/* ── Reset & base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Light mode tokens (default) */
:root {
  --clr-bg:         #f8f7f4;
  --clr-surface:    #ffffff;
  --clr-border:     #e8e5de;
  --clr-accent:     #c0392b;
  --clr-accent-dk:  #9b2116;
  --clr-accent-lt:  #e74c3c;
  --clr-text:       #1a1a1a;
  --clr-muted:      #6b6b6b;
  --clr-subtle:     #9a9a9a;
  --clr-overlay:    rgba(0,0,0,.45);
  --clr-footer-bg:  #1a1a1a;
  --clr-footer-bd:  #2e2e2e;
  --clr-footer-txt: #a0a0a0;
  --clr-footer-dim: #777;
  --clr-footer-btn: #2a2a2a;
  --clr-footer-bot: #555;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --shadow-card:    0 1px 4px rgba(0,0,0,.07), 0 0 0 0.5px rgba(0,0,0,.06);
  --font:           'Inter', system-ui, sans-serif;
  --container:      1200px;
  --gap:            1.25rem;
}

/* Dark mode tokens — applied when OS prefers dark OR user toggled */
:root[data-theme="dark"],
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --clr-bg:         #18181b;
  --clr-surface:    #232329;
  --clr-border:     #333338;
  --clr-accent:     #e74c3c;
  --clr-accent-dk:  #c0392b;
  --clr-accent-lt:  #ff6b5b;
  --clr-text:       #f0ede8;
  --clr-muted:      #a8a49e;
  --clr-subtle:     #6b6760;
  --clr-overlay:    rgba(0,0,0,.6);
  --clr-footer-bg:  #111113;
  --clr-footer-bd:  #222226;
  --clr-footer-txt: #888882;
  --clr-footer-dim: #5a5a56;
  --clr-footer-btn: #1e1e22;
  --clr-footer-bot: #444440;
  --shadow-card:    0 1px 6px rgba(0,0,0,.35), 0 0 0 0.5px rgba(255,255,255,.04);
} }

/* Explicit dark toggle overrides (data-theme beats media query) */
:root[data-theme="dark"] {
  --clr-bg:         #18181b;
  --clr-surface:    #232329;
  --clr-border:     #333338;
  --clr-accent:     #e74c3c;
  --clr-accent-dk:  #c0392b;
  --clr-accent-lt:  #ff6b5b;
  --clr-text:       #f0ede8;
  --clr-muted:      #a8a49e;
  --clr-subtle:     #6b6760;
  --clr-overlay:    rgba(0,0,0,.6);
  --clr-footer-bg:  #111113;
  --clr-footer-bd:  #222226;
  --clr-footer-txt: #888882;
  --clr-footer-dim: #5a5a56;
  --clr-footer-btn: #1e1e22;
  --clr-footer-bot: #444440;
  --shadow-card:    0 1px 6px rgba(0,0,0,.35), 0 0 0 0.5px rgba(255,255,255,.04);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

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

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 60px;
}

.logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 38px;
  width: auto;
  display: block;
  transition: filter .2s;
}

/* Make logo visible on dark header — invert black to white */
:root[data-theme="dark"] .logo-img { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-img { filter: brightness(0) invert(1); }
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  font-size: .875rem;
}

.main-nav a {
  color: var(--clr-muted);
  transition: color .15s;
  white-space: nowrap;
}

.main-nav a:hover { color: var(--clr-text); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  color: var(--clr-muted);
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--clr-bg); color: var(--clr-text); }

