/* Local Fonts */
@font-face { font-family: 'PT Serif'; font-weight: 400; font-style: normal; font-display: optional; src: url('../fonts/pt-serif-regular.woff2') format('woff2'), url('../fonts/pt-serif-regular.ttf') format('truetype'); }
@font-face { font-family: 'PT Serif'; font-weight: 700; font-style: normal; font-display: optional; src: url('../fonts/pt-serif-bold.woff2') format('woff2'), url('../fonts/pt-serif-bold.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: optional; src: url('../fonts/inter-400.woff2') format('woff2'), url('../fonts/inter-400.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: optional; src: url('../fonts/inter-500.woff2') format('woff2'), url('../fonts/inter-500.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: optional; src: url('../fonts/inter-600.woff2') format('woff2'), url('../fonts/inter-600.ttf') format('truetype'); }

:root {
  --primary: #c0392b;
  --primary-light: #e74c3c;
  --primary-dark: #962d22;
  --accent: #e67e22;
  --accent-light: #f39c12;
  --warm: #f5e6d3;
  --warm-light: #fdf6ee;
  --warm-dark: #d4a574;
  --text: #2c1810;
  --text-light: #6b5345;
  --text-muted: #7a6b61;
  --bg: #fefcfa;
  --card-bg: #ffffff;
  --border: #eee0d5;
  --shadow: 0 2px 16px rgba(44,24,16,0.08);
  --shadow-lg: 0 8px 32px rgba(44,24,16,0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
  --max-w: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4 { font-family: 'PT Serif', serif; line-height: 1.25; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* ── Header ── */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--accent) 100%);
  padding: 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-w); margin: 0 auto; padding: 12px 20px;
}
.site-logo {
  font-family: 'PT Serif', serif;
  font-size: 1.3rem; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 10px;
}
.site-logo img { height: 80px; width: auto; display: block; }
.site-logo:hover { color: var(--warm); }

.nav-links { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav-links a {
  color: rgba(255,255,255,0.9); padding: 8px 14px;
  border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500;
  transition: all var(--transition);
}
.nav-links a:hover { background: rgba(255,255,255,0.15); color: #fff; }

.search-form { display: flex; align-items: center; gap: 8px; }
.search-form .icon { color: rgba(255,255,255,0.6); flex-shrink: 0; }
.search-form input {
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; padding: 8px 16px; border-radius: 25px;
  font-size: 0.85rem; width: 180px; outline: none;
  transition: all var(--transition);
}
.search-form input::placeholder { color: rgba(255,255,255,0.6); }
.search-form input:focus { background: rgba(255,255,255,0.25); width: 220px; border-color: rgba(255,255,255,0.4); }

/* Mobile toggle */
.mobile-toggle {
  display: none; background: none; border: none; color: #fff;
  cursor: pointer; padding: 6px; border-radius: 6px;
}
.mobile-toggle:hover { background: rgba(255,255,255,0.15); }

/* Desktop: collapse is always visible inline */
.header-collapse { display: contents; }

@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; }
  .mobile-toggle { display: flex; align-items: center; }
  .header-collapse {
    display: none; width: 100%;
    flex-direction: column; gap: 12px;
    padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: 12px;
  }
  .header-collapse.open { display: flex; }
  .nav-links { flex-direction: column; gap: 2px; width: 100%; }
  .nav-links a { padding: 10px 14px; border-radius: 8px; }
  .search-form { width: 100%; }
  .search-form input { width: 100%; flex: 1; }
}

/* ── Hero ── */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden;
  margin-bottom: 40px; min-height: 400px;
  display: flex; align-items: flex-end;
}
.hero picture { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: relative; z-index: 1; width: 100%;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  padding: 60px 40px 40px;
}
.hero-badge {
  display: inline-block; background: #a05a12;
  color: #fff; padding: 4px 14px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 12px;
}
.hero h1 { color: #fff; font-size: 2.2rem; margin-bottom: 8px; }
.hero p { color: rgba(255,255,255,0.85); font-size: 0.95rem; max-width: 600px; }
.hero-meta { display: flex; gap: 20px; margin-top: 16px; }
.hero-meta span { color: rgba(255,255,255,0.8); font-size: 0.85rem; display: flex; align-items: center; gap: 6px; }

/* ── Section Headings ── */
.section-title {
  font-size: 1.6rem; margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px;
}
.section-title::after {
  content: ''; flex: 1; height: 2px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ── Recipe Card Grid ── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px; margin-bottom: 40px;
}

/* ── Ads ── */
.ad-slot {
  display: flex; justify-content: center; align-items: center;
  margin: 24px 0;
}
.ad-slot:empty, .ad-slot:has(div:empty) { display: none; }

.recipe-card {
  background: var(--card-bg); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: all var(--transition); cursor: pointer;
  display: flex; flex-direction: column;
}
.recipe-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.recipe-card a { color: inherit; }

.card-image {
  position: relative; overflow: hidden;
  aspect-ratio: 4/3;
}
.card-image picture { display: block; width: 100%; height: 100%; }
.card-image img, .card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.recipe-card:hover .card-image img { transform: scale(1.08); }

.card-category {
  position: absolute; top: 12px; left: 12px;
  background: var(--primary); color: #fff;
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.3px;
}
.card-time {
  position: absolute; bottom: 12px; right: 12px;
  background: rgba(0,0,0,0.65); color: #fff;
  padding: 4px 10px; border-radius: 15px;
  font-size: 0.75rem; display: flex; align-items: center; gap: 4px;
  backdrop-filter: blur(4px);
}

.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 {
  font-size: 1.1rem; margin-bottom: 8px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-excerpt {
  color: var(--text-light); font-size: 0.85rem; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 12px; flex: 1;
}
.card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-muted);
}
.card-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  background: var(--warm); color: var(--text-light);
  padding: 3px 10px; border-radius: 12px; font-size: 0.72rem; font-weight: 500;
  display: flex; align-items: center; gap: 4px;
}

