@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600&display=swap');

/* ============================================================
   VARIABLES & RESET
   ============================================================ */
:root {
  --primary:       #F59E0B;
  --primary-dark:  #D97706;
  --primary-glow:  rgba(245,158,11,0.18);
  --bg:            #0C0C0C;
  --bg2:           #141414;
  --bg-card:       #1A1A1A;
  --bg-card-h:     #212121;
  --text:          #F5F5F5;
  --text-muted:    #999;
  --text-dim:      #555;
  --border:        #2A2A2A;
  --border-h:      #3A3A3A;
  --radius:        14px;
  --radius-lg:     22px;
  --shadow:        0 4px 30px rgba(0,0,0,0.5);
  --shadow-p:      0 8px 40px rgba(245,158,11,0.18);
  --transition:    .25s cubic-bezier(.4,0,.2,1);
  --font-head:     'Outfit', sans-serif;
  --font-body:     'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  /* iOS momentum scrolling */
  -webkit-overflow-scrolling: touch;
  /* Prevent text size adjustment on iOS orientation change */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  /* iOS safe area support */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  /* Remove iOS tap highlight */
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea {
  font-family: inherit;
  /* Prevent iOS zoom on focus (must be >= 16px) */
  font-size: 16px;
  border-radius: 0; /* Reset iOS default button radius */
  -webkit-appearance: none;
  appearance: none;
}
ul { list-style: none; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 72px 0; }
.section-alt { background: var(--bg2); }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text);
}

.section-link {
  font-size: .875rem;
  font-weight: 600;
  color: var(--primary);
  transition: var(--transition);
}
.section-link:hover { color: var(--primary-dark); gap: 6px; }

/* ============================================================
   FADE IN ANIMATION
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeUp .5s ease both; }
.fade-in-1 { animation-delay: .1s; }
.fade-in-2 { animation-delay: .2s; }
.fade-in-3 { animation-delay: .3s; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 68px;
  background: rgba(12,12,12,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.navbar.scrolled { background: rgba(12,12,12,.98); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -.5px;
  color: var(--text);
  cursor: pointer;
}
.logo-accent { color: var(--primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.06); }

.nav-btn {
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--primary);
  color: #000;
  font-size: .85rem;
  font-weight: 700;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.nav-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  /* 100dvh = real viewport on iOS (excludes browser chrome) */
  height: 100dvh;
  height: 100svh; /* safe viewport height fallback */
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 68px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('../images/Foire fcv 1.jpg') center/cover no-repeat;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12,12,12,1) 0%, rgba(12,12,12,.65) 50%, rgba(12,12,12,.35) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
  max-width: 780px;
  margin: 0 auto;
}

.hero-label {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--primary-glow);
  border: 1px solid rgba(245,158,11,.3);
  font-size: .78rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeUp .6s ease both;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.03em;
  margin-bottom: 20px;
  animation: fadeUp .7s .1s ease both;
}
.hero-title .accent { color: var(--primary); }

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 36px;
  animation: fadeUp .7s .2s ease both;
}

/* Search bar */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  padding: 10px;
  animation: fadeUp .7s .3s ease both;
}