.btn-donate {
  display: inline-flex;
  align-items: center;
  padding: .35rem 1rem;
  background: var(--clr-accent);
  color: #fff !important;
  border-radius: 999px;
  font-size: .825rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.btn-donate:hover { background: var(--clr-accent-dk); }

.nav-toggle { display: none; }

/* ── Hero banner ─────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #1a1a1a;
}

.hero-bg {
  position: absolute; inset: 0;
  background-image: url('../img/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  opacity: .45;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4rem 0;
  max-width: 640px;
}

.hero-content h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.05rem;
  color: rgba(255,255,255,.8);
  margin-bottom: 2rem;
}

.hero-search {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.hero-search input {
  flex: 1;
  min-width: 200px;
  padding: .75rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font);
  background: #fff;
  color: #1a1a1a;
}

.hero-search input:focus { outline: 2px solid var(--clr-accent); }

.btn-accent {
  padding: .75rem 1.5rem;
  background: var(--clr-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: .95rem;
  font-weight: 500;
  transition: background .15s;
  white-space: nowrap;
}
.btn-accent:hover { background: var(--clr-accent-dk); }

/* ── Section titles ──────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-top: 2.5rem;
}

.section-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
}

.section-header a {
  font-size: .875rem;
  color: var(--clr-accent);
}

/* ── Recipe card grid ────────────────────────────────────────── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* ── Recipe card ─────────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

.card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--clr-bg);
}

.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.card:hover .card-thumb img { transform: scale(1.04); }

.card-thumb .no-image {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--clr-subtle);
}

.badge-cat {
  position: absolute; top: 10px; left: 10px;
  background: var(--clr-overlay);
  color: #fff;
  font-size: .7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

.badge-video {
  position: absolute; bottom: 10px; right: 10px;
  background: var(--clr-overlay);
  color: #fff;
  font-size: .75rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 4px;
  backdrop-filter: blur(4px);
}

.badge-video svg { width: 12px; height: 12px; fill: #fff; }

.card-body {
  padding: .875rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-origin {
  font-size: .75rem;
  color: var(--clr-muted);
  margin-bottom: .25rem;
  display: flex; align-items: center; gap: 4px;
}

.card-origin svg { width: 12px; height: 12px; flex-shrink: 0; }

.card-title {
  font-size: .975rem;
  font-weight: 600;
  color: var(--clr-text);
  line-height: 1.35;
  margin-bottom: .4rem;
}

.card-title a { color: inherit; }
.card-title a:hover { color: var(--clr-accent); }

.card-desc {
  font-size: .825rem;
  color: var(--clr-muted);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--clr-border);
  font-size: .75rem;
  color: var(--clr-subtle);
}

.card-footer span { display: flex; align-items: center; gap: 4px; }
.card-footer svg { width: 13px; height: 13px; }

/* ── Search / filter bar ─────────────────────────────────────── */
.filter-bar {
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  padding: .875rem 0;
  position: sticky;
  top: 60px;
  z-index: 90;
}

.filter-inner {
  display: flex;
  gap: .625rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-inner input,
.filter-inner select {
  padding: .5rem .875rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
  transition: border-color .15s;
}

.filter-inner input:focus,
.filter-inner select:focus {
  outline: none;
  border-color: var(--clr-accent);
}

.filter-inner input:not([type="checkbox"]) { flex: 1; min-width: 180px; }
.filter-inner select { flex: 1; min-width: 0; }

.filter-inner .btn-accent {
  padding: .5rem 1.25rem;
  font-size: .875rem;
}

.filter-inner .btn-reset {
  padding: .5rem .875rem;
  font-size: .875rem;
  background: transparent;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-muted);
  transition: background .15s;
}
.filter-inner .btn-reset:hover { background: var(--clr-bg); }

.filter-check {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .875rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  color: var(--clr-text);
}
.filter-check input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  cursor: pointer;
  accent-color: var(--clr-accent);
  flex-shrink: 0;
  position: relative;
  top: 0;
}

.results-meta {
  font-size: .825rem;
  color: var(--clr-muted);
  padding: 1rem 0 .5rem;
}

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  padding: 2.5rem 0 3rem;
}

.pagination a,
.pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  background: var(--clr-surface);
  color: var(--clr-text);
  transition: background .15s, border-color .15s;
}

.pagination a:hover { background: var(--clr-bg); border-color: var(--clr-accent); color: var(--clr-accent); }
.pagination .active { background: var(--clr-accent); color: #fff; border-color: var(--clr-accent); }
.pagination .dots { border: none; background: transparent; color: var(--clr-subtle); }

/* ── Infinite scroll / Load more ────────────────────────────── */
.load-more-wrap {
  text-align: center;
  padding: 2rem 0 3rem;
}
.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 2.5rem;
  background: transparent;
  border: 2px solid var(--clr-accent);
  border-radius: var(--radius-lg);
  color: var(--clr-accent);
  font-size: .95rem;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-load-more:hover:not(:disabled) {
  background: var(--clr-accent);
  color: #fff;
}
.btn-load-more:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.scroll-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
  height: 0;
  overflow: hidden;
  transition: height .2s;
}
.scroll-loader.active {
  height: 72px;
}
.scroll-loader.active::after {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--clr-border);
  border-top-color: var(--clr-accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Recipe detail page ──────────────────────────────────────── */
.detail-wrap { padding: 2rem 0 4rem; }

.breadcrumb {
  font-size: .8rem;
  color: var(--clr-muted);
  display: flex; align-items: center; gap: .375rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--clr-muted); }
