/*
Theme Name: Marine 2026
Description: Custom theme for the Sudan Marine Parks UNESCO World Heritage portal — Sanganeb Atoll and Dungonab Bay. Built per the 2026 architecture document: split-screen dual-park hero, UNESCO tracker, IUCN integrations, bilingual EN/AR with RTL support.
Version: 1.1.0
Author: Sudan Marine Parks project
Text Domain: marine-2026
Requires PHP: 8.0
*/

/* Design tokens */
:root {
	/* Sanganeb: open-water atoll blues. Dungonab: shallow-bay teals. */
	--c-deep: #06283d;
	--c-ocean: #0b4f7a;
	--c-reef: #1273a6;
	--c-teal: #0e7a6e;
	--c-lagoon: #19a596;
	--c-sand: #f5efe2;
	--c-coral: #e8604c;
	--c-ink: #12222e;
	--c-ink-soft: #46606f;
	--c-paper: #ffffff;
	--c-line: #dde6ec;
	--c-gold: #c9a227;

	--font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
	--font-body: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
	--font-arabic: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;

	--radius: 14px;
	--radius-sm: 8px;
	--shadow-soft: 0 10px 40px rgba(6, 40, 61, 0.12);
	--maxw: 1200px;
}

html[lang^="ar"] body {
	font-family: var(--font-arabic);
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--font-body);
	color: var(--c-ink);
	background: var(--c-paper);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--c-reef); }
a:hover { color: var(--c-ocean); }

.wrap {
	max-width: var(--maxw);
	margin: 0 auto;
	padding: 0 1.25rem;
}

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--c-line);
}
.site-header .wrap {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	min-height: 70px;
}
.brand {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	text-decoration: none;
	color: var(--c-deep);
	font-weight: 700;
	font-size: 1.05rem;
	letter-spacing: 0.01em;
}
.brand img { height: 44px; width: auto; }
.brand .brand-sub {
	display: block;
	font-size: 0.7rem;
	font-weight: 500;
	color: var(--c-ink-soft);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.main-nav { margin-inline-start: auto; }
.main-nav ul {
	display: flex;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
}
.main-nav a {
	display: block;
	padding: 0.45rem 0.8rem;
	border-radius: var(--radius-sm);
	color: var(--c-ink);
	text-decoration: none;
	font-size: 0.92rem;
	font-weight: 600;
}
.main-nav a:hover,
.main-nav .current-menu-item > a { background: var(--c-sand); color: var(--c-deep); }

/* Dropdowns */
.main-nav li { position: relative; }
.main-nav li ul {
	display: none;
	position: absolute;
	inset-inline-start: 0;
	top: 100%;
	min-width: 240px;
	background: var(--c-paper);
	border: 1px solid var(--c-line);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-soft);
	padding: 0.35rem;
	flex-direction: column;
	z-index: 60;
}
/* Second- and deeper-level menus fly out to the side, not downward over siblings. */
.main-nav li li { position: relative; }
.main-nav li li > ul {
	top: -0.35rem;
	inset-inline-start: 100%;
}
/* Mark parents that have a submenu. */
.main-nav .menu-item-has-children > a::after {
	content: "›";
	margin-inline-start: 0.35rem;
	opacity: 0.6;
}
.main-nav li li.menu-item-has-children > a::after {
	content: "›";
	float: inline-end;
}
.main-nav li:hover > ul,
.main-nav li:focus-within > ul,
.main-nav li.submenu-open > ul { display: flex; }

