/*
  Afghan Villages — original design system ("Warm Heritage")
  Hand-written, no framework. Mobile-first.
*/

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
body { overflow-x: hidden; }

/* Grid/flex items default to min-width:auto, which lets an image's
   intrinsic size push its column wider than the viewport on mobile.
   Force them shrinkable so content wraps instead of overflowing. */
.grid > *, .hero-grid > *, .about-grid > *, .footer-grid > * { min-width: 0; }

/* ---------- Design tokens ---------- */
:root {
  --color-bg: #FBF3E7;
  --color-bg-alt: #F3E4CE;
  --color-surface: #FFFFFF;
  --color-primary: #B5502F;
  --color-primary-dark: #8F3D22;
  --color-accent: #C99A3E;
  --color-accent-light: #E4C878;
  --color-text: #2B2420;
  --color-text-muted: #6B5D4F;
  --color-border: #E6D5BC;
  --color-dark: #241D17;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --container-max: 1180px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --shadow-sm: 0 2px 10px rgba(43, 36, 32, 0.06);
  --shadow-md: 0 12px 32px rgba(43, 36, 32, 0.10);
  --section-pad: clamp(3rem, 6vw, 6rem);
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-dark);
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
h4 { font-size: clamp(1.1rem, 1.5vw, 1.25rem); }

p { color: var(--color-text-muted); }

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section { padding-block: var(--section-pad); }
.section-alt { background: var(--color-bg-alt); }

.section-head {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: 3rem;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  margin-bottom: 1rem;
}

.text-center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline { background: transparent; border-color: var(--color-primary); color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-sm { padding: 0.55rem 1.3rem; font-size: 0.85rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 243, 231, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
  gap: 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand img { height: 44px; width: auto; }
.brand-text { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--color-dark); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.9rem;
  flex-wrap: wrap;
}
.nav-menu a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  position: relative;
  padding-block: 0.3rem;
}
.nav-menu a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--color-primary);
  transition: width 0.2s ease;
}
.nav-menu a:hover::after,
.nav-menu a.active::after { width: 100%; }
.nav-menu a.active { color: var(--color-primary); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-primary);
}
.nav-cta { display: inline-flex; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-cta { display: none; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--color-surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem;
    gap: 1rem;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
  }
  .nav-menu.open { display: flex; }
}

/* ---------- Hero (home) ---------- */
.hero {
  padding-block: clamp(3rem, 8vw, 6rem);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
}
.hero h1 { margin-block: 1.2rem 1.6rem; }
.hero h1 .accent { color: var(--color-primary); }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
}

