/* ===========================
   EARTHY THEME + GLOBALS
=========================== */
:root {
  /* Palette */
  --bg: #f3ebdd; /* warm parchment */
  --panel: #f9f5ee; /* soft off-white for cards/panels */
  --text: #3b2d26; /* deep brown */
  --muted: #6e5c46; /* medium brown for secondary text */
  --line: #e3d8c8; /* subtle divider */
  --brand: #6f4e37; /* coffee/clay */
  --brand-2: #a67856; /* lighter clay */
  --accent: #4f6d5b; /* sage green */

  --radius: 16px;
  --shadow: 0 10px 30px rgba(35, 20, 10, 0.08);

  --container-max: 1200px;
  --section-gap: clamp(24px, 6vw, 64px);

  /* Logo size (header + page heroes) */
  --hero-logo-size: 200px;

  /* Hero vine placement */
  --vine-width: 220px;
  --vine-offset: 140px; /* distance from container edge into gutter */
}

/* ===========================
   BASE
=========================== */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html,
body {
  background: var(--panel);
  color: var(--text);
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial;
}

/* Soft background texture */
body {
  background: radial-gradient(
      800px 300px at 20% -10%,
      rgba(184, 140, 99, 0.1),
      transparent 60%
    ),
    linear-gradient(180deg, var(--panel), #faf6f1 60%);
}

h1,
h2,
h3 {
  color: var(--text);
}
.muted,
small,
.subtle {
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  filter: brightness(0.9);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
}

/* Containers */
.container {
  width: min(var(--container-max), calc(100% - 2rem));
  margin-inline: auto;
}

/* Screen-reader only text */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Main vertical rhythm */
#main {
  display: grid;
  gap: var(--section-gap);
}

/* ===========================
   HEADER
=========================== */
.site-header {
  display: grid;
  grid-template-columns: auto 1fr; /* logo | right group */
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  padding-block: 12px;
  position: relative;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand__logo {
  height: var(--hero-logo-size);
  width: auto;
  display: block;
}

.header__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 2vw, 24px);
}

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__list a {
  color: var(--text);
}
.nav__list a:hover {
  color: var(--brand);
}

.nav__toggle {
  display: none;
} /* you can wire this up later with JS */

.header__book {
  white-space: nowrap;
}

@media (max-width: 800px) {
  .brand__logo {
    height: 40px;
  }
  .nav__toggle {
    display: inline-block;
  }
  .nav__list {
    display: none;
  } /* show via JS toggle if desired */
}

/* ===========================
   HERO
=========================== */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr; /* text | image */
  align-items: center;
  gap: clamp(16px, 3vw, 48px);
  position: relative; /* for the vine layer */
  background: transparent; /* no solid hero block */
}

.hero__text {
  align-self: center;
  padding-bottom: 16px;
}
.hero__media .hero__img {
  width: 100%;
  height: min(60vh, 600px);
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

/* hero logo (if used in hero sections) */
.hero__logo {
  width: clamp(120px, 18vw, 100%);
  height: auto;
  display: block;
  margin-bottom: 80px;
}

/* Mobile hero */
@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero__media .hero__img {
    height: auto;
  }
  .hero__text {
    text-align: center;
    margin-inline: auto;
  }
  .hero__logo {
    margin-inline: auto;
  }
}

/* === Flowers behind the HERO only (home) === */
/* If your hero section has id="home" */
#home.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0; /* below content */

  /* Path is relative to assets/css/style.css */
  background-image: url("/assets/img/earthy-vine.svg"),
    url("/assets/img/earthy-vine.svg"), url("/assets/img/earthy-vine.svg");
  background-repeat: repeat-y, repeat-y, repeat-y;
  background-size: var(--vine-width) auto, var(--vine-width) auto,
    var(--vine-width) auto;

  /* align left/right to gutters, one in the center */
  --gutter-x: clamp(
    0px,
    calc((100vw - var(--container-max)) / 2 - var(--vine-offset)),
    160px
  );
  background-position: left var(--gutter-x) top, 50% top,
    right var(--gutter-x) top;
}
#home.hero > * {
  position: relative;
  z-index: 1;
}

/* ===========================
   SECTIONS / CARDS
=========================== */
section {
  padding-block: clamp(8px, 2vw, 24px);
}

.card,
.about__card,
.table-wrap,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.about {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}
@media (max-width: 860px) {
  .about {
    grid-template-columns: 1fr;
  }
}