/* ── Recipe Detail ── */
.recipe-hero {
  position: relative; border-radius: var(--radius); overflow: hidden;
  margin-bottom: 32px;
}
.recipe-hero picture { display: block; cursor: zoom-in; }
.recipe-hero img, .recipe-hero-img {
  width: 100%; height: 500px; display: block;
  object-fit: cover;
}
.hero-zoom-hint {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  background: rgba(0,0,0,0.5); color: #fff;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.recipe-hero:hover .hero-zoom-hint { opacity: 1; }
.recipe-hero-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 80px 40px 32px;
}
.recipe-hero-overlay h1 { color: #fff; font-size: 2.4rem; margin-bottom: 8px; }
.recipe-hero-overlay .meta { color: rgba(255,255,255,0.75); font-size: 0.9rem; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.recipe-info-bar {
  display: flex; gap: 0; justify-content: center; flex-wrap: wrap;
  margin-bottom: 36px; background: var(--card-bg);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.info-item {
  flex: 1; min-width: 140px; padding: 20px 16px;
  text-align: center; border-right: 1px solid var(--border);
  transition: background var(--transition);
}
.info-item:last-child { border-right: none; }
.info-item:hover { background: var(--warm-light); }
.info-item .icon { font-size: 1.5rem; margin-bottom: 4px; }
.info-item .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; }
.info-item .value { font-size: 1.15rem; font-weight: 600; color: var(--text); font-family: 'PT Serif', serif; }
.info-item .value-sm { font-size: 0.85rem; }

.recipe-content-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 40px; margin-bottom: 48px;
}

/* Recipe Gallery */
.recipe-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.recipe-gallery picture, .recipe-gallery img {
  width: 100%; height: auto; border-radius: var(--radius);
  cursor: pointer; transition: transform .2s, box-shadow .2s;
  display: block;
}
.recipe-gallery picture:hover img, .recipe-gallery img:hover {
  transform: scale(1.02); box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
@media (min-width: 768px) {
  .recipe-gallery { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

/* Ingredients Sidebar */
.ingredients-card {
  background: var(--warm-light); border-radius: var(--radius);
  padding: 28px; position: sticky; top: 80px; align-self: start;
  border: 1px solid var(--border);
}
.ingredients-card h2 {
  font-size: 1.25rem; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.ingredient-list { list-style: none; }
.ingredient-list li {
  padding: 10px 0; border-bottom: 1px dashed rgba(0,0,0,0.08);
  display: flex; align-items: center; gap: 12px;
  font-size: 0.92rem; cursor: pointer;
  transition: opacity var(--transition);
}
.ingredient-list li:last-child { border-bottom: none; }
.ingredient-list li.checked { opacity: 0.4; text-decoration: line-through; }
.ingredient-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--warm-dark); background: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all var(--transition);
}
.ingredient-list li.checked .ingredient-check {
  background: var(--primary); border-color: var(--primary);
  color: #fff;
}
.ingredient-name { flex: 1; }

/* Buy Button */
.buy-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 6px; padding: 4px 10px; font-size: 0.75rem;
  font-weight: 600; cursor: pointer; text-decoration: none;
  white-space: nowrap; transition: all .2s;
  flex-shrink: 0; line-height: 1.4;
}
.buy-btn:hover { background: #d35400; color: #fff; transform: scale(1.05); box-shadow: 0 2px 8px rgba(211,84,0,.35); }
.buy-btn svg { flex-shrink: 0; }

/* Ad Slots */
.ad-slot, .promo-unit { display: flex; justify-content: center; margin: 24px auto; box-sizing: border-box; max-width: 100%; overflow: hidden; }
.ad-slot > div, .promo-unit > div { max-width: 100% !important; overflow: hidden; }
.ad-slot iframe, .ad-slot img, .promo-unit iframe, .promo-unit img { max-width: 100%; }
.ad-slot:empty, .promo-unit:empty { display: none; }

/* Gladen Dropdown */
.gladen-dropdown {
  position: absolute; z-index: 1000; width: 300px;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.25);
  overflow: hidden;
}
.gladen-dropdown-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: rgba(0,0,0,.15);
  font-size: .8rem; color: #94a3b8; font-weight: 600;
}
.gladen-results { max-height: 280px; overflow-y: auto; }
.gladen-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border); font-size: .85rem;
  transition: background .15s;
}
.gladen-item:hover { background: rgba(255,255,255,.05); }
.gladen-item:last-child { border-bottom: none; }
.gladen-item img {
  width: 40px; height: 40px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0;
}
.gladen-item span { flex: 1; line-height: 1.3; }

