/* ==========================================================================
   afourar.info — design system
   Palette drawn from the town itself: pisé clay walls, mandarin orchards,
   Atlas olive-green slopes and the turquoise of the Bin El Ouidane lake.
   ========================================================================== */

:root {
    /* --- surfaces: limestone, sand, plaster --- */
    --sand-50: #fbf7f0;
    --sand-100: #f5eee2;
    --sand-200: #e9decb;
    --sand-300: #dbcbb1;

    /* --- earth: pisé and rammed clay --- */
    --clay-900: #2b1d16;
    --clay-800: #3d2a20;
    --clay-700: #5a3a28;

    /* fixed surface colours — dark sections remap --clay-900 etc. for TEXT, so
       their own backgrounds must come from tokens that are never remapped */
    --surface-clay: #2b1d16;
    --surface-clay-deep: #1d130e;

    /* --- citrus: the Nadorcott accent --- */
    --burnt: #c2510a;
    --burnt-dark: #a8430a;
    --mandarin: #e2660f;
    --mandarin-300: #f9be8e;
    --amber: #f5a01f;

    /* --- Atlas slopes and olive groves --- */
    --olive-900: #1e3a2a;
    --olive-800: #2f4a34;
    --olive-600: #4b6b4a;

    /* --- Bin El Ouidane --- */
    --lake-800: #14535f;
    --lake-600: #1e7c8c;

    /* --- text --- */
    --ink: #221a14;
    --muted: #5f5245;
    --on-dark: #f3e9da;
    --on-dark-muted: #c9bba6;

    /* --- type --- */
    --font-display: "Fraunces", "Playfair Display", Georgia, serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

    --step--1: clamp(0.83rem, 0.79rem + 0.18vw, 0.94rem);
    --step-0: clamp(1rem, 0.95rem + 0.24vw, 1.13rem);
    --step-1: clamp(1.19rem, 1.11rem + 0.38vw, 1.42rem);
    --step-2: clamp(1.41rem, 1.29rem + 0.62vw, 1.78rem);
    --step-3: clamp(1.69rem, 1.49rem + 0.98vw, 2.22rem);
    --step-4: clamp(2rem, 1.71rem + 1.48vw, 2.78rem);
    --step-5: clamp(2.37rem, 1.94rem + 2.16vw, 3.47rem);
    --step-6: clamp(2.8rem, 2.15rem + 3.25vw, 4.7rem);

    /* --- rhythm --- */
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --section-y: clamp(3.75rem, 8vw, 7rem);
    --measure: 68ch;
    --radius: 14px;
    --radius-lg: 22px;

    --shadow-sm: 0 1px 2px rgba(43, 29, 22, .06), 0 2px 8px rgba(43, 29, 22, .05);
    --shadow-md: 0 4px 12px rgba(43, 29, 22, .07), 0 16px 32px -12px rgba(43, 29, 22, .16);
    --shadow-lg: 0 8px 20px rgba(43, 29, 22, .09), 0 32px 60px -20px rgba(43, 29, 22, .28);

    --ease: cubic-bezier(.22, .61, .36, 1);
    --header-h: 68px;
}

/* --------------------------------------------------------------- reset -- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
    background-color: var(--sand-50);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.7;
    font-synthesis-weight: none;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img,
picture,
iframe {
    display: block;
    max-width: 100%;
}

svg {
    max-width: 100%;
    vertical-align: middle;
}

img {
    height: auto;
}

button,
input,
select {
    font: inherit;
    color: inherit;
}

a {
    color: var(--burnt-dark);
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}

a:hover {
    color: var(--clay-900);
}

/* ------------------------------------------------------------ headings -- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.015em;
    text-wrap: balance;
    font-variation-settings: "SOFT" 20, "WONK" 1;
}

h1 {
    font-size: var(--step-6);
    letter-spacing: -0.025em;
}

h2 {
    font-size: var(--step-4);
}

h3 {
    font-size: var(--step-2);
    line-height: 1.2;
}

h4 {
    font-size: var(--step-1);
    line-height: 1.25;
}

p,
li {
    text-wrap: pretty;
}

/* ---------------------------------------------------------- utilities --- */
.wrap {
    width: min(100% - (var(--gutter) * 2), 1180px);
    margin-inline: auto;
}

.wrap-narrow {
    width: min(100% - (var(--gutter) * 2), 760px);
    margin-inline: auto;
}

.prose> :where(p, ul, ol, blockquote, .note, figure, table) {
    max-width: var(--measure);
}

