/* =====================================================
   FORKIFY — pages.css
   Page-specific styles:
     • index.html  → Hero, Search, Grid, Cards
     • recipe.html → Detail hero, Stats bar, Body, Ingredients
   ===================================================== */

/* =====================================================
   PAGE: INDEX — Hero
   ===================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 50% 0%,
      rgba(232, 160, 69, 0.12) 0%,
      transparent 65%
    ),
    radial-gradient(
      ellipse at 80% 80%,
      rgba(192, 57, 43, 0.08) 0%,
      transparent 60%
    );
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}
.hero-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(48px, 8vw, 90px);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.8s 0.4s forwards;
}
.hero-title span {
  color: var(--accent);
}
.hero-desc {
  font-size: 17px;
  color: var(--muted);
  max-width: 500px;
  line-height: 1.7;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s forwards;
}

/* ── Search Bar ── */
.search-wrap {
  width: 100%;
  max-width: 560px;
  position: relative;
  opacity: 0;
  animation: fadeUp 0.8s 0.8s forwards;
}
.search-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 18px 24px 18px 60px;
  border-radius: 18px;
  font-size: 16px;
  font-family: "DM Sans", sans-serif;
  outline: none;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}
.search-input::placeholder {
  color: var(--muted);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 160, 69, 0.12);
}
.search-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    transform 0.2s;
}
.search-btn:hover {
  background: #d4922e;
  transform: translateY(-50%) scale(1.08);
}

/* ── Results Section ── */
#results-section {
  padding-top: 40px;
}

.section-heading {
  font-family: "Playfair Display", serif;
  font-size: 28px;
  font-weight: 700;
  padding: 0 32px 24px;
}
.section-heading em {
  color: var(--accent);
  font-style: normal;
}

/* ── Recipe Grid ── */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
  padding: 0 32px 60px;
}

/* ── Recipe Card ── */
.recipe-card {
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #222;
  display: block;
  color: var(--text);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  animation: fadeIn 0.5s both;
}
.recipe-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
}
.recipe-card:hover .card-img {
  transform: scale(1.06);
}

.card-img-wrap {
  height: 200px;
  overflow: hidden;
  position: relative;
}
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
  font-weight: 700;
  text-transform: uppercase;
}
.card-body {
  padding: 18px 20px 20px;
}
.card-title {
  font-family: "Playfair Display", serif;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  overflow: hidden;
}
.card-publisher {
  font-size: 12px;
  color: var(--muted);
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.card-cta {
  font-size: 11px;
  background: rgba(232, 160, 69, 0.12);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 20px;
}
.card-arrow {
  color: var(--muted);
  font-size: 18px;
}

/* =====================================================
   PAGE: RECIPE DETAIL — Back Button
   ===================================================== */
#back-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 300;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 20px;
  border-radius: 16px;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition:
    background 0.2s,
    border-color 0.2s;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
#back-btn:hover {
  background: #222;
  border-color: var(--accent);
}

/* ── Spinner ── */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  gap: 16px;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid #222;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.loading-text {
  color: var(--muted);
  font-size: 15px;
}

/* ── Hero Image ── */
.recipe-hero {
  height: 60vh;
  min-height: 380px;
  position: relative;
  overflow: hidden;
}
.recipe-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 8s ease;
  display: block;
}
.recipe-hero:hover img {
  transform: scale(1.04);
}
.recipe-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(13, 13, 13, 0.97) 0%,
    rgba(13, 13, 13, 0.35) 55%,
    transparent 100%
  );
}
.recipe-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 48px;
}
.recipe-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.recipe-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(26px, 5vw, 52px);
  font-weight: 900;
  line-height: 1.1;
  max-width: 720px;
}
.recipe-publisher {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

/* ── Stats Bar ── */
.stats-bar {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.stat {
  flex: 1;
  min-width: 120px;
  padding: 24px 20px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child {
  border-right: none;
}
.stat-icon {
  font-size: 20px;
  margin-bottom: 6px;
  color: var(--muted);
}
.stat-value {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* ── Recipe Body ── */
.recipe-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 48px 80px;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 60px;
}

/* ── Section Label ── */
.section-label {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Ingredients List ── */
.ingredients-list {
  list-style: none;
}
.ingredient-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #1e1e1e;
}
.ing-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px;
  flex-shrink: 0;
}
.ing-qty {
  color: var(--accent);
  font-weight: 700;
  min-width: 46px;
  font-size: 15px;
}
.ing-unit {
  color: var(--muted);
  font-size: 13px;
  margin-right: 4px;
}
.ing-desc {
  font-size: 15px;
  line-height: 1.5;
}

/* ── Instructions Side ── */
.instruction-note {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 20px 24px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 24px;
}
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  padding: 16px 28px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.source-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(232, 160, 69, 0.3);
}

/* ── Error State ── */
.error-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 40px;
}
.error-icon {
  font-size: 44px;
  margin-bottom: 16px;
  color: var(--muted);
}
.error-title {
  font-family: "Playfair Display", serif;
  font-size: 26px;
  margin-bottom: 8px;
}
.error-desc {
  color: var(--muted);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  .recipe-body {
    grid-template-columns: 1fr;
    padding: 32px 24px 60px;
    gap: 40px;
  }
  .recipe-hero-content {
    padding: 24px;
  }
  .recipe-grid {
    padding: 0 16px 40px;
    gap: 16px;
  }
  .section-heading {
    padding: 0 16px 16px;
  }
}
