/* ============================================================
   Authentic Tunisia — shared stylesheet
   Saharan cream/sand base + Sidi Bou Said blue & white mosaic accent
   ============================================================ */

:root {
  --cream:        #FFFFFF;
  --cream-warm:   #F7F7F5;
  --sand:         #E3CFA4;
  --sand-deep:    #C9A66B;
  --ink:          #2B2420;
  --ink-soft:     #5B4F42;
  --blue:         #1B4D7A;
  --blue-deep:    #123553;
  --blue-bright:  #2E7FBF;
  --white:        #FFFFFF;
  --terracotta:   #B5602E;
  --gold:         #A8823D;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;

  --font-display: "Marcellus", "Iowan Old Style", Georgia, serif;
  --font-body: "Jost", "Avenir Next", -apple-system, sans-serif;
  --font-accent: "Outfit", "Jost", -apple-system, sans-serif;

  --container: 1200px;
  --radius: 4px;
  --shadow-card: 0 8px 24px rgba(43, 36, 32, 0.10);
  --shadow-soft: 0 4px 14px rgba(18, 53, 83, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--blue-deep);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
  font-weight: 400;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }

p { margin: 0 0 var(--space-4); color: var(--ink-soft); max-width: 62ch; }

a { color: var(--blue-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--terracotta);
  display: inline-block;
  margin-bottom: var(--space-3);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 13px 28px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { background: var(--blue-deep); }

.btn-ghost {
  background: transparent;
  border-color: var(--white);
  color: var(--white);
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

.btn-outline {
  background: transparent;
  border-color: var(--blue);
  color: var(--blue);
}
.btn-outline:hover { background: var(--blue); color: var(--white); }

/* ---------- Mosaic divider ---------- */

.mosaic-divider {
  position: relative;
  height: 56px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.mosaic-divider::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent 0%, var(--sand-deep) 20%, var(--sand-deep) 80%, transparent 100%);
}
.mosaic-divider::after {
  content: "";
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  background: var(--blue);
  transform: rotate(45deg);
}
.mosaic-divider.on-blue::before {
  background: linear-gradient(90deg, transparent 0%, rgba(250,244,230,0.4) 20%, rgba(250,244,230,0.4) 80%, transparent 100%);
}
.mosaic-divider.on-blue::after {
  background: var(--gold);
}

/* ---------- Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 2px solid var(--blue);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  max-width: var(--container);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand img {
  height: 44px;
  width: 44px;
  object-fit: contain;
}
.brand-word {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--blue-deep);
  line-height: 1;
}
.brand-word small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-top: 3px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--ink);
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  position: relative;
  padding-bottom: 4px;
}
.nav-links a:hover { text-decoration: none; color: var(--blue); }
.nav-links a.active { color: var(--blue); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--terracotta);
}

.nav-cta { display: none; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--blue-deep);
  margin: 5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-panel {
  display: none;
  flex-direction: column;
  background: var(--cream);
  border-bottom: 2px solid var(--blue);
  padding: var(--space-2) var(--space-6) var(--space-6);
}
.nav-mobile-panel a {
  color: var(--ink);
  font-family: var(--font-accent);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--sand);
}
.nav-mobile-panel a:hover { text-decoration: none; color: var(--blue); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-mobile-panel.open { display: flex; }
}

/* ---------- Hero carousel ---------- */

.hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 480px;
  max-height: 880px;
  overflow: hidden;
  background: var(--blue-deep);
}

.hero-slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.6s ease, transform 6s ease;
  will-change: opacity, transform;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}
.hero-slide.is-prev {
  opacity: 0;
  z-index: 1;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(18,53,83,0.55) 0%, rgba(18,53,83,0.15) 32%, rgba(18,53,83,0.35) 68%, rgba(18,53,83,0.82) 100%);
  pointer-events: none;
}

.fireflies {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}
.firefly {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,224,158,1) 0%, rgba(255,190,90,0.85) 40%, rgba(255,190,90,0) 75%);
  box-shadow: 0 0 8px 3px rgba(255, 200, 110, 0.65);
  opacity: 0;
}

.hero-content {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8) var(--space-6) var(--space-24);
  color: var(--white);
}
.hero-content .eyebrow { color: var(--sand); }
.hero-content h1 {
  color: var(--white);
  max-width: 16ch;
  text-shadow: 0 2px 18px rgba(0,0,0,0.35);
}
.hero-content .hero-sub {
  color: var(--cream);
  max-width: 46ch;
  font-size: 1.05rem;
  margin-bottom: var(--space-8);
}
.hero-ctas { display: flex; gap: var(--space-4); flex-wrap: wrap; justify-content: center; }