.prose>*+* {
    margin-block-start: 1.05em;
}

.prose> :where(h2) {
    margin-block-start: 2.2em;
}

.prose> :where(h3) {
    margin-block-start: 1.9em;
    color: var(--clay-800);
}

.prose> :where(h4) {
    margin-block-start: 1.6em;
    font-family: var(--font-body);
    font-weight: 650;
    letter-spacing: 0;
}

.prose ul,
.prose ol {
    padding-inline-start: 1.3em;
}

.prose li+li {
    margin-block-start: .5em;
}

.prose li::marker {
    color: var(--burnt);
}

.prose strong {
    font-weight: 650;
    color: var(--clay-900);
}

.lede {
    font-size: var(--step-1);
    line-height: 1.55;
    color: var(--muted);
    max-width: 58ch;
}

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

.skip-link {
    position: absolute;
    inset-inline-start: 1rem;
    top: -100px;
    z-index: 2000;
    background: var(--surface-clay);
    color: var(--on-dark);
    padding: .7rem 1.1rem;
    border-radius: 0 0 10px 10px;
    text-decoration: none;
    font-weight: 600;
    transition: top .18s var(--ease);
}

.skip-link:focus-visible {
    top: 0;
    color: var(--on-dark);
}

:where(a, button, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--burnt);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --------------------------------------------- Amazigh motif details ---- */
.eyebrow {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--font-body);
    font-size: .74rem;
    font-weight: 650;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--burnt-dark);
    margin-block-end: .9rem;
}

.eyebrow::before {
    content: "";
    width: 11px;
    height: 11px;
    flex: none;
    background: currentColor;
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.eyebrow--center {
    justify-content: center;
}

.motif-rule {
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12' viewBox='0 0 48 12'%3E%3Cpath d='M0 11 L6 1 L12 11 L18 1 L24 11 L30 1 L36 11 L42 1 L48 11' fill='none' stroke='%23c2510a' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: center;
    opacity: .45;
}

/* ------------------------------------------------------------ buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 48px;
    padding: .78rem 1.6rem;
    border: 1.5px solid transparent;
    border-radius: 100px;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .01em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}

.btn svg {
    flex: none;
}

.btn--primary {
    background: var(--burnt);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
    background: var(--burnt-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--ghost {
    border-color: rgba(251, 247, 240, .55);
    color: #fff;
    backdrop-filter: blur(4px);
    background: rgba(43, 29, 22, .22);
}

.btn--ghost:hover {
    background: rgba(251, 247, 240, .95);
    color: var(--clay-900);
    border-color: transparent;
    transform: translateY(-2px);
}

.btn--outline {
    border-color: var(--sand-300);
    color: var(--clay-800);
    background: transparent;
}

.btn--outline:hover {
    border-color: var(--burnt);
    color: var(--burnt-dark);
    background: var(--sand-100);
}

/* ------------------------------------------------------------- header --- */
.site-header {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(24, 15, 10, .62), rgba(24, 15, 10, 0));
    transition: background-color .28s var(--ease), box-shadow .28s var(--ease), transform .3s var(--ease);
}

.site-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--surface-clay);
    opacity: 0;
    transition: opacity .28s var(--ease);
    z-index: -1;
}

.site-header.is-stuck {
    background: rgba(33, 22, 16, .93);
    backdrop-filter: saturate(1.3) blur(10px);
    box-shadow: 0 1px 0 rgba(251, 247, 240, .1), 0 10px 30px -12px rgba(0, 0, 0, .5);
}

.site-header.is-hidden {
    transform: translateY(-105%);
}

/* solid variant for interior pages that have no photographic hero */
.site-header--solid {
    background: rgba(33, 22, 16, .97);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: #fff;
    margin-inline-end: auto;
    flex: none;
}

.brand:hover {
    color: #fff;
}

.brand-mark {
    width: 32px;
    height: 32px;
    flex: none;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: .01em;
}

.brand-tag {
    font-size: .6rem;
    letter-spacing: .19em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .68);
}

.nav {
    display: flex;
    align-items: center;
    gap: .15rem;
}

.nav a {
    position: relative;
    display: block;
    padding: .55rem .72rem;
    color: rgba(255, 255, 255, .88);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 8px;
    transition: color .2s var(--ease), background-color .2s var(--ease);
}

.nav a::after {
    content: "";
    position: absolute;
    inset-inline: .72rem;
    inset-block-end: .3rem;
    height: 2px;
    background: var(--amber);
    transform: scaleX(0);
    transform-origin: inline-start;
    transition: transform .25s var(--ease);
}

.nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.nav a:hover::after,
.nav a[aria-current="page"]::after {
    transform: scaleX(1);
}

.nav a[aria-current="page"] {
    color: #fff;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: none;
}

/* language switcher */
.lang {
    position: relative;
}

.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 40px;
    padding: .4rem .8rem;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 100px;
    color: #fff;
    font-size: .8rem;
    font-weight: 650;
    letter-spacing: .06em;
    cursor: pointer;
    transition: background-color .2s var(--ease), border-color .2s var(--ease);
}

.lang-toggle:hover,
.lang-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .7);
}

.lang-menu {
    position: absolute;
    inset-block-start: calc(100% + .5rem);
    inset-inline-end: 0;
    min-width: 172px;
    padding: .4rem;
    background: var(--sand-50);
    border: 1px solid var(--sand-200);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 30;
}

.lang-menu[data-open="true"] {
    display: block;
}

.lang-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .7rem;
    border-radius: 9px;
    color: var(--clay-800);
    font-size: .92rem;
    text-decoration: none;
}

.lang-menu a:hover {
    background: var(--sand-100);
    color: var(--burnt-dark);
}

.lang-menu a[aria-current="true"] {
    background: var(--sand-100);
    font-weight: 650;
}

.lang-menu .lang-code {
    font-size: .68rem;
    letter-spacing: .12em;
    color: var(--muted);
}

/* hamburger */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 12px;
    cursor: pointer;
}

.nav-toggle span {
    position: relative;
    display: block;
    width: 19px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .25s var(--ease), opacity .2s var(--ease);
}

.nav-toggle span::before,
.nav-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
    width: 19px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .25s var(--ease);
}

.nav-toggle span::before {
    top: -6px;
}

.nav-toggle span::after {
    top: 6px;
}

.nav-toggle[aria-expanded="true"] span {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] span::before {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span::after {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 960px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav {
        position: fixed;
        inset: var(--header-h) 0 0;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 1.25rem var(--gutter) 3rem;
        background: var(--surface-clay);
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
    }

    .nav[data-open="true"] {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav a {
        padding: .95rem .25rem;
        font-size: .95rem;
        letter-spacing: .06em;
        border-block-end: 1px solid rgba(251, 247, 240, .1);
        border-radius: 0;
    }

    .nav a::after {
        display: none;
    }

    body.nav-open {
        overflow: hidden;
    }
}

/* --------------------------------------------------------------- hero --- */
.hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: min(92vh, 860px);
    padding-block: calc(var(--header-h) + 4rem) clamp(2.5rem, 6vw, 4.5rem);
    color: #fff;
    overflow: hidden;
    background: var(--surface-clay);
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
}

.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    /* warm, layered scrim — keeps the sunset colour instead of greying it */
    background:
        linear-gradient(to bottom, rgba(30, 14, 6, .62) 0%, rgba(30, 14, 6, .12) 34%, rgba(26, 12, 6, .55) 72%, rgba(22, 10, 5, .88) 100%),
        radial-gradient(120% 75% at 22% 100%, rgba(43, 29, 22, .7), transparent 62%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero .eyebrow {
    color: var(--amber);
}

.hero h1 {
    max-width: 16ch;
    text-shadow: 0 2px 26px rgba(20, 9, 4, .5);
}

.hero h1 em {
    font-style: normal;
    color: var(--amber);
}

.hero-lede {
    margin-block-start: 1.25rem;
    max-width: 52ch;
    font-size: var(--step-1);
    line-height: 1.5;
    color: rgba(255, 255, 255, .92);
    text-shadow: 0 1px 14px rgba(20, 9, 4, .55);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-block-start: 2rem;
}

.hero-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    margin-block-start: clamp(2.5rem, 6vw, 4rem);
    background: rgba(251, 247, 240, .22);
    border: 1px solid rgba(251, 247, 240, .22);
    border-radius: var(--radius);
    overflow: hidden;
}

.hero-fact {
    padding: 1rem 1.15rem;
    background: rgba(28, 16, 9, .55);
    backdrop-filter: blur(6px);
}

.hero-fact dt {
    font-size: .68rem;
    font-weight: 650;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--mandarin-300);
}

.hero-fact dd {
    margin: .25rem 0 0;
    font-family: var(--font-display);
    font-size: 1.18rem;
    font-weight: 600;
    line-height: 1.25;
}

