/* ============================================================
   Halalpoint.com — design system
   Palette pulled directly from the brand mark:
     orange #DE7800 · green #5FA80A · teal #058D81
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,900;1,9..144,500;1,9..144,600&family=Public+Sans:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* --- brand --- */
  --ink:        #201A10;
  --ink-soft:   #3A3021;
  --paper:      #FFFDF7;
  --sand:       #F6EEDC;
  --sand-deep:  #EDE1C6;
  --orange:     #DE7800;
  --orange-deep:#A85B00;
  --orange-tint:#FCE7C9;
  --green:      #5FA80A;
  --green-deep: #3D7A05;
  --green-tint: #E4F1D1;
  --teal:       #058D81;
  --teal-deep:  #036158;
  --teal-tint:  #D8F0EC;
  --line:       rgba(32, 26, 16, 0.12);

  /* --- type --- */
  --font-display: 'Fraunces', 'Iowan Old Style', serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 14px;
  --shadow-stamp: 0 1px 0 rgba(32,26,16,0.05), 0 8px 24px -12px rgba(32,26,16,0.35);
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}
h1 { font-weight: 700; }
p { margin: 0 0 1em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--teal-deep);
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ============================== RESPONSIVE SPLIT LAYOUTS ============================== */
/* Used anywhere content needs a 2-up or 3-up layout that must stack on mobile
   instead of squeezing columns down to nothing. */
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.split-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.scanner-layout { display: grid; grid-template-columns: 1fr 1.15fr; gap: 44px; align-items: flex-start; }

@media (max-width: 860px) {
  .split-2, .scanner-layout { grid-template-columns: 1fr; gap: 30px; }
  .split-3 { grid-template-columns: 1fr; gap: 16px; }
}
@media (min-width: 861px) and (max-width: 980px) {
  .split-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================== NAV ============================== */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; flex-wrap: wrap; gap: 10px 0; padding-top: 8px; padding-bottom: 8px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  color: var(--ink);
}
.brand img { width: 38px; height: 38px; }
.brand span.tld { color: var(--orange); }

.nav-links {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  list-style: none; margin: 0; padding: 0;
  font-weight: 600; font-size: 14.5px;
}
.nav-links a {
  text-decoration: none; color: var(--ink-soft);
  padding: 8px 2px; border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--orange-deep); border-color: var(--orange); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--paper) !important;
  font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.nav-cta:hover { background: var(--teal-deep); transform: translateY(-1px); }

.nav-toggle { display: none; }

/* ============================== MOBILE TAB BAR ============================== */
.mobile-tabbar { display: none; }

@media (max-width: 860px) {
  body { padding-bottom: 92px; } /* keep content clear of the fixed bar + raised circles */

  .mobile-tabbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 46px;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    z-index: 60;
    height: 78px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow: visible;
    background: var(--paper);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px -14px rgba(32,26,16,0.35);
  }

  .tab-half {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    gap: 6px;
    text-decoration: none;
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .tab-icon-circle {
    width: 62px; height: 62px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--ink);
    border: 3px solid var(--sand-deep);
    color: #fff;
    transform: translateY(-16px);
    box-shadow: 0 10px 20px -8px rgba(32,26,16,0.5);
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
  }
  .tab-icon-circle svg { width: 26px; height: 26px; }
  .tab-half span:last-child { margin-top: -10px; }

  .tab-barcode .tab-icon-circle { border-color: var(--orange); }
  .tab-qr .tab-icon-circle { border-color: var(--teal); }

  .tab-barcode.active { color: var(--orange-deep); }
  .tab-barcode.active .tab-icon-circle { background: var(--orange); border-color: var(--orange); }
  .tab-qr.active { color: var(--teal-deep); }
  .tab-qr.active .tab-icon-circle { background: var(--teal); border-color: var(--teal); }

  .tab-half:active .tab-icon-circle { transform: translateY(-16px) scale(0.94); }
}

@media (max-width: 360px) {
  .mobile-tabbar { gap: 30px; }
  .tab-icon-circle { width: 54px; height: 54px; }
  .tab-icon-circle svg { width: 22px; height: 22px; }
}

@media (max-width: 860px) {
  .nav-links { position: fixed; inset: 72px 0 0 0; z-index: 70; background: var(--paper); flex-direction: column; flex-wrap: nowrap; padding: 28px; gap: 4px; transform: translateX(100%); transition: transform 0.25s ease; overflow-y: auto; }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { display: block; padding: 14px 4px; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav-links .nav-cta { display: flex; justify-content: center; margin-top: 18px; padding: 14px 18px; border-bottom: none; }
  .nav-toggle { display: block; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--ink); position: relative; z-index: 71; }
}