.lang-switch ul { display: flex; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.lang-switch a {
	display: block;
	padding: 0.3rem 0.6rem;
	border: 1px solid var(--c-line);
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: 700;
	text-decoration: none;
	color: var(--c-ink-soft);
}
.lang-switch .current-lang a { background: var(--c-deep); border-color: var(--c-deep); color: #fff; }

/* ---------- Split-screen dual-park hero ---------- */
.dual-hero {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: min(78vh, 760px);
}
.hero-panel {
	position: relative;
	display: flex;
	align-items: flex-end;
	padding: 2.5rem;
	color: #fff;
	text-decoration: none;
	overflow: hidden;
	background-size: cover;
	background-position: center;
	transition: flex 0.4s ease;
}
.hero-panel::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(4, 28, 44, 0.85) 0%, rgba(4, 28, 44, 0.25) 55%, rgba(4, 28, 44, 0.15) 100%);
	transition: background 0.3s;
}
.hero-panel:hover::before {
	background: linear-gradient(to top, rgba(4, 28, 44, 0.92) 0%, rgba(4, 28, 44, 0.35) 60%, rgba(4, 28, 44, 0.1) 100%);
}
.hero-panel.sanganeb { background-color: var(--c-ocean); }
.hero-panel.dungonab { background-color: var(--c-teal); }

.hero-content { position: relative; z-index: 1; width: 100%; }
.hero-kicker {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.85;
	margin-bottom: 0.5rem;
}
.hero-panel h2 {
	font-family: var(--font-display);
	font-size: clamp(1.6rem, 3.2vw, 2.6rem);
	line-height: 1.12;
	margin: 0 0 1rem;
	font-weight: 800;
}
.hero-stats {
	display: flex;
	gap: 1.75rem;
	flex-wrap: wrap;
}
.hero-stat .num {
	font-size: 1.55rem;
	font-weight: 800;
	display: block;
	line-height: 1.1;
}
.hero-stat .lbl {
	font-size: 0.78rem;
	opacity: 0.85;
}

/* ---------- UNESCO inscription banner ---------- */
.unesco-banner {
	background: var(--c-deep);
	color: #fff;
}
.unesco-banner .wrap {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	padding-top: 1.1rem;
	padding-bottom: 1.1rem;
	flex-wrap: wrap;
}
.unesco-banner .badge {
	font-size: 2rem;
	line-height: 1;
}
.unesco-banner p { margin: 0; font-size: 0.98rem; }
.unesco-banner strong { color: var(--c-gold); }
.unesco-banner .cta {
	margin-inline-start: auto;
	padding: 0.5rem 1.1rem;
	background: var(--c-gold);
	color: var(--c-deep);
	font-weight: 700;
	border-radius: 999px;
	text-decoration: none;
	font-size: 0.9rem;
	white-space: nowrap;
}

/* ---------- Sections ---------- */
.section { padding: 3.5rem 0; }
.section.alt { background: var(--c-sand); }
.section-head { max-width: 640px; margin-bottom: 2rem; }
.section-head h2 {
	font-family: var(--font-display);
	font-size: clamp(1.5rem, 2.6vw, 2.1rem);
	margin: 0 0 0.5rem;
	color: var(--c-deep);
}
.section-head p { margin: 0; color: var(--c-ink-soft); }