.hero-fact dd small {
    display: block;
    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 400;
    line-height: 1.4;
    color: rgba(255, 255, 255, .72);
    margin-block-start: .15rem;
}

/* compact hero for interior pages */
.page-hero {
    position: relative;
    padding-block: calc(var(--header-h) + clamp(2.75rem, 7vw, 5rem)) clamp(2.5rem, 6vw, 4rem);
    background-color: var(--surface-clay);
    background-image:
        radial-gradient(90% 120% at 82% 0%, rgba(30, 124, 140, .17), transparent 58%),
        radial-gradient(85% 110% at 8% 100%, rgba(194, 81, 10, .16), transparent 55%),
        linear-gradient(170deg, var(--surface-clay), var(--surface-clay-deep) 72%);
    color: var(--on-dark);
    overflow: hidden;
}

.page-hero::after {
    content: "";
    position: absolute;
    inset-block-end: 0;
    inset-inline: 0;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='12' viewBox='0 0 48 12'%3E%3Cpath d='M0 11 L6 1 L12 11 L18 1 L24 11 L30 1 L36 11 L42 1 L48 11' fill='none' stroke='%23f5a15a' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    opacity: .3;
}

.page-hero h1 {
    font-size: var(--step-5);
    max-width: 20ch;
}

.page-hero .lede {
    color: var(--on-dark-muted);
    margin-block-start: 1.1rem;
}

.page-hero .eyebrow {
    color: var(--mandarin-300);
}

/* -------------------------------------------------------- breadcrumbs --- */
.crumbs {
    font-size: .8rem;
    margin-block-end: 1.1rem;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    list-style: none;
    padding: 0;
}

.crumbs li+li::before {
    content: "/";
    margin-inline-end: .45rem;
    color: var(--on-dark-muted);
    opacity: .6;
}

.crumbs a {
    color: var(--on-dark-muted);
    text-decoration: none;
}

.crumbs a:hover {
    color: #fff;
    text-decoration: underline;
}

.crumbs [aria-current="page"] {
    color: var(--on-dark);
}

/* ----------------------------------------------------------- sections --- */
.section {
    padding-block: var(--section-y);
    position: relative;
}

.section--sand {
    background: var(--sand-100);
}

.section--edge {
    border-block-start: 1px solid var(--sand-200);
}

.section--clay {
    background-color: var(--surface-clay);
    background-image: linear-gradient(165deg, var(--surface-clay), var(--surface-clay-deep));
    color: var(--on-dark);
}

.section--olive {
    background-color: var(--olive-900);
    background-image: linear-gradient(165deg, var(--olive-900), #16281d);
    color: var(--on-dark);
}

.section--lake {
    background-color: var(--lake-800);
    background-image: linear-gradient(165deg, var(--lake-800), #0e3a43);
    color: var(--on-dark);
}

/* Dark surfaces re-point the text tokens rather than overriding every element:
   anything inside them (including .prose strong, h3, .card p, figcaption) then
   inherits a colour that passes AA, with no specificity battles. */
.section--clay,
.section--olive,
.section--lake,
.page-hero {
    --ink: #ffffff;
    --muted: var(--on-dark-muted);
    --clay-900: #ffffff;
    --clay-800: var(--on-dark);
    --burnt-dark: var(--mandarin-300);
    --burnt: var(--mandarin-300);
    color: var(--on-dark);
}

.section--clay :where(h2, h3, h4, strong),
.section--olive :where(h2, h3, h4, strong),
.section--lake :where(h2, h3, h4, strong) {
    color: #fff;
}

.section--clay :where(p, li),
.section--olive :where(p, li),
.section--lake :where(p, li) {
    color: var(--on-dark-muted);
}

.section--clay .eyebrow,
.section--olive .eyebrow,
.section--lake .eyebrow {
    color: var(--mandarin-300);
}

.section--clay a:not(.btn),
.section--olive a:not(.btn),
.section--lake a:not(.btn) {
    color: var(--mandarin-300);
}

.section--clay a:not(.btn):hover,
.section--olive a:not(.btn):hover,
.section--lake a:not(.btn):hover {
    color: #fff;
}

.section--clay .prose strong,
.section--olive .prose strong,
.section--lake .prose strong,
.section--clay .note strong,
.section--olive .note strong,
.section--lake .note strong {
    color: #fff;
}

.section-head {
    max-width: 62ch;
    margin-block-end: clamp(2.25rem, 5vw, 3.25rem);
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
}

.section-head--center .lede {
    margin-inline: auto;
}

.section-head .lede {
    margin-block-start: 1rem;
}

/* editorial split: text beside a picture */
.split {
    display: grid;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
}

@media (min-width: 900px) {
    .split {
        grid-template-columns: 1fr 1fr;
    }

    .split--flip .split-media {
        order: -1;
    }

    .split--wide-text {
        grid-template-columns: 1.15fr .85fr;
    }
}

.split-media {
    position: relative;
}

.split-media img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.split-media--square img {
    aspect-ratio: 1 / 1;
}

/* thin terracotta frame offset behind the photo (matches the image box only,
   so a caption underneath stays outside it) */
.split-media--framed::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 18px;
    right: -18px;
    aspect-ratio: 4 / 3;
    border: 1.5px solid var(--burnt);
    border-radius: var(--radius-lg);
    opacity: .45;
    z-index: -1;
}

.split-media--framed.split-media--square::before {
    aspect-ratio: 1 / 1;
}

@media (max-width: 560px) {
    .split-media--framed::before {
        display: none;
    }
}

.split-media figcaption {
    margin-block-start: .75rem;
    font-size: .82rem;
    color: var(--muted);
}

:where(.section--clay, .section--olive, .section--lake) .split-media figcaption {
    color: var(--on-dark-muted);
}

/* ------------------------------------------------------------- cards ---- */
.card-grid {
    display: grid;
    gap: clamp(1.1rem, 2.4vw, 1.75rem);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--sand-50);
    border: 1px solid var(--sand-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--sand-300);
}