/* ============================== BUTTONS ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 15px;
  padding: 13px 24px; border-radius: 999px;
  border: none; cursor: pointer; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 10px 24px -10px rgba(222,120,0,0.55); }
.btn-primary:hover { background: var(--orange-deep); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--paper); border: 1.5px solid rgba(255,253,247,0.55); }
.btn-outline:hover { background: rgba(255,253,247,0.12); }
.btn-ghost { background: var(--sand); color: var(--ink); }
.btn-ghost:hover { background: var(--sand-deep); }

/* ============================== HERO ============================== */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse 900px 500px at 82% -10%, rgba(222,120,0,0.35), transparent 60%),
    radial-gradient(ellipse 700px 500px at 10% 110%, rgba(95,168,10,0.28), transparent 60%),
    linear-gradient(160deg, #1B231F 0%, #17211F 35%, var(--ink) 100%);
  color: var(--paper);
  overflow: hidden;
}
.hero::before {
  /* faint dotted world-map texture */
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,253,247,0.14) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, black 40%, transparent 78%);
  opacity: 0.55;
}
.hero .wrap {
  position: relative;
  padding: 74px 28px 88px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(38px, 5.2vw, 60px);
  color: #fff;
}
.hero h1 em { color: var(--orange); font-style: normal; }
.hero h1 .accent-underline { text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 4px; text-underline-offset: 6px; }
.hero p.lede {
  font-size: 18px; color: rgba(255,253,247,0.78);
  max-width: 48ch; margin-bottom: 30px;
}
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }
.hero .trust-row { display: flex; gap: 26px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 12.5px; color: rgba(255,253,247,0.6); }
.hero .trust-row b { color: #fff; font-size: 15px; display: block; font-family: var(--font-body); }

/* Hero stamp visual */
.hero-stamp-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.hero-stamp {
  width: min(320px, 80%);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px dashed rgba(255,253,247,0.35);
  display: flex; align-items: center; justify-content: center;
  animation: spin-slow 40s linear infinite;
  position: relative;
  z-index: 10; /* badges use z-index 20 in front / 3 behind, around this */
}
.hero-stamp img { width: 62%; filter: drop-shadow(0 18px 30px rgba(0,0,0,0.45)); animation: spin-slow-reverse 40s linear infinite; }
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes spin-slow-reverse { to { transform: rotate(-360deg); } }

.orbit-badges-row { position: absolute; inset: 0; }

/* Orbit motion is NOT defined here. The badges' positioning and movement
   are both handled inside index.php - critical CSS in an inline <style>
   block, motion in JS - because this stylesheet has repeatedly been
   served stale by hosts/CDNs, and when that happened the badges lost
   their absolute centring and collapsed into a single row. What's left
   here is only the badge's own appearance, which degrades harmlessly if
   it ever does go stale. */
.hero-orbit-tag {
  background: var(--paper); color: var(--ink);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px;
  box-shadow: var(--shadow-stamp);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; width: max-content;
}
.hero-orbit-tag .orbit-text {
  display: flex; align-items: center; gap: 6px;
  transition: opacity 0.4s ease;
}
.hero-orbit-tag .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--orange); }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 44px; }
  .hero-stamp-wrap { order: -1; margin-bottom: 10px; flex-direction: column; gap: 16px; }
  .hero-stamp { width: 220px; }
  .hero-orbit-tag { font-size: 11px; padding: 6px 10px; }

  /* All 5 badges stay visible below the stamp instead of orbiting around
     it - orbiting needs real space around a circle that a shrunk mobile
     circle just doesn't have. The orbit JS in index.php stops running
     and clears its inline transform/opacity/z-index below 901px, so
     these plain flex rules take over cleanly. */
  .orbit-badges-row {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
    position: static; max-width: 360px; margin: 0 auto;
  }
  .hero-orbit-tag.orbit-content {
    position: static; transform: none; opacity: 1; z-index: auto; animation: none;
  }
}
@media (max-width: 480px) {
  .hero .wrap { padding: 36px 20px 56px; }
  .hero-orbit-tag { font-size: 10px; padding: 5px 9px; }
}


/* ============================== SECTIONS ============================== */
section { padding: 84px 0; }
@media (max-width: 700px) { section { padding: 52px 0; } }
.section-head { max-width: 620px; margin-bottom: 46px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 38px); }
.section-head p { color: var(--ink-soft); font-size: 16.5px; }

.section-sand { background: var(--sand); }

