/* ==========================================================================
   VINEWORK — STYLESHEET
   Used by both the homepage (index.html) and all series pages.
   ========================================================================== */

/* --- Design Tokens -------------------------------------------------------- */
:root {
  /* Colors */
  --color-bg:          #faf7f2;   /* warm cream-white page background */
  --color-surface:     #f3ede2;   /* slightly deeper cream for surfaces */
  --color-card:        #ffffff;   /* card backgrounds */
  --color-green:       #2b5a3e;   /* deep forest green — primary brand */
  --color-green-dark:  #1f4430;   /* hover state for green */
  --color-green-faint: #e8f2ec;   /* very light green for tinted backgrounds */
  --color-gold:        #b8924a;   /* muted amber-gold accent */
  --color-brown:       #7a5c40;   /* warm brown for secondary text */
  --color-border:      #ddd5c5;   /* warm light borders */
  --color-text:        #1c1a17;   /* near-black warm text */
  --color-muted:       #6b5b48;   /* body text on cards */
  --color-faint:       #9b8c78;   /* placeholder / light labels */

  /* Typography */
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Shape */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  /* Elevation */
  --shadow-sm: 0 1px 4px rgba(28, 22, 10, 0.07);
  --shadow-md: 0 4px 20px rgba(28, 22, 10, 0.09);

  /* Layout */
  --width-max: 1100px;
  --gutter:    1.5rem;
}


/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; }
ul, ol { list-style: none; padding: 0; }


/* --- Base ----------------------------------------------------------------- */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a {
  color: var(--color-green);
  text-underline-offset: 2px;
}

a:hover { color: var(--color-green-dark); }


/* --- Container ------------------------------------------------------------ */
.container {
  max-width: var(--width-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}


/* ==========================================================================
   SHARED COMPONENTS
   ========================================================================== */

/* --- Site Header ---------------------------------------------------------- */
.site-header {
  background: var(--color-green);
  padding: 1rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #f0e6d0;
  letter-spacing: 0.03em;
  text-decoration: none;
}
.site-name:hover { color: #f8f0e3; }

.site-header-back {
  color: rgba(201, 169, 110, 0.85);
  font-size: 0.88rem;
  text-decoration: none;
}

.site-header-back:hover { color: #c9a96e; }

.site-header-sign-in {
  color: #f0e6d0;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(240, 230, 208, 0.5);
}

.site-header-sign-in:hover { color: #ffffff; }


/* --- Section Label (small all-caps heading) ------------------------------- */
.section-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-faint);
  margin-bottom: 1.25rem;
}


/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  line-height: 1.4;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.83rem;
}

.btn-primary {
  background: var(--color-green);
  color: #f0e6d0;
}
.btn-primary:hover { background: var(--color-green-dark); color: #f0e6d0; }

.btn-secondary {
  background: transparent;
  color: var(--color-green);
  border: 1.5px solid var(--color-green);
}
.btn-secondary:hover { background: var(--color-green-faint); }

.btn-ghost {
  background: var(--color-surface);
  color: var(--color-brown);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover { background: var(--color-border); }

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}


/* --- Site Footer ---------------------------------------------------------- */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  text-align: center;
}

.site-footer p {
  color: var(--color-faint);
  font-size: 0.88rem;
}


/* ==========================================================================
   HOMEPAGE
   ========================================================================== */

/* --- Hero ----------------------------------------------------------------- */
.hero {
  /* Photo with a deep green overlay so text remains crisp.
     The gradient sits on top of the image; both layers use the same
     semi-opaque green so the warm tones of the photo bleed through
     softly without competing with the text. */
  background:
    linear-gradient(rgba(27, 54, 36, 0.78), rgba(27, 54, 36, 0.78)),
    url('assets/hero-image.png') center / cover no-repeat;
  padding: 5rem 0 6rem;
  text-align: center;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 7vw, 4.2rem);
  color: #f0e6d0;
  font-weight: normal;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: #c9a96e;
  max-width: 480px;
  margin: 0 auto 1.75rem;
  line-height: 1.55;
}

.hero-body {
  color: rgba(240, 230, 208, 0.82);
  font-size: 0.975rem;
  line-height: 1.75;
  max-width: 540px;
  margin-inline: auto;
}

