/* ==========================================================================
   Hoy Ping Kung Fu — shared stylesheet
   Palette: traditional red/gold on a clean dark base
   ========================================================================== */

:root {
  --color-bg: #141110;
  --color-bg-alt: #1c1815;
  --color-surface: #231e1a;
  --color-text: #f5efe6;
  --color-text-muted: #c9bfb2;
  --color-red: #b3122c;
  --color-red-dark: #8a0e22;
  --color-gold: #d4a537;
  --color-gold-light: #e8c565;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;

  --max-width: 1200px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.4rem, 5vw + 1rem, 4.2rem);
}

h2 {
  font-size: clamp(1.7rem, 2.5vw + 1rem, 2.6rem);
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 var(--space-2);
  color: var(--color-text-muted);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.85em 1.8em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--color-gold);
  color: #1a1512;
}

.btn-primary:hover {
  background: var(--color-gold-light);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-gold);
  color: var(--color-gold-light);
}

.btn-outline:hover {
  background: rgba(212, 165, 55, 0.12);
}

/* -------------------------------------------------------------------------
   Skip link
   ------------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--color-gold);
  color: #1a1512;
  padding: 0.75em 1.2em;
  border-radius: var(--radius);
  z-index: 1000;
}

.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
}

/* -------------------------------------------------------------------------
   Site header / nav
   ------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 17, 16, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(212, 165, 55, 0.18);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.nav-logo .mark {
  color: var(--color-gold);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25em 0.4em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a:not(.btn) {
  font-weight: 600;
  color: var(--color-text-muted);
  transition: color 0.15s ease;
}

.nav-links a:not(.btn):hover,
.nav-links a[aria-current="page"] {
  color: var(--color-gold-light);
}

.nav-links .btn {
  padding: 0.55em 1.4em;
  font-size: 0.9rem;
}

@media (max-width: 780px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--color-bg-alt);
    border-bottom: 1px solid rgba(212, 165, 55, 0.18);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  }

  .nav-links.is-open {
    opacity: 1;
  }

  .nav-links li {
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid rgba(212, 165, 55, 0.1);
  }

  .nav-links .btn {
    display: inline-flex;
    margin-top: 0.25em;
  }
}

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--color-text);
}

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(20, 17, 16, 0.35) 0%,
    rgba(20, 17, 16, 0.55) 55%,
    rgba(20, 17, 16, 0.95) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: var(--space-6) var(--space-3) var(--space-5);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  display: inline-block;
  color: var(--color-gold-light);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: var(--space-2);
}

.hero-content h1 {
  max-width: 16ch;
}

.hero-sub {
  font-size: 1.15rem;
  max-width: 46ch;
  color: var(--color-text);
  opacity: 0.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* -------------------------------------------------------------------------
   Section scaffolding
   ------------------------------------------------------------------------- */

section {
  padding: var(--space-6) 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-header {
  max-width: 60ch;
  margin-bottom: var(--space-4);
}

.section-header .eyebrow {
  display: block;
  color: var(--color-gold);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: var(--space-1);
}

/* -------------------------------------------------------------------------
   Intro / quotable copy
   ------------------------------------------------------------------------- */

.intro p {
  font-size: 1.2rem;
  color: var(--color-text);
  max-width: 62ch;
}

/* -------------------------------------------------------------------------
   Services strip
   ------------------------------------------------------------------------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-3);
}

.service-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--color-surface);
  display: flex;
  align-items: flex-end;
  isolation: isolate;
}

.service-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  transition: transform 0.35s ease;
}

.service-card:hover img {
  transform: scale(1.06);
}

.service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(20, 17, 16, 0.92) 100%);
  z-index: -1;
}

.service-card-label {
  padding: var(--space-3);
}

.service-card-label h3 {
  margin-bottom: 0.2em;
}

.service-card-label span {
  color: var(--color-gold-light);
  font-weight: 600;
  font-size: 0.9rem;
}

/* -------------------------------------------------------------------------
   Tradition cards (About page) — nested image above text
   ------------------------------------------------------------------------- */

.service-card img.tradition-card-image {
  position: static;
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  z-index: auto;
}

/* -------------------------------------------------------------------------
   History section (About page) — full-bleed background photo with a
   gradient so the text stays readable over any image
   ------------------------------------------------------------------------- */

.history-section {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 70vh;
}

.history-section .history-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 24, 21, 0.1) 0%, rgba(28, 24, 21, 0.55) 55%, rgba(28, 24, 21, 0.97) 100%);
  z-index: -1;
}

/* -------------------------------------------------------------------------
   Gallery teaser
   ------------------------------------------------------------------------- */

.gallery-strip {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  scroll-snap-type: x mandatory;
}

.gallery-strip img {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 260px;
  height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
}