.breadcrumb a:hover { color: var(--clr-accent); }
.breadcrumb svg { width: 12px; height: 12px; }

.detail-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.detail-hero-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--clr-bg);
}

.detail-hero-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.detail-img-video-link {
  display: block;
  position: relative;
  width: 100%; height: 100%;
}
.detail-img-video-link img {
  transition: filter .2s;
}
.detail-img-video-link:hover img {
  filter: brightness(.85);
}
.detail-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.detail-hero-img .no-image {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--clr-subtle);
}

.recipe-id {
  font-size: .75rem;
  color: var(--clr-subtle);
  margin-bottom: .5rem;
  letter-spacing: .04em;
}

.detail-title {
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: .875rem;
}

.tag-row {
  display: flex; flex-wrap: wrap; gap: .375rem;
  margin-bottom: 1rem;
}

.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .75rem;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--clr-border);
  color: var(--clr-muted);
  background: var(--clr-surface);
}
.tag svg { width: 12px; height: 12px; }

.tag-ramadan { border-color: #b45309; color: #b45309; background: #fefce8; }
.tag-video   { border-color: #c0392b; color: #c0392b; }

.detail-desc {
  font-size: .95rem;
  color: var(--clr-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .625rem;
  margin-bottom: 1.25rem;
}

.meta-box {
  background: var(--clr-bg);
  border-radius: var(--radius-md);
  padding: .75rem 1rem;
  text-align: center;
}

.meta-box .label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--clr-subtle);
  margin-bottom: .2rem;
}

.meta-box .value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--clr-text);
}

.action-row {
  display: flex; flex-wrap: wrap; gap: .5rem;
}

.btn-outline {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-family: var(--font);
  background: var(--clr-surface);
  color: var(--clr-text);
  transition: background .15s, border-color .15s;
}
.btn-outline:hover { background: var(--clr-bg); border-color: var(--clr-text); }
.btn-outline svg { width: 16px; height: 16px; }

.btn-outline-accent {
  border-color: var(--clr-accent);
  color: var(--clr-accent);
}
.btn-outline-accent:hover { background: #fff5f5; }

/* ── Detail sections ─────────────────────────────────────────── */
.detail-section {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.detail-section h2 {
  font-size: 1.05rem;
  font-weight: 600;
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--clr-border);
}

.detail-section h2 svg { width: 18px; height: 18px; color: var(--clr-accent); }

/* Ingredients */
.ingredient-list {
  list-style: none;
  columns: 2; column-gap: 2rem;
}

.ingredient-list li {
  font-size: .9rem;
  color: var(--clr-muted);
  padding: .375rem 0;
  border-bottom: 1px solid var(--clr-border);
  break-inside: avoid;
  display: flex; align-items: flex-start; gap: .5rem;
}

.ingredient-list li::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--clr-accent);
  flex-shrink: 0;
  margin-top: 7px;
}

/* Preparation steps */
.steps-list {
  list-style: none;
  counter-reset: step;
}

