/* Recipe Detail Page Styles - Modern Editorial Design */

/* ============================================
   LAYOUT & CONTAINER
   ============================================ */

/* We override the default container behavior for this page */
.recipe-detail-wrapper {
    background-color: var(--paper);
    min-height: 100vh;
    padding-bottom: 4rem;
}

/* Ensure the hero can be full width while body is contained */
.recipe-body-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--s-4);
    position: relative;
    z-index: 10;
}

/* ============================================
   HERO SECTION (Contained)
   ============================================ */

.recipe-hero {
    max-width: 1200px;
    margin: 2rem auto 0;
    background-color: var(--paper-bright);
    border: 1px solid var(--line);
    border-radius: var(--r-3);
    overflow: hidden;
    box-shadow: var(--shadow-1);
}

/* Two-column hero layout for desktop */
.recipe-hero-inner {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* Content slightly wider than image */
    min-height: 450px;
}

/* Left: Content */
.hero-content {
    padding: 3rem var(--s-6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* Right: Image */
.hero-image-wrapper {
    position: relative;
    height: 100%;
    min-height: 400px;
    background-color: var(--gray-2);
    overflow: hidden;
    border-left: 1px solid var(--line);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 10s ease; /* Subtle zoom effect */
}

.hero-image-wrapper:hover .hero-image {
    transform: scale(1.05);
}

/* Typography in Hero */
.hero-meta-top {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--ink);
    font-weight: 700;
}

.hero-description {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--ink-2);
    margin-bottom: 2rem;
    max-width: 50ch;
}

.hero-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--ink);
    font-weight: 500;
}

.hero-author-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--sage-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    text-transform: uppercase;
}

.hero-verification {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--gray-5);
}

.hero-verification-indented {
    margin-left: 3.25rem;
}

.hero-quick-metrics {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.hero-quick-metrics-indented {
    margin-left: 3.25rem;
}

.hero-quick-metric {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--r-2);
    background: var(--paper);
    min-width: 6.75rem;
}

.hero-quick-metric--full {
    flex: 1 1 100%;
    min-width: 0;
}

.hero-quick-metric--chips {
    gap: 0.4rem;
    width: fit-content;
    max-width: 100%;
}

.hero-quick-metrics-break {
    flex-basis: 100%;
    height: 0;
}

.hero-dietary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hero-dietary-chip {
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.hero-quick-metric-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-5);
    font-weight: 700;
}

.hero-quick-metric-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    font-feature-settings: "tnum";
    white-space: nowrap;
}

.hero-verification-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--gray-5);
}

.hero-verification-value {
    font-weight: 600;
    color: var(--ink);
}

.hero-verification-meta {
    color: var(--gray-5);
}

.verification-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
    line-height: 1.2;
}

.verification-pill--unverified {
    color: #8b2f2f;
    background: #fff5f5;
    border-color: #e1a3a3;
}

.verification-pill--approximated {
    color: #7a5a00;
    background: #fffbea;
    border-color: #f6e05e;
}

.verification-pill--verified {
    color: #16612f;
    background: #f0fff4;
    border-color: #8ba888;
}

/* Back Link (Absolute in top left) */
.hero-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-5);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.2s ease;
}

.hero-back-link:hover {
    color: var(--sage-green);
}

/* ============================================
   STICKY META BAR
   ============================================ */

.recipe-meta-bar {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    border-top: none;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0;
    box-shadow: var(--shadow-1);
    border-bottom-left-radius: var(--r-2);
    border-bottom-right-radius: var(--r-2);
    transition: transform 0.3s ease;
}

.meta-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--s-4);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.meta-bar-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

.meta-bar-secondary {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--line-faint);
    width: 100%;
}
.meta-bar-secondary-stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.meta-bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.meta-stats {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.meta-stat-item {
    display: flex;
    flex-direction: column;
}

.meta-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-5);
    font-weight: 600;
}

.meta-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
    font-feature-settings: "tnum";
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-stat-icon {
    width: 1rem;
    height: 1rem;
    color: var(--sage-green);
    opacity: 0.8;
}

.meta-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dev-tools-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.meta-action-icon {
    width: 1rem;
    height: 1rem;
    margin-right: 0.25rem;
}

.is-disabled-link {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-icon-circle {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-2);
    transition: all 0.2s ease;
}

.btn-icon-circle:hover {
    background: var(--gray-1);
    color: var(--sage-green);
    border-color: var(--sage-green);
}

/* Dropdown menu for overflow actions */
.action-dropdown {
    position: relative;
}

.action-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--paper-bright);
    border: 1px solid var(--line);
    border-radius: var(--r-2);
    box-shadow: var(--shadow-2);
    min-width: 160px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.action-dropdown[data-open="true"] .action-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.action-dropdown-menu a,
.action-dropdown-menu button {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    color: var(--ink);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
}

.action-dropdown-menu a:hover,
.action-dropdown-menu button:hover {
    background: var(--gray-1);
}

/* ============================================
   MAIN CONTENT GRID
   ============================================ */

.recipe-content-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 4rem;
    margin-top: 3rem;
    align-items: start;
}

/* Sidebar (Ingredients) */
.recipe-sidebar {
    position: sticky;
    top: 6rem; /* Space for meta bar + padding */
}

.ingredients-card {
    background: var(--paper-bright);
    padding: 2rem;
    border-radius: var(--r-3);
    box-shadow: var(--shadow-1);
    border: 1px solid var(--line-faint);
}

.ingredients-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--sage-green);
}

.ingredients-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--ink);
}

.ingredients-header-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--sage-green);
}

