/* ==========================================================================
   languages.css - look and feel of https://GoJes.us/languages/ (index.htm)
   --------------------------------------------------------------------------
   * Every rule is namespaced .lh-* (languages hub).
   * The LANGUAGE LISTS are NOT styled here: they are the shared files in /webparts/, which carry their own look
     (/webparts/weblists.css) so the hub and every other page show the same list the same way. This file only
     lays them out one under the other (or two per row for one-picture languages).
   * Brand: maroon #800000 + gold #FF9933 + the flag wallpaper, refined. One long page (owner decision D3).
   * LIGHT AND DARK: the page around the panel, the wallpaper and the banner go dark; the white content panel and every list in it
     STAY LIGHT with the owner's own list colours, because the pictures in the lists only look right on a light background (owner, draft 3).
   * Never put transform/filter on <body>: the shared menu panel is position:fixed (R:\Global_Menu_Instructions.txt).
   ========================================================================== */

:root {
  --lh-maroon: #800000;
  --lh-maroon-2: #a31616;
  --lh-gold: #ff9933;
  --lh-gold-soft: #fff4e6;
  --lh-ink: #1f1a17;
  --lh-muted: #5b524c;
  --lh-paper: #fffbf5;            /* a warm light panel (owner: "a light background colour if it helps"): softer than pure white in dark mode */
  --lh-page: #f4ece3;
  --lh-line: #e6d5c3;
  --lh-link: #0b5cad;
  --lh-heading: #800000;
  --lh-radius: 14px;
  --lh-shadow: 0 8px 30px rgba(70, 25, 0, .16);
  --lh-wallpaper-opacity: .22;
  --lh-hero-1: #6d0f1f; --lh-hero-2: #8c1b2c; --lh-hero-glow: #c23a4d;
}

/* dark mode: only what is OUTSIDE the white content panel changes (the panel keeps the light colours above) */
@media (prefers-color-scheme: dark) {
  :root {
    --lh-page: #14100e;
    --lh-shadow: 0 8px 30px rgba(0, 0, 0, .6);
    --lh-wallpaper-opacity: .07;
    --lh-hero-1: #4a0a14; --lh-hero-2: #6b1424; --lh-hero-glow: #8f2a3b;
  }
}

/* ---- page and wallpaper (faded, behind the white panel) ------------------- */
html { background: var(--lh-page); }

body.lh-page {
  margin: 0;
  background: transparent;
  color: var(--lh-ink);
  font: 16px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  text-align: left;
}

body.lh-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("/images/flags.jpg") repeat;
  opacity: var(--lh-wallpaper-opacity);
}

@media (prefers-color-scheme: dark) {
  body.lh-page::before { filter: brightness(.6); }
}

.lh-skip {
  position: absolute; left: -999px; top: 8px; z-index: 1000;
  padding: 8px 14px; border-radius: 8px; background: #fff; color: #000; font-weight: 700;
}
.lh-skip:focus { left: 8px; }

.lh-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

:where(a, button, summary):focus-visible { outline: 3px solid var(--lh-link); outline-offset: 3px; }

/* ---- the white panel ------------------------------------------------------- */
.lh-shell {
  max-width: 1100px;
  margin: 18px auto 40px;
  background: var(--lh-paper);
  border-radius: 20px;
  box-shadow: var(--lh-shadow);
  overflow: hidden;
  color: var(--lh-ink);
}

/* ---- the banner: HTML + SVG, so it is crisp and right in light AND dark mode ---- */
.lh-hero {
  position: relative;
  margin: 0; padding: 0; text-align: center; color: #fff;
  background:
    radial-gradient(900px 260px at 50% -30%, var(--lh-hero-glow), transparent 70%),
    linear-gradient(135deg, var(--lh-hero-1), var(--lh-hero-2) 55%, var(--lh-hero-1));
}
.lh-hero-btn {
  all: unset; box-sizing: border-box; width: 100%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: clamp(12px, 3vw, 30px);
  padding: clamp(18px, 4vw, 34px) 16px 10px;
}
.lh-hero-btn:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
/* the Global Menu button (owner R1): in the banner's top-left corner, NOT on an always-visible bar. The shared menu panel is
   position:fixed with z-index 10, so it opens above everything here. */