/* Courses */
.courses > h1 {
  text-align: center;
  margin-bottom: clamp(8px, 2vw, 20px);
}
.courses .cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 32px);
}
@media (max-width: 900px) {
  .courses .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .courses .cards {
    grid-template-columns: 1fr;
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Section headings centered for gallery/schedule */
#gallery > h2,
#schedule > h2 {
  text-align: center;
  margin-bottom: clamp(8px, 2vw, 20px);
  grid-column: 1 / -1;
}

/* ===========================
   TABLES (Schedule)
=========================== */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}
.table th,
.table td {
  padding: 12px;
  border: 1px solid var(--line);
  text-align: left; /* default left */
}
.table thead th {
  background: color-mix(in srgb, var(--brand-2) 18%, var(--panel));
  color: var(--text);
  font-weight: 600;
}
.table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--panel) 80%, var(--bg));
}

/* Left-align ONLY the schedule table headers (explicit request) */
#schedule .table thead tr > th {
  text-align: left !important;
}

/* ===========================
   GALLERY
=========================== */
.gallery-grid img {
  border-radius: var(--radius);
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ===========================
   FAQ
=========================== */
details {
  background: var(--brand);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
details p {
  color: var(--muted);
  margin: 6px 0 0;
}

/* ===========================
   FORMS
=========================== */
.form {
  max-width: 560px;
}
.form__row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
input,
textarea {
  background: var(--panel);
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  padding: 12px;
  border-radius: 10px;
}
input:focus,
textarea:focus {
  border-color: var(--brand);
}
.form__status {
  margin-top: 10px;
  color: var(--muted);
  min-height: 1.4em;
}

/* ===========================
   BUTTONS
=========================== */
.btn {
  display: inline-block;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  background: transparent;
  color: var(--text);
}
.btn--primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn--primary:hover {
  filter: brightness(0.92);
}
.btn--secondary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand-2);
}
.btn--ghost:hover {
  background: color-mix(in srgb, var(--brand-2) 12%, white);
}
.btn--small,
.btn--sm {
  padding: 8px 12px;
  font-size: 0.95rem;
}
button.btn {
  cursor: pointer;
}

/* ===========================
   POPDOWN (Openings)
=========================== */
.hero__cta {
  display: flex;
  gap: clamp(10px, 2vw, 16px);
  align-items: center;
}

.popdown {
  position: left;
}
.popdown__toggle {
  white-space: nowrap;
}

.popdown__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0; /* align to trigger’s right edge */
  width: min(400px, 96vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  z-index: 50;
  animation: popdown-fade 120ms ease-out;
  max-height: 70vh;
  overflow: auto;
}
.popdown__panel::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 16px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  background: var(--panel);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.popdown__header {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.05rem;
}
.popdown__list {
  list-style: none;
  margin: 0 0 10px 0;
  padding: 0;
}
.popdown__list li {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  white-space: normal;
  overflow-wrap: anywhere;
}
.popdown__list li:last-child {
  border-bottom: 0;
}
.popdown__book.btn--sm {
  padding: 8px 12px;
  font-size: 0.9rem;
}

@keyframes popdown-fade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .popdown__panel {
    width: 96vw;
    left: 2vw;
    right: auto;
  }
  .popdown__panel::before {
    left: 24px;
    right: auto;
  }
}

/* ===========================
   FOOTER
=========================== */
.site-footer {
  padding: 24px 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}
.footer-links {
  display: flex;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-links a {
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--text);
}

/* Centered variant with divider (if you used .footer-row) */
.site-footer.container {
  display: block;
}
.footer-row {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 2vw, 16px);
  text-align: center;
  color: var(--text);
}
.footer-row > span {
  white-space: nowrap;
}
.footer-divider {
  width: 1px;
  height: 1.2em;
  background: var(--line);
  margin-inline: clamp(8px, 2vw, 16px);
}

/* ===========================
   RESPONSIVE GRIDS
=========================== */
@media (max-width: 860px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .site-header {
    flex-wrap: wrap;
  } /* harmless if grid; keeps header stable */
}
/* === Flowers behind all sections (hero + about + courses + schedule + gallery + contact) === */
:root {
  --container-max: 1200px;
  --vine-width: 220px;
  --vine-offset: 140px; /* distance from container edge into the gutter */
}

.hero,
.about,
.courses,
.schedule,
.gallery,
.contact {
  position: relative;
}