.hero-dots {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: var(--space-3);
}
.hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--white);
  background: transparent;
  padding: 0;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.hero-dot.is-active { background: var(--white); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: opacity 0.4s linear; transform: none !important; }
  .firefly { display: none; }
}

/* ---------- Page hero (interior pages) ---------- */

.page-hero {
  position: relative;
  padding: var(--space-24) 0 var(--space-16);
  background: var(--blue-deep);
  color: var(--white);
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18,53,83,0.72) 0%, rgba(18,53,83,0.6) 45%, rgba(18,53,83,0.82) 100%);
}
.page-hero h1, .page-hero p {
  text-shadow: 0 2px 14px rgba(0,0,0,0.3);
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero .eyebrow { color: var(--sand); }
.page-hero h1 { color: var(--white); max-width: 22ch; }
.page-hero p { color: var(--cream); max-width: 60ch; }

/* ---------- Sections ---------- */

section { padding: var(--space-24) 0; }
.section-cream-warm { background: var(--cream-warm); }
.section-blue { background: var(--blue-deep); color: var(--cream); }
.section-blue h2 { color: var(--white); }
.section-blue p { color: var(--sand); }

.section-head {
  max-width: 680px;
  margin: 0 auto var(--space-12);
  text-align: center;
}
.section-head.align-left { margin-left: 0; text-align: left; }

/* ---------- Grids & cards ---------- */

.grid {
  display: grid;
  gap: var(--space-8);
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1024px) {
  .grid-3, .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-3, .grid-2, .grid-5 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(43,36,32,0.16); }

.card-arch {
  position: relative;
  height: 220px;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  margin: var(--space-4) var(--space-4) 0;
  border: 1px solid var(--sand-deep);
  border-bottom: none;
}
.card-arch img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.card-body h3 { margin-bottom: var(--space-1); }
.card-tag {
  align-self: flex-start;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--terracotta);
  font-weight: 600;
}
.card-body p { margin-bottom: var(--space-3); flex: 1; }
.card-link { font-weight: 600; font-size: 0.9rem; }

/* ---------- Region card variant (landscape image top) ---------- */

.region-card .card-arch {
  border-radius: 0;
  margin: 0;
  height: 240px;
  border: none;
}

/* ---------- Split feature (image + text) ---------- */

.feature-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}
.feature-split.reverse .feature-media { order: 2; }
.feature-media {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 6px solid var(--white);
  outline: 1px solid var(--sand-deep);
}
.feature-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; }

@media (max-width: 860px) {
  .feature-split, .feature-split.reverse { grid-template-columns: 1fr; }
  .feature-split.reverse .feature-media { order: 0; }
}

/* ---------- Stat strip ---------- */

.stat-strip {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: var(--space-8);
  text-align: center;
}
.stat-strip .stat-num {
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  color: var(--white);
  display: block;
}
.stat-strip .stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sand);
}

/* ---------- Quality checklist ---------- */

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--ink-soft);
}
.checklist .mark {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  margin-top: 2px;
}

/* ---------- Region "famous for" tag list ---------- */

.famous-for { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.famous-for li {
  font-size: 0.78rem;
  padding: 6px 12px;
  border: 1px solid var(--sand-deep);
  border-radius: 999px;
  color: var(--blue-deep);
  background: var(--cream);
}

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--blue);
  color: var(--white);
  text-align: center;
  padding: var(--space-16) 0;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: var(--sand); margin: 0 auto var(--space-8); }

/* ---------- Timeline (about page) ---------- */

.timeline {
  border-left: 2px solid var(--sand-deep);
  padding-left: var(--space-8);
  display: grid;
  gap: var(--space-8);
  max-width: 680px;
}
.timeline-item { position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-8) - 6px);
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid var(--cream);
  box-shadow: 0 0 0 2px var(--sand-deep);
}
.timeline-year {
  font-family: var(--font-accent);
  font-weight: 700;
  color: var(--terracotta);
  font-size: 1.1rem;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--blue-deep);
  color: var(--sand);
  padding: var(--space-16) 0 var(--space-8);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}
.footer-brand { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.footer-brand img { height: 40px; width: 40px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.9; }
.footer-brand-word { font-family: var(--font-display); font-size: 1.2rem; color: var(--white); }
.site-footer p { color: var(--sand); }
.site-footer h4 {
  color: var(--white);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  margin-bottom: var(--space-4);
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.footer-links a { color: var(--sand); }
.footer-links a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(250,244,230,0.18);
  padding-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: 0.82rem;
  color: rgba(250,244,230,0.6);
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-8); }
}

/* ---------- Utility ---------- */

.mt-0 { margin-top: 0; }
.center-text { text-align: center; }
.max-prose { max-width: 68ch; margin-left: auto; margin-right: auto; }

[data-pretext] { overflow-wrap: break-word; }