.lh-menu-btn {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  min-width: 56px; min-height: 44px; padding: 6px 14px;
  border: 2px solid #ffcf8a; border-radius: 12px;
  background: rgba(0, 0, 0, .22); color: #ffe2b8;
  font: 700 1.15rem/1 system-ui, "Segoe UI Symbol", sans-serif; letter-spacing: .08em;
  cursor: pointer;
}
.lh-menu-btn:hover, .lh-menu-btn:focus-visible { background: rgba(255, 255, 255, .26); outline: 3px solid #fff; outline-offset: 2px; }
.lh-globe { width: clamp(64px, 13vw, 112px); height: auto; flex: none; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }
.lh-hero-text { display: block; text-align: left; min-width: 0; }
.lh-hero-title {
  display: block; font: 700 clamp(1.7rem, 5.6vw, 3.1rem)/1.05 Georgia, "Times New Roman", serif;
  color: #ffd89a; text-shadow: 0 2px 0 rgba(0, 0, 0, .4);
}
.lh-hero-sub { display: block; margin-top: 8px; max-width: 34rem; font: 600 clamp(.85rem, 2.2vw, 1.05rem)/1.4 system-ui, sans-serif; color: #ffeedd; }
.lh-ribbon {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  height: 20px; overflow: hidden; margin: 4px 12px 16px;     /* one row only: margin (not padding) so no second row peeks out */
}
.lh-ribbon img { height: 20px; width: auto; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .45); }

.lh-main { padding: 14px clamp(12px, 3vw, 30px) 30px; }

.lh-h2 {
  margin: 8px 0 12px;
  font: 700 1.35rem/1.2 Georgia, "Times New Roman", serif;
  color: var(--lh-heading);
}

/* ---- the lists keep THEIR OWN look (/webparts/weblists.css) in light AND dark mode: the owner's pictures only work on the light colours ---- */
.lh-main .wl, .lh-main .wl-bar { max-width: none; margin-left: 0; margin-right: 0; }
.lh-flags { padding: 2px 0 6px; }
.lh-flags .wl { margin-top: 6px; }

/* ---- "+300 MP3 Bibles": your orange and maroon box, collapsed below the grid ---------
   The A-to-Z list inside is the shared file /ssi/mp3_bible_languages.htm, included live (never copied), so a new language added there
   appears here by itself. */
.lh-mp3 {
  margin: 20px 0 8px;
  border: 3px solid var(--lh-maroon);
  border-radius: var(--lh-radius);
  background: var(--lh-gold);
  overflow: hidden;
}
.lh-mp3 > summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  padding: 14px 18px;
  list-style: none;
  cursor: pointer;
  color: var(--lh-maroon);
  font: 700 1.35rem/1.3 Georgia, "Times New Roman", serif;
}
.lh-mp3 > summary::-webkit-details-marker { display: none; }
.lh-mp3 > summary::before { content: "\25B8"; display: inline-block; transition: transform .15s; }
.lh-mp3[open] > summary::before { transform: rotate(90deg); }
.lh-hint { margin-left: auto; font: 600 .85rem system-ui, sans-serif; color: #5a1500; }
.lh-direct { margin: 0 18px; font-size: .9rem; }
.lh-direct a { color: #5a1500; font-weight: 700; }
.lh-mp3-body {
  padding: 10px 18px 16px;
  max-height: min(70vh, 640px); overflow: auto;
  border-top: 2px solid var(--lh-maroon);
  background: var(--lh-gold); color: #800000; line-height: 1.95;
}
.lh-mp3-body a { color: #0a2f8f; }

/* ---- one block per language: JUST the shared list (its own top picture already names the language) ---- */
.lh-lang { margin: 26px 0; }
.lh-lang > p { margin: 0; text-align: center; }                     /* a language that is only one title picture */
/* a title picture that stands alone (a <p> or a <div>; Somali is a fixed 953px wide): never wider than its cell, same proportions */
.lh-lang > :not(.wl):not(.wl-bar):not(.lh-zip-row) img { max-width: 100%; height: auto; border-radius: 8px; }
.lh-lang > div:not(.wl):not(.wl-bar) { text-align: center; }
.lh-zip-row { margin: 10px 0 0; text-align: center; }
/* banner lists with a ZIP: the banner on its own line, then the MP3 Bible picture and the ZIP button side by side (owner) */
.lh-inline-zip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; }
.lh-inline-zip > .wl-bar { display: contents; }
.lh-inline-zip > .lh-zip-row { margin: 0; }
.lh-zip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 999px;
  background: var(--lh-gold); color: #3b1500; border: 2px solid var(--lh-maroon);
  font-weight: 700; font-size: .9rem; text-decoration: none;
}
.lh-zip img { width: 16px; height: auto; }
.lh-zip:hover, .lh-zip:focus-visible { filter: brightness(1.06); }

/* ---- languages that are just ONE picture: two per row when there is room, one per row when not ----
   An odd one out at the end of a run spans the full row, so a row is never half empty. */
.lh-pairs {
  display: grid; gap: 20px 18px; margin: 26px 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 470px), 1fr));
}
.lh-pairs > .lh-lang { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.lh-pairs > .lh-lang:last-child:nth-child(odd) { grid-column: 1 / -1; }
.lh-pairs > .lh-lang > p { width: 100%; }

/* ---- the two big frames became two buttons --------------------------------- */
.lh-more { margin: 32px 0 6px; }
.lh-more-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.lh-card-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px;
  border: 2px solid var(--lh-maroon); border-radius: var(--lh-radius);
  background: var(--lh-gold-soft); color: var(--lh-ink);
  text-decoration: none;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.lh-card-link:hover, .lh-card-link:focus-visible { border-color: var(--lh-gold); box-shadow: var(--lh-shadow); transform: translateY(-1px); }
.lh-card-title { font: 700 1.15rem Georgia, "Times New Roman", serif; color: var(--lh-heading); }
.lh-card-line { color: var(--lh-muted); }

/* ---- phones ---------------------------------------------------------------- */
@media (max-width: 640px) {
  .lh-shell { margin: 8px 8px 28px; border-radius: 16px; }
  .lh-hero-btn { flex-direction: column; gap: 6px; }
  .lh-hero-text { text-align: center; }
  .lh-menu-btn { top: 8px; left: 8px; }
  .lh-hint { margin-left: 0; }
  .lh-mp3 > summary { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  body.lh-page::before, .lh-skip, .lh-menu-btn { display: none !important; }
  .lh-shell { box-shadow: none; margin: 0; }
  .lh-lang { break-inside: avoid-page; }
  .lh-mp3 { display: none; }
}