.card-media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--sand-200);
}

/* stand-in panel so a photo-less card still lines up in a mixed grid */
.card-media--motif {
    background-color: var(--sand-100);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath d='M28 6 50 28 28 50 6 28Z' fill='none' stroke='%23c2510a' stroke-width='1.2'/%3E%3Cpath d='M28 17 39 28 28 39 17 28Z' fill='none' stroke='%232f4a34' stroke-width='1.2'/%3E%3C/svg%3E"),
        linear-gradient(135deg, var(--sand-100), var(--sand-200));
    background-size: 56px 56px, cover;
    opacity: .9;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--ease);
}

.card:hover .card-media img {
    transform: scale(1.04);
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    padding: 1.35rem 1.4rem 1.5rem;
    flex: 1;
}

.card h3 {
    font-size: var(--step-1);
}

.card h3 a {
    color: inherit;
    text-decoration: none;
}

/* whole card clickable, link text still the accessible name */
.card h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.card:hover h3 a {
    color: var(--burnt-dark);
}

.card p {
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.6;
}

.card-more {
    margin-block-start: auto;
    padding-block-start: .35rem;
    font-size: .82rem;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--burnt-dark);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.card-more svg {
    transition: transform .25s var(--ease);
}

/* arrow links in body copy stay on the same line as their last word */
.prose a svg {
    display: inline-block;
    vertical-align: -.1em;
    margin-inline-start: .15em;
}

.card:hover .card-more svg {
    transform: translateX(3px);
}

.card--flat {
    background: var(--sand-100);
}

:where(.section--clay, .section--olive, .section--lake) .card {
    background: rgba(251, 247, 240, .06);
    border-color: rgba(251, 247, 240, .16);
}

:where(.section--clay, .section--olive, .section--lake) .card:hover {
    background: rgba(251, 247, 240, .1);
}

