@font-face { font-family: "Plex"; src: url("/fonts/plex-400.ttf"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/fonts/plex-600.ttf"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/fonts/plex-700.ttf"); font-weight: 700; font-display: swap; }

:root {
  --blue: #0e4d78; --gold: #e8b13c; --blue-dark: #0a3554;
  --ink: #15202a; --muted: #55636f; --ground: #ffffff; --soft: #f3f4f6; --line: #dde2e8; --danger: #a3261b;
  --radius: 20px; --wrap: 1180px; --pad: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 17px/1.75 "Plex", system-ui, sans-serif; }
img { max-width: 100%; display: block; }
a { color: var(--blue); }
h1, h2 { line-height: 1.3; font-weight: 700; margin: 0 0 12px; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--pad)); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: 12px; top: -80px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 30; }
.skip:focus { top: 12px; }

.top { position: sticky; top: 0; z-index: 20; background: var(--ground); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.35rem; line-height: 1.15; white-space: nowrap; }
.brand img { border-radius: 12px; }
.brand small { display: block; font-size: .78rem; font-weight: 400; color: var(--muted); }
.top nav { display: flex; align-items: center; gap: 4px; margin-inline-end: auto; }
.top nav > a, .menu summary { color: var(--ink); text-decoration: none; font-weight: 600; padding: 8px 16px; border-radius: 999px; min-height: 44px; display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; white-space: nowrap; }
.menu summary::-webkit-details-marker { display: none; }
.top nav > a:hover, .menu summary:hover { background: var(--soft); }
.top nav > a[aria-current], .menu summary.active { background: var(--blue); color: #fff; }
.menu { position: relative; }
.menu > div { position: absolute; top: calc(100% + 8px); inset-inline-start: 0; min-width: 230px; display: grid; padding: 8px; background: var(--ground); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px rgb(10 30 50 / .14); animation: rise .18s ease-out; }
.menu > div a { padding: 10px 14px; border-radius: 10px; text-decoration: none; color: var(--ink); min-height: 44px; display: flex; align-items: center; }
.menu > div a:hover, .menu > div a[aria-current] { background: var(--soft); color: var(--blue); }
.tools { display: flex; align-items: center; gap: 4px; }
.icon-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); border: 0; background: none; cursor: pointer; }
.icon-btn:hover { background: var(--soft); }
.burger { display: none; }
.fav-count { position: absolute; top: 4px; inset-inline-end: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--gold); color: var(--ink); font-size: .72rem; line-height: 18px; text-align: center; }
.fav-count[hidden] { display: none; }
.langs summary { padding: 8px 12px; font-size: .95rem; }
.langs > div { inset-inline-start: auto; inset-inline-end: 0; min-width: 170px; }
.langs > div a[aria-current] { font-weight: 700; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px; border: 2px solid var(--blue); background: var(--blue); color: #fff; font: 600 1rem "Plex", sans-serif; text-decoration: none; cursor: pointer; transition: transform .15s, background-color .15s; }
.btn:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn.light { background: #fff; border-color: #fff; color: var(--ink); }
.btn.light:hover { background: var(--soft); }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.text-link { min-height: 48px; display: inline-flex; align-items: center; }

.hero { position: relative; margin-top: 20px; border-radius: var(--radius); overflow: hidden; min-height: min(70vh, 520px); display: flex; align-items: flex-end; background: var(--blue-dark); color: #fff; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / .78), rgb(0 0 0 / .12) 75%); }
.hero > div { position: relative; z-index: 1; padding: clamp(24px, 5vw, 56px); max-width: 640px; animation: rise .6s ease-out both; }
.hero p { font-size: 1.15rem; margin: 0 0 20px; }
.hero.plain { min-height: 240px; }
.hero.plain::after { content: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.block { margin-block: 64px; }
.narrow { max-width: 680px; }
.lead, .count { color: var(--muted); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }

.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.service { display: flex; flex-direction: column; gap: 8px; padding: 26px; min-height: 190px; border-radius: var(--radius); background: var(--soft); color: var(--ink); text-decoration: none; transition: transform .2s; }
.service strong { font-size: 1.25rem; }
.service span { color: var(--muted); }
.service svg { margin-top: auto; margin-inline-start: auto; color: var(--blue); }
.service:hover, .card:hover, .tile:hover { transform: translateY(-2px); }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 18px; }
.card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); transition: transform .2s; }
.frame { display: block; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: var(--soft); margin-bottom: 10px; }
.frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover img, .tile:hover img { transform: scale(1.03); }
.eyebrow { display: block; color: var(--muted); font-size: .86rem; font-weight: 600; }
.card strong { font-size: 1.05rem; line-height: 1.5; }
.no-photo { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: .95rem; background: var(--soft); }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--blue); color: #fff; text-decoration: none; transition: transform .2s; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.tile .no-photo { display: none; }
.tile > span:last-child { position: absolute; inset-inline: 0; bottom: 0; padding: 40px 18px 16px; background: linear-gradient(to top, rgb(0 0 0 / .82), transparent); }
.tile strong { display: block; font-size: 1.35rem; }
.tile small { display: block; font-size: .9rem; }