/* Entry cards (Directory / Travel Guide / Scanners / Bodies / Prayer tools) */
.entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
@media (max-width: 640px) { .entry-grid { grid-template-columns: 1fr; } }
.entry-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px 26px;
  text-decoration: none; color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.entry-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-stamp); border-color: transparent; }
.entry-card .icon-badge {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid currentColor;
  margin-bottom: 18px;
  transition: transform 0.25s ease;
}
.entry-card .icon-badge svg { width: 24px; height: 24px; }
.entry-card:hover .icon-badge { transform: rotate(-8deg); }
.entry-card h3 { font-size: 21px; margin-bottom: 8px; }
.entry-card p { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 16px; }
.entry-card .go { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: 0.03em; }
.card-orange .icon-badge { background: var(--orange-tint); color: var(--orange-deep); }
.card-green  .icon-badge { background: var(--green-tint); color: var(--green-deep); }
.card-teal   .icon-badge { background: var(--teal-tint); color: var(--teal-deep); }
.card-ink    .icon-badge { background: var(--sand-deep); color: var(--ink); }
.card-gold   .icon-badge { background: #F3E6C8; color: #8A6420; }
.card-navy   .icon-badge { background: #DCE6F0; color: #2A4A6B; }
.card-rose   .icon-badge { background: #F4DCD8; color: #8A3B2E; }
.card-orange .go { color: var(--orange-deep); }
.card-green  .go { color: var(--green-deep); }
.card-teal   .go { color: var(--teal-deep); }
.card-ink    .go { color: var(--ink); }
.card-gold   .go { color: #8A6420; }
.card-navy   .go { color: #2A4A6B; }
.card-rose   .go { color: #8A3B2E; }


/* Interactive "how the check works" widget */
.check-flow { background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.check-flow::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 300px at 15% 0%, rgba(5,141,129,0.25), transparent 60%),
              radial-gradient(500px 260px at 100% 100%, rgba(222,120,0,0.18), transparent 60%);
}
.check-flow .wrap { position: relative; z-index: 1; }
.check-flow .section-head { position: relative; }
.check-flow .eyebrow { color: var(--orange); }
.check-flow .section-head p { color: rgba(255,253,247,0.65); }

.check-flow-widget { position: relative; display: grid; gap: 30px; }

.check-flow-steps { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cfs-progress {
  grid-column: 1 / -1; order: 2; height: 3px; background: rgba(255,253,247,0.14);
  border-radius: 999px; margin-top: 2px; overflow: hidden;
}
.cfs-progress-fill { height: 100%; width: 25%; background: linear-gradient(90deg, var(--teal), var(--orange)); transition: width 0.5s cubic-bezier(.4,0,.2,1); border-radius: 999px; }
.check-flow-step {
  font: inherit; cursor: pointer; text-align: left;
  background: rgba(255,253,247,0.05); border: 1px solid rgba(255,253,247,0.12); border-radius: 12px;
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
  color: rgba(255,253,247,0.65); transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.check-flow-step:hover { border-color: rgba(255,253,247,0.3); color: var(--paper); }
.check-flow-step.active { background: rgba(255,253,247,0.1); border-color: var(--orange); color: var(--paper); transform: translateY(-2px); }
.cfs-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; background: rgba(255,253,247,0.1); color: rgba(255,253,247,0.7);
  transition: background 0.25s ease, color 0.25s ease;
}
.check-flow-step.active .cfs-num { background: var(--orange); color: var(--ink); }
.cfs-label { font-size: 13.5px; font-weight: 600; }

.check-flow-detail { position: relative; min-height: 148px; }
.cfd-panel {
  display: none; background: rgba(255,253,247,0.04); border: 1px solid rgba(255,253,247,0.1);
  border-radius: 16px; padding: 28px 30px; animation: cfd-fade-in 0.4s ease;
}
.cfd-panel.active { display: block; }
@keyframes cfd-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.cfd-panel h3 { font-size: 20px; margin: 8px 0 10px; }
.cfd-panel p { color: rgba(255,253,247,0.72); font-size: 14.5px; line-height: 1.7; max-width: 62ch; }
.cfd-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px;
}
.cfd-tag-primary { background: var(--teal-tint); color: var(--teal-deep); }
.cfd-tag-secondary { background: var(--orange-tint); color: var(--orange-deep); }
.cfd-tag-fallback { background: var(--green-tint); color: var(--green-deep); }
.cfd-tag-manual { background: rgba(255,253,247,0.15); color: var(--paper); }

@media (max-width: 700px) {
  .check-flow-steps { grid-template-columns: repeat(2, 1fr); }
  .cfd-panel { padding: 22px 20px; }
}

/* Data-driven coverage infographic (homepage).
   Every number here is computed from $halal_bodies at render time - see
   index.php - so the chart stays truthful as that dataset grows. */
.coverage-viz { background: var(--sand); }
.coverage-widget { display: grid; grid-template-columns: 1.35fr 1fr; gap: 34px; align-items: start; }

.coverage-bars { display: flex; flex-direction: column; gap: 6px; }
.cov-row {
  font: inherit; cursor: pointer; text-align: left; width: 100%;
  display: grid; grid-template-columns: 128px 1fr 34px; align-items: center; gap: 14px;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  padding: 9px 12px; color: var(--ink);
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}
.cov-row:hover, .cov-row.active { background: var(--paper); border-color: var(--line); transform: translateX(3px); }
.cov-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cov-track { height: 12px; background: var(--sand-deep); border-radius: 999px; overflow: hidden; }
.cov-fill {
  display: flex; height: 100%; width: var(--w, 0%); border-radius: 999px; overflow: hidden;
  transform-origin: left center; animation: cov-grow 0.85s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes cov-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.cov-seg { display: block; height: 100%; }
.seg-state { background: var(--teal); }
.seg-private { background: var(--green); }
.seg-independent { background: var(--orange); }
.cov-count { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--ink-soft); text-align: right; }

.coverage-detail {
  background: var(--ink); color: var(--paper); border-radius: 18px; padding: 30px 28px;
  position: sticky; top: 90px;
}
.coverage-detail .eyebrow { color: var(--orange); }
.cov-big { font-family: var(--font-display); font-size: 58px; line-height: 1; margin-top: 10px; }
.cov-big-label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255,253,247,0.55); margin-bottom: 22px; }
.cov-split { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.cov-split-item { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: rgba(255,253,247,0.78); }
.cov-split-item b { font-family: var(--font-mono); font-size: 14px; color: var(--paper); min-width: 20px; }
.cov-key { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.cov-bodies {
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.75;
  color: rgba(255,253,247,0.5); margin: 0 0 20px;
  max-height: 78px; overflow: hidden;
}
.cov-cta { border-color: rgba(255,253,247,0.3); color: var(--paper); }
.cov-cta:hover { background: rgba(255,253,247,0.1); }

@media (max-width: 860px) {
  .coverage-widget { grid-template-columns: 1fr; gap: 24px; }
  .coverage-detail { position: static; order: -1; }
  .cov-row { grid-template-columns: 96px 1fr 30px; gap: 10px; padding: 8px 10px; }
  .cov-name { font-size: 12.5px; }
  .cov-big { font-size: 46px; }
}

/* Stats strip */
.stats-strip {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stats-strip .wrap { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; }
.stat { padding: 26px 28px; text-align: center; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; }
.stat b { display: block; font-family: var(--font-display); font-size: 32px; color: var(--orange-deep); }
.stat span { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
@media (max-width: 700px) { .stats-strip .wrap { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(3) { border-left: none; } }

/* ============================== STAMP BADGE (signature) ============================== */
.stamp {
  --stamp-color: var(--orange);
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  border: 2.5px solid var(--stamp-color);
  color: var(--stamp-color);
  position: relative;
  flex-shrink: 0;
  transform: rotate(-6deg);
}
.stamp::before {
  content: ""; position: absolute; inset: 5px;
  border: 1px dashed var(--stamp-color); border-radius: 50%; opacity: 0.55;
}
.stamp .stamp-icon { display: flex; }
.stamp-pop { animation: stamp-in 0.5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes stamp-in {
  0% { opacity: 0; transform: scale(1.6) rotate(-16deg); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: scale(1) rotate(-6deg); }
}

/* ============================== LISTING CARDS ============================== */
.listing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.listing-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; gap: 16px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.listing-card:hover { box-shadow: var(--shadow-stamp); transform: translateY(-3px); }
.listing-card .stamp { width: 52px; height: 52px; }
.listing-body h4 { font-size: 16.5px; margin-bottom: 4px; }
.listing-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.listing-meta .flag { font-size: 14px; }
.listing-body p.desc { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 10px; }
.pill {
  display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; letter-spacing: 0.02em;
}
.pill-green { background: var(--green-tint); color: var(--green-deep); }
.pill-orange { background: var(--orange-tint); color: var(--orange-deep); }
.pill-teal { background: var(--teal-tint); color: var(--teal-deep); }

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

/* ============================== FILTER BAR ============================== */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 8px 8px 20px; margin-bottom: 30px;
}
.filter-bar input[type="search"] {
  flex: 1; min-width: 160px; border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: 15px; padding: 10px 0;
}
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 0; }
.chip {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--sand); cursor: pointer; user-select: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.results-empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); font-family: var(--font-mono); font-size: 13.5px; }

/* ============================== COUNTRY / TRAVEL CARDS ============================== */
.country-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.country-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.country-banner {
  height: 96px;
  display: flex; align-items: flex-end; padding: 14px 18px;
  font-size: 34px;
  color: #fff;
}
.country-card h3 { font-size: 19px; margin: 16px 18px 4px; }
.country-card .sub { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); margin: 0 18px 12px; }
.country-card p { padding: 0 18px; font-size: 14px; color: var(--ink-soft); }
.country-card .country-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-top: 1px solid var(--line); margin-top: 14px;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
}
@media (max-width: 980px) { .country-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .country-grid { grid-template-columns: 1fr; } }

/* ============================== FOOTER ============================== */
.site-footer { background: var(--ink); color: rgba(255,253,247,0.7); padding: 60px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; margin-bottom: 40px; }
.footer-grid h5 { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,253,247,0.45); margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a { text-decoration: none; color: rgba(255,253,247,0.78); font-size: 14.5px; }
.footer-grid a:hover { color: var(--orange); }
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 19px; color: #fff; margin-bottom: 10px; }
.footer-brand img { width: 32px; height: 32px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 24px; border-top: 1px solid rgba(255,253,247,0.12); font-size: 13px; color: rgba(255,253,247,0.45); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } .footer-bottom { flex-direction: column; } }

/* ============================== EFFECTS ============================== */

/* --- Scroll reveal: applied via JS (footer.php) to cards/section heads
   across every page. Starts hidden+offset only once JS confirms it can
   actually animate it back in, so content is never stuck invisible if
   JS fails to load. --- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2,.8,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* --- Cursor-following spotlight glow on cards. Each card variant sets
   --accent (RGB triplet) so the glow tints to match its own color
   instead of one generic color everywhere. --- */
.card-orange { --accent: 222,120,0; }
.card-green  { --accent: 95,168,10; }
.card-teal   { --accent: 5,141,129; }
.card-ink    { --accent: 32,26,16; }
.card-gold   { --accent: 138,100,32; }
.card-navy   { --accent: 42,74,107; }
.card-rose   { --accent: 138,59,46; }

.glow-card { position: relative; overflow: hidden; }
.glow-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent, 222,120,0), 0.14), transparent 70%);
  opacity: 0; transition: opacity 0.35s ease;
  pointer-events: none;
}
.glow-card:hover::before { opacity: 1; }