.hero-actions {
  margin-top: 2rem;
}

.library-hero {
  padding-block: 3.75rem 4.25rem;
}

.tenant-hero {
  background:
    linear-gradient(rgba(27, 54, 36, 0.78), rgba(27, 54, 36, 0.78)),
    url('/assets/hero-image.png') center / cover no-repeat;
}

.library-owner {
  color: rgba(240, 230, 208, 0.72);
  margin-bottom: 0.75rem;
}

.library-series article {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.library-series h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: normal;
}

.library-series p {
  color: var(--color-muted);
  margin: 0.5rem 0 1rem;
  max-width: 44rem;
}

.btn-hero {
  background: #f0e6d0;
  color: var(--color-green-dark);
}

.btn-hero:hover {
  background: #ffffff;
  color: var(--color-green-dark);
}


/* --- Current Series Section ----------------------------------------------- */
.current-series {
  padding: 3.5rem 0 2rem;
}


/* --- Series Card (on homepage) -------------------------------------------- */
.series-card {
  display: flex;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.series-card-cover {
  display: flex;
  align-items: flex-start;
  padding: 2.25rem 2rem;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  flex-shrink: 0;
}

.series-card-cover img {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.series-card-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
}

.series-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: normal;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.series-description {
  color: var(--color-muted);
  font-size: 0.96rem;
  line-height: 1.72;
}

.series-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}


/* --- Future Series -------------------------------------------------------- */
.future-series { padding: 0 0 3.5rem; }

.future-note {
  color: var(--color-faint);
  font-size: 0.92rem;
  font-style: italic;
  text-align: center;
  border-top: 1px solid var(--color-border);
  padding-top: 2.5rem;
}


/* ==========================================================================
   SERIES PAGE
   ========================================================================== */

/* --- Series Hero ---------------------------------------------------------- */
.series-hero {
  background: var(--color-green);
  padding: 3.5rem 0 4.25rem;
}

.series-hero-inner {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.series-hero-cover {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.series-hero-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c9a96e;
  margin-bottom: 0.5rem;
}

.series-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: #f0e6d0;
  font-weight: normal;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.series-hero-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  color: rgba(201, 169, 110, 0.9);
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: 1.1rem;
}

.series-hero-body {
  color: rgba(240, 230, 208, 0.8);
  font-size: 0.95rem;
  line-height: 1.72;
  max-width: 500px;
}


/* --- Subscribe Section ---------------------------------------------------- */
.subscribe-section {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  padding: 1.75rem 0;
}

.subscribe-text > p {
  color: var(--color-muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

.rss-copy-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.rss-url {
  font-family: var(--font-sans);
  font-size: 0.83rem;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  user-select: all;
  word-break: break-all;
}

.rss-copied-msg {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--color-green);
}

/* .subscribe-text > p is more specific (0,1,1) than .privacy-note (0,1,0),
   so we raise specificity here to ensure the note is styled differently. */
.subscribe-text p.privacy-note {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--color-faint);
  font-style: italic;
}


/* --- Episodes Section ----------------------------------------------------- */
.episodes-section { padding: 3rem 0 4rem; }

.episodes-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
}

.episodes-header h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: normal;
  color: var(--color-text);
}


/* --- Episode Card --------------------------------------------------------- */
.episode-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 2rem;
}

.episode-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.episode-num {
  display: inline-block;
  background: var(--color-green-faint);
  color: var(--color-green);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
  flex-shrink: 0;
  margin-top: 0.35rem;
  white-space: nowrap;
}

.episode-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: normal;
  color: var(--color-text);
  line-height: 1.3;
}

.episode-duration {
  font-size: 0.85rem;
  color: var(--color-faint);
  margin-top: 0.25rem;
}

.episode-description {
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.72;
  margin-bottom: 1.5rem;
}

/* --- Episode two-column wrappers ----------------------------------------- */
/* On mobile these are plain block elements — no layout change.
   The desktop grid is applied in the @media (min-width: 1024px) block below. */
.episode-main,
.episode-aside {
  min-width: 0; /* prevent grid blowout on long words */
}

/* Mobile: add space between the main content and the questions block */
.episode-aside { margin-top: 1.75rem; }


