/* ==========================================================================
   weblists.css - ONE look for every language list in /webparts/  (shared by the hub and every page that shows a list)
   --------------------------------------------------------------------------
   * Each list file starts with <link rel="stylesheet" href="/webparts/weblists.css">, so any page that includes a list gets this file.
   * Every rule is namespaced .wl-*  (web list); nothing here touches the rest of a page.
   * Each language keeps ITS OWN colours: the list sets two colours inline, e.g.  <div class="wl" style="--wl-c:#D2E1FF;--wl-b:#000080">
        --wl-c  the fill colour of the table      --wl-b  the colour of its border and thin lines
   * The pictures of a list sit together in one row at the top (.wl-head). Pictures that fit into the empty cells of the last text
     row sit there instead (li.wl-pics). A two-language list has one .wl-sec per language (its own colour: --wl-s).
   * The text table has a chosen number of columns: <ul class="wl-items wl-c3"> (1-4). A short last row shares the row out evenly,
     so there are never empty cells. Narrow places get fewer columns by themselves (container queries).
   * To add a resource: copy one <li dir="auto"><span>...</span></li> inside the <ul class="wl-items"> of that list.
   * Lists that are just a language banner + an MP3 Bible picture: <div class="wl-bar"> (wl-bar-side: the tall picture beside it).
   ========================================================================== */