/* --- Button shine sweep --- */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: "";
  position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-18deg);
  transition: left 0.65s ease;
  pointer-events: none;
}
.btn-primary:hover::after { left: 130%; }

/* --- Living hero background: a second, slow-drifting glow layer on top
   of the existing static gradients + dotted texture. --- */
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(520px 380px at 22% 105%, rgba(5,141,129,0.22), transparent 65%);
  animation: hero-drift 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes hero-drift {
  0% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  100% { transform: translate(36px, -22px) scale(1.08); opacity: 1; }
}

/* --- Chip pop on selection --- */
.chip.active { animation: chip-pop 0.3s ease; }
@keyframes chip-pop { 0% { transform: scale(0.92); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }

/* --- Marquee strip (certifying bodies ticker) --- */
.marquee-wrap {
  overflow: hidden;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--sand);
  padding: 20px 0;
}
.marquee-track {
  display: flex; align-items: baseline; gap: 42px;
  width: max-content;
  /* Duration is set inline per-render (see index.php) and scales with how
     many bodies are in the list, so the *speed* stays constant no matter
     how long the track gets. A fixed duration here would mean the ticker
     silently accelerates every time a certifying body is added - which is
     exactly what happened when the list went from 13 bodies to 87. */
  animation: marquee-scroll var(--marquee-dur, 30s) linear infinite;
}
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  color: var(--ink); white-space: nowrap;
  display: flex; align-items: baseline; gap: 6px;
}
.marquee-item::before { content: "✦"; color: var(--orange); font-size: 11px; margin-right: 4px; }
.marquee-item small { font-weight: 500; color: var(--ink-soft); }
@keyframes marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --- Stat number ticking up: no extra styling needed beyond what
   .stat b already has, this just documents that the JS mutates its
   text content on scroll-into-view. --- */