.steps-list li {
  counter-increment: step;
  display: flex; gap: 1rem;
  font-size: .925rem;
  color: var(--clr-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.steps-list li::before {
  content: counter(step);
  display: flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--clr-accent);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Video / Audio */
.video-embed {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-embed iframe {
  width: 100%; height: 100%;
  border: none;
}

.btn-watch-yt {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  background: #ff0000;
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s;
}
.btn-watch-yt:hover { background: #cc0000; color: #fff; }

.audio-player {
  width: 100%;
  border-radius: var(--radius-md);
}

/* Nutrition */
.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-bottom: 1rem;
}

.nut-item {
  background: var(--clr-bg);
  border-radius: var(--radius-md);
  padding: .875rem .5rem;
  text-align: center;
}

.nut-item .nval {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--clr-text);
}

.nut-item .nlbl {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--clr-subtle);
  margin-top: .15rem;
}

.allergen-list {
  display: flex; flex-wrap: wrap; gap: .375rem;
  margin-top: .75rem;
}

.allergen {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .775rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(234, 179, 8, .15);
  border: 1px solid rgba(234, 179, 8, .45);
  color: var(--clr-text);
}
.allergen svg { width: 12px; height: 12px; }

/* Share */
.share-row {
  display: flex; flex-wrap: wrap; gap: .5rem;
}

.share-btn {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .45rem 1rem;
  font-size: .825rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  background: var(--clr-surface);
  color: var(--clr-text);
  transition: background .15s;
}
.share-btn:hover { background: var(--clr-bg); }
.share-btn svg { width: 16px; height: 16px; }

.source-note {
  font-size: .775rem;
  color: var(--clr-subtle);
  margin-top: .875rem;
  display: flex; align-items: center; gap: .3rem;
}
.source-note svg { width: 13px; height: 13px; }

/* ── Footer ──────────────────────────────────────────────────── */
/* ── Sticky mini-footer ──────────────────────────────────────── */
.sticky-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(20, 20, 20, .92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: rgba(255,255,255,.75);
  font-size: .75rem;
  text-align: center;
  padding: .4rem 1rem;
  z-index: 200;
  transform: translateY(100%);
  transition: transform .3s ease;
  font-family: var(--font);
}
.sticky-footer.visible { transform: translateY(0); }
.sticky-footer a { color: rgba(255,255,255,.75); text-decoration: none; }
.sticky-footer a:hover { color: #fff; }
@media print { .sticky-footer { display: none !important; } }

.site-footer {
  background: var(--clr-footer-bg);
  color: var(--clr-footer-txt);
  padding: 3rem 0 0;
  margin-top: 3rem;
  padding-bottom: 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--clr-footer-bd);
}

.footer-logo {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: .5rem;
  text-decoration: none;
}
.footer-logo:hover { color: var(--clr-accent); }

.footer-tagline {
  font-size: .875rem;
  color: #ccc;
  font-weight: 500;
  margin-bottom: .625rem;
}

.footer-about {
  font-size: .8rem;
  line-height: 1.65;
  color: var(--clr-footer-dim);
  margin-bottom: 1.25rem;
  max-width: 300px;
}

.footer-social {
  display: flex;
  gap: .625rem;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--clr-footer-btn);
  color: var(--clr-footer-txt);
  transition: background .15s, color .15s;
}
.footer-social a:hover { background: var(--clr-accent); color: #fff; }

.footer-heading {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #fff;
  font-weight: 600;
  margin-bottom: .875rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.footer-col ul li a {
  font-size: .825rem;
  color: var(--clr-footer-dim);
  text-decoration: none;
  transition: color .15s;
}
.footer-col ul li a:hover { color: #fff; }

.footer-admin-link { opacity: .5; }
.footer-admin-link:hover { opacity: 1 !important; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  padding: 1.25rem 0;
  font-size: .775rem;
  color: var(--clr-footer-bot);
}

.footer-bottom a { color: var(--clr-footer-bot); text-decoration: none; }
.footer-bottom a:hover { color: var(--clr-footer-txt); }

.footer-bottom nav { display: flex; gap: 1.25rem; }

/* ── Theme toggle button ─────────────────────────────────────── */
.theme-toggle {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  color: var(--clr-muted);
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--clr-bg); color: var(--clr-text); }

/* Sun icon shown in dark mode, moon icon shown in light mode */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-brand { grid-column: auto; }
}

/* ── Admin ───────────────────────────────────────────────────── */
.admin-wrap { padding: 2rem 0 4rem; }

.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}

.admin-header h1 { font-size: 1.4rem; font-weight: 600; }

.admin-table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.admin-table th,
.admin-table td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--clr-border);
}

.admin-table th {
  background: var(--clr-bg);
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--clr-muted);
}

.admin-table tr:hover td { background: #fafaf8; }

.admin-actions { display: flex; gap: .375rem; }

.btn-sm {
  padding: .3rem .75rem;
  font-size: .8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--clr-border);
  background: var(--clr-surface);
  color: var(--clr-text);
  cursor: pointer;
  transition: background .15s;
}
.btn-sm:hover { background: var(--clr-bg); }
.btn-sm-danger { border-color: #f87171; color: #c0392b; }
.btn-sm-danger:hover { background: #fff5f5; }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .375rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--clr-accent); }
.form-group textarea { resize: vertical; min-height: 120px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }

.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-md);
  font-size: .875rem;
  margin-bottom: 1rem;
}
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }
.alert-error   { background: #fff5f5; border: 1px solid #fca5a5; color: #9b1c1c; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .recipe-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-hero-img { max-height: 320px; }
  .form-grid { grid-template-columns: 1fr; }
  .nutrition-grid { grid-template-columns: repeat(2, 1fr); }
  .ingredient-list { columns: 1; }
}