/* ------------------------------------------------------- fact / stats --- */
.facts {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    background: var(--sand-200);
    border: 1px solid var(--sand-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.fact {
    padding: 1.2rem 1.35rem;
    background: var(--sand-50);
}

.fact dt {
    font-size: .7rem;
    font-weight: 650;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.fact dd {
    margin: .3rem 0 0;
    font-family: var(--font-display);
    font-size: var(--step-2);
    font-weight: 600;
    line-height: 1.15;
    color: var(--clay-900);
}

.fact dd small {
    display: block;
    font-family: var(--font-body);
    font-size: .8rem;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: 0;
    margin-block-start: .2rem;
}

:where(.section--clay, .section--olive, .section--lake) .facts {
    background: rgba(251, 247, 240, .18);
    border-color: rgba(251, 247, 240, .18);
}

:where(.section--clay, .section--olive, .section--lake) .fact {
    background: rgba(24, 14, 9, .55);
}

:where(.section--clay, .section--olive, .section--lake) .fact dt {
    color: var(--mandarin-300);
}

:where(.section--clay, .section--olive, .section--lake) .fact dd {
    color: #fff;
}

/* icon list (region / province / elevation …) */
.spec-list {
    display: grid;
    gap: .7rem;
    list-style: none;
    padding: 0;
    margin-block: 1.75rem;
}

.spec {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .85rem 1.1rem;
    background: var(--sand-50);
    border: 1px solid var(--sand-200);
    border-inline-start: 3px solid var(--burnt);
    border-radius: 10px;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.spec:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow-sm);
}

.spec svg {
    flex: none;
    color: var(--burnt);
}

.spec-label {
    display: block;
    font-size: .68rem;
    font-weight: 650;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--muted);
}

.spec-value {
    font-weight: 600;
    color: var(--clay-900);
}

/* callout / note */
.note {
    padding: 1.1rem 1.3rem;
    background: var(--sand-100);
    border: 1px solid var(--sand-200);
    border-inline-start: 3px solid var(--lake-600);
    border-radius: 10px;
    font-size: .95rem;
}

.note strong {
    color: var(--clay-900);
}

.note--warm {
    border-inline-start-color: var(--burnt);
}

/* ---------------------------------------------------------- timeline ---- */
.timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.timeline::before {
    content: "";
    position: absolute;
    inset-block: .6rem;
    inset-inline-start: 7px;
    width: 2px;
    background: linear-gradient(to bottom, var(--burnt), var(--olive-600));
    opacity: .35;
}

.timeline li {
    position: relative;
    padding-inline-start: 2.4rem;
    padding-block-end: 2rem;
}

.timeline li:last-child {
    padding-block-end: 0;
}

.timeline li::before {
    content: "";
    position: absolute;
    inset-block-start: .55rem;
    inset-inline-start: 0;
    width: 16px;
    height: 16px;
    background: var(--sand-50);
    border: 3px solid var(--burnt);
    border-radius: 50%;
}

.timeline .t-year {
    display: block;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--burnt-dark);
    letter-spacing: .01em;
}

.timeline h3 {
    font-size: var(--step-1);
    margin-block: .15rem .4rem;
}

.timeline p {
    color: var(--muted);
    max-width: 62ch;
}

:where(.section--clay, .section--olive, .section--lake) .timeline li::before {
    background: var(--surface-clay);
    border-color: var(--mandarin-300);
}

:where(.section--clay, .section--olive, .section--lake) .timeline .t-year {
    color: var(--mandarin-300);
}

/* --------------------------------------------------------------- FAQ ---- */
.faq {
    display: grid;
    gap: .7rem;
    max-width: 820px;
}

.faq details {
    background: var(--sand-50);
    border: 1px solid var(--sand-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.faq details[open] {
    border-color: var(--sand-300);
    box-shadow: var(--shadow-sm);
}

.faq summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 1.25rem;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-display);
    font-size: var(--step-1);
    font-weight: 600;
    line-height: 1.3;
    color: var(--clay-900);
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "";
    flex: none;
    width: 13px;
    height: 13px;
    margin-block-start: .45em;
    border-inline-end: 2px solid var(--burnt);
    border-block-end: 2px solid var(--burnt);
    transform: rotate(45deg);
    transition: transform .25s var(--ease);
}

.faq details[open] summary::after {
    transform: rotate(-135deg);
}

.faq summary:hover {
    color: var(--burnt-dark);
}

.faq-body {
    padding: 0 1.25rem 1.25rem;
    color: var(--muted);
}

.faq-body> :where(p, ul, ol)+ :where(p, ul, ol) {
    margin-block-start: .8rem;
}

.faq-body ul {
    padding-inline-start: 1.2rem;
}

/* ----------------------------------------------------------- gallery ---- */
.gallery {
    display: grid;
    gap: clamp(.6rem, 1.5vw, 1rem);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.gallery figure {
    position: relative;
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--sand-200);
}

.gallery img {
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .5s var(--ease);
}

.gallery figure:hover img {
    transform: scale(1.05);
}

.gallery figcaption {
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    padding: 2.5rem .9rem .8rem;
    font-size: .82rem;
    line-height: 1.4;
    color: #fff;
    background: linear-gradient(to top, rgba(20, 11, 6, .88), transparent);
}

.gallery .g-wide {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .gallery .g-wide {
        grid-column: span 1;
    }
}

.gallery button.g-open {
    position: absolute;
    inset: 0;
    width: 100%;
    background: none;
    border: 0;
    cursor: zoom-in;
    padding: 0;
}