/* ============================== PRODUCT DETAIL PAGE ============================== */
/* /product.php - one approved product, all stored fields. */

.listing-more {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
  color: var(--teal-deep); text-decoration: none;
}
.listing-more:hover { text-decoration: underline; }

.pd-hero { background: var(--sand); padding: 34px 0 44px; border-bottom: 1px solid var(--line); }
.pd-back {
  display: inline-block; margin-bottom: 24px;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
  color: var(--ink-soft); text-decoration: none;
}
.pd-back:hover { color: var(--ink); }

.pd-head { display: grid; grid-template-columns: 260px 1fr; gap: 38px; align-items: start; }

.pd-photo {
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; box-shadow: var(--shadow-stamp);
}
/* object-fit: contain, never cover - packaging shots are all different
   aspect ratios and cropping them tends to cut off exactly the part
   people want to see (the logo, the halal mark, the flavour name). */
.pd-photo img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.pd-photo.is-empty { background: var(--sand-deep); border-style: dashed; box-shadow: none; }
.pd-photo-fallback {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--ink-soft); font-family: var(--font-mono); font-size: 12px; text-align: center;
}

.pd-headline h1 { font-size: clamp(26px, 3.4vw, 38px); margin: 6px 0 8px; }
.pd-sub { color: var(--ink-soft); font-size: 16px; margin: 0 0 18px; }
.pd-flagline {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft);
}
.pd-flag { font-size: 17px; }