.crumbs { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 18px; font-size: .92rem; color: var(--muted); }
.crumbs a { text-decoration: none; }
.banner { margin-top: 20px; padding: clamp(24px, 5vw, 48px); border-radius: var(--radius); background: var(--soft); }
.banner p { margin: 0; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; padding-block: 24px; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .92rem; }
.filters label { flex: 1 1 220px; }
input, select, textarea { font: 400 1rem "Plex", sans-serif; color: var(--ink); background: #fff; border: 1px solid #bcc6c2; border-radius: 10px; min-height: 48px; padding: 8px 14px; width: 100%; }
textarea { line-height: 1.7; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin-block: 40px; }

.gallery { margin-top: 20px; border-radius: var(--radius); overflow: hidden; height: min(62vh, 520px); background: var(--soft); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery.many { display: grid; grid-template-columns: 2fr 1fr; grid-auto-rows: 1fr; gap: 8px; background: none; }
.gallery.many img { min-height: 0; }
.gallery.many img:first-child { grid-row: span 2; }
.gallery.many img:nth-child(2):last-child { grid-row: span 2; }
.gallery.many img:nth-child(n+4) { display: none; }
.prose { max-width: 780px; margin-block: 32px; }
.prose p { font-size: 1.1rem; }
.prose h1 { margin-top: 6px; }
.latin { color: var(--muted); margin-top: -8px; }
html[dir="rtl"] .latin[dir="ltr"] { text-align: right; }
html[dir="ltr"] .latin[dir="rtl"] { text-align: left; }
html[lang="zh"] body { font-family: "Plex", "PingFang SC", "Microsoft YaHei", sans-serif; }
.note { background: var(--soft); border-radius: var(--radius); padding: 28px; }
.credit { font-size: .82rem; color: var(--muted); }

.map { height: min(72vh, 640px); border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.map.small { height: 360px; }
.map-page { margin-block: 16px 0; }
.map-error { padding: 24px; }
.maplibregl-popup-content { font-family: "Plex", sans-serif; text-align: start; }

.credits { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.credits li { display: flex; gap: 12px; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.credits img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; }
.credits small { display: block; color: var(--muted); }
.credits a { display: block; font-size: .88rem; }

footer { margin-top: 80px; background: var(--blue-dark); color: #fff; padding-block: 48px; border-top: 4px solid var(--gold); }
footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
footer p { margin: 8px 0 0; color: #cddbe7; max-width: 38ch; }
footer .about strong { font-size: 1.5rem; }
footer .wrap > div { display: flex; flex-direction: column; align-items: flex-start; }
footer a { color: #fff; min-height: 40px; display: inline-flex; align-items: center; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* لوحة التحكم */
.form { display: grid; gap: 16px; max-width: 720px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.table { width: 100%; border-collapse: collapse; }
.table td, .table th { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.alert { background: #fdecea; color: var(--danger); padding: 12px 16px; border-radius: 10px; }
.ok { background: #e6eff6; color: var(--blue-dark); padding: 12px 16px; border-radius: 10px; }

@media (max-width: 960px) {
  .grid, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services { grid-template-columns: 1fr; }
  .service { min-height: 0; }
  .credits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* الواجهة المتحركة */
.montage > img { opacity: 0; transition: opacity 1.2s ease; }
.montage > img.on { opacity: 1; animation: drift 7s ease-out both; }
.montage.paused > img.on { animation-play-state: paused; }
@keyframes drift { from { transform: scale(1.12); } to { transform: scale(1); } }
.montage { min-height: min(78vh, 600px); }
.motion-toggle { position: absolute; z-index: 2; bottom: 18px; inset-inline-end: 18px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .6); background: rgb(0 0 0 / .45); color: #fff; cursor: pointer; font-size: .85rem; }

/* المقدّمة */
.intro-open { overflow: hidden; }
.intro { position: fixed; inset: 0; z-index: 100; background: #061c2e; color: #fff; display: grid; place-items: center; transition: opacity .7s ease, transform .7s ease; }
.intro[hidden] { display: none; }
.intro.leaving { opacity: 0; transform: scale(1.04); pointer-events: none; }
.intro-slides, .intro-slides figure { position: absolute; inset: 0; margin: 0; }
.intro-slides figure { opacity: 0; transition: opacity .8s ease; }
.intro-slides figure.on { opacity: 1; }
.intro-slides img { width: 100%; height: 100%; object-fit: cover; }
.intro-slides figure.on img { animation: drift 3s ease-out both; }
.intro-slides figure::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgb(6 28 46 / .45), rgb(6 28 46 / .82)); }
.intro-slides figcaption { position: absolute; z-index: 1; bottom: 78px; inset-inline: 0; text-align: center; color: #f4e3bd; font-size: .95rem; }
.intro-brand { position: relative; text-align: center; padding: 20px; }
.intro-brand img { margin: 0 auto 14px; border-radius: 20px; animation: rise .8s ease-out both; }
.intro-title { margin: 0; font-size: clamp(3rem, 11vw, 7rem); font-weight: 700; line-height: 1.1; letter-spacing: -.01em; animation: rise .8s .25s ease-out both; }
.intro-tag { margin: 6px 0 26px; font-size: clamp(1.2rem, 3vw, 1.8rem); color: var(--gold); animation: rise .8s .55s ease-out both; }
.intro-brand .btn { animation: rise .8s .9s ease-out both; }
.intro-skip { position: absolute; z-index: 2; top: 20px; inset-inline-end: 20px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .6); background: rgb(0 0 0 / .35); color: #fff; font: 600 .95rem "Plex", sans-serif; cursor: pointer; }
.intro-progress { position: absolute; bottom: 44px; width: min(320px, 70vw); height: 3px; background: rgb(255 255 255 / .22); border-radius: 2px; overflow: hidden; }
.intro-progress i { display: block; height: 100%; background: var(--gold); transform-origin: right; animation: fill var(--length, 10s) linear both; }
html[dir="ltr"] .intro-progress i { transform-origin: left; }
@keyframes fill { from { transform: scaleX(0); } }

/* ظهور الأقسام */
.reveal { transition: opacity .6s ease, transform .6s ease; }
.reveal.wait:not(.in) { opacity: 0; transform: translateY(24px); }

/* قسم الاستكشاف المقسوم */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; margin-block: 72px; }
.huge { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.split-text h3 { font-size: 1.2rem; margin: 0 0 8px; }
.split-text p { color: var(--muted); }
.split-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.split-photos img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; border-start-start-radius: 48px; }
.split-photos img:nth-child(2) { margin-top: 72px; border-start-start-radius: 8px; border-end-end-radius: 48px; }

/* المسارات */
.route { list-style: none; padding: 0; display: grid; gap: 16px; counter-reset: stop; max-width: 900px; }
.route li { counter-increment: stop; position: relative; }
.route a { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.route a:hover { border-color: var(--blue); }
.route .frame { margin: 0; }
.route a > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.route strong::before { content: counter(stop) ". "; color: var(--blue); }

/* الأفلام */
.film { max-width: 900px; }
.film-stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--blue-dark); }
.film-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease; }
.film-stage img.on { opacity: 1; animation: drift 9s ease-out both; }
.film-caption { position: absolute; inset-inline: 0; bottom: 0; margin: 0; padding: 40px 20px 16px; color: #fff; text-align: center; background: linear-gradient(to top, rgb(0 0 0 / .82), transparent); font-size: clamp(.95rem, 2.2vw, 1.25rem); }
.film-bar { display: flex; align-items: center; gap: 16px; margin-block: 14px; }
.film-progress { flex: 1; display: flex; gap: 4px; }
.film-progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.film-progress i.done { background: var(--blue); }
.transcript li { cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.transcript li.on { background: var(--soft); font-weight: 600; }
.videos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.videos figure { margin: 0; }
.videos video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; }
.videos figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.videos small { color: var(--muted); overflow-wrap: anywhere; }

/* الفعاليات وخطط الرحلة */
.events { list-style: none; padding: 0; margin: 0; max-width: 860px; }
.events li { display: grid; grid-template-columns: 220px 1fr; gap: 18px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.events .when { font-weight: 700; color: var(--blue); display: flex; flex-direction: column; }
.events .when small, .events small { color: var(--muted); font-weight: 400; }
.events li > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: 999px; background: var(--soft); text-decoration: none; color: var(--ink); }
.chips a[aria-current] { background: var(--blue); color: #fff; }
.fav[hidden] { display: none; }
.fav[aria-pressed="true"] svg { fill: currentColor; }
/* إضافات: التنبيه، البحث، فلتر الخريطة، أدوات القراءة */
.alert-bar { background: var(--blue-dark); color: #fff; font-size: .92rem; }
.alert-bar[hidden] { display: none; }
.alert-bar .wrap { display: flex; align-items: center; gap: 12px; justify-content: space-between; min-height: 44px; }
.alert-bar p { margin: 6px 0; }
.alert-bar a { color: var(--gold); font-weight: 700; }
.alert-bar button { min-width: 44px; min-height: 44px; border: 0; background: none; color: #fff; font-size: 1.5rem; cursor: pointer; }
.results { list-style: none; padding: 0; max-width: 820px; }
.results li { display: flex; flex-direction: column; padding-block: 14px; border-bottom: 1px solid var(--line); }
.results a { font-weight: 700; font-size: 1.1rem; }
.results span { color: var(--muted); }
.map-filter { margin-bottom: 14px; }
.chips button { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--soft); color: var(--ink); font: 600 .95rem "Plex", sans-serif; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.reading { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
footer .reading { display: flex; }
.reading button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgb(255 255 255 / .5); background: none; color: #fff; font: 600 .9rem "Plex", sans-serif; cursor: pointer; }
.reading button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
html.big body { font-size: 20px; }
html.big .prose p { font-size: 1.2rem; }
html.contrast { --ink: #000; --muted: #1f1f1f; --line: #555; --soft: #ededed; --blue: #00335c; }
html.contrast a { text-decoration: underline; }

@media (max-width: 1040px) {
  .burger { display: grid; }
  .bar { flex-wrap: wrap; gap: 8px; }
  .brand { margin-inline-end: auto; }
  .top nav { display: none; order: 3; width: 100%; margin: 0; padding-bottom: 12px; flex-direction: column; align-items: stretch; }
  .top nav.open { display: flex; }
  .menu > div { position: static; box-shadow: none; border: 0; padding-inline-start: 20px; }
  footer .wrap { grid-template-columns: 1fr 1fr; }
  footer .about { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --pad: 16px; }
  .top { position: static; }
  .brand { font-size: 1.1rem; }
  .brand small { font-size: .7rem; }
  .brand img { width: 38px; height: 38px; }
  .tools .icon-btn, .burger { width: 40px; }
  .bar { gap: 2px; }
  .langs summary span { display: none; }
  .langs summary { padding: 0 8px; }
  .langs > div { position: absolute; }
  .block { margin-block: 44px; }
  .grid, .tiles { gap: 14px 12px; }
  .card strong { font-size: .95rem; }
  .gallery, .gallery.many { height: 300px; display: block; }
  .gallery.many img:nth-child(n+2) { display: none; }
  .credits, .form .row, .videos { grid-template-columns: 1fr; }
  .filters .btn { flex: 1; }
  .split { grid-template-columns: 1fr; }
  .route a { grid-template-columns: 1fr; }
  .events li { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