/* -------------------------------------------------------------------------
   Gallery grid (Gallery page) — full photo/video grid
   ------------------------------------------------------------------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-auto-flow: dense;
  gap: var(--space-2);
}

.gallery-grid .media-placeholder {
  aspect-ratio: 4 / 5;
}

.gallery-item {
  display: block;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  border-radius: var(--radius);
}

.gallery-item:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.gallery-grid img {
  aspect-ratio: 4 / 5;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.03);
  filter: brightness(1.08);
}

.gallery-grid .video-tile {
  aspect-ratio: 16 / 9;
  flex-direction: column;
  gap: 0.5em;
}

.gallery-grid .video-tile.video-portrait {
  aspect-ratio: 9 / 16;
}

.gallery-grid video.video-tile {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (min-width: 560px) {
  .gallery-grid .video-tile {
    grid-column: span 2;
  }

  .gallery-grid .video-tile.video-portrait {
    grid-column: span 1;
  }
}

/* -------------------------------------------------------------------------
   Lightbox (Gallery page) — enlarged photo overlay
   ------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 7, 0.92);
  padding: var(--space-3);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-img {
  max-width: min(90vw, 1100px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 1px solid rgba(245, 239, 230, 0.25);
  background: rgba(28, 24, 21, 0.7);
  color: var(--color-text);
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: var(--color-red);
  border-color: var(--color-red);
}

.lightbox-close {
  top: var(--space-2);
  right: var(--space-2);
  width: 44px;
  height: 44px;
  font-size: 1.75rem;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
}

.lightbox-prev {
  left: var(--space-2);
}

.lightbox-next {
  right: var(--space-2);
}

@media (max-width: 560px) {
  .lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .lightbox-close {
    width: 38px;
    height: 38px;
  }
}

.gallery-cta {
  margin-top: var(--space-3);
}

/* -------------------------------------------------------------------------
   CTA band
   ------------------------------------------------------------------------- */

.cta-band {
  background: linear-gradient(120deg, var(--color-red-dark), var(--color-red));
  color: #fff;
  text-align: center;
  padding: var(--space-5) 0;
}

.cta-band h2 {
  color: #fff;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 50ch;
  margin: 0 auto var(--space-3);
}

.cta-band .btn-primary {
  background: var(--color-gold);
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */

.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid rgba(212, 165, 55, 0.18);
  padding: var(--space-5) 0 var(--space-3);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.footer-grid h3 {
  color: var(--color-gold-light);
  font-size: 1rem;
  margin-bottom: var(--space-2);
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 0.5em;
}

.footer-grid a:hover {
  color: var(--color-gold-light);
}

.footer-bottom {
  border-top: 1px solid rgba(212, 165, 55, 0.12);
  padding-top: var(--space-2);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1);
}

/* -------------------------------------------------------------------------
   Placeholder media blocks (until real assets are added)
   ------------------------------------------------------------------------- */

.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: repeating-linear-gradient(
    45deg,
    var(--color-surface),
    var(--color-surface) 12px,
    var(--color-bg-alt) 12px,
    var(--color-bg-alt) 24px
  );
  color: var(--color-text-muted);
  font-size: 0.85rem;
  padding: var(--space-2);
  border: 1px dashed rgba(212, 165, 55, 0.4);
  border-radius: var(--radius);
}

/* -------------------------------------------------------------------------
   Generic inner-page content (stub pages)
   ------------------------------------------------------------------------- */

.page-header {
  padding: var(--space-5) 0 var(--space-3);
}

.page-header p {
  max-width: 60ch;
}

.page-header-tight {
  padding-bottom: var(--space-2);
}

.faq-section {
  padding-top: var(--space-3);
}

/* -------------------------------------------------------------------------
   FAQ list
   ------------------------------------------------------------------------- */

.faq-list {
  display: grid;
  gap: var(--space-4);
  max-width: 70ch;
}

.faq-list dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-gold-light);
  margin-bottom: 0.5em;
}

.faq-list dd {
  margin: 0;
  color: var(--color-text-muted);
}

/* -------------------------------------------------------------------------
   Contact page — form + sidebar layout
   ------------------------------------------------------------------------- */

.contact-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-5);
  align-items: start;
}

@media (max-width: 780px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

.contact-sidebar {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: var(--space-3);
}

.contact-sidebar h3 {
  color: var(--color-gold-light);
  font-size: 1rem;
  margin-bottom: var(--space-2);
}

.contact-sidebar ul {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
}

.contact-sidebar li {
  margin-bottom: 0.6em;
}

.contact-sidebar a:hover {
  color: var(--color-gold-light);
}

.form-group {
  margin-bottom: var(--space-3);
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4em;
}

.form-group .optional {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 0.85rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid rgba(212, 165, 55, 0.25);
  border-radius: var(--radius);
  padding: 0.75em 1em;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-gold);
}

.form-group select {
  cursor: pointer;
}