.pd-status {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 12px; margin-bottom: 18px;
  border-left: 4px solid;
}
.pd-status.is-certified { background: var(--green-tint); border-color: var(--green); color: var(--green-deep); }
.pd-status.is-soft { background: var(--orange-tint); border-color: var(--orange); color: var(--orange-deep); }
.pd-status-icon { flex-shrink: 0; margin-top: 1px; }
.pd-status-main { font-weight: 700; font-size: 15px; }
.pd-status-sub { font-size: 13px; opacity: 0.85; margin-top: 3px; }

.pd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-chip {
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.pd-chip-mono { font-family: var(--font-mono); font-size: 11.5px; }
.pd-chip-grade { background: var(--teal-tint); border-color: transparent; color: var(--teal-deep); }

.pd-body { padding: 46px 0 70px; }
.pd-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 26px; align-items: start; }
.pd-main, .pd-side { display: flex; flex-direction: column; gap: 20px; }

.pd-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px 26px;
}
.pd-card h2 { font-size: 17px; margin: 0 0 14px; }
.pd-card h2 small { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--ink-soft); margin-left: 6px; }
.pd-card-warn { background: var(--orange-tint); border-color: transparent; }
.pd-card-warn h2 { color: var(--orange-deep); }
.pd-card-dark { background: var(--ink); border-color: transparent; color: var(--paper); }
.pd-card-dark h2 { color: var(--paper); }

.pd-ingredients { font-size: 14.5px; line-height: 1.75; color: var(--ink-soft); margin: 0; }
.pd-ing-photo { display: block; margin-top: 16px; text-decoration: none; }
.pd-ing-photo img {
  width: 100%; max-height: 200px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line);
}
.pd-ing-photo span {
  display: inline-block; margin-top: 8px;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--teal-deep);
}
.pd-ing-photo:hover span { text-decoration: underline; }

.pd-rows { margin: 0; }
.pd-row { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); }
.pd-row:first-child { border-top: none; padding-top: 0; }
.pd-row dt { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); }
.pd-row dd { margin: 0; font-size: 14px; line-height: 1.6; }
.pd-card-warn .pd-row { border-color: rgba(168,91,0,0.18); }
.pd-rows-tight .pd-row { grid-template-columns: 118px 1fr; padding: 7px 0; }

.pd-nutri { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; }
.pd-nutri-item {
  background: var(--sand); border-radius: 12px; padding: 14px 12px; text-align: center;
}
.pd-nutri-val { display: block; font-family: var(--font-display); font-size: 22px; color: var(--orange-deep); }
.pd-nutri-val small { font-size: 12px; margin-left: 1px; }
.pd-nutri-label { display: block; font-size: 11.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.35; }

.pd-note { font-size: 13.5px; line-height: 1.7; margin: 0 0 12px; color: var(--ink-soft); }
.pd-card-dark .pd-note { color: rgba(255,253,247,0.8); }
.pd-note-dim { opacity: 0.75; font-size: 12.5px; }
.pd-link {
  display: block; margin-top: 4px;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
  color: var(--teal-deep); text-decoration: none;
}
.pd-card-dark .pd-link { color: var(--paper); }
.pd-card-warn .pd-link { color: var(--orange-deep); }
.pd-link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .pd-grid { grid-template-columns: 1fr; }
  .pd-head { grid-template-columns: 200px 1fr; gap: 24px; }
}
@media (max-width: 620px) {
  .pd-head { grid-template-columns: 1fr; }
  .pd-photo { max-width: 220px; }
  .pd-row { grid-template-columns: 1fr; gap: 3px; }
  .pd-card { padding: 20px; }
}

