/* ============================================================
   Radatz Rezeptplattform – Detailseite
   ============================================================ */

/* ---- Page Layout ----------------------------------------- */
.detail-layout {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}
@media (min-width: 768px) { .detail-layout { padding: 2rem 1.5rem 3rem; } }

/* ---- Recipe Header --------------------------------------- */
.recipe-header {
    background: #fff;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border-light);
    padding: 1.25rem 1.5rem 1rem;
    margin-bottom: 1.25rem;
}
.recipe-header__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.recipe-header__dept {
    font-style: italic;
    font-size: 1.1rem;
    color: var(--color-text-muted);
    line-height: 1;
}
.recipe-header__dept span {
    font-style: normal;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-primary);
    display: block;
    line-height: 1;
}
.recipe-header__logo {
    flex-shrink: 0;
    width: 90px;
    opacity: 0.85;
}
.recipe-header__meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    align-items: center;
    border-top: 2px dashed var(--color-border-light);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}
.recipe-header__plu {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--color-primary-dark);
    color: #fff;
    padding: 0.15rem 0.6rem;
    border-radius: 3px;
    letter-spacing: 0.04em;
    line-height: 1.4;
    flex-shrink: 0;
    font-size: small;
}
.recipe-header__title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    flex: 1;
    line-height: 1.2;
}
.recipe-header__info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-style: normal;
    border-top: 1px solid var(--color-border-light);
    padding-top: 0.6rem;
    margin-top: 0.5rem;
}
.recipe-header__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

/* ---- Action Bar ------------------------------------------ */
.recipe-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

/* ---- Photos Gallery ------------------------------------- */
.recipe-photos {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.recipe-photos__item {
    flex: 1;
    min-width: 200px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
}
.recipe-photos__item img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}
@media (max-width: 480px) { .recipe-photos__item { min-width: 100%; } }

/* ---- Portion Calculator ---------------------------------- */
.portion-calc {
    background: var(--color-primary-light);
    border: 1px solid var(--color-warning-border);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.portion-calc__label { font-size: 0.875rem; font-weight: 500; }
.portion-calc__controls { display: flex; align-items: center; gap: 0.25rem; }
.portion-btn {
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--border-radius);
    background: #fff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
    line-height: 1;
}
.portion-btn:hover { background: var(--color-bg-alt); }
#portion-input {
    width: 64px;
    text-align: center;
    padding: 0.25rem 0.4rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--border-radius);
    font: inherit;
    font-size: 0.9rem;
}
#portion-input:focus { outline: none; border-color: var(--color-primary); }
.portion-calc__base {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-style: italic;
    flex-basis: 100%;
}
@media (min-width: 480px) { .portion-calc__base { flex-basis: auto; } }
#portion-reset {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: var(--color-primary);
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}
#portion-reset:hover { text-decoration: underline; }

/* ---- Ingredients Table ----------------------------------- */
.section--ingredients .section__body { padding: 0; }
.ingredient-table {
    width: 100%;
    font-size: 0.875rem;
}
.ingredient-table thead th {
    background: var(--color-bg-alt);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-border-light);
    white-space: nowrap;
}
.ingredient-table tbody td {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: top;
}
.ingredient-table tbody tr:last-child td { border-bottom: none; }
.ingredient-table tbody tr:nth-child(even) td { background: var(--color-bg-alt); }
.ingredient-table .col-plu { width: 60px; color: var(--color-text-muted); font-size: 0.8rem; }
.ingredient-table .col-menge { width: 80px; text-align: right; font-weight: 500; }
.ingredient-table .col-allergen { width: 70px; font-size: 0.75rem; color: var(--color-primary); font-weight: 500; }
.ingredient-menge { transition: background 0.4s ease; }
.ingredient-menge--flash { background: #fff9c4 !important; }

/* ---- Recipe Content Sections ----------------------------- */
.recipe-section {
    background: #fff;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border-light);
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.recipe-section__header {
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-bg-alt);
}
.recipe-section__title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text);
}
.recipe-section__body { padding: 1.25rem; }

/* ---- Warning Block (ACHTUNG) ----------------------------- */
.step-warning {
    background: var(--color-warning-bg);
    border: 1.5px solid var(--color-warning-border);
    border-radius: var(--border-radius);
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}
.step-warning__label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

/* ---- Production Steps ------------------------------------ */
.steps-list { display: flex; flex-direction: column; gap: 1.25rem; }
.step-item { display: flex; gap: 1rem; }
.step-item__number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    margin-top: 0.1rem;
}
.step-item__content { flex: 1; }
.step-item__title { font-weight: 700; margin-bottom: 0.25rem; }
.step-item__text {
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
}
.step-item__media {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}
.step-item__photo {
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--color-border-light);
    max-width: 220px;
}
.step-item__photo img { width: 100%; display: block; }
.step-item__photo figcaption { font-size: 0.75rem; color: var(--color-text-muted); padding: 0.3rem 0.5rem; font-style: italic; background: var(--color-bg-alt); }
.step-item__video { max-width: 320px; }
.step-item__video video { width: 100%; border-radius: var(--border-radius); }

/* ---- Bullet List Sections -------------------------------- */
.bullet-list { padding-left: 0; }
.bullet-list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    line-height: 1.5;
}
.bullet-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
}

/* ---- Präsentation Detail (Bullet-Liste + Foto) ----------- */
.praes-detail {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 640px) {
    .praes-detail { grid-template-columns: 1fr; }
}
.praes-detail__photo {
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--color-border-light);
    background: var(--color-bg-alt);
}
.praes-detail__photo img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    display: block;
}

/* ---- Allergen Section ------------------------------------ */
.allergen-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.allergen-item { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.allergen-item__name { font-size: 0; color: var(--color-text-muted); text-align: center; max-width: 60px; line-height: 1.2; }
.allergen-legend {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    border-top: 1px dashed var(--color-border-light);
    padding-top: 0.75rem;
    font-style: normal;
}

/* ---- Print Styles ---------------------------------------- */
@media print {
    .site-header, .site-footer, .recipe-actions, .portion-calc,
    .no-print { display: none !important; }

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

    .detail-layout { padding: 0; max-width: none; }

    .recipe-header, .recipe-section, .recipe-photos__item {
        border: none;
        box-shadow: none;
        border-radius: 0;
    }
    .recipe-section { page-break-inside: avoid; }
    .recipe-section--steps { page-break-before: always; }

    .ingredient-table tbody tr:nth-child(even) td { background: #f8f8f8; }

    .recipe-photos { max-height: 180px; overflow: hidden; }
    .recipe-photos__item img { height: 160px; }

    .allergen-badge--active { background: #333 !important; color: #fff !important; }

    @page { margin: 1.5cm; }
}
