/* =============================================
   article-media.css  v1  — the "Exhibit Kit"
   Reusable illustrated-article layout primitives
   for the Learn / natural-history pages.

   Load order:  main.css → learn.css → article-media.css
   Purely ADDITIVE: defines new patterns only, never
   overrides existing .lh-* rules. Inherits the global
   --lh-* museum palette declared in learn.css.

   Used by:
     native-vs-introduced.html   (first model page)
     living-with-squirrels.html
     found-baby-squirrel.html
     how-squirrels-came-west.html
     resources.html

   Sections:
     1. Numbered photo-credit system   (live now)
     2. Four-species comparison strip
     3. Two-column feature block
     4. Vertical / inline figure modifiers
     5. Image-cap card grid
     6. Wide comparison exhibit
   Patterns 2–6 are inert until page markup uses them.
   ============================================= */


/* ═══════════════════════════════════════════════
   1 · NUMBERED PHOTO-CREDIT SYSTEM
   A small clickable [n] marker on each figure, and a
   "Photo Credits" list at the foot of the page.
   Generalizes the .sl-credit-num / .sl-attribution
   pattern proven on squirrel-image-library.html.
   ═══════════════════════════════════════════════ */

/* The [n] marker — sits at the end of a caption or
   floats over an image corner. Clickable: jumps to the
   matching <li id="cred-n"> in the credits list. */
.lh-credit-ref {
  font-family: 'Raleway', sans-serif;
  font-size: 0.72em;
  font-weight: 600;
  line-height: 1;
  color: var(--lh-label);
  text-decoration: none;
  vertical-align: super;
  white-space: nowrap;
}
.lh-credit-ref::before { content: "["; }
.lh-credit-ref::after  { content: "]"; }
.lh-credit-ref:hover { color: var(--lh-accent); text-decoration: underline; }

/* Corner-overlay variant for full-bleed images that have
   no caption to host the marker. Add .lh-credit-ref--corner
   on the <a>, inside a position:relative figure. */
.lh-figure,
.lh-strip-cell,
.lh-feature-media,
.lh-imgcard,
.lh-exhibit-media { position: relative; }

.lh-credit-ref--corner {
  position: absolute;
  right: 7px;
  bottom: 7px;
  vertical-align: baseline;
  background: rgba(27, 22, 6, 0.62);
  color: #f4ecd8;
  padding: 1px 6px 2px;
  border-radius: 3px;
  backdrop-filter: blur(1px);
}
.lh-credit-ref--corner:hover { background: var(--lh-accent); color: #1b1606; }

/* Highlight a credit briefly when jumped to via the marker */
.lh-credits li:target {
  background: #fbf1d8;
  outline: 2px solid var(--lh-gold);
  border-radius: 3px;
}

/* The bottom-of-page "Photo Credits" block
   (mirrors .sl-attribution from the image library). */
.lh-credits {
  max-width: 60rem;
  margin: 8px auto 0;
  padding: 24px 24px 8px;
  border-top: 2px solid var(--lh-border);
}
.lh-credits h2 {
  font-family: 'Raleway', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--lh-label);
  margin: 0 0 14px;
  text-align: left;
}
.lh-credits ol {
  font-family: 'Raleway', sans-serif;
  font-size: 0.82rem;
  color: var(--lh-ink-soft);
  line-height: 1.65;
  padding-left: 1.7em;
  margin: 0;
  columns: 2;
  column-gap: 32px;
}
.lh-credits li { margin: 0 0 4px; break-inside: avoid; }
.lh-credits a { color: var(--lh-label); text-decoration: none; }
.lh-credits a:hover { text-decoration: underline; }
.lh-credits .lh-credits-note {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 0.88rem;
  color: var(--lh-ink-soft);
  font-style: italic;
  margin: 14px 0 0;
}
@media (max-width: 720px) {
  .lh-credits ol { columns: 1; }
}


/* ═══════════════════════════════════════════════
   2 · FOUR-SPECIES COMPARISON STRIP
   A row of framed portraits (typically 4), each able to
   carry a native / introduced colour edge and a label.
   Square cells, contain-fit (never crops the animal).
   ═══════════════════════════════════════════════ */
.lh-strip {
  max-width: 62rem;
  margin: 28px auto;
  padding: 0 24px;
}
.lh-strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.lh-strip-cell { margin: 0; }
.lh-strip-cell img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;           /* proof-sheet honesty: whole animal visible */
  background: var(--lh-parchment-2);
  display: block;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(27, 22, 6, 0.16);
  border-bottom: 4px solid transparent;
}
.lh-strip-cell.is-native img { border-bottom-color: var(--lh-native); }
.lh-strip-cell.is-intro  img { border-bottom-color: var(--lh-accent); }
.lh-strip-cell figcaption {
  font-family: 'Raleway', sans-serif;
  font-size: 0.82rem;
  color: var(--lh-ink);
  margin-top: 7px;
  text-align: center;
}
.lh-strip-cell .lh-strip-tag {
  display: block;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}
.lh-strip-cell.is-native .lh-strip-tag { color: var(--lh-native); }
.lh-strip-cell.is-intro  .lh-strip-tag { color: var(--lh-accent); }