/* Additive findings on the product detail page - haram and mushbooh are
   visually distinct, since treating them the same would wrongly condemn
   ordinary products containing source-ambiguous emulsifiers. */
.pd-additive { padding: 13px 15px; border-radius: 10px; border-left: 3px solid; margin-bottom: 10px; }
.pd-additive:last-of-type { margin-bottom: 0; }
.pd-additive.is-haram { background: var(--orange-tint); border-color: var(--orange); color: #7A3E00; }
.pd-additive.is-doubtful { background: var(--sand); border-color: #C9A227; color: #6B5200; }
.pd-additive-head { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd-additive-tag {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,0.09);
}
.pd-additive p { margin: 4px 0 0; font-size: 13px; line-height: 1.6; }
.pd-additive-cond { opacity: 0.88; font-size: 12.4px !important; }
.pd-additive-src { opacity: 0.68; font-size: 11px !important; font-style: italic; }

/* Barcode above the product title - identifies the record before you read
   the name, and reads as a catalogue reference rather than a chip. */
.pd-barcode {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 6px;
}
.pd-headline .pd-flagline { margin-bottom: 18px; align-items: flex-start; line-height: 1.55; }

/* Open Food Facts' three gradings, grouped inside the Nutrition card.
   Each carries a note explaining what it measures - a bare "Eco-Score F"
   chip told the reader nothing about the scale it sits on. */
.pd-scores { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.pd-score { display: flex; align-items: center; gap: 12px; }
.pd-score-badge {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  background: var(--sand-deep); color: var(--ink);
}
/* Nutri-Score / Eco-Score use the same A-E scale, so one colour ramp
   serves both. NOVA is 1-4, where 4 is worst - the digits happen to land
   on sensible colours in the same ramp. */
.pd-score.grade-a .pd-score-badge, .pd-score.grade-1 .pd-score-badge { background: var(--green-tint); color: var(--green-deep); }
.pd-score.grade-b .pd-score-badge, .pd-score.grade-2 .pd-score-badge { background: var(--green-tint); color: var(--green-deep); }
.pd-score.grade-c .pd-score-badge, .pd-score.grade-3 .pd-score-badge { background: #F6EEDC; color: #6B5200; }
.pd-score.grade-d .pd-score-badge, .pd-score.grade-4 .pd-score-badge { background: var(--orange-tint); color: var(--orange-deep); }
.pd-score.grade-e .pd-score-badge, .pd-score.grade-f .pd-score-badge { background: var(--orange-tint); color: var(--orange-deep); }
.pd-score.is-unknown .pd-score-badge { background: var(--sand-deep); color: var(--ink-soft); }
.pd-score-text { display: flex; flex-direction: column; line-height: 1.4; }
.pd-score-text b { font-size: 14px; }
.pd-score-text small { font-size: 12px; color: var(--ink-soft); }

/* ============================== DIRECTORY PAGE ============================== */
/* directory.php - hero, sticky filter toolbar, and restructured cards. */

.dir-hero {
  background: linear-gradient(160deg, var(--sand) 0%, var(--sand-deep) 100%);
  border-bottom: 1px solid var(--line);
  padding: 54px 0 44px;
}
.dir-hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; }
.dir-hero h1 { font-size: clamp(30px, 4vw, 44px); max-width: 16ch; margin: 6px 0 12px; }
.dir-hero p { color: var(--ink-soft); max-width: 52ch; font-size: 16.5px; margin: 0; }

.dir-hero-stats { display: flex; gap: 12px; margin: 0; }
.dir-hero-stats > div {
  flex: 1; background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px; text-align: center;
}
.dir-hero-stats dt {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px;
}
.dir-hero-stats dd { margin: 0; font-family: var(--font-display); font-size: 27px; color: var(--orange-deep); line-height: 1; }

/* Sticky so the filters stay reachable while scrolling a long result set -
   the single biggest usability difference on a directory that keeps
   growing. */
.dir-toolbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,253,247,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 14px 0 12px;
}
.dir-toolbar-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.dir-toolbar-row-2 { margin-top: 10px; justify-content: space-between; }

.dir-search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 18px; transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.dir-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-tint); }
.dir-search-icon { display: flex; color: var(--ink-soft); flex-shrink: 0; }
.dir-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: 15px; padding: 11px 0;
}