/* --- Audio Player --------------------------------------------------------- */
.episode-audio { margin-bottom: 1.25rem; }

.episode-audio audio {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
  /* Height / appearance is browser-controlled; container provides context */
}

/* --- Episode Action Buttons ----------------------------------------------- */
.episode-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}


/* --- Reflection Questions ------------------------------------------------- */
.reflection-block {
  background: var(--color-green-faint);
  border-left: 3px solid var(--color-green);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
}

.reflection-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-green);
  margin-bottom: 0.85rem;
}

.reflection-questions {
  list-style: none;
  counter-reset: q;
  padding: 0;
}

.reflection-questions li {
  counter-increment: q;
  position: relative;
  padding: 0.55rem 0 0.55rem 1.65rem;
  border-bottom: 1px solid rgba(43, 90, 62, 0.12);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--color-text);
}

.reflection-questions li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.reflection-questions li::before {
  content: counter(q);
  position: absolute;
  left: 0;
  top: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-green);
  line-height: 1.65;
}


/* --- PDF Viewer Modal ----------------------------------------------------- */
.pdf-modal {
  width: min(92vw, 860px);
  height: min(88vh, 720px);
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(28, 22, 10, 0.25);
}

.pdf-modal[open] {
  display: flex;
  flex-direction: column;
}

.pdf-modal::backdrop {
  background: rgba(28, 22, 10, 0.6);
}

.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--color-green);
  flex-shrink: 0;
  gap: 1rem;
}

.pdf-modal-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: #f0e6d0;
  flex: 1;
}

.pdf-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pdf-modal-download {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(240, 230, 208, 0.85);
  text-decoration: none;
  border: 1px solid rgba(240, 230, 208, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.65rem;
}

.pdf-modal-download:hover {
  color: #f0e6d0;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(240, 230, 208, 0.6);
}

.pdf-modal-close {
  background: none;
  border: none;
  color: rgba(240, 230, 208, 0.75);
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.pdf-modal-close:hover {
  color: #f0e6d0;
  background: rgba(255, 255, 255, 0.12);
}

.pdf-modal-frame {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 640px) {
  :root { --gutter: 1.125rem; }

  /* Homepage series card stacks vertically */
  .series-card { flex-direction: column; }

  .series-card-cover {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 1.5rem;
    justify-content: center;
  }

  .series-card-cover img { width: 110px; height: 110px; }
  .series-card-body { padding: 1.5rem; }

  /* Series hero stacks vertically and centers on mobile */
  .series-hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .series-hero-body { max-width: none; }

  .episode-card { padding: 1.5rem; }

  .reflection-block { padding: 1.1rem 1.25rem; }
}

/* ==========================================================================
   DESKTOP — enhancements for large screens only (≥ 1024px).
   Mobile and tablet are completely unaffected by everything below.
   ========================================================================== */
@media (min-width: 1024px) {

  /* More vertical breathing room in the hero on a big screen */
  .hero {
    padding: 7rem 0 8rem;
  }

  /* Larger cover image in the series card */
  .series-card-cover img {
    width: 180px;
    height: 180px;
  }

  /* More generous internal padding on the series and episode cards */
  .series-card-cover { padding: 2.75rem 2.5rem; }
  .series-card-body  { padding: 2.75rem; }
  .episode-card      { padding: 2.75rem; }

  /* A little more vertical space around the series hero on large screens */
  .series-hero { padding: 5rem 0 6rem; }

  /* Larger series cover image in the hero on desktop */
  .series-hero-cover {
    width: 200px;
    height: 200px;
  }

  /* --- Episode card: two-column layout on desktop ----------------------- */
  /* Left (wider): episode info, audio player, download buttons.
     Right: discussion questions — visible alongside the player. */
  .episode-card {
    display: grid;
    grid-template-columns: 3fr 2fr;
    align-items: start;
  }

  .episode-main {
    padding-right: 2.25rem;
    border-right: 1px solid var(--color-border);
  }

  /* Remove the bottom margin on the action buttons — they're the last
     item in the left column so there's nothing below them that needs space. */
  .episode-main .episode-actions {
    margin-bottom: 0;
  }

  .episode-aside {
    padding-left: 2.25rem;
    margin-top: 0; /* override the mobile top-margin; grid handles spacing */
  }

}