/* ---------- Page hero / breadcrumb ---------- */
.page-hero {
  background: var(--color-bg-alt);
  padding-block: clamp(3rem, 6vw, 4.5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(135deg, var(--color-border) 1px, transparent 1px),
    linear-gradient(45deg, var(--color-border) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.35;
  pointer-events: none;
}
.page-hero .container { position: relative; }
.breadcrumb { margin-top: 0.75rem; color: var(--color-text-muted); font-size: 0.9rem; }
.breadcrumb a { color: var(--color-primary); font-weight: 600; }
.breadcrumb .sep { margin-inline: 0.5rem; }

/* ---------- About / Fact ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 860px) {
  .about-grid { grid-template-columns: 0.85fr 1.15fr; }
}
.about-grid img {
  border-radius: var(--radius-lg);
  aspect-ratio: 4/5;
  object-fit: cover;
  width: 100%;
  box-shadow: var(--shadow-md);
}
.feature-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  margin-block: 1.5rem 2rem;
  color: var(--color-text);
  font-weight: 500;
}
.feature-list li { display: flex; align-items: flex-start; gap: 0.6rem; }
.feature-list i { color: var(--color-primary); margin-top: 0.2rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.stat-card {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 1.75rem 1rem;
  text-align: center;
}
.stat-card i { font-size: 1.8rem; margin-bottom: 0.6rem; opacity: 0.9; }
.stat-card .stat-num { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 700; display: block; }
.stat-card .stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.9; }

.video-teaser { display: flex; justify-content: center; margin-top: 2rem; }
.btn-play {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}
.btn-play span {
  width: 0; height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid var(--color-primary);
  margin-left: 4px;
}

/* ---------- Cards grid (generic) ---------- */
.grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.grid-top { align-items: start; }
@media (min-width: 860px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Service cards */
.service-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 2.25rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.service-card i { font-size: 2.4rem; color: var(--color-primary); margin-bottom: 1rem; }
.service-card h4 { margin-bottom: 0.6rem; }
.service-card p { margin-bottom: 1.25rem; font-size: 0.92rem; }

/* ---------- Category tabs (Menu / Events) ---------- */
.tab-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 2.5rem;
}
.tab-pill {
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.tab-pill.active, .tab-pill:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Event cards */
.event-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-sm);
}
.event-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.event-card:hover img { transform: scale(1.06); }
.event-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(36,29,23,0.75) 0%, rgba(36,29,23,0) 55%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.1rem;
}
.event-overlay h4 { color: #fff; font-size: 1rem; margin: 0; }
.event-overlay button { background: none; border: none; color: #fff; font-size: 1.1rem; }

/* Dish (menu item) cards */
.dish-card {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.dish-card img {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--color-bg-alt);
  cursor: zoom-in;
}
.dish-info { flex: 1; min-width: 0; }
.dish-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.4rem;
}
.dish-top h4 { font-size: 1.05rem; margin: 0; }
.dish-price { font-family: var(--font-display); color: var(--color-primary); font-weight: 700; white-space: nowrap; }
.dish-info p { font-size: 0.88rem; margin: 0; }

/* Testimonial */
.testimonial-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
}
.testimonial-card {
  scroll-snap-align: start;
  flex: 0 0 min(360px, 85vw);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.testimonial-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1rem; }
.testimonial-head img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.testimonial-head h4 { margin: 0; font-size: 1rem; }
.testimonial-head p { margin: 0; font-size: 0.82rem; }
.stars { color: var(--color-accent); margin-bottom: 0.7rem; letter-spacing: 0.15em; }
.slider-nav { display: flex; justify-content: center; gap: 0.75rem; margin-top: 1.5rem; }