@media (max-width: 600px) {
  .recipe-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute; top: 60px; left: 0; right: 0;
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    padding: 1rem 1.25rem;
    gap: 1rem;
    z-index: 99;
  }
  .hero { min-height: 0; }
  .hero-content { padding: 1.75rem 0; }
  .hero-content h1 { font-size: 1.4rem; margin-bottom: .5rem; }
  .hero-content p { font-size: .9rem; margin-bottom: 1rem; }
  .hero-search input { padding: .6rem .85rem; font-size: .9rem; }
  .btn-accent { padding: .6rem 1.1rem; font-size: .9rem; }
  .section-header { padding-top: 1.25rem; margin-bottom: .75rem; }
  .meta-row { grid-template-columns: repeat(3, 1fr); }
  .nutrition-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  .site-header,
  .site-footer,
  .filter-bar,
  .action-row,
  .share-row,
  .pagination,
  .hero,
  .badge-video,
  .video-embed,
  .audio-player,
  .btn-accent,
  .btn-outline,
  .btn-outline-accent { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }

  .container { max-width: 100%; padding: 0; }

  .detail-wrap { padding: 0; }

  .detail-hero {
    display: block;
  }

  .detail-hero-img {
    max-height: 260px;
    aspect-ratio: unset;
    page-break-inside: avoid;
  }

  .detail-section {
    border: 1px solid #ccc;
    page-break-inside: avoid;
    margin-bottom: 1rem;
  }

  .ingredient-list { columns: 2; }

  .steps-list li { page-break-inside: avoid; }

  a::after { content: none !important; }

  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 10pt;
    color: #555;
  }
}

.print-header { display: none; }

/* ══════════════════════════════════════════════════════════════
   RECIPE VIDEO-FIRST DETAIL PAGE
   ══════════════════════════════════════════════════════════════ */

/* Lock body scroll on recipe page, hide footer */
/* Hide sticky mini-footer on recipe page */
body.recipe-page .sticky-footer { display: none !important; }

/* Shell — normal flow, no height lock */
.recipe-shell { background: var(--clr-bg); }

/* ── Video pane: sticky below 60px header ── */
.recipe-vid-pane {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: #000;
  display: flex;
  flex-direction: column;
}
.recipe-vid-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.recipe-vid-inner .vid-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.recipe-vid-inner iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
  display: none;
}
.recipe-vid-inner.playing { cursor: default; }
.recipe-vid-inner.playing .vid-thumb { display: none; }
.recipe-vid-inner.playing .recipe-play-btn { display: none; }
.recipe-vid-inner.playing iframe { display: block; }

/* Play button overlay — decorative only, parent handles clicks */
/* Transparent full-area click target — sits on top of the decorative overlay */
.recipe-vid-trigger {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 5;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.recipe-vid-inner.playing .recipe-vid-trigger { display: none; }

.recipe-play-btn {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.38);
  border: none;
  color: #fff;
  gap: .75rem;
  padding: 1.25rem;
  text-align: center;
  pointer-events: none;
  touch-action: none;
}
.recipe-play-circle {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.recipe-play-text strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  line-height: 1.25;
}
.recipe-play-text span {
  display: block;
  font-size: .78rem;
  opacity: .88;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  max-width: 280px;
  line-height: 1.4;
}

/* Desktop meta strip (hidden on mobile) */
/* Metadata strip — visible on both mobile and desktop */
.recipe-vid-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  padding: .75rem 1rem;
  background: #1a1a1a;
  border-top: 1px solid #333;
}
.vid-meta-item { flex: 1; min-width: 80px; }
.vid-meta-label {
  display: block;
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #888;
  margin-bottom: .15rem;
}
.vid-meta-value {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: #f0f0f0;
}

/* ── Content pane: normal flow ── */
.recipe-content-pane { background: var(--clr-bg); }

