/**
 * Single Ingredient Page Styles
 *
 * Mobile-first design following Gourmand design system.
 * Includes FDA-style nutrition facts box with authentic typography.
 *
 * @package Gourmand_Recipes
 * @since 3.13.0
 */


/* ============================================
   INGREDIENT CARD LAYOUT
   ============================================ */

/* Wrapper - uses single-content-wrapper from theme for consistent width */
.gourmand-ingredient-card {
    width: 100%;
    background: var(--color-white);
    padding-bottom: 3rem;
}

/* Ingredient-specific overrides (width handled by theme's single-content-wrapper) */
.gourmand-ingredient-wrapper {
    /* inherits max-width, margin, padding from theme */
}

/* Header - uses shared single-post styles with ingredient-specific overrides */
.gourmand-ingredient-header {
    /* No border - section headings provide visual separation */
}

.gourmand-ingredient-title {
    margin: 0;
}

/* Content Layout - Mobile: single column stacked */
.gourmand-ingredient-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.gourmand-ingredient-image {
    text-align: center;
}

.gourmand-ingredient-image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
}

/* Section Headings (General Description, Reference Product, Alternatives) */
.gourmand-general-description h3,
.gourmand-reference-product h3,
.gourmand-alternatives h3 {
    font-family: var(--font-heading);
    font-size: var(--heading-m);
    font-weight: var(--weight-semibold);
    color: var(--color-heading);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-gray-300);
}

/* Reference Product Section */
.gourmand-reference-product .gourmand-ingredient-image {
    margin-bottom: 0.75rem;
}

.gourmand-reference-name {
    margin: 0 0 0.5rem 0;
    font-family: var(--font-heading);
    font-size: var(--heading-xs);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-heading-normal);
    color: var(--color-heading);
}

.gourmand-reference-name a {
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.gourmand-reference-name a:hover {
    opacity: 0.8;
    text-decoration: none;
}

/* Reference Product Description */
.gourmand-reference-description {
    margin-top: 0.5rem;
}

.gourmand-reference-description p:last-child {
    margin-bottom: 0;
}

/* Alternatives List */
.gourmand-alternatives-list {
    list-style: disc;
    margin: 0;
    padding: 0 0 0 1.25rem;
}

.gourmand-alternative-item {
    padding: 0.375rem 0;
}

.gourmand-alternative-item a {
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.gourmand-alternative-item a:hover {
    opacity: 0.8;
    text-decoration: none;
}

.gourmand-alt-name {
    font-family: var(--font-body);
    font-size: var(--body-l);
    font-weight: var(--weight-semibold);
}

.gourmand-alt-notes {
    display: block;
    font-family: var(--font-body);
    font-size: var(--body-s);
    font-style: italic;
    color: var(--color-gray-600);
    margin-top: 0.125rem;
    padding-left: 0;
}

/* Description uses single-post-content styles from theme */
.gourmand-ingredient-description {
    margin-bottom: 0;
}

/* Nutrition wrapper with disclaimer - centered */
.gourmand-nutrition-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.gourmand-nutrition-disclaimer {
    font-family: var(--font-body);
    font-size: var(--body-s);
    font-style: italic;
    color: var(--color-gray-600);
    margin: 0;
    text-align: center;
}


/* ============================================
   FDA NUTRITION FACTS BOX
   Authentic FDA label styling
   ============================================ */

.gourmand-nutrition-facts {
    width: 100%;
    border: 1px solid var(--color-black);
    padding: 0.25rem;
    font-family: var(--font-fda);
    background: var(--color-white);
}

/* Inner border */
.gourmand-nutrition-facts > * {
    margin-left: 0.25rem;
    margin-right: 0.25rem;
}

/* Header */
.gourmand-nf-header {
    padding-bottom: 0.125rem;
}

.gourmand-nf-title {
    font-family: var(--font-fda);
    font-size: var(--fda-title);
    font-weight: var(--weight-black);
    line-height: 1;
    color: var(--color-black);
    margin: 0;
}

/* Serving Size */
.gourmand-nf-serving {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: var(--fda-serving);
    font-weight: var(--weight-bold);
}

.gourmand-nf-serving-label {
    font-weight: var(--weight-bold);
}

.gourmand-nf-serving-value {
    font-weight: var(--weight-bold);
}

/* Dividers */
.gourmand-nf-divider {
    border-top: 1px solid var(--color-black);
    margin: 0.125rem 0;
}

.gourmand-nf-divider-thick {
    border-top-width: 8px;
    margin: 0.25rem 0;
}

.gourmand-nf-divider-medium {
    border-top-width: 4px;
    margin: 0.25rem 0;
}

/* Calories Row (special styling) */
.gourmand-nf-calories {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.25rem 0;
}

.gourmand-nf-calories-label {
    font-size: var(--fda-calories-label);
    font-weight: var(--weight-bold);
}

.gourmand-nf-calories-value {
    font-size: var(--fda-calories);
    font-weight: var(--weight-black);
}

/* Nutrient Rows */
.gourmand-nf-nutrients {
    font-size: var(--fda-nutrient);
}

.gourmand-nf-row {
    display: flex;
    justify-content: space-between;
    padding: 0.0625rem 0;
    border-top: 1px solid var(--color-gray-400);
}

.gourmand-nf-row:first-child {
    border-top: none;
}

.gourmand-nf-bold .gourmand-nf-label {
    font-weight: var(--weight-bold);
}

.gourmand-nf-indent {
    padding-left: 1rem;
}

.gourmand-nf-indent .gourmand-nf-label {
    font-weight: var(--weight-normal);
}

.gourmand-nf-value {
    font-weight: var(--weight-normal);
}

/* Footnote */
.gourmand-nf-footnote {
    font-size: var(--fda-daily-value);
    padding: 0.25rem 0;
    color: var(--color-gray-700);
}


/* ============================================
   USED IN RECIPES SECTION
   ============================================ */

.gourmand-ingredient-recipes {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-gray-300);
}

.gourmand-ingredient-recipes h2 {
    font-family: var(--font-heading);
    font-size: var(--heading-m);
    font-weight: var(--weight-bold);
    color: var(--color-heading);
    margin: 0 0 1.5rem 0;
}

.gourmand-recipe-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.gourmand-recipe-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--color-gray-50);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gourmand-recipe-card-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.gourmand-recipe-card-link img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.gourmand-recipe-card-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--color-gray-200);
}

.gourmand-recipe-card-title {
    padding: 0.75rem;
    font-family: var(--font-heading);
    font-size: var(--body-s);
    font-weight: var(--weight-medium);
    line-height: var(--leading-body-tight);
}


/* ============================================
   TABLET (768px+)
   Still stacked to work with 720px width
   ============================================ */

@media (min-width: 768px) {
    .gourmand-recipe-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gourmand-nutrition-facts {
        max-width: 380px;
    }
}


/* ============================================
   DESKTOP (1024px+)
   Wider spacing, can discuss multi-column later
   ============================================ */

@media (min-width: 1024px) {
    .gourmand-ingredient-content {
        gap: 2rem;
        margin-top: 2rem;
    }

    .gourmand-recipe-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
