/* ============================================================
   Binge & Bound: style.css
   Blue theme. Colors and fonts live in :root. Change them
   there and the whole site updates.
   ============================================================ */

:root {
  /* Colors */
  --paper: #e6eefb;   /* page background, pale blue */
  --navy: #0a1f5c;    /* site title, text, darkest band */
  --blue: #1d4ed8;    /* links, book label */
  --sky: #9fc3f7;     /* show label, song strip */
  --mist: #cfe0fa;    /* text on navy */
  --white: #ffffff;

  /* Fonts: editorial serif for titles, Courier for everything else */
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --text: "Courier Prime", "Courier New", Courier, monospace;

  --gutter: clamp(1.25rem, 5vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: var(--text);
  font-size: 1.05rem;
  line-height: 1.6;
}

a { color: var(--blue); text-underline-offset: 0.2em; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.skip-link {
  position: absolute; left: -999px; top: 0.5rem;
  background: var(--navy); color: var(--white);
  padding: 0.6rem 1rem; z-index: 10;
}
.skip-link:focus { left: 0.5rem; }


/* ---------- Header and navigation ---------- */

.site-header {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 0.75rem 2rem;
  padding: 1.25rem var(--gutter);
}

.brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--navy);
  text-decoration: none;
}

.site-header nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.75rem; }

.site-header nav a {
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
}
.site-header nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.site-header nav a[aria-current="page"] {
  text-decoration: underline; text-decoration-thickness: 3px;
  text-decoration-color: var(--blue); text-underline-offset: 6px;
}


/* ---------- Home page hero ---------- */

.hero {
  padding: clamp(2rem, 6vw, 5rem) var(--gutter) clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 9vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--navy);
}

.tagline {
  max-width: 44ch;
  margin: 1.5rem auto 0;
  text-wrap: balance;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-style: italic;
}


/* Blue ribbon banner behind the site title */
.hero { overflow-x: clip; }

.ribbon {
  position: relative;
  display: inline-block;
  isolation: isolate;
  margin: 0 0.9em;
  padding: 0.12em 0.55em 0.18em;
  background: var(--sky);
  border: 4px solid var(--navy);
  box-shadow: 0 8px 0 var(--blue);
}

/* The folded, swallow-tailed ends of the ribbon */
.ribbon::before,
.ribbon::after {
  content: "";
  position: absolute;
  top: 0.4em;
  width: 1em;
  height: 100%;
  background: var(--blue);
  z-index: -1;
}
.ribbon::before {
  left: -0.8em;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0.4em 50%);
}
.ribbon::after {
  right: -0.8em;
  clip-path: polygon(0 0, 100% 0, calc(100% - 0.4em) 50%, 100% 100%, 0 100%);
}


/* ---------- This month ---------- */

.month-head { padding: 0 var(--gutter) 1.75rem; text-align: center; }

.month-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.hint { margin: 0.5rem 0 0; font-size: 0.9rem; opacity: 0.7; }

.picks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.75rem);
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter) 2.5rem;
}

.pick { text-align: center; }

/* Poster-shaped photo box */
.photo {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 2 / 3; overflow: hidden;
  padding: 0.4rem;
  background: var(--white);
  border: 5px solid var(--navy);
  box-shadow: 8px 8px 0 var(--blue);
}
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Empty photo boxes show the title and the file to add */
.photo.is-empty, .song-photo.is-empty {
  flex-direction: column; gap: 0.5rem; padding: 1rem; text-align: center;
  background: rgba(255, 255, 255, 0.55);
  border-style: dashed; box-shadow: none;
}
.photo-title { font-family: var(--display); font-weight: 800; font-size: 1.3rem; line-height: 1.1; }
.photo-hint { font-size: 0.8rem; opacity: 0.55; word-break: break-all; }
.photo:not(.is-empty) .photo-title, .photo:not(.is-empty) .photo-hint,
.song-photo:not(.is-empty) .photo-title, .song-photo:not(.is-empty) .photo-hint { display: none; }

.pick .kind {
  display: inline-block;
  margin: 1.4rem 0 0.4rem;
  padding: 0.1rem 0.9rem;
  font-weight: 700; font-size: 0.9rem; font-style: italic;
  border-radius: 999px;
}
.pick-book .kind { background: var(--blue); color: var(--white); }
.pick-show .kind { background: var(--sky); color: var(--navy); }
.pick-movie .kind { background: var(--navy); color: var(--mist); }

.pick h3 { margin: 0.15rem 0 0.3rem; line-height: 1.15; }

/* The clickable title under each photo */
.title-btn {
  padding: 0; margin: 0;
  background: none; border: 0; cursor: pointer;
  font-family: var(--text);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.15;
  color: var(--navy);
  text-align: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--blue);
  text-underline-offset: 5px;
}
.title-btn:hover { color: var(--blue); }