.dir-select {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 8px 0 16px; transition: border-color 0.18s ease;
}
.dir-select:focus-within { border-color: var(--teal); }
.dir-select-label {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap;
}
.dir-select select {
  border: none; outline: none; background: transparent; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; color: var(--ink);
  padding: 11px 6px 11px 0; max-width: 190px;
}

/* Count badge inside a type chip. Inherits colour so it flips correctly
   when the chip becomes active. */
.chip b {
  font-weight: 700; opacity: 0.55; margin-left: 3px; font-size: 11.5px;
}
.chip.active b { opacity: 0.8; }

.dir-result-line {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); white-space: nowrap;
}
.dir-clear {
  font: inherit; cursor: pointer; border: 1px solid var(--line);
  background: var(--paper); border-radius: 999px; padding: 5px 12px;
  color: var(--ink); font-weight: 700;
}
.dir-clear:hover { border-color: var(--orange); color: var(--orange-deep); }

.dir-body { padding: 34px 0 70px; }

/* Cards become a three-part vertical stack (header / body / footer) so
   the certifier pills and links line up across a row regardless of how
   long each description runs - the old side-by-side layout left every
   card a different shape. */
.listing-card {
  flex-direction: column; gap: 0; padding: 0; overflow: hidden;
}
.listing-card[hidden] { display: none; }
.listing-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 0;
}
.listing-card .stamp { width: 44px; height: 44px; }
.listing-type {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft);
  background: var(--sand); border-radius: 999px; padding: 4px 10px;
}
.listing-card .listing-body { padding: 14px 20px 0; flex: 1; }
.listing-card .listing-body h4 { font-size: 16.5px; margin-bottom: 6px; line-height: 1.35; }
.listing-card .listing-body p.desc {
  font-size: 13.5px; color: var(--ink-soft); margin: 0 0 14px; line-height: 1.6;
  /* Clamp so one verbose OFF category string can't make a card three
     times the height of its neighbours. */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.listing-foot { padding: 0 20px 18px; margin-top: auto; }
.listing-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.listing-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.listing-more-alt { color: var(--ink-soft); }

.results-empty { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-body); font-size: 15px; }
.results-empty strong { font-size: 17px; color: var(--ink); }
.results-empty a { color: var(--teal-deep); font-weight: 700; }

@media (max-width: 980px) {
  .dir-hero-grid { grid-template-columns: 1fr; gap: 26px; align-items: start; }
  .dir-hero-stats { max-width: 420px; }
}
@media (max-width: 760px) {
  .dir-toolbar { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .dir-toolbar-row-2 { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dir-select { width: 100%; }
  .dir-select select { max-width: none; flex: 1; }
  .dir-hero-stats > div { padding: 12px; }
  .dir-hero-stats dd { font-size: 22px; }
}

/* Product photo frame. Uncropped photos keep contain-fit (packaging shots
   are all different shapes and cropping them by default tends to cut off
   the logo or halal mark). When an admin has set a crop, the frame
   becomes a fixed window and the image fills it per the stored focal
   point - see includes/image-crop.php. */
.pd-photo-frame { display: block; width: 100%; height: 100%; }
.pd-photo-frame img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.pd-photo-frame.is-cropped { overflow: hidden; border-radius: 10px; }
.pd-photo-frame.is-cropped img { max-width: none; max-height: none; border-radius: 0; }

/* Photo inside the stamp circle on directory cards.
   The stamp is rotated -6deg for its "rubber stamp" look, which would
   tilt the photo with it - so an inner wrapper counter-rotates to sit the
   picture level while the ring around it stays angled.

   The counter-rotation is deliberately on the wrapper, not the <img>: the
   crop tool writes an inline `transform` on the image for zoom, and an
   inline style always beats the stylesheet. Sharing one element would
   mean any cropped photo silently lost its counter-rotation. */
.stamp-photo { overflow: hidden; background: var(--sand); }
.stamp-photo-inner {
  display: block; width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden;
  /* scale compensates for the gap the counter-rotation opens at the
     circle's edges - without it, corners of the photo pull away from the
     ring. */
  transform: rotate(6deg) scale(1.18);
}
/* The dashed inner ring sits above the photo so the stamp still reads as
   a stamp rather than a plain avatar. */
.stamp-photo::before { z-index: 2; }

/* Map links on the restaurant detail page */
.rd-map-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; }