.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.25rem;
}
.card {
	background: var(--c-paper);
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.card .thumb { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.card .card-body { padding: 1.1rem 1.2rem 1.3rem; }
.card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.card h3 a { color: var(--c-deep); text-decoration: none; }
.card p { margin: 0; font-size: 0.9rem; color: var(--c-ink-soft); }

/* ---------- Content pages ---------- */
.page-hero {
	background: linear-gradient(120deg, var(--c-deep), var(--c-ocean));
	color: #fff;
	padding: 3.2rem 0 2.6rem;
}
.page-hero h1 {
	font-family: var(--font-display);
	margin: 0;
	font-size: clamp(1.7rem, 3vw, 2.4rem);
}
.breadcrumbs { font-size: 0.82rem; opacity: 0.75; margin-bottom: 0.4rem; }
.breadcrumbs a { color: #fff; }

.content-area { padding: 2.8rem 0 4rem; }
.content-area .entry { max-width: 820px; }
.entry img { border-radius: var(--radius-sm); }
.entry h2, .entry h3 { color: var(--c-deep); font-family: var(--font-display); }

/* ---------- Feature hero (large image with title overlay) ---------- */
.feature-hero {
	position: relative;
	min-height: clamp(300px, 42vw, 480px);
	display: flex;
	align-items: flex-end;
	background-size: cover;
	background-position: center;
	background-color: var(--c-ocean);
}
.feature-hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(4, 28, 44, 0.88) 0%, rgba(4, 28, 44, 0.45) 45%, rgba(4, 28, 44, 0.15) 100%);
}
.feature-hero-inner {
	position: relative;
	z-index: 1;
	width: 100%;
	padding-top: 2rem;
	padding-bottom: 2.2rem;
	color: #fff;
}
.feature-hero-inner h1 {
	font-family: var(--font-display);
	font-size: clamp(1.9rem, 4vw, 3rem);
	font-weight: 800;
	margin: 0;
	line-height: 1.1;
	max-width: 900px;
	text-shadow: 0 2px 20px rgba(4, 28, 44, 0.5);
}
.feature-hero .breadcrumbs { color: rgba(255, 255, 255, 0.85); }
.feature-hero .breadcrumbs a { color: #fff; }

/* Readable article typography for species / content pages */
.entry-readable { font-size: 1.05rem; line-height: 1.8; color: #25323b; }
.entry-readable > p:first-of-type { font-size: 1.18rem; line-height: 1.7; color: var(--c-ink); }
.entry-readable h2 { font-size: 1.5rem; margin: 2rem 0 0.7rem; }
.entry-readable h3 { font-size: 1.2rem; margin: 1.6rem 0 0.5rem; }
.entry-readable p { margin: 0 0 1.1rem; }
.entry-readable ul, .entry-readable ol { margin: 0 0 1.2rem; padding-inline-start: 1.3rem; }
.entry-readable li { margin-bottom: 0.4rem; }
.entry-readable img { margin: 1rem 0; box-shadow: var(--shadow-soft); }
.entry-readable a { color: var(--c-reef); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Footer ---------- */
.site-footer {
	background: var(--c-deep);
	color: rgba(255, 255, 255, 0.85);
	margin-top: auto;
}
.site-footer .wrap {
	padding: 3rem 1.25rem 2rem;
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 2.5rem;
}
.site-footer h4 { color: #fff; margin: 0 0 0.8rem; font-size: 0.95rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer a { color: rgba(255, 255, 255, 0.8); text-decoration: none; font-size: 0.92rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	padding: 1.1rem 0;
	font-size: 0.82rem;
	text-align: center;
	color: rgba(255, 255, 255, 0.6);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
	.dual-hero { grid-template-columns: 1fr; }
	.hero-panel { min-height: 46vh; }
	.site-footer .wrap { grid-template-columns: 1fr; gap: 1.6rem; }
	.main-nav { display: none; } /* mobile menu handled by JS toggle */
	.main-nav.open {
		display: block;
		position: absolute;
		top: 70px;
		inset-inline: 0;
		background: var(--c-paper);
		border-bottom: 1px solid var(--c-line);
		padding: 1rem;
	}
	.main-nav.open ul { flex-direction: column; }
	.nav-toggle { display: inline-flex; }
}
.nav-toggle {
	display: none;
	margin-inline-start: auto;
	background: none;
	border: 1px solid var(--c-line);
	border-radius: var(--radius-sm);
	padding: 0.45rem 0.7rem;
	font-size: 1.1rem;
	cursor: pointer;
}
@media (min-width: 861px) { .nav-toggle { display: none !important; } }

/* ---------- Photo galleries ---------- */
.marine-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 0.9rem;
}
.marine-gallery figure { margin: 0; position: relative; }
.marine-gallery img {
	width: 100%;
	aspect-ratio: 4/3;
	object-fit: cover;
	border-radius: var(--radius-sm);
	display: block;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.marine-gallery a:hover img { transform: scale(1.02); box-shadow: var(--shadow-soft); }
.marine-gallery figcaption {
	font-size: 0.78rem;
	color: var(--c-ink-soft);
	padding: 0.3rem 0.15rem 0;
	line-height: 1.35;
}

/* ---------- Species spotlight wheel ---------- */
.species-wheel {
	display: flex;
	gap: 1.1rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 0.8rem;
	-webkit-overflow-scrolling: touch;
}
.sp-card {
	flex: 0 0 270px;
	scroll-snap-align: start;
	background: var(--c-paper);
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.sp-img { width: 100%; aspect-ratio: 16/11; object-fit: cover; display: block; }
.sp-img-fallback {
	display: flex; align-items: center; justify-content: center;
	font-size: 3rem; background: linear-gradient(135deg, var(--c-ocean), var(--c-lagoon));
}
.sp-body { padding: 1rem 1.1rem 1.2rem; position: relative; }
.sp-body h3 { margin: 0.35rem 0 0.1rem; font-size: 1.05rem; color: var(--c-deep); }
.sp-sci { margin: 0 0 0.5rem; font-style: italic; font-size: 0.82rem; color: var(--c-ink-soft); }
.sp-fact { margin: 0 0 0.55rem; font-size: 0.86rem; color: var(--c-ink-soft); }
.sp-meta { margin: 0; font-size: 0.78rem; color: var(--c-ink-soft); }

/* Official IUCN Red List category colours */
.iucn-badge {
	display: inline-block;
	padding: 0.18rem 0.55rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.04em;
}
.iucn-cr { background: #d81e05; color: #fff; }
.iucn-en { background: #fc7f3f; color: #41250c; }
.iucn-vu { background: #f9e814; color: #4d4406; }
.iucn-nt { background: #cce226; color: #3d4710; }
.iucn-lc { background: #60c659; color: #103b0d; }
.iucn-dd { background: #d1d1c6; color: #3c3c37; }

/* ---------- Seasonal wildlife calendar ---------- */
.season-cal { border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; }
.season-row { display: grid; grid-template-columns: 170px repeat(12, 1fr); align-items: center; }
.season-row + .season-row { border-top: 1px solid var(--c-line); }
.season-row.head { background: var(--c-sand); font-weight: 700; font-size: 0.75rem; }
.season-row.head > div { text-align: center; padding: 0.5rem 0; }
.season-label { padding: 0.6rem 0.9rem; font-size: 0.85rem; font-weight: 600; color: var(--c-deep); }
.season-cell { height: 14px; margin: 0 1px; border-radius: 3px; }
.season-cell.on { background: var(--c-lagoon); }

/* ---------- Progress bars (GBF targets) ---------- */
.gbf-row { margin-bottom: 1.2rem; max-width: 720px; }
.gbf-label { display: flex; justify-content: space-between; font-size: 0.92rem; margin-bottom: 0.3rem; }
.gbf-label .status { color: var(--c-ink-soft); font-size: 0.8rem; }
.gbf-bar { height: 8px; background: var(--c-sand); border-radius: 5px; overflow: hidden; }
.gbf-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--c-reef), var(--c-lagoon)); }

/* ---------- IUCN donut ---------- */
.iucn-donut-wrap { display: flex; gap: 2.2rem; align-items: center; flex-wrap: wrap; }
.iucn-donut {
	width: 210px; height: 210px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; position: relative;
}
.iucn-donut::after {
	content: ""; position: absolute; inset: 38px; background: var(--c-paper); border-radius: 50%;
}
.iucn-donut .total { position: relative; z-index: 1; text-align: center; font-weight: 800; font-size: 1.6rem; color: var(--c-deep); }
.iucn-donut .total small { display: block; font-size: 0.72rem; font-weight: 600; color: var(--c-ink-soft); }
.iucn-legend { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.iucn-legend li { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.45rem; }
.iucn-legend .dot { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 12px; }

/* RTL fine-tuning: logical properties cover most cases */
[dir="rtl"] .hero-kicker { letter-spacing: 0; }
