/* Wildlife of Meghalaya in the site style (Home → Territorial Overview): full width inside 5% margins, the features on
   the golden split (words 38.2%, picture 61.8%) zig-zagging by their place on the page, 8px corners, 150ms motion.
   Pictures open in full view (js/map_zoom.js). */
html body .wl-page .wl-wrap { max-width: none; padding: 0 5%; box-sizing: border-box; }
html body .wl-page .wl-cat-section, html body .wl-page .wl-iucn-block { max-width: none; }
html body .wl-page .wl-iucn-block { padding: 0; }

.wl-page .wl-feature { display: grid; grid-template-columns: 38.2fr 61.8fr; align-items: center; gap: 52px; margin: 84px 0; }
.wl-page .wl-feature.wl-img-left { grid-template-columns: 61.8fr 38.2fr; }
.wl-page .wl-feature.wl-img-left .wl-feature-media { order: -1; }
.wl-page .wl-feature-text, .wl-page .wl-feature-media { min-width: 0; }

.wl-page .wl-feature-subtitle { font-style: italic; margin: 0 0 12px; font-size: 14px; font-weight: 700; letter-spacing: .04em; color: #a8820c; }
.wl-page .wl-feature-title { margin: 0 0 20px; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: clamp(22px, 2vw, 30px); line-height: 1.12; letter-spacing: -.03em; color: #0a2e1a; text-wrap: balance; }
.wl-page .wl-feature-content { font-size: 16px; line-height: 1.75; color: #1f2a22; }
.wl-page .wl-feature-content p { margin: 0 0 12px; }
.wl-page .wl-feature-content strong { color: #0a2e1a; }

.wl-page .wl-feature-img-wrap { position: relative; aspect-ratio: 3 / 2; border-radius: 8px; overflow: hidden; box-shadow: none; background: #f2ede1; }
.wl-page .wl-feature-img { display: block; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform 600ms cubic-bezier(.16, 1, .3, 1); }
.wl-page .wl-feature-img-wrap:hover .wl-feature-img { transform: scale(1.03); }
.wl-page .wl-feature-img:focus-visible { outline: 2px solid #1a472a; outline-offset: -4px; }
.wl-zoom-hint { position: absolute; right: 12px; top: 12px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(249, 246, 239, .92); color: #0a2e1a; pointer-events: none;
    opacity: 0; transform: scale(.85); transition: opacity 150ms cubic-bezier(.4, 0, .2, 1), transform 150ms cubic-bezier(.4, 0, .2, 1); }
.wl-feature-img-wrap:hover .wl-zoom-hint, .wl-feature-img:focus-visible + .wl-zoom-hint { opacity: 1; transform: none; }
@media (hover: none) { .wl-zoom-hint { opacity: 1; transform: none; } }
/* A picture whose file is missing: a quiet sand panel with a leaf, no broken-image text */
.wl-feature-img-wrap.is-missing .wl-feature-img, .wl-feature-img-wrap.is-missing .wl-zoom-hint { display: none; }
.wl-feature-img-wrap.is-missing::after { content: ''; position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; opacity: .25;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a2e1a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z'/%3E%3Cpath d='M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12'/%3E%3C/svg%3E"); }

@media (max-width: 992px) {
    .wl-page .wl-feature, .wl-page .wl-feature.wl-img-left { grid-template-columns: minmax(0, 1fr); gap: 20px; margin: 52px 0; }
    .wl-page .wl-feature .wl-feature-media { order: -1; }
}
@media (max-width: 600px) { html body .wl-page .wl-wrap { padding: 0 20px; } }

/* IUCN Red List note: a sand card on the golden split, words left; the Red List scale and the link button on the right,
   the button in the bottom right corner. Pointing at a step of the scale lifts it and names it. */
.wl-redlist { display: grid; grid-template-columns: 61.8fr 38.2fr; gap: 52px; align-items: stretch; margin: 52px 0; padding: 32px; border-radius: 8px; background: #f2ede1; }
.wl-redlist-copy { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wl-redlist-mark { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; letter-spacing: .02em; color: #b42a24; }
.wl-redlist-text { margin: 0; font-size: 17px; line-height: 1.7; color: #1f2a22; }
.wl-redlist-by { margin: 0; font-size: 14px; color: #4b5563; }
.wl-redlist-side { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; gap: 20px; min-width: 0; }
.wl-redlist-scale { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wl-redlist-scale li { position: relative; }
.wl-redlist-scale b { display: grid; place-items: center; height: 40px; border-radius: 4px; background: var(--c); color: #fff; font: 700 12px/1 Roboto, sans-serif; letter-spacing: .04em;
    transition: transform 150ms cubic-bezier(.4, 0, .2, 1); }
.wl-redlist-scale span { position: absolute; left: 50%; top: calc(100% + 8px); translate: -50% 4px; white-space: nowrap; font-size: 12px; font-weight: 600; color: #0a2e1a; opacity: 0; pointer-events: none;
    transition: opacity 150ms cubic-bezier(.4, 0, .2, 1), translate 150ms cubic-bezier(.4, 0, .2, 1); }
.wl-redlist-scale li:hover b { transform: translateY(-3px); }
.wl-redlist-scale li:hover span { opacity: 1; translate: -50% 0; }
.wl-redlist-scale li:first-child span { left: 0; translate: 0 4px; } .wl-redlist-scale li:first-child:hover span { translate: 0 0; }
.wl-redlist-scale li:last-child span { left: auto; right: 0; translate: 0 4px; } .wl-redlist-scale li:last-child:hover span { translate: 0 0; }
.wl-redlist-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 8px; background: #b42a24; color: #fff !important; font-size: 15px; font-weight: 700; text-decoration: none !important;
    transition: background-color 150ms cubic-bezier(.4, 0, .2, 1), transform 150ms cubic-bezier(.4, 0, .2, 1); }
.wl-redlist-btn svg { transition: transform 150ms cubic-bezier(.4, 0, .2, 1); }
.wl-redlist-btn:hover { background: #962019; }
.wl-redlist-btn:hover svg { transform: translate(2px, -2px); }
.wl-redlist-btn:active { transform: translateY(1px); }
.wl-redlist-btn:focus-visible { outline: 2px solid #0a2e1a; outline-offset: 3px; }
@media (max-width: 992px) { .wl-redlist { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
@media (max-width: 600px) { .wl-redlist { padding: 20px; } .wl-redlist-side { align-items: stretch; } .wl-redlist-btn { justify-content: center; } }

/* Species categories: a left heading with arrows on the right, then one row of sand cards (four in view) that scrolls
   sideways when a group has more. Status tags take the Red List colours. */
.wl-page .wl-row { margin: 84px 0 0; }
.wl-page .wl-row + .wl-row { margin-top: 52px; }
.wl-row-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.wl-row-head h2 { display: flex; align-items: center; gap: 12px; margin: 0; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: clamp(22px, 1.8vw, 28px); line-height: 1.1; letter-spacing: -.03em; color: #0a2e1a; }
.wl-row-head h2 i { font-size: .6em; color: #2e7d4f; }
.wl-row-arrows { display: none; gap: 8px; }
.wl-row.is-scrollable .wl-row-arrows { display: flex; }
.wl-row-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgba(10, 46, 26, .15); border-radius: 50%; background: transparent; color: #0a2e1a; cursor: pointer;
    transition: background-color 150ms cubic-bezier(.4, 0, .2, 1), color 150ms, border-color 150ms, transform 150ms; }
.wl-row-btn:hover:not(:disabled) { background: #0a2e1a; border-color: #0a2e1a; color: #fff; }
.wl-row-btn:active:not(:disabled) { transform: translateY(1px); }
.wl-row-btn:disabled { opacity: .3; cursor: default; }
.wl-row-btn:focus-visible { outline: 2px solid #1a472a; outline-offset: 2px; }
.wl-row-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 20px) / 4); gap: 20px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding: 4px 0 8px; outline: none; }
.wl-row-track::-webkit-scrollbar { display: none; }
.wl-row-track:focus-visible { box-shadow: 0 0 0 2px #1a472a; border-radius: 8px; }
html body .wl-page .wl-row .wl-species-card { scroll-snap-align: start; opacity: 1; transform: none; display: flex; flex-direction: column; border: 0; border-radius: 8px; background: #f2ede1; box-shadow: none;
    transition: transform 150ms cubic-bezier(.4, 0, .2, 1), background-color 150ms cubic-bezier(.4, 0, .2, 1); }
html body .wl-page .wl-row .wl-species-card:hover { transform: translateY(-2px) !important; background: #ece5d3; box-shadow: none; }
.wl-page .wl-row .wl-species-img-wrap { position: relative; height: auto; aspect-ratio: 4 / 3; background: #e9e2d0; }
.wl-page .wl-row .wl-species-img { display: block; cursor: zoom-in; transition: transform 600ms cubic-bezier(.16, 1, .3, 1); }
.wl-page .wl-row .wl-species-card:hover .wl-species-img { transform: scale(1.04); }
.wl-page .wl-row .wl-species-img-wrap.is-missing .wl-species-img { display: none; }
.wl-page .wl-row .wl-species-info { padding: 20px; }
.wl-page .wl-row .wl-species-name { margin: 0 0 4px; font-size: 20px; font-weight: 700; line-height: 1.25; color: #0a2e1a; }
.wl-page .wl-row .wl-species-sci { margin: 0 0 12px; font-size: 14px; color: #5b6b60; }
.wl-page .wl-row .wl-species-desc { font-size: 15px; line-height: 1.6; color: #1f2a22; }
.wl-page .wl-row .wl-status-badge { margin: 0 0 12px; padding: 4px 8px; border-radius: 4px; background: #5b6b60; color: #fff; font: 700 11px/1.4 Roboto, sans-serif; letter-spacing: .05em; }
.wl-status-badge[data-status="leastconcern"] { background: #2e7d4f !important; }
.wl-status-badge[data-status="nearthreatened"] { background: #7aa33a !important; }
.wl-status-badge[data-status="vulnerable"] { background: #d9a400 !important; color: #1d1d1d !important; }
.wl-status-badge[data-status="endangered"] { background: #e07b1a !important; }
.wl-status-badge[data-status="criticallyendangered"] { background: #c8322b !important; }
@media (max-width: 1100px) { .wl-row-track { grid-auto-columns: calc((100% - 20px) / 2.3); } }
@media (max-width: 600px) { .wl-row-track { grid-auto-columns: 82%; gap: 12px; } .wl-page .wl-row { margin-top: 52px; } }
@media (prefers-reduced-motion: reduce) { .wl-row-track { scroll-behavior: auto; } }

/* The stories box: the features in one frame that scrolls inside itself, one story per stop (snapping), so the page
   stands still while the stories change; a numbered rail beside it shows where you are and jumps on click. When the
   last story is reached the page carries on. Phones: the stories simply stack. */
.wl-page .wl-stories-wrap { margin: 52px 0 0; }
.wl-stories { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.wl-stories-scroll { height: min(calc(100vh - 140px), 720px); min-height: 420px; overflow-y: auto; scroll-snap-type: y mandatory; scroll-behavior: smooth; scrollbar-width: none; border-radius: 8px; outline: none; }
.wl-stories-scroll::-webkit-scrollbar { display: none; }
.wl-stories-scroll:focus-visible { box-shadow: 0 0 0 2px #1a472a; }
html body .wl-page .wl-stories .wl-story { height: 100%; padding: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.wl-page .wl-stories .wl-feature { height: 100%; margin: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; opacity: 1; transform: none; overflow: hidden; }
/* the picture fills its half of the story and never pushes the story taller (it would spill into the next one) */
.wl-page .wl-stories .wl-feature-media { height: 100%; min-height: 0; overflow: hidden; }
.wl-page .wl-stories .wl-feature-img-wrap { flex: 1 1 0; height: auto; min-height: 0; aspect-ratio: auto; }
.wl-page .wl-stories .wl-feature-img { position: absolute; inset: 0; }
.wl-page .wl-stories .wl-feature-text { align-self: center; max-height: 100%; overflow-y: auto; scrollbar-width: thin; padding: 4px 4px 4px 0; }
.wl-page .wl-stories .wl-feature-content { font-size: 15px; line-height: 1.7; }
/* each story arrives: the picture settles from a slight zoom, the words rise in */
@media (prefers-reduced-motion: no-preference) {
    .wl-stories .wl-feature-img { transform: scale(1.08); transition: transform 1100ms cubic-bezier(.16, 1, .3, 1); }
    .wl-stories .wl-story.is-now .wl-feature-img { transform: scale(1); }
    .wl-stories .wl-story.is-now .wl-feature-img-wrap:hover .wl-feature-img { transform: scale(1.03); }
    .wl-stories .wl-feature-text > * { opacity: 0; translate: 0 20px; transition: opacity 600ms cubic-bezier(.16, 1, .3, 1), translate 700ms cubic-bezier(.16, 1, .3, 1); }
    .wl-stories .wl-story.is-now .wl-feature-text > * { opacity: 1; translate: 0 0; }
    .wl-stories .wl-story.is-now .wl-feature-text > :nth-child(2) { transition-delay: 80ms; }
    .wl-stories .wl-story.is-now .wl-feature-text > :nth-child(3) { transition-delay: 160ms; }
}
.wl-stories-rail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wl-stories-rail li { position: relative; }
.wl-stories-rail button { display: flex; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; cursor: pointer; font: 700 13px/1 Roboto, sans-serif; font-variant-numeric: tabular-nums; color: rgba(10, 46, 26, .4);
    transition: color 150ms cubic-bezier(.4, 0, .2, 1); }
.wl-stories-rail button::before { content: ''; width: 12px; height: 2px; border-radius: 2px; background: currentColor; transition: width 300ms cubic-bezier(.16, 1, .3, 1); }
.wl-stories-rail button:hover { color: #0a2e1a; }
.wl-stories-rail button.is-now { color: #0a2e1a; }
.wl-stories-rail button.is-now::before { width: 28px; background: #f1c40f; }
.wl-stories-rail button span { position: absolute; right: calc(100% + 12px); top: 50%; translate: 4px -50%; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; padding: 6px 12px; border-radius: 4px;
    background: #0a2e1a; color: #fff; font: 600 12px/1.3 'Plus Jakarta Sans', sans-serif; opacity: 0; pointer-events: none; transition: opacity 150ms, translate 150ms cubic-bezier(.4, 0, .2, 1); }
.wl-stories-rail button:hover span, .wl-stories-rail button:focus-visible span { opacity: 1; translate: 0 -50%; }
.wl-stories-rail button:focus-visible { outline: 2px solid #1a472a; outline-offset: 2px; border-radius: 4px; }
.wl-stories-hint { position: absolute; left: 50%; bottom: 12px; translate: -50% 0; margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px;
    background: rgba(249, 246, 239, .92); color: #0a2e1a; font-size: 12px; font-weight: 600; pointer-events: none; transition: opacity 300ms; }
.wl-stories.is-moved .wl-stories-hint { opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .wl-stories-hint svg path { animation: wlWheel 1.4s ease-in-out infinite; } @keyframes wlWheel { 0%, 100% { translate: 0 0; opacity: 1; } 60% { translate: 0 3px; opacity: .3; } } }
@media (max-width: 992px) {
    .wl-stories { display: block; }
    .wl-stories-scroll { height: auto; overflow: visible; scroll-snap-type: none; }
    html body .wl-page .wl-stories .wl-story { height: auto; }
    .wl-page .wl-stories .wl-feature { height: auto; margin: 0 0 52px; }
    .wl-page .wl-stories .wl-feature-img-wrap { height: auto; aspect-ratio: 3 / 2; }
    .wl-page .wl-stories .wl-feature-text { max-height: none; overflow: visible; }
    .wl-stories-rail, .wl-stories-hint { display: none; }
    .wl-stories .wl-feature-text > * { opacity: 1 !important; translate: none !important; }
    .wl-stories .wl-feature-img { transform: none !important; }
}
/* Mouse scrolling of the species rows: a grab hand, no snapping while the wheel or a drag moves the row */
@media (hover: hover) and (pointer: fine) { .wl-row.is-scrollable .wl-row-track { cursor: grab; } }
.wl-row-track.is-free { scroll-snap-type: none; scroll-behavior: auto; }
.wl-row-track.is-dragging { cursor: grabbing; user-select: none; }
.wl-row-track.is-dragging img { pointer-events: none; }

/* One stop = one picture and its words, all in view: inside the stories box the two halves are equal (the words get
   the room they need), the type is sized for the box, and a story whose words still overflow is scaled down a little
   (--fit, set by js/designs/wl_wildlife.js) instead of being cut off. */
@media (min-width: 993px) {
    html body .wl-page .wl-stories .wl-feature, html body .wl-page .wl-stories .wl-feature.wl-img-left { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 52px; }
    .wl-page .wl-stories .wl-feature-text { --fit: 1; overflow: hidden; padding: 0; }
    .wl-page .wl-stories .wl-feature-subtitle { margin-bottom: calc(8px * var(--fit)); font-size: calc(13px * var(--fit)); }
    .wl-page .wl-stories .wl-feature-title { margin-bottom: calc(16px * var(--fit)); font-size: calc(clamp(22px, 1.8vw, 28px) * var(--fit)); }
    .wl-page .wl-stories .wl-feature-content { font-size: calc(15px * var(--fit)); line-height: 1.65; }
    .wl-page .wl-stories .wl-feature-content p { margin-bottom: calc(10px * var(--fit)); }
}
.wl-page .wl-stories .wl-feature-content > :last-child, .wl-page .wl-stories .wl-feature-content p:last-child { margin-bottom: 0; }

/* The feature stories, balanced: a shorter picture window (it no longer towers over the words) and the words set larger
   (title, 17px text) so the two halves read as a pair; --fit still shrinks a long story a little to keep it in view. */
@media (min-width: 993px) {
    .wl-stories-scroll { height: min(calc(100vh - 220px), 520px); min-height: 420px; }
    html body .wl-page .wl-stories .wl-feature { grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); gap: 56px; }
    html body .wl-page .wl-stories .wl-feature.wl-img-left { grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); gap: 56px; }
    .wl-page .wl-stories .wl-feature-subtitle { margin-bottom: calc(10px * var(--fit)); font-size: calc(14px * var(--fit)); }
    .wl-page .wl-stories .wl-feature-title { margin-bottom: calc(20px * var(--fit)); font-size: calc(clamp(28px, 2.3vw, 40px) * var(--fit)); line-height: 1.12; }
    .wl-page .wl-stories .wl-feature-content { font-size: calc(17px * var(--fit)); line-height: 1.75; }
    .wl-page .wl-stories .wl-feature-content p { margin-bottom: calc(14px * var(--fit)); }
    .wl-page .wl-stories .wl-feature-text { padding-bottom: 10px; }   /* room for the last line's descenders */
}

/* The feature stories' scientific names as written — italic, the genus capitalised and the rest small
   ("Neofelis nebulosa"), not in capitals */
html body .wl-page .wl-feature-subtitle { text-transform: none !important; letter-spacing: 0 !important; font-size: 15px; }