.pick .by { margin: 0; font-style: italic; font-size: 0.95rem; }


/* ---------- Song of the month ---------- */

.song {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 1.25rem 2rem;
  max-width: 40rem;
  margin: 0 auto 2.5rem;
  padding: 1.5rem 2rem;
  background: var(--sky);
  border: 3px solid var(--navy);
  text-align: center;
}

.song-photo {
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 9rem; aspect-ratio: 1 / 1; overflow: hidden;
  padding: 0.3rem; background: var(--white); border: 4px solid var(--navy);
}
.song-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.song-photo .photo-title { font-size: 1rem; }

.song-label { margin: 0 0 0.3rem; font-size: 0.9rem; font-style: italic; }
.song h3 { margin: 0; }
.song .title-btn { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.song-artist { margin: 0.25rem 0 0; font-style: italic; }

.song-link {
  display: inline-block; margin-top: 1rem; padding: 0.6rem 1.5rem;
  background: var(--navy); color: var(--white);
  font-weight: 700; text-decoration: none;
}
.song-link:hover { background: var(--blue); }

/* Space below the song box now that the meetup section is gone */
.song { margin-bottom: 4rem; }


/* ---------- Details popup ---------- */

dialog#details {
  width: min(44rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 0;
  background: var(--paper);
  color: var(--navy);
  border: 3px solid var(--navy);
  box-shadow: 10px 10px 0 var(--blue);
  overflow: auto;
}
dialog#details[open] { animation: pop 0.18s ease-out; }
dialog#details::backdrop { background: rgba(10, 31, 92, 0.65); }

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { dialog#details[open] { animation: none; } }

.close-btn {
  position: absolute; top: 0.75rem; right: 0.75rem;
  padding: 0.35rem 0.9rem;
  background: var(--navy); color: var(--white);
  border: 0; cursor: pointer;
  font-family: var(--text); font-weight: 700; font-size: 0.95rem;
}
.close-btn:hover { background: var(--blue); }

.d-grid { display: grid; grid-template-columns: 11rem 1fr; gap: 1.5rem 2rem; padding: 2.75rem 2rem 2rem; }
.d-img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; padding: 0.35rem; background: var(--white); border: 5px solid var(--navy); box-shadow: 6px 6px 0 var(--blue); }
.d-kind { margin: 0; font-style: italic; font-size: 0.95rem; color: var(--blue); font-weight: 700; }
.d-body h2 { margin: 0.1rem 0 0.5rem; font-family: var(--display); font-weight: 800; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.05; }
.d-line { margin: 0.1rem 0; font-size: 0.95rem; }
.d-line:first-of-type { font-style: italic; }
.d-synopsis { margin: 1rem 0; font-size: 1.05rem; }

.d-info { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; margin: 1rem 0 0; padding-top: 1rem; border-top: 2px solid var(--navy); }
.d-info dt { font-weight: 700; }
.d-info dd { margin: 0; }


/* ---------- Inner pages (past, recommend) ---------- */

.page-head { padding: clamp(1.5rem, 5vw, 3.5rem) var(--gutter) 1.5rem; }

.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--navy);
}

.lead { max-width: 42ch; margin: 1rem 0 0; font-size: 1.2rem; font-style: italic; }

.content { max-width: 46rem; padding: 0 var(--gutter) 4rem; }


/* ---------- Past months ---------- */

.past-row {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) 1fr;
  gap: 1.25rem 3rem;
  padding: 2rem var(--gutter);
  border-top: 2px solid var(--navy);
}
.past-month h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.75rem; }
.past-month p { margin: 0.25rem 0 0.75rem; font-style: italic; }

.past-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.25rem 2rem; margin: 0; }
.past-picks dt { font-size: 0.9rem; font-style: italic; color: var(--blue); }
.past-picks dd { margin: 0; }
.past-picks dd:not(.by) { font-weight: 700; font-size: 1.15rem; line-height: 1.25; }
.past-picks .by { font-size: 0.95rem; font-style: italic; }


/* ---------- Recommend page button ---------- */

.form-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.85rem 1.75rem;
  background: var(--navy);
  color: var(--white);
  border: 3px solid var(--navy);
  box-shadow: 6px 6px 0 var(--blue);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.form-button:hover { background: var(--blue); }


/* ---------- Messages and footer ---------- */

.status { margin: 0; padding: 1rem var(--gutter); font-style: italic; }

.site-footer { padding: 2.5rem var(--gutter) 3rem; background: var(--navy); color: var(--mist); font-size: 0.95rem; }
.site-footer p { margin: 0.25rem 0; max-width: 55ch; }
.site-footer a { color: var(--sky); }


/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .picks { grid-template-columns: 1fr; max-width: 22rem; }
  .past-row { grid-template-columns: 1fr; }
  .d-grid { grid-template-columns: 1fr; }
  .d-img { max-width: 11rem; }
}