/* lightbox */
/* the author `display` must be scoped to [open], otherwise it overrides the
   browser's own `dialog:not([open]) { display: none }` and the closed dialog
   paints in the top-left corner of every page */
.lightbox {
    display: none;
}

.lightbox[open] {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 3rem);
    background: rgba(18, 10, 5, .94);
    border: 0;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
}

.lightbox::backdrop {
    background: rgba(18, 10, 5, .94);
}

.lightbox img {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 10px;
    object-fit: contain;
}

.lightbox figcaption {
    margin-block-start: 1rem;
    text-align: center;
    color: var(--on-dark-muted);
    font-size: .9rem;
}

.lightbox-close {
    position: absolute;
    inset-block-start: 1rem;
    inset-inline-end: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, .22);
}

/* -------------------------------------------------------------- map ----- */
.map-frame {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--sand-200);
    box-shadow: var(--shadow-md);
    background: var(--sand-200);
}

.map-frame iframe {
    width: 100%;
    height: clamp(320px, 46vw, 460px);
    border: 0;
}

/* ------------------------------------------------- journeys / routes ---- */
.routes {
    display: grid;
    gap: 1px;
    background: var(--sand-200);
    border: 1px solid var(--sand-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.route {
    display: grid;
    gap: .2rem 1.25rem;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    padding: 1rem 1.25rem;
    background: var(--sand-50);
}

.route-from {
    font-weight: 650;
    color: var(--clay-900);
}

.route-note {
    grid-column: 1 / -1;
    font-size: .88rem;
    color: var(--muted);
}

.route-figure {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--burnt-dark);
    white-space: nowrap;
}

/* ---------------------------------------------------- related / pager --- */
.pager {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    margin-block-start: clamp(2.5rem, 6vw, 4rem);
    padding-block-start: 2rem;
    border-block-start: 1px solid var(--sand-200);
}

.pager a {
    display: block;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--sand-200);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--clay-900);
    background: var(--sand-50);
    transition: border-color .2s var(--ease), transform .2s var(--ease);
}

.pager a:hover {
    border-color: var(--burnt);
    transform: translateY(-2px);
}

.pager .p-dir {
    display: block;
    font-size: .7rem;
    font-weight: 650;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-block-end: .25rem;
}

.pager .p-title {
    font-family: var(--font-display);
    font-size: var(--step-1);
    font-weight: 600;
}

.pager .p-next {
    text-align: end;
}

/* --------------------------------------------------------- blog bits ---- */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .9rem;
    font-size: .82rem;
    color: var(--on-dark-muted);
    margin-block-start: 1.25rem;
}

.post-meta .dot {
    opacity: .5;
}