/* Instructions */
.instructions-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 36px; box-shadow: var(--shadow);
}
.instructions-card h2 { font-size: 1.4rem; margin-bottom: 24px; }
.instructions-card .content { font-size: 1rem; line-height: 1.85; color: var(--text); }
.instructions-card .content p { margin-bottom: 16px; }
.instructions-card .content ul, .instructions-card .content ol {
  margin: 16px 0; padding-left: 24px;
}
.instructions-card .content li { margin-bottom: 8px; }

/* Recipe Gallery */
.recipe-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin: 28px 0; border-radius: var(--radius-sm); overflow: hidden;
}
.recipe-gallery img {
  width: 100%; height: 320px; object-fit: cover;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: transform var(--transition);
}
.recipe-gallery img:hover { transform: scale(1.03); }

/* Tags */
.recipe-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.recipe-tags a {
  background: var(--warm); color: var(--text-light);
  padding: 6px 14px; border-radius: 20px; font-size: 0.8rem;
  transition: all var(--transition);
}
.recipe-tags a:hover { background: var(--primary); color: #fff; }

/* Comments */
.comments-section {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow); margin-bottom: 40px;
}
.comments-section h2 { font-size: 1.3rem; margin-bottom: 24px; }
.comment {
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-author { font-weight: 600; color: var(--primary); font-size: 0.95rem; }
.comment-date { color: var(--text-muted); font-size: 0.8rem; margin-left: 12px; }
.comment-text { margin-top: 8px; color: var(--text-light); font-size: 0.92rem; line-height: 1.65; }

/* Related */
.related-section { margin-bottom: 48px; }

/* ── Category/Tag Page Header ── */
.page-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  border-radius: var(--radius); padding: 40px;
  margin-bottom: 32px; color: #fff;
}
.page-header h1 { font-size: 2rem; margin-bottom: 4px; }
.page-header p { opacity: 0.8; font-size: 0.95rem; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 32px 0; }
.pagination a, .pagination span {
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500;
  transition: all var(--transition);
}
.pagination a { background: var(--card-bg); color: var(--text); box-shadow: var(--shadow); }
.pagination a:hover { background: var(--primary); color: #fff; }
.pagination .active { background: var(--primary); color: #fff; }

/* ── Category Pills Bar ── */
.category-bar {
  display: flex; gap: 8px; margin-bottom: 32px;
  overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: thin;
}
.category-bar a {
  white-space: nowrap; padding: 10px 20px; border-radius: 25px;
  background: var(--card-bg); color: var(--text);
  font-size: 0.85rem; font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all var(--transition);
}
.category-bar a:hover, .category-bar a.active {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 12px rgba(192,57,43,0.3);
}

/* ── Footer ── */
.site-footer {
  background: var(--text); color: rgba(255,255,255,0.7);
  padding: 40px 0; margin-top: 60px; text-align: center;
  font-size: 0.85rem;
}
.site-footer a { color: var(--accent-light); text-decoration: underline; text-underline-offset: 2px; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* ── Print ── */
.print-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  background: var(--warm); color: var(--text);
  border: none; cursor: pointer; font-size: 0.85rem; font-weight: 500;
  transition: all var(--transition); margin-top: 20px;
}
.print-btn:hover { background: var(--primary); color: #fff; }

@media print {
  .site-header, .site-footer, .nav-links, .search-form,
  .related-section, .comments-section, .print-btn, .category-bar,
  .recipe-tags { display: none !important; }
  .recipe-content-grid { grid-template-columns: 1fr; }
  .ingredients-card { position: static; }
  body { font-size: 12pt; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .recipe-content-grid { grid-template-columns: 1fr; }
  .ingredients-card { position: static; }
}
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .nav-links { order: 3; width: 100%; justify-content: center; }
  .search-form { order: 2; }
  .search-form input { width: 140px; }
  .hero h1 { font-size: 1.6rem; }
  .hero-overlay { padding: 40px 20px 24px; }
  .site-logo img { height: 48px; }
  .recipe-hero img { height: 300px; }
  .recipe-hero-overlay h1 { font-size: 1.6rem; }
  .recipe-hero-overlay { padding: 40px 20px 20px; }
  .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
  .info-item { min-width: 100px; padding: 14px 10px; }
  .instructions-card { padding: 24px; }
  .page-header { padding: 28px 20px; }
  .page-header h1 { font-size: 1.5rem; }
  .recipe-content-grid { grid-template-columns: 1fr; gap: 24px; }
  .ingredients-card { position: static; }
}
@media (max-width: 480px) {
  .recipe-grid { grid-template-columns: 1fr; }
  .recipe-info-bar {
    display: grid; grid-template-columns: repeat(3, 1fr);
  }
  .info-item {
    min-width: 0; padding: 10px 6px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .info-item:nth-child(3n) { border-right: none; }
  .info-item:last-child { border-right: none; }
  .info-item .icon svg { width: 18px; height: 18px; }
  .info-item .label { font-size: 0.6rem; }
  .info-item .value { font-size: 0.95rem; }
  .recipe-gallery { grid-template-columns: 1fr; }
}

/* ── Lightbox Modal ── */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.active { opacity: 1; pointer-events: all; }
.lightbox-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
}
.lightbox-content {
  position: relative; z-index: 1;
  max-width: 90vw; max-height: 85vh;
  display: flex; flex-direction: column; align-items: center;
}
.lightbox-content img {
  max-width: 90vw; max-height: 80vh;
  object-fit: contain; border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transition: opacity 0.15s ease;
}
.lightbox-counter {
  color: rgba(255,255,255,0.7); font-size: 0.85rem;
  margin-top: 12px; font-family: 'Inter', sans-serif;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute; z-index: 2;
  background: rgba(255,255,255,0.1); border: none;
  color: #fff; cursor: pointer;
  border-radius: 50%; width: 48px; height: 48px;
  font-size: 1.6rem; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.1);
}
.lightbox-close { top: 20px; right: 20px; font-size: 2rem; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.1); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.1); }