.search-field {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.06);
  border-radius: 12px;
  padding: 12px 16px;
}
.search-field .icon { font-size: 1rem; opacity: .7; flex-shrink: 0; }
.search-field input,
.search-field select {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  /* Min 16px prevents iOS auto-zoom on focus */
  font-size: 16px;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
.search-field input::placeholder { color: var(--text-muted); }
.search-field select option { background: #1a1a1a; }

.search-btn {
  padding: 12px 28px;
  background: var(--primary);
  color: #000;
  font-weight: 700;
  font-size: .9rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.search-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* Hero stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 48px;
  animation: fadeUp .7s .45s ease both;
}
.hero-stat strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}
.hero-stat span { font-size: .8rem; color: var(--text-muted); }

/* ============================================================
   CATEGORY CARDS
   ============================================================ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.cat-card:hover {
  border-color: var(--primary);
  background: var(--bg-card-h);
  box-shadow: var(--shadow-p);
  transform: translateY(-4px);
}
.cat-icon { font-size: 2.2rem; line-height: 1; }
.cat-name {
  font-family: var(--font-head);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  transition: var(--transition);
}
.cat-card:hover .cat-name { color: var(--primary); }
.cat-count { font-size: .75rem; color: var(--text-muted); }

/* ============================================================
   ESTABLISHMENT CARDS
   ============================================================ */
.est-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.est-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.est-card:hover {
  border-color: var(--border-h);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.est-img-wrap {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.est-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform .5s ease;
}
.est-card:hover .est-img-wrap img { transform: scale(1.06); }

.est-badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.badge-featured { background: var(--primary); color: #000; }
.badge-new { background: #10B981; color: #fff; }

.est-rating-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--primary);
}

.est-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.est-cat {
  font-size: .72rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.est-name {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  transition: var(--transition);
  line-height: 1.3;
}
.est-card:hover .est-name { color: var(--primary); }

.est-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  color: var(--text-muted);
}

.est-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.tag {
  padding: 3px 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .7rem;
  color: var(--text-muted);
}

/* ============================================================
   ARTICLE CARDS
   ============================================================ */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.article-card:hover {
  border-color: var(--border-h);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.article-img {
  aspect-ratio: 16/9;
  overflow: hidden;
}
.article-img img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform .5s ease;
}
.article-card:hover .article-img img { transform: scale(1.06); }

.article-body { padding: 18px; }
.article-cat {
  font-size: .7rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.article-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 8px 0 6px;
  line-height: 1.35;
  transition: var(--transition);
}
.article-card:hover .article-title { color: var(--primary); }
.article-excerpt {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  font-size: .75rem;
  color: var(--text-dim);
}

/* ============================================================
   AD BANNER
   ============================================================ */
.ad-banner {
  background: linear-gradient(135deg, #1a1200, #2a1f00);
  border: 1px dashed rgba(245,158,11,.3);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
  margin: 40px 0;
}
.ad-banner strong { display: block; color: var(--primary); margin-bottom: 4px; font-size: 1rem; }

/* ============================================================
   CTA SECTION
   ============================================================ */
.cta-section {
  background: linear-gradient(135deg, #111 0%, #1a1200 50%, #111 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 80px 20px;
}
.cta-title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 12px;
}
.cta-sub { color: var(--text-muted); margin-bottom: 32px; font-size: 1rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(245,158,11,.3); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-h); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 8px 18px; font-size: .82rem; }
.btn-lg { padding: 16px 40px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* Contact buttons row */
.contact-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.btn-call   { background: #2563EB; color: #fff; }
.btn-wa     { background: #25D366; color: #fff; }
.btn-route  { background: #7C3AED; color: #fff; }
.btn-call:hover   { background: #1D4ED8; transform: translateY(-2px); }
.btn-wa:hover     { background: #1ebe5b; transform: translateY(-2px); }
.btn-route:hover  { background: #6D28D9; transform: translateY(-2px); }

/* ============================================================
   PAGE HEADER (inner pages)
   ============================================================ */
.page-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 40px;
  margin-top: 68px;
}
.page-header h1 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 8px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-select {
  padding: 9px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  /* Min 16px prevents iOS zoom */
  font-size: 16px;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
  /* iOS dropdown arrow fix */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.filter-select:focus { border-color: var(--primary); }
.filter-select option { background: #1a1a1a; }

/* ============================================================
   MAP
   ============================================================ */
.map-container {
  height: 340px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 36px;
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin: 40px 0;
}

.gallery {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}
.gallery-main {
  aspect-ratio: 16/9;
  overflow: hidden;
}
.gallery-main img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: opacity .3s;
}
.gallery-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--bg-card);
}
.gallery-thumb {
  width: 72px; height: 54px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: .55;
  transition: var(--transition);
  border: 2px solid transparent;
}
.gallery-thumb.active,
.gallery-thumb:hover { opacity: 1; border-color: var(--primary); }

.detail-info { display: flex; flex-direction: column; gap: 20px; }

.detail-title {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.stars { color: var(--primary); font-size: 1.1rem; letter-spacing: 1px; }
.rating-num { font-size: 1.1rem; font-weight: 700; }
.review-count { font-size: .82rem; color: var(--text-muted); }

.info-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.info-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.info-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.info-label { font-size: .78rem; color: var(--text-muted); }
.info-value { font-size: .92rem; font-weight: 500; }

/* ============================================================
   FORMS
   ============================================================ */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 680px;
  margin: 0 auto;
}

.form-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--text-muted); }

.form-input,
.form-select,
.form-textarea {
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  /* Min 16px prevents iOS auto-zoom on focus */
  font-size: 16px;
  outline: none;
  transition: var(--transition);
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-dim); }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-color: var(--bg2);
  padding-right: 36px;
}
.form-select option { background: #1a1a1a; }
.form-textarea { resize: vertical; min-height: 120px; -webkit-appearance: none; }

.form-success {
  text-align: center;
  padding: 48px 32px;
  display: none;
}
.form-success .success-icon { font-size: 3.5rem; margin-bottom: 16px; }
.form-success h3 { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.form-success p { color: var(--text-muted); }

/* ============================================================
   ADMIN DASHBOARD
   ============================================================ */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  min-height: calc(100vh - 68px);
  margin-top: 68px;
}

.admin-sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 28px 0;
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow-y: auto;
}

.admin-menu-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 20px;
  margin-bottom: 8px;
  margin-top: 20px;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.admin-menu-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.admin-menu-item.active { color: var(--primary); border-left-color: var(--primary); background: var(--primary-glow); }

.admin-main { padding: 32px; overflow-y: auto; }

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-topbar h1 { font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--primary); box-shadow: var(--shadow-p); }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-change { font-size: .75rem; color: #10B981; margin-top: 4px; }

.admin-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.admin-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.admin-table-header h3 { font-family: var(--font-head); font-size: 1rem; font-weight: 700; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 14px 16px;
  font-size: .88rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }

.status-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
}
.status-active { background: rgba(16,185,129,.15); color: #10B981; }
.status-pending { background: rgba(245,158,11,.15); color: var(--primary); }
.status-draft { background: rgba(255,255,255,.07); color: var(--text-muted); }

/* Chart bars */
.chart-bar-wrap { display: flex; gap: 4px; align-items: flex-end; height: 80px; }
.chart-bar {
  flex: 1;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  opacity: .7;
  transition: opacity .2s;
}
.chart-bar:hover { opacity: 1; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 64px 0 0;
  /* iOS home bar safe area at bottom */
  padding-bottom: env(safe-area-inset-bottom);
  display: none; /* shown by JS when not admin */
}
.footer.visible { display: block; }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  padding-bottom: 48px;
}

.footer-logo {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 12px;
}
.footer-brand p { font-size: .88rem; color: var(--text-muted); max-width: 260px; line-height: 1.6; }

.social-links { display: flex; gap: 10px; margin-top: 20px; }
.social-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-muted);
}
.social-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