.post-list {
    display: grid;
    gap: clamp(1.1rem, 2.4vw, 1.75rem);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.post-body>h2 {
    font-size: var(--step-3);
}

.toc {
    padding: 1.25rem 1.4rem;
    background: var(--sand-100);
    border: 1px solid var(--sand-200);
    border-radius: var(--radius);
    margin-block: 2rem;
    max-width: var(--measure);
}

.toc h2 {
    font-size: .78rem !important;
    font-family: var(--font-body);
    font-weight: 650;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 .7rem !important;
}

.toc ol {
    margin: 0;
    padding-inline-start: 1.15rem;
    font-size: .95rem;
}

.toc li+li {
    margin-block-start: .35rem;
}

/* ------------------------------------------------------------ footer ---- */
.site-footer {
    background: var(--surface-clay);
    color: var(--on-dark-muted);
    padding-block: clamp(3rem, 7vw, 4.5rem) 2rem;
    border-block-start: 3px solid var(--burnt);
}

.footer-grid {
    display: grid;
    gap: clamp(2rem, 5vw, 3rem);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.footer-brand p {
    margin-block-start: .9rem;
    max-width: 34ch;
    font-size: .92rem;
}

.site-footer h2 {
    font-family: var(--font-body);
    font-size: .74rem;
    font-weight: 650;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--mandarin-300);
    margin-block-end: .9rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    display: grid;
    gap: .55rem;
    font-size: .93rem;
}

.footer-links a {
    color: var(--on-dark-muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.social {
    display: flex;
    gap: .6rem;
    margin-block-start: 1.1rem;
}

.social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(251, 247, 240, .22);
    color: var(--on-dark);
    transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}

.social a:hover {
    background: var(--burnt);
    border-color: var(--burnt);
    color: #fff;
    transform: translateY(-2px);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1.25rem;
    align-items: center;
    justify-content: space-between;
    margin-block-start: clamp(2.5rem, 5vw, 3.5rem);
    padding-block-start: 1.5rem;
    border-block-start: 1px solid rgba(251, 247, 240, .14);
    font-size: .85rem;
}

.footer-bottom nav {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
}

.footer-bottom a {
    color: var(--on-dark-muted);
    text-decoration: none;
}

.footer-bottom a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ------------------------------------------------- scroll reveal / fx --- */
/* only hidden when JS is running, so the page stays readable without it */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    .js [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

/* ------------------------------------------------------- legal pages ---- */
.legal h2 {
    font-size: var(--step-2);
}

.legal .prose> :where(h2) {
    margin-block-start: 2em;
}

/* ---------------------------------------------------------------- RTL --- */
[dir="rtl"] {
    --font-display: "Cairo", "Noto Kufi Arabic", "Fraunces", Georgia, serif;
    --font-body: "Noto Naskh Arabic", "Cairo", system-ui, sans-serif;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4 {
    letter-spacing: 0;
    /* Arabic needs more leading than the Latin display face: ascenders,
       descenders and hamzas collide at the Latin line-height */
    line-height: 1.55;
    font-variation-settings: normal;
}

[dir="rtl"] h1 {
    font-size: clamp(2.2rem, 1.7rem + 2.4vw, 3.7rem);
    line-height: 1.5;
}

[dir="rtl"] h2 {
    font-size: clamp(1.8rem, 1.55rem + 1.2vw, 2.5rem);
}

[dir="rtl"] .faq summary,
[dir="rtl"] .fact dd,
[dir="rtl"] .hero-fact dd {
    line-height: 1.6;
}

[dir="rtl"] body,
[dir="rtl"] .prose {
    line-height: 1.95;
}

[dir="rtl"] .eyebrow {
    letter-spacing: 0;
}

[dir="rtl"] .nav a,
[dir="rtl"] .site-footer h2,
[dir="rtl"] .fact dt,
[dir="rtl"] .spec-label,
[dir="rtl"] .card-more,
[dir="rtl"] .hero-fact dt,
[dir="rtl"] .pager .p-dir,
[dir="rtl"] .brand-tag {
    letter-spacing: 0;
}

[dir="rtl"] .timeline .t-year,
[dir="rtl"] .route-figure,
[dir="rtl"] .fact dd {
    font-family: var(--font-body);
}

[dir="rtl"] .nav a::after {
    transform-origin: right;
}

[dir="rtl"] .faq summary::after {
    transform: rotate(135deg);
}

[dir="rtl"] .faq details[open] summary::after {
    transform: rotate(-45deg);
}

[dir="rtl"] .split-media--framed::before {
    left: -18px;
    right: 18px;
}

/* ------------------------------------------------------------- print --- */
@media print {

    .site-header,
    .site-footer,
    .pager,
    .hero-actions,
    .lightbox {
        display: none !important;
    }

    body {
        background: #fff;
    }
}

/* ---------------------------------------------------------- data table --- */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--sand-200);
    background: var(--sand-50);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    font-size: .95rem;
}

.data-table caption {
    caption-side: bottom;
    padding: .9rem 1.1rem;
    text-align: start;
    font-size: .82rem;
    line-height: 1.5;
    color: var(--muted);
    border-block-start: 1px solid var(--sand-200);
}

.data-table th,
.data-table td {
    padding: .62rem 1.1rem;
    text-align: end;
    border-block-end: 1px solid var(--sand-200);
}

.data-table thead th {
    font-size: .7rem;
    font-weight: 650;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--sand-100);
    white-space: nowrap;
}

.data-table th[scope="row"],
.data-table thead th:first-child {
    text-align: start;
    font-weight: 600;
    color: var(--clay-900);
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
    border-block-end: 0;
}

.data-table tbody tr:hover {
    background: var(--sand-100);
}

.data-table tr.is-hot th[scope="row"] {
    color: var(--burnt-dark);
}

.data-table tr.is-hot td:first-of-type {
    color: var(--burnt-dark);
    font-weight: 600;
}

[dir="rtl"] .data-table th,
[dir="rtl"] .data-table td {
    text-align: start;
}

/* the prose column inside a .split keeps its own measure */
.split .text-col> :where(p, ul, ol) {
    max-width: none;
}

.data-table thead th span {
    display: block;
    font-weight: 400;
    letter-spacing: .04em;
    opacity: .75;
}