/* Ingredient List */
.modern-ing-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.modern-ing-item {
    display: grid;
    grid-template-columns: minmax(3rem, auto) 1fr;
    gap: 0.75rem;
    align-items: baseline;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line-faint);
}

.modern-ing-item:last-child {
    border-bottom: none;
}

.modern-ing-qty {
    text-align: right;
    font-weight: 700;
    color: var(--sage-green);
    font-feature-settings: "tnum";
    white-space: nowrap;
}

.modern-ing-name {
    color: var(--ink);
}

.modern-ing-note {
    font-size: 0.85rem;
    color: var(--gray-5);
    font-style: italic;
}

/* Dietary Tags */
.dietary-tags {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Main (Directions) */
.directions-wrapper {
    background: var(--paper-bright);
    padding: 3rem;
    border-radius: var(--r-3);
    box-shadow: var(--shadow-1);
    border: 1px solid var(--line-faint);
}

.directions-header {
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.directions-header h2 {
    font-size: 2rem;
    margin: 0;
}

.directions-header-icon {
    width: 2rem;
    height: 2rem;
    color: var(--sage-green);
}

.modern-dir-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.modern-dir-item {
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 1.5rem;
}

.step-number {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    color: rgba(85, 107, 47, 0.15); /* Faded sage */
    line-height: 0.8;
    text-align: right;
    user-select: none;
}

.step-content {
    padding-top: 0.25rem;
}

.step-content p {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--ink);
    margin-bottom: 0;
}

/* Direction chips (read-only view) */
.directions-wrapper .dir-chip {
    cursor: default;
}

.step-title {
    display: block;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--ink);
    font-family: var(--font-serif);
}

/* ============================================
   METADATA ACCORDION & FOOTER
   ============================================ */

.recipe-footer-meta {
    margin-top: 4rem;
    padding-top: 2rem;
}

.metadata-accordion {
    background: var(--paper-bright);
    border: 1px solid var(--line);
    border-radius: var(--r-2);
    overflow: hidden;
}

.metadata-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink-2);
    text-align: left;
    transition: background 0.15s ease;
}

.metadata-accordion-header:hover {
    background: var(--gray-1);
}

.metadata-accordion-icon {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.2s ease;
}

.metadata-accordion[data-open="true"] .metadata-accordion-icon {
    transform: rotate(180deg);
}

.metadata-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.metadata-accordion[data-open="true"] .metadata-accordion-content {
    max-height: 800px;
}

.metadata-accordion-body {
    padding: 0 1.5rem 1.5rem;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    font-size: 0.9rem;
}

.meta-grid-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-grid-item .text-muted {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-4);
}

/* Developer tools */
.dev-tools-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.dev-tools-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .recipe-hero-inner {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .hero-image-wrapper {
        min-height: 300px;
        order: -1; /* Image on top mobile */
    }

    .hero-content {
        padding: 2rem var(--s-4);
    }

    .hero-quick-metric {
        min-width: 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .recipe-content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .recipe-sidebar {
        position: static;
        width: 100%;
    }

    .ingredients-card, .directions-wrapper {
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
    .meta-bar-inner {
        overflow-x: auto;
        padding-bottom: 0.5rem;
        justify-content: flex-start;
        gap: 1.5rem;
    }
    
    .meta-stats {
        flex-shrink: 0;
    }
    
    .meta-actions {
        display: none; /* Hide primary actions on very small screens or move them */
    }

    .modern-dir-item {
        grid-template-columns: 1fr; /* Stack number and text */
        gap: 0.5rem;
    }

    .step-number {
        text-align: left;
        font-size: 1.5rem;
        color: var(--sage-green);
        opacity: 1;
    }
}

/* Print Styles Override */
@media print {
    .recipe-hero-inner {
        display: block;
    }
    .hero-image-wrapper {
        height: 300px;
        margin-bottom: 2rem;
    }
    .recipe-meta-bar {
        position: static;
        border: 1px solid #ccc;
        box-shadow: none;
    }
    .recipe-content-grid {
        display: block;
    }
    .recipe-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
    .ingredients-card, .directions-wrapper {
        border: none;
        box-shadow: none;
        padding: 0;
    }
    .step-number {
        color: var(--ink);
        border: 1px solid #ccc;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        text-align: center;
        font-size: 1rem;
        line-height: 30px;
    }
    .btn, .action-dropdown, .hero-back-link, .dev-tools-section, .navbar {
        display: none !important;
    }
}

/* ==========================================================================
   SEASONAL MONTHS — detail page
   ========================================================================== */
.hero-seasonal-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-sage, rgba(74,124,89,0.12));
  color: var(--accent, #4a7c59);
  font-weight: 600;
}
.seasonal-months-row { grid-column: 1 / -1; }
.seasonal-months-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.seasonal-month-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.month-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-sage, rgba(74,124,89,0.12));
  color: var(--accent, #4a7c59);
  font-weight: 600;
}
.btn-edit-inline {
  background: none;
  border: none;
  padding: 0.2rem;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.btn-edit-inline:hover { opacity: 1; color: var(--accent, #4a7c59); }
.seasonal-months-editor { margin-top: 0.5rem; }
.month-picker-grid--detail {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.month-pick-btn {
  padding: 0.25rem 0;
  font-size: 0.72rem;
  font-weight: 500;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.month-pick-btn:hover {
  background: var(--surface-2, #f5f5f5);
  color: var(--text);
  border-color: var(--accent, #4a7c59);
}
.month-pick-btn--on {
  background: var(--accent, #4a7c59);
  color: #fff;
  border-color: var(--accent, #4a7c59);
}
.seasonal-months-editor-actions { display: flex; gap: 0.5rem; align-items: center; }
