/*
 * rskurg.ee — site.css
 *
 * Everything in this file is OUR work, not a port. The Claude-Design export contains
 * ZERO @media queries (verified: 0 breakpoints across all 7 flattened pages) — the
 * responsive layout below is authored from design/mobile-reference.html, which specs
 * three phone artboards: "Avaleht", "Menüü avatud" (burger panel) and
 * "Plaadid — lugude nimekiri", plus a persistent call button.
 *
 * The design's layout lives in inline style="" attributes, so overriding it needs
 * !important inside the media queries. That is deliberate here, not sloppiness.
 */

/* ---------------------------------------------------------------- base ---- */

/* Skip link. Hidden with the clip pattern, NOT left:-9999px — an element parked far off
   to the left still counts toward document scrollWidth and shows up as a phantom
   horizontal overflow in every measurement. */
.rskurg-skip {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.rskurg-skip:focus {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: auto;
  height: auto;
  margin: 0;
  padding: 12px 20px;
  overflow: visible;
  clip: auto;
  clip-path: none;
  background: #7C2F2F;
  color: #FAF2DE;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}

/* Visible focus for keyboard users — the design defines hover only. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #B0842F;
  outline-offset: 3px;
  border-radius: 3px;
}

img { max-width: 100%; height: auto; }

/* Fallback prose pages (blog posts, 404) rendered by index.php. */
.rskurg-proosa { padding: 56px 24px 80px; }
.rskurg-proosa-sisu { max-width: 760px; margin: 0 auto; }
.rskurg-proosa-sisu h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(32px, 1.7rem + 2vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  color: #3B2E21;
  margin: 0 0 24px;
}

/* --------------------------------------------------- interactive parts ---- */

/* Album tracklists: the markup stays in the DOM (so search engines and AI crawlers
   read all 7 tracklists) and is only visually collapsed. */
.rskurg-lugude-nimekiri[hidden] { display: none; }
.rskurg-ava-nupp { cursor: pointer; }
.rskurg-ava-nupp[aria-expanded="true"] .rskurg-ava-ikoon { transform: rotate(45deg); }
.rskurg-ava-ikoon {
  display: inline-block;
  transition: transform .18s ease;
}

/* Audio sample rows — the row IS the control; the <audio> element is headless
   (the a11y/fidelity audit found the native browser control bar rendering next to the
   design's play pill). */
.rskurg-naidis.on-mangimas [data-rskurg-mangi] {
  background: rgba(176, 132, 47, .16) !important;
  border-color: #B0842F !important;
}
.rskurg-audio { display: none; }

/* ------------------------------------------------ accessible gold text ----
   The design's two gold text colors measure below WCAG AA on the cream backgrounds
   (4.33:1 and 2.96:1 against #F6EFDF; 4.5 needed). #7A5B1E keeps the gold hue at
   5.5–5.8:1 on every cream in the palette. Attribute-substring selectors are safe
   here: no part uses "background-color: rgb(142|176 …)" (verified), so only text
   color declarations match. */
[style*="color: rgb(142, 106, 36)"] { color: #7A5B1E !important; }
main [style*="color: rgb(176, 132, 47)"] { color: #7A5B1E !important; }

/* Video facade — a real YouTube iframe is only inserted on click, so no third-party
   request (and no cookie) is made until the visitor asks for it. */
.rskurg-video { position: relative; cursor: pointer; }
.rskurg-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }

/* Burger panel — rendered as a BODY-level sibling, never inside <header>: the header
   carries a background/filter that would become the containing block for a
   position:fixed overlay and silently clamp it to the header's height. */
.rskurg-burger { display: none; }
.rskurg-menu {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #FBF5E5;
  padding: 26px 24px calc(26px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.rskurg-menu[hidden] { display: none; }
.rskurg-menu a {
  display: block;
  padding: 17px 6px;
  border-bottom: 1px solid #E8D6A8;
  text-decoration: none;
  color: #3B2E21;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.rskurg-menu a[aria-current="page"] { color: #7C2F2F; }
.rskurg-menu-sulge {
  background: none;
  border: 0;
  font-size: 30px;
  line-height: 1;
  color: #3B2E21;
  padding: 6px 10px;
  cursor: pointer;
}
.rskurg-menu-pais {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.rskurg-menu-helista {
  display: block;
  margin-top: 22px;
  background: #7C2F2F;
  color: #FAF2DE !important;
  text-align: center;
  border-radius: 999px;
  padding: 15px 20px !important;
  border-bottom: 0 !important;
}

/* Lightbox — the photo album's enlarge-and-browse view. Photos are max 500 px
   (watermarked originals), so they are shown at NATURAL size, never upscaled to blur. */
.rskurg-galerii-pilt { cursor: zoom-in; }
.rskurg-valgusboks {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(30, 23, 15, .93);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.rskurg-valgusboks[hidden] { display: none; }
.rskurg-valgusboks-raam {
  background: #FFFDF4;
  padding: 14px 14px 8px;
  border: 1px solid #E6DCC2;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  max-width: min(92vw, 560px);
}
.rskurg-valgusboks-raam img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  border: 1px solid rgba(59, 46, 33, .1);
  margin: 0 auto;
}
.rskurg-valgusboks-pealdis {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 16px;
  color: #6B5A44;
  text-align: center;
  padding: 10px 6px 8px;
  min-height: 1.4em;
}
.rskurg-valgusboks-loendur {
  color: #D9B872;
  font-size: 14px;
  letter-spacing: 2px;
  margin-top: 14px;
}
.rskurg-valgusboks button {
  background: none;
  border: 2px solid rgba(231, 197, 121, .65);
  color: #F3E3BC;
  border-radius: 999px;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rskurg-valgusboks button:hover { background: rgba(231, 197, 121, .18); }
.rskurg-valgusboks-eelmine,
.rskurg-valgusboks-jargmine {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.rskurg-valgusboks-eelmine { left: 18px; }
.rskurg-valgusboks-jargmine { right: 18px; }
.rskurg-valgusboks-sulge {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 30px !important;
}
@media (max-width: 760px) {
  .rskurg-valgusboks { padding: 12px; }
  .rskurg-valgusboks-eelmine { left: 6px; }
  .rskurg-valgusboks-jargmine { right: 6px; }
  .rskurg-valgusboks button { width: 44px; height: 44px; }
  .rskurg-valgusboks-raam img { max-height: 62vh; }
}

/* Persistent call bar (mobile only) — specced in the mobile artboard. */
.rskurg-helista-riba {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 110;
  background: #7C2F2F;
  color: #FAF2DE;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  padding: 15px 16px calc(15px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(59, 46, 33, .25);
}

/* ------------------------------------------------------------- tablet ----- */

@media (max-width: 980px) {
  main [style*="grid-template-columns: 1fr 1fr"],
  main [style*="grid-template-columns: 300px 1fr"] {
    grid-template-columns: 1fr !important;
  }
  main [style*="grid-template-columns: repeat(auto-fit, minmax(360px"],
  main [style*="grid-template-columns: repeat(auto-fit, minmax(340px"],
  main [style*="grid-template-columns: repeat(auto-fit, minmax(330px"],
  main [style*="grid-template-columns: repeat(auto-fit, minmax(320px"] {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  }
  main [style*="padding: 72px"],
  main [style*="padding: 80px"] { padding-left: 24px !important; padding-right: 24px !important; }
}

/* -------------------------------------------------------------- phone ----- */

@media (max-width: 760px) {
  /* Header: hide the desktop nav + the inline phone block, show the burger. */
  header nav { display: none !important; }
  header a[href^="tel:"] { display: none !important; }
  .rskurg-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-direction: column;
    width: 46px;
    height: 46px;
    background: none;
    border: 1px solid #E8D6A8;
    border-radius: 10px;
    cursor: pointer;
    flex: 0 0 auto;
  }
  .rskurg-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #3B2E21;
  }

  header > div:first-child {
    padding: 14px 18px 12px !important;
    gap: 12px !important;
  }
  /* the duo name + strapline */
  header [style*="font-size: 30px"] { font-size: 22px !important; }
  header [style*="letter-spacing: 2.4px"] { font-size: 11px !important; letter-spacing: 1.6px !important; }

  /* Every multi-column layout becomes one column. */
  main [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  main [style*="display: flex"] { flex-wrap: wrap !important; }

  /* Fixed-width framed photos must not overflow. */
  main img[style*="width: 330px"],
  main img[style*="width: 300px"],
  main img[style*="width: 250px"],
  main img[style*="width: 230px"] { width: 100% !important; max-width: 340px; }

  /* Generous desktop padding is unusable on a phone. */
  main [style*="padding: 72px"],
  main [style*="padding: 80px"],
  main [style*="padding: 64px"],
  main [style*="padding: 56px"] {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
  main [style*="max-width: 1200px"] { padding-left: 18px !important; padding-right: 18px !important; }

  /* Headings: the design has no fluid curve below its single desktop size. */
  main h1, main [style*="font-size: 60px"], main [style*="font-size: 56px"] {
    font-size: clamp(30px, 7vw, 40px) !important;
    line-height: 1.12 !important;
  }
  main h2, main [style*="font-size: 40px"], main [style*="font-size: 38px"] {
    font-size: clamp(25px, 5.6vw, 32px) !important;
  }

  /* Tracklist tables: let them scroll inside their own box rather than break the page.
     The scroller itself must be width-constrained, or it just relays the table's width
     to the document. */
  .rskurg-tabeli-kest {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .rskurg-tabeli-kest table { min-width: 460px; }

  /* Decorative absolutely-positioned flourishes (the vinyl discs behind covers, the
     tucked-in polaroids) are deliberately hung outside their box with negative offsets.
     On a phone that pushes the document wider than the screen. */
  main [style*="position: absolute"][style*="right: -"] { right: 0 !important; }
  main [style*="position: absolute"][style*="left: -"]  { left: 0 !important; }

  /* ⛔ The one that actually mattered: grid and flex items default to min-width:auto, so
     a child that has a min-content width (our tracklist scroller sets min-width:460px on
     the table) forces its whole track wider and drags the document with it — measured
     825px on a 390px screen. min-width:0 lets the item shrink and the scroller do its job.
     This is the "media query overrides row-height but not the columns" trap in another
     shape. */
  main [style*="display: grid"] > *,
  main [style*="display: flex"] > * { min-width: 0; max-width: 100%; }

  /* The <audio> control has a wide intrinsic width in Chrome and, as a flex child of the
     compact album cards, dragged its whole card to 400px inside a 354px column. */
  .rskurg-audio { width: 100%; min-width: 0; max-width: 100%; }
  .rskurg-naidis { max-width: 100%; min-width: 0; }

  /* The design's page container: keep its inner width inside the viewport. */
  main section, main section > div { max-width: 100% !important; }
  main [style*="max-width: 1200px"],
  main [style*="max-width: 1100px"],
  main [style*="max-width: 1000px"],
  main [style*="max-width: 980px"] { max-width: 100% !important; box-sizing: border-box; }

  /* Persistent call bar + room for it. */
  .rskurg-helista-riba { display: block; }
  body { padding-bottom: 64px; }
  footer { margin-bottom: 8px; }

  /* Tap targets: the a11y audit measured footer links at 27px, accordion rows at 38px,
     tel/mailto links at 25–29px — all under the 44px minimum. Pad the small stuff. */
  footer a,
  main a[href^="tel:"],
  main a[href^="mailto:"],
  main a[href="#ules"] {
    display: inline-block;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
  }
  [data-rskurg-ava] { padding-top: 14px !important; padding-bottom: 14px !important; }
  [data-rskurg-mangi] { min-height: 48px; }
}

@media (max-width: 400px) {
  header [style*="font-size: 30px"] { font-size: 19px !important; }
  .rskurg-tabeli-kest table { min-width: 400px; }
}

/* ------------------------------------------------------------- print ----- */

@media print {
  header nav, .rskurg-helista-riba, .rskurg-burger, .rskurg-menu { display: none !important; }
  .rskurg-lugude-nimekiri[hidden] { display: block !important; }
}

/* --------------------------------------------------- reduced motion ------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