.footer-col h4 {
  font-family: var(--font-head);
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.footer-col a,
.footer-col p {
  display: block;
  font-size: .84rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  transition: var(--transition);
}
.footer-col a:hover { color: var(--primary); transform: translateX(4px); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .8rem;
  color: var(--text-dim);
}
.footer-bottom a { color: var(--text-dim); transition: var(--transition); }
.footer-bottom a:hover { color: var(--primary); }
.footer-links { display: flex; gap: 20px; }

/* ============================================================
   EMPTY / 404
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 8px; color: var(--text); }

/* ============================================================
   MOBILE FIRST — Base (< 480px, small phones)
   ============================================================ */

/* Navbar: sticky with safe-area on iOS */
.navbar {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Nav links overlay: full safe-area aware */
.nav-links {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

/* Ensure buttons are easy to tap (min 44px touch target) */
.btn, .nav-btn, .search-btn, .social-btn {
  min-height: 44px;
  touch-action: manipulation;
}

.nav-toggle {
  display: flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

/* Filter selects: full width on small screens */
.filters {
  flex-direction: column;
}
.filter-select,
.filter-search-wrap {
  width: 100%;
}

/* Search bar: vertical stack on mobile */
.search-bar {
  flex-direction: column;
  gap: 8px;
}
.search-field {
  width: 100%;
  min-width: unset;
}
.search-btn {
  width: 100%;
  justify-content: center;
}

/* Categories: 2 columns on small screens */
.cat-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Cards: single column on small screens */
.est-grid,
.article-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Slightly tighter section padding on mobile */
.section { padding: 48px 0; }

/* Hero: compact on small phones */
.hero-content {
  padding: 0 16px;
  max-width: 100%;
}
.hero-stats {
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-stats strong { font-size: 1.3rem; }
.hero-stat span { font-size: .72rem; }

/* Detail page: single column */
.detail-layout {
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 24px 0;
}

/* Gallery: horizontal thumbnails on mobile */
.gallery-thumbs { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gallery-thumb { flex-shrink: 0; }

/* Contact buttons: stack vertically on very small screens */
.contact-btns { flex-direction: column; }
.contact-btns .btn { width: 100%; justify-content: center; }

/* Forms: single column */
.form-grid { grid-template-columns: 1fr; gap: 16px; }
.form-card { padding: 20px; border-radius: var(--radius); }

/* Admin: vertical on mobile */
.admin-layout { grid-template-columns: 1fr; }
.admin-sidebar {
  position: static;
  height: auto;
  display: flex;
  flex-wrap: wrap;
  padding: 12px;
  gap: 4px;
  border-right: none;
  border-bottom: 1px solid var(--border);
  /* Horizontal scroll if many items */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-menu-item {
  padding: 8px 14px;
  border-left: none;
  border-radius: 8px;
  font-size: .8rem;
  white-space: nowrap;
}
.admin-menu-item.active { border-bottom: 2px solid var(--primary); background: var(--primary-glow); }
.admin-menu-title { display: none; }
.admin-main { padding: 20px 16px; }
.stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-value { font-size: 1.5rem; }

/* Footer: single column on mobile */
.footer-grid {
  grid-template-columns: 1fr;
  gap: 28px;
  padding-bottom: max(48px, calc(32px + env(safe-area-inset-bottom)));
}
.footer-bottom {
  flex-direction: column;
  text-align: center;
  gap: 8px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}
.footer-links { justify-content: center; flex-wrap: wrap; gap: 12px; }

/* Map: shorter on small screens */
.map-container { height: 220px; }

/* Stat cards in detail view */
.info-block { padding: 16px; }

/* Page header padding */
.page-header { padding: 32px 0 24px; margin-top: 68px; }

/* ============================================================
   MOBILE NAVBAR (< 768px)
   ============================================================ */
@media (max-width: 767px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 68px; left: 0; right: 0;
    background: rgba(12,12,12,.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    gap: 4px;
    transform: translateY(-110%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    z-index: 999;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-link, .nav-btn {
    padding: 14px 16px;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
  }
}

/* ============================================================
   SMALL PHONES (< 375px — iPhone SE, older Android)
   ============================================================ */
@media (max-width: 374px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cat-card { padding: 18px 10px; }
  .cat-icon { font-size: 1.8rem; }
  .hero-stats { gap: 12px; }
  .search-bar { padding: 8px; }
  .container { padding: 0 12px; }
  .stat-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   TABLET (>= 640px)
   ============================================================ */
@media (min-width: 640px) {
  .search-bar { flex-direction: row; flex-wrap: wrap; }
  .search-btn { width: auto; }
  .contact-btns { flex-direction: row; }
  .contact-btns .btn { width: auto; flex: 1; justify-content: center; }
  .filters { flex-direction: row; }
  .filter-select { width: auto; flex: 1; }
  .est-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .map-container { height: 280px; }
}

/* ============================================================
   TABLET LANDSCAPE / SMALL DESKTOP (>= 768px)
   ============================================================ */
@media (min-width: 768px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-bottom { flex-direction: row; text-align: left; }
  .footer-links { justify-content: flex-end; }
  .detail-layout { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .gallery-thumbs {
    flex-direction: column;
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 80px;
    background: rgba(0,0,0,.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .gallery-thumb { width: 56px; height: 42px; flex-shrink: 0; }
  .gallery-main { margin-left: 80px; }
  .admin-layout { grid-template-columns: 220px 1fr; }
  .admin-sidebar { position: sticky; top: 68px; height: calc(100vh - 68px); flex-direction: column; flex-wrap: nowrap; overflow-y: auto; overflow-x: hidden; border-right: 1px solid var(--border); border-bottom: none; padding: 28px 0; gap: 0; }
  .admin-menu-item { white-space: normal; border-left: 3px solid transparent; border-bottom: none; border-radius: 0; }
  .admin-menu-item.active { border-left-color: var(--primary); border-bottom: none; }
  .admin-menu-title { display: block; }
  .admin-main { padding: 32px; }
  .stat-value { font-size: 2rem; }
  .map-container { height: 340px; }
  .section { padding: 72px 0; }
  .search-bar { flex-wrap: wrap; }
}

/* ============================================================
   DESKTOP (>= 1024px)
   ============================================================ */
@media (min-width: 1024px) {
  .est-grid { grid-template-columns: repeat(3, 1fr); }
  .article-grid { grid-template-columns: repeat(3, 1fr); }
  .search-bar { flex-wrap: nowrap; }
  .contact-btns .btn { flex: none; }
}

/* ============================================================
   iOS SPECIFIC FIXES
   ============================================================ */

/* Prevent pull-to-refresh interfering with scroll on body */
body { overscroll-behavior-y: none; }

/* Smooth scrollable containers */
.admin-sidebar,
.gallery-thumbs {
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: none;
}

/* Fix iOS blurry backdrop on older Safari */
@supports (-webkit-touch-callout: none) {
  .navbar {
    background: rgba(12,12,12,.95);
  }
  .nav-links {
    background: rgba(12,12,12,.97);
  }
  /* Ensure hero fills correctly on iOS Safari */
  .hero {
    height: 100svh;
    min-height: 560px;
  }
  /* Prevent rubber-band overscroll on gallery thumbnails */
  .gallery-thumbs {
    overscroll-behavior-x: contain;
  }
}