/* ── Tab bar: sticks below header + video (16:9 = 56.25vw) ── */
.recipe-tabs {
  position: sticky;
  top: calc(60px + 56.25vw);
  z-index: 49;
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.recipe-tabs::-webkit-scrollbar { display: none; }

.recipe-tab {
  flex-shrink: 0;
  padding: .75rem 1rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--clr-muted);
  font-size: .85rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.recipe-tab:hover { color: var(--clr-text); }
.recipe-tab.active {
  color: var(--clr-accent);
  border-bottom-color: var(--clr-accent);
}

/* ── Tab panels ── */
.recipe-panel { display: none; padding: 1.25rem 1rem; }
.recipe-panel.active { display: block; }

/* ── Overview content ── */
.rp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .875rem;
}
.rp-tag {
  border: 1.5px solid var(--clr-accent);
  color: var(--clr-accent);
  border-radius: 999px;
  padding: .2rem .75rem;
  font-size: .78rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.rp-tag:hover { background: var(--clr-accent); color: #fff; }
.rp-tag-id { border-color: var(--clr-border); color: var(--clr-muted); }
.rp-tag-ramadan { border-color: #b45309; color: #92400e; }
.rp-tag-ramadan:hover { background: #b45309; color: #fff; }
.rp-tag-prophet { border-color: #6d28d9; color: #5b21b6; }

.rp-title {
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--clr-text);
  margin-bottom: .625rem;
}
.rp-desc {
  font-size: .925rem;
  line-height: 1.65;
  color: var(--clr-muted);
  margin-bottom: .875rem;
}
.rp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  margin-bottom: 1rem;
}
.rp-stat-box {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: .625rem .75rem;
}
.rp-stat-label {
  display: block;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--clr-muted);
  margin-bottom: .2rem;
}
.rp-stat-val {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  color: var(--clr-text);
}
.rp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding-top: .25rem;
}

/* ── Ingredient & Step lists ── */
.rp-panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--clr-text);
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--clr-accent);
  display: inline-block;
}
.rp-ingredient-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rp-ingredient-list li {
  padding: .6rem 0;
  border-bottom: 1px solid var(--clr-border);
  font-size: .9rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: .625rem;
}
.rp-ingredient-list li::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--clr-accent);
  flex-shrink: 0;
  margin-top: .45em;
}
.rp-ingredient-list li.rp-ingredient-header {
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--clr-muted);
  padding-top: 1rem;
  border-bottom: none;
}
.rp-ingredient-list li.rp-ingredient-header::before { display: none; }
.rp-steps-list li.rp-step-header {
  counter-increment: none;
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--clr-muted);
  padding-top: 1rem;
  border-bottom: none;
}
.rp-steps-list li.rp-step-header::before { display: none; }
.rp-steps-list {
  list-style: none;
  counter-reset: step;
  padding: 0; margin: 0;
}
.rp-steps-list li {
  counter-increment: step;
  display: flex;
  gap: .875rem;
  padding: .875rem 0;
  border-bottom: 1px solid var(--clr-border);
  font-size: .9rem;
  line-height: 1.65;
  align-items: flex-start;
}
.rp-steps-list li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  background: var(--clr-accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font);
  margin-top: .05em;
}
.rp-allergen-heading {
  font-size: .85rem;
  font-weight: 600;
  margin: 1rem 0 .5rem;
}
.rp-nutr-html { font-size: .9rem; color: var(--clr-muted); line-height: 1.7; }

/* ══ DESKTOP SPLIT LAYOUT (768px+) ══════════════════════════ */
@media (min-width: 768px) {
  /* Side-by-side: video left (sticky), content right (normal flow) */
  .recipe-shell {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
  }
  .recipe-vid-pane {
    width: 50%;
    flex-shrink: 0;
    position: sticky;
    top: 60px;
    max-height: calc(100dvh - 60px);
    overflow: hidden;
    background: #111;
  }
  .recipe-vid-inner {
    aspect-ratio: 16 / 9;
    width: 100%;
  }
  /* Desktop meta strip — slightly larger text than mobile */
  .recipe-vid-meta { padding: 1rem 1.25rem; gap: .75rem; }
  .vid-meta-value { font-size: .875rem; }
  .recipe-content-pane {
    flex: 1;
    border-left: 1px solid var(--clr-border);
  }
  /* Tabs stick to top of viewport (body is the scroll container) */
  .recipe-tabs { top: 60px; }
  .recipe-panel { padding: 1.5rem 1.5rem; }
  .rp-title { font-size: clamp(1.4rem, 2.5vw, 2rem); }
}