.wl {
  --wl-fill: var(--wl-c, #d2e1ff);
  --wl-line: var(--wl-b, #000080);
  --wl-ink: #1c1c1c;
  --wl-link: #0b3a9e;
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 980px;
  margin: 14px auto;
  background: var(--wl-fill);
  color: var(--wl-ink);
  border: 2px solid var(--wl-line);
  border-radius: 12px;
  overflow: hidden;
  font: 16px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  letter-spacing: normal;
  text-align: center;
  text-indent: 0;
}
.wl *, .wl *::before, .wl *::after { box-sizing: border-box; }

.wl a { color: var(--wl-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.wl a:hover, .wl a:focus-visible { text-decoration-thickness: 2px; }
.wl a:focus-visible { outline: 3px solid var(--wl-link); outline-offset: 2px; border-radius: 3px; }
.wl b, .wl strong { font-weight: 700; }
.wl img { max-width: 100%; border: 0; vertical-align: middle; object-fit: contain; }   /* no height:auto - it would override the height="67" the pictures were given */

/* ---- the picture row: language banner first, then every other picture, at the sizes the owner chose ---- */
.wl-logos {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px 20px;
  padding: 14px 16px;
}
.wl-head { border-bottom: 1px solid var(--wl-line); }
.wl-head:last-child { border-bottom: 0; }
.wl-logos a { display: inline-block; line-height: 0; }
.wl-logos a:hover img, .wl-logos a:focus-visible img, .wl-pics a:hover img, .wl-pic a:hover img { filter: brightness(1.08); }

/* a picture with its download formats under it (the Jesus Film: MP4 · Low) */
.wl-fig { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.wl-cap { font-size: .85rem; line-height: 1.2; white-space: nowrap; }
.wl-cap a { display: inline; line-height: 1.2; }

/* ---- two-language lists (Serbo-Croatian): one band per language, in that language's colour ---- */
.wl-sec { background: var(--wl-s, transparent); border-bottom: 1px solid var(--wl-line); }
.wl-sec-h { margin: 0; padding: 12px 16px 0; font: 700 1.15rem/1.25 Georgia, "Times New Roman", serif; color: var(--wl-ink); }
.wl-sec .wl-logos { padding-top: 10px; }

/* ---- the text table: one cell per resource, thin lines between, a chosen number of columns ----
   Flex rows: every cell of a full row has the same width; a short last row shares the row out (no empty cells). */
.wl-items {
  --wl-cols: 4;
  list-style: none; margin: 0 -1px -1px 0; padding: 0;          /* the -1px hides the last right/bottom line behind the outer border */
  display: flex; flex-wrap: wrap;
  container: wl-table / inline-size;
  min-width: min(100%, 280px);
}
.wl-c1 { --wl-cols: 1; }
.wl-c2 { --wl-cols: 2; }
.wl-c3 { --wl-cols: 3; }
.wl-c4 { --wl-cols: 4; }
.wl-items > li {
  flex: 1 0 calc(100% / var(--wl-cols) - 1px);
  min-width: 0;
  display: flex; align-items: center; justify-content: center;
  min-height: 64px; margin: 0; padding: 0;
  list-style: none;
  border: solid var(--wl-line); border-width: 0 1px 1px 0;
}
.wl-items > li > span { display: block; min-width: 0; padding: 12px 14px; overflow-wrap: anywhere; }
.wl-items > li:not(.wl-pic):not(.wl-pics) img { height: 22px; width: auto; vertical-align: middle; }   /* small icons beside a link (PDF icon ...) */

/* a title that is a picture (Hindi), and a cell that holds the pictures that fitted into the last row */
.wl-pic > span { padding: 10px 12px; line-height: 0; }
.wl-pics > span { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 12px; padding: 10px 12px; }
.wl-pics a { display: inline-block; line-height: 0; }

/* fewer columns where the list is narrow (a phone, a side column of another page) */
@container wl-table (max-width: 820px) {
  .wl-c4 > li { flex-basis: calc(100% / 3 - 1px); }
}
@container wl-table (max-width: 560px) {
  .wl-c3 > li, .wl-c4 > li { flex-basis: calc(50% - 1px); }
  .wl-items > li > span { padding: 9px 8px; font-size: .96rem; }
}
@container wl-table (max-width: 300px) {
  .wl-items > li { flex-basis: 100%; }
}

/* ---- the flag grid (all_languages.htm) ---- */
.wl-flags .wl-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); container-type: normal; }
.wl-flags .wl-items > li { justify-content: flex-start; min-height: 48px; }
.wl-flags .wl-items > li > span { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 12px; text-align: left; }
.wl-flags .wl-items > li:not(.wl-pic):not(.wl-pics) img { height: 20px; width: auto; max-width: 36px; object-fit: contain; }
.wl-flags .wl-items > li:not(:has(img)) > span::before { content: "\1F310"; line-height: 1; }   /* no flag picture: a small globe, so every tile looks alike */

/* ---- the Bible downloads block (bible_downloads.htm): groups of links ---- */
.wl-dl { --wl-ink: #800000; --wl-link: #800000; text-align: left; }
.wl-dl a { font-weight: 700; }
.wl-g { padding: 14px 16px; border-bottom: 1px solid var(--wl-line); }
.wl-g:last-child { border-bottom: 0; }
.wl-g p { margin: 6px 0; }
.wl-g-intro { text-align: center; font: 700 1.25rem/1.3 Georgia, "Times New Roman", serif; }
.wl-g-intro p { margin: 0; }
.wl-g-intro img { height: 26px; width: auto; }
.wl-gh { margin: 0 0 8px; font: 700 1.15rem/1.25 Georgia, "Times New Roman", serif; color: var(--wl-ink); }
.wl-cta { text-align: center; margin: 0 !important; }
.wl-cta a { display: block; padding: 14px 16px; border: 2px solid var(--wl-line); border-radius: 10px; font: 700 1.3rem/1.3 Georgia, "Times New Roman", serif; text-decoration: none; }
.wl-cta a:hover, .wl-cta a:focus-visible { background: rgba(255, 255, 255, .35); }
.wl-cols { list-style: none; margin: 10px 0 0; padding: 0; columns: 3 190px; column-gap: 0; border: solid var(--wl-line); border-width: 1px 0 0 1px; }
.wl-cols > li { break-inside: avoid; margin: 0; padding: 7px 12px; border: solid var(--wl-line); border-width: 0 1px 1px 0; }
.wl-cols img { height: 56px; width: auto; vertical-align: middle; }

/* ---- a language that is just its banner + an MP3 Bible picture ----
   wl-bar: the banner on its own line, the MP3 picture under it.  wl-bar-side: the tall MP3 picture to the RIGHT of the banner. */
.wl-bar {
  box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px 16px; width: 100%; max-width: 980px; margin: 14px auto; text-align: center;
}
.wl-bar > a { display: inline-block; line-height: 0; }
.wl-bar img { max-width: 100%; border: 0; border-radius: 8px; vertical-align: middle; }
.wl-bar img.wl-fluid { height: auto; }                       /* the owner made these banners shrink with the page */
.wl-bar > a:first-child { flex: 0 0 100%; }
.wl-bar-side > a:first-child { flex: 1 1 0; min-width: min(100%, 420px); }
.wl-bar-side > a:first-child img { width: 100%; }
.wl-bar-side > a + a { flex: none; }
.wl-bar > a:hover img, .wl-bar > a:focus-visible img { filter: brightness(1.06); }

/* ---- phones and browsers without container queries ---- */
@media (max-width: 600px) {
  .wl { margin: 10px auto; border-radius: 10px; }
  .wl-c3 > li, .wl-c4 > li { flex-basis: calc(50% - 1px); }
  .wl-items > li { min-height: 54px; }
  .wl-logos { gap: 10px 14px; padding: 12px 10px; }
  .wl-g { padding: 12px; }
}

@media print {
  .wl { break-inside: avoid; box-shadow: none; }
}