/* Optional divider label between the native pair and the
   introduced pair (e.g. a centered "Native | Introduced"). */
.lh-strip-legend {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin: 14px 0 0;
  font-family: 'Raleway', sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lh-strip-legend .is-native { color: var(--lh-native); font-weight: 600; }
.lh-strip-legend .is-intro  { color: var(--lh-accent); font-weight: 600; }

@media (max-width: 720px) {
  .lh-strip-grid { grid-template-columns: 1fr 1fr; }
}


/* ═══════════════════════════════════════════════
   3 · TWO-COLUMN FEATURE BLOCK  (text + image)
   The workhorse for graceful vertical images: the tall
   photo sits in one column while text fills the other,
   so a portrait reads as intentional, not as a gap.
   Add --reverse to flip the image to the other side
   (chain them to alternate down a page).
   ═══════════════════════════════════════════════ */
.lh-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
  max-width: 62rem;
  margin: 34px auto;
  padding: 0 24px;
}
.lh-feature--reverse .lh-feature-media { order: 2; }
.lh-feature-media { margin: 0; }
.lh-feature-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 14px rgba(27, 22, 6, 0.18);
  background: var(--lh-parchment-2);
}
/* Cap a very tall image so it never dominates the row */
.lh-feature-media img { max-height: 560px; object-fit: contain; }
.lh-feature-media figcaption {
  font-family: 'Raleway', sans-serif;
  font-size: 0.8rem;
  color: var(--lh-ink-soft);
  margin-top: 7px;
}
.lh-feature-body h2,
.lh-feature-body h3 {
  font-family: 'National Park', 'Raleway', Arial, sans-serif;
  color: var(--lh-bg);
  text-align: left;
  margin: 0 0 12px;
  line-height: 1.14;
}
.lh-feature-body p {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.62;
  color: var(--lh-ink);
  margin: 0 0 1em;
}
.lh-feature-body p:last-child { margin-bottom: 0; }
.lh-feature-body strong { color: var(--lh-label); }

@media (max-width: 720px) {
  .lh-feature { grid-template-columns: 1fr; gap: 18px; }
  .lh-feature--reverse .lh-feature-media { order: 0; }  /* image back on top */
  .lh-feature-media img { max-height: 70vh; }
}


/* ═══════════════════════════════════════════════
   4 · VERTICAL & INLINE FIGURE MODIFIERS
   Standalone tall image, or a small inline detail shot.
   Apply as a modifier on the existing .lh-figure.
   ═══════════════════════════════════════════════ */

/* Portrait: cap the width, centre on the column axis. */
.lh-figure--portrait {
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.lh-figure--portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  background: var(--lh-parchment-2);
}
.lh-figure--portrait figcaption { text-align: center; }

/* Inline detail: small image that floats beside text
   (a tail, ear, eye, track). Clears on mobile. */
.lh-figure--inline {
  float: right;
  width: 220px;
  margin: 4px 0 14px 22px;
}
.lh-figure--inline img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: var(--lh-parchment-2);
}
.lh-figure--inline figcaption {
  font-family: 'Raleway', sans-serif;
  font-size: 0.76rem;
  color: var(--lh-ink-soft);
  margin-top: 5px;
  text-align: center;
}
@media (max-width: 560px) {
  .lh-figure--inline { float: none; width: 100%; margin: 14px 0; }
}


/* ═══════════════════════════════════════════════
   5 · IMAGE-CAP CARD GRID
   Cards that lead with an image (misconception cards,
   historical-figure cards, resource-style cards).
   ═══════════════════════════════════════════════ */
.lh-imgcard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 46rem;
  margin: 8px auto 2px;
}
.lh-imgcard {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--lh-border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(27, 22, 6, 0.08);
}
.lh-imgcard-media { margin: 0; display: block; }
.lh-imgcard-media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--lh-parchment-2);
  display: block;
}
.lh-imgcard-body { padding: 13px 16px 15px; }
.lh-imgcard-body h4 {
  font-family: 'Raleway', sans-serif;
  font-size: 0.98rem;
  color: var(--lh-bg);
  margin: 0 0 6px;
  text-align: left;
}
.lh-imgcard-body p {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--lh-ink-soft);
  margin: 0;
}
@media (max-width: 600px) {
  .lh-imgcard-grid { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════
   6 · WIDE COMPARISON EXHIBIT
   A panel that intentionally breaks out wider than the
   reading column for a panoramic / side-by-side moment.
   ═══════════════════════════════════════════════ */
.lh-exhibit {
  max-width: 1080px;
  margin: 34px auto;
  padding: 0 24px;
}
.lh-exhibit-media { margin: 0; }
.lh-exhibit-media img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  box-shadow: 0 2px 16px rgba(27, 22, 6, 0.20);
}
.lh-exhibit-caption {
  font-family: 'Raleway', sans-serif;
  font-size: 0.82rem;
  color: var(--lh-ink-soft);
  margin: 8px 0 0;
  text-align: center;
}
@media (max-width: 640px) {
  .lh-exhibit-media img { aspect-ratio: 4 / 3; }
}