/* Blog cards */
.blog-card { background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.blog-card img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.blog-card-body { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; }
.blog-date { text-align: center; background: var(--color-primary); color: #fff; border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; line-height: 1.2; flex-shrink: 0; }
.blog-date .d { font-weight: 700; display: block; }
.blog-date .m { font-size: 0.7rem; text-transform: uppercase; }
.blog-card-body a { font-weight: 600; }

/* ---------- Forms ---------- */
.form-field {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.form-field:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }
textarea.form-field { resize: vertical; min-height: 120px; }
.form-card { background: var(--color-surface); border-radius: var(--radius-lg); padding: clamp(1.5rem, 4vw, 3rem); box-shadow: var(--shadow-sm); }
.form-card-narrow { max-width: 900px; margin-inline: auto; }
.info-tile {
  display: flex; gap: 1rem; align-items: flex-start;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.info-tile i { color: var(--color-primary); font-size: 1.4rem; margin-top: 0.15rem; }
.info-tile h4 { margin-bottom: 0.2rem; }
.form-success {
  background: #EAF4E9; color: #2F5D34;
  border: 1px solid #BEDCC0;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
}
.form-error {
  background: #FBEAEA; color: #8A3232;
  border: 1px solid #E9BEBE;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
}
.consent-field {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  text-align: left;
}
.consent-field input[type="checkbox"] { margin-top: 0.2rem; flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--color-primary); }
.consent-field a { color: var(--color-primary); text-decoration: underline; }
.map-frame { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.map-frame iframe { width: 100%; height: 420px; border: 0; display: block; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-dark); color: #E7DCCB; padding-block: var(--section-pad) 2rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 720px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-brand { font-family: var(--font-display); font-size: 1.5rem; color: #fff; margin-bottom: 0.9rem; }
.footer-brand .accent { color: var(--color-accent-light); }
.footer-col h4 { color: #fff; margin-bottom: 1rem; font-size: 1rem; }
.footer-col a, .footer-col p { color: #C9BBA5; font-size: 0.9rem; display: block; margin-bottom: 0.65rem; }
.footer-col a:hover { color: var(--color-accent-light); }
.social-icons { display: flex; gap: 0.6rem; }
.social-icons a {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
}
.social-icons a:hover { background: var(--color-primary); }
.gallery-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.gallery-mini img { aspect-ratio: 1/1; object-fit: cover; border-radius: 50%; border: 2px solid var(--color-primary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #B6A88E;
}
.footer-bottom a { color: #B6A88E; }
.footer-bottom a:hover { color: var(--color-accent-light); }

/* ---------- Modal (video / lightbox) ---------- */
.av-modal {
  position: fixed; inset: 0;
  background: rgba(20, 16, 12, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}
.av-modal.open { display: flex; }
.av-modal-content { max-width: 900px; width: 100%; }
.av-modal-content img { border-radius: var(--radius-md); width: 100%; }
.lightbox-caption { color: #fff; text-align: center; margin-top: 0.75rem; }
.av-modal .ratio-16x9 { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--radius-md); overflow: hidden; }
.av-modal .ratio-16x9 iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.av-modal-close {
  position: absolute; top: 1.25rem; right: 1.5rem;
  background: none; border: none; color: #fff; font-size: 2rem; line-height: 1;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 1.5rem; bottom: 1.5rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 90;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- 404 ---------- */
.error-page { text-align: center; padding-block: var(--section-pad); }
.error-page .error-code { font-family: var(--font-display); font-size: clamp(4rem, 12vw, 8rem); color: var(--color-primary); line-height: 1; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Cookie consent ---------- */
.cookie-consent {
  position: fixed;
  left: 1rem; right: 1rem; bottom: 1rem;
  max-width: 720px;
  margin-inline: auto;
  background: var(--color-dark);
  color: #E7DCCB;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.25rem 1.5rem;
  z-index: 200;
  transform: translateY(140%);
  transition: transform 0.4s ease;
}
.cookie-consent.show { transform: translateY(0); }
.cookie-consent p { color: #C9BBA5; font-size: 0.88rem; margin-bottom: 1rem; }
.cookie-consent a { color: var(--color-accent-light); text-decoration: underline; }
.cookie-consent-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.cookie-consent .btn-outline { border-color: #C9BBA5; color: #E7DCCB; }
.cookie-consent .btn-outline:hover { background: #C9BBA5; color: var(--color-dark); }

/* Consent-gated embeds (e.g. Google Maps before consent) */
.embed-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 420px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  text-align: center;
  padding: 2rem;
}
.embed-placeholder p { max-width: 420px; margin: 0; }

/* ---------- Misc ---------- */
.mb-0 { margin-bottom: 0 !important; }
.entry-content { max-width: 760px; margin-inline: auto; }
.entry-content p { color: var(--color-text); margin-bottom: 1.1rem; }
.entry-content h3 { margin-top: 2.25rem; margin-bottom: 0.85rem; }
.entry-content h3:first-child { margin-top: 0; }
.entry-content ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1.5rem; color: var(--color-text); }
.entry-content li { margin-bottom: 0.4rem; }
.entry-content table.widefat {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.75rem;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.entry-content table.widefat th,
.entry-content table.widefat td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.entry-content table.widefat th { background: var(--color-bg-alt); font-family: var(--font-display); font-weight: 600; }
.entry-content table.widefat tr:last-child td { border-bottom: 0; }
.entry-thumb { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 2rem; }
.entry-thumb img { width: 100%; }
.entry-spaced { margin-bottom: 2.5rem; }
.pagination-wrap { margin-top: 2.5rem; }
.pagination-wrap .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding-inline: 0.6rem; margin: 0 0.2rem; border-radius: 999px; border: 1px solid var(--color-border); font-weight: 600; font-size: 0.9rem; }
.pagination-wrap .page-numbers.current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pagination-wrap .page-numbers:hover { border-color: var(--color-primary); }