.hero::before,
.about::before,
.courses::before,
.schedule::before,
.gallery::before,
.contact::before {
  content: "" !important; /* force on, even if an earlier rule hid it */
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;

  /* triple vine */
  background-image: url("/assets/img/earthy-vine.svg"),
    url("/assets/img/earthy-vine.svg"), url("/assets/img/earthy-vine.svg");
  background-repeat: repeat-y, repeat-y, repeat-y;
  background-size: var(--vine-width) auto, var(--vine-width) auto,
    var(--vine-width) auto;

  /* align left/right to gutters, one in the center */
  --gutter-x: clamp(
    0px,
    calc((100vw - var(--container-max)) / 2 - var(--vine-offset)),
    160px
  );
  background-position: left var(--gutter-x) top, 50% top,
    right var(--gutter-x) top;
}

/* keep section content above flowers */
.hero > *,
.about > *,
.courses > *,
.schedule > *,
.gallery > *,
.contact > * {
  position: relative;
  z-index: 1;
}

/* === About: more breathing room === */
.about__card {
  padding: clamp(20px, 3vw, 32px);
  line-height: 1.6;
}

/* === Courses: image scaling & consistency === */
.courses .card__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3; /* uniform crop */
  height: auto; /* keeps layout stable */
  object-fit: cover; /* no distortion */
  border-radius: var(--radius);
}

/* Just in case any image tries to overflow a grid cell */
.courses .card {
  overflow: hidden;
}
/* Courses: add breathing room inside cards */
.courses .card {
  padding: clamp(20px, 3vw, 32px);
}
:root {
  --card-pad: clamp(20px, 3vw, 32px);
}

.courses .card {
  padding: var(--card-pad);
  overflow: hidden;
}

/* Pull the image out to the edges, keep text padded */
.courses .card .card__img {
  display: block;
  width: calc(100% + calc(var(--card-pad) * 2));
  margin: calc(var(--card-pad) * -1) calc(var(--card-pad) * -1) 12px;
  border-radius: var(--radius);
}
/* Hero text card: same color as background, no border, subtle shadow */
.hero_card {
  position: relative;
  z-index: 1; /* above the flower layer */
  background: var(--panel); /* same as site background */
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(35, 20, 10, 0.08);
  padding: clamp(16px, 3vw, 28px);
  max-width: 720px; /* keeps lines readable */
}

/* Mobile: full width and centered */
@media (max-width: 800px) {
  .hero_card {
    max-width: 100%;
  }
}
/* === Single continuous flower layer across the whole page === */
:root {
  --container-max: 1200px; /* your .container width */
  --vine-width: 220px; /* SVG width */
  --vine-offset: 140px; /* distance from container edge into gutter */
}

body {
  position: relative;
}

/* The fixed background that sits behind everything */
.page-vines {
  position: fixed;
  inset: -200px 0 -200px 0; /* extend a bit above/below the viewport */
  pointer-events: none;
  z-index: 0; /* behind page content */

  /* IMPORTANT: path is relative to assets/css/style.css */
  background-image: url("/assets/img/earthy-vine.svg"),
    url("/assets/img/earthy-vine.svg"), url("/assets/img/earthy-vine.svg");
  background-repeat: repeat-y, repeat-y, repeat-y;
  background-size: var(--vine-width) auto, var(--vine-width) auto,
    var(--vine-width) auto;

  /* left gutter, center, right gutter */
  --gutter-x: clamp(
    0px,
    calc((100vw - var(--container-max)) / 2 - var(--vine-offset)),
    160px
  );
  background-position: left var(--gutter-x) top, 50% top,
    right var(--gutter-x) top;

  /* adjust if you want it a tad subtler */
  /* opacity: .9; */
}

/* Ensure content paints above the background */
.site-header,
#main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Kill any old per-section flower layers to avoid duplicates */
.hero::before,
.about::before,
.courses::before,
.schedule::before,
.gallery::before,
.contact::before {
  content: none !important;
  background: none !important;
}
/* SIMPLE, RELIABLE POPDOWN */
/* Anchor the popdown to the button wrapper */
.popdown {
  position: relative;
  display: inline-block; /* wrapper shrinks to button width */
  z-index: 5; /* new stacking context */
}

/* Panel appears under the button, aligned to its right edge */
.popdown__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: auto; /* align to button’s right edge */
  left: 0; /* ensure no old left:0 wins */
  z-index: 9999; /* above other sections/cards */
}

/* Make sure [hidden] actually hides it */
.popdown__panel[hidden] {
  display: none !important;
}

/* Ensure hero sits over following sections */
.hero {
  position: relative;
  z-index: 10;
}
.about,
.courses,
.schedule,
.gallery,
.contact {
  position: relative;
  z-index: 1;
}

/* If any section/card had transform/filters creating a higher stacking context,
   neutralize them or keep their z-index lower than the hero/popdown. */
/* Disabled state for buttons */
.btn[disabled],
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}
