/* Recipe Detail Page Styles */

/* ─── Travel Banner ─────────────────────────────────────────────────────────── */

.travel-banner {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 36px 32px;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    border: 1px solid transparent;
    background-clip: padding-box;
}

/* Thin gradient border */
.travel-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.5), rgba(245, 158, 11, 0.25));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Faint world map */
.travel-banner__map {
    position: absolute;
    inset: 0;
    color: #f97316;
    opacity: 0.04;
    pointer-events: none;
}

.travel-banner__map svg {
    width: 100%;
    height: 100%;
}

/* Dashed route line */
.travel-banner__route {
    position: absolute;
    inset: 0;
    color: #fdba74;
    pointer-events: none;
}

.travel-banner__route svg {
    width: 100%;
    height: 100%;
}

.travel-banner__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.travel-banner__badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid #fed7aa;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    color: #ea580c;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 50px;
}

.travel-banner__title {
    margin: 18px 0 0;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0f172a;
}

.travel-banner__subtitle {
    margin: 14px 0 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #475569;
    max-width: 640px;
}

.travel-banner__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.travel-banner__chip {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.9rem;
    padding: 7px 16px;
    border-radius: 50px;
}

/* Accent only on the button */
.travel-banner__cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    border-radius: 30px;
    padding: 16px 32px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(90deg, #f97316, #f59e0b);
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.travel-banner__cta:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(249, 115, 22, 0.3);
}

.travel-banner__cta-icon {
    margin-left: 12px;
    transition: transform 0.2s ease;
}

.travel-banner__cta:hover .travel-banner__cta-icon {
    transform: translateX(4px);
}

/* Side-by-side layout on wider viewports */
@media (min-width: 768px) {
    .travel-banner__content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .travel-banner__cta {
        align-self: center;
        flex-shrink: 0;
    }
}

/* ─── КБЖУ Nutrition Panel ─────────────────────────────────────────────────── */

.nutrition-panel {
    background: #fff;
    border: 1px solid #eef0f2;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 24px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
}

.nutrition-panel__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.nutrition-panel__badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Macro grid, distribution bar and sub-nutrients live in the shared
   nutrition-facts.css (.nf-*). Below: only recipe-specific bits — the
   collapsible per-ingredient detail table and notes. */

/* Ingredient detail table */
.nutrition-table {
    font-size: 0.8rem;
}

.nutrition-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.nutrition-row--skipped td {
    opacity: 0.55;
}

/* Notes (average weights etc.) */
.nutrition-notes li {
    font-size: 0.75rem;
    color: #6c757d;
    padding: 2px 0;
}

.nutrition-notes li::before {
    content: "•";
    color: #198754;
    margin-right: 5px;
}

/* ─────────────────────────────────────────────────────────────────────────── */

/* Старые стили .recipe-header удалены - теперь используется универсальный hero-block */

/* Mobile Photo Gallery Section (displayed below hero on xs screens, hidden on sm+) */
/* Gradient seamlessly continues the dark hero into the white page content */
.mobile-photo-gallery-section {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 60%, #ffffff 100%);
}

.mobile-gallery-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Recipe Actions Block */
.recipe-actions-block {
    background: #f8f9fa;
    padding: 30px 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.recipe-actions-block .btn {
    min-width: 200px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.recipe-actions-block .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}


.recipe-actions-block .btn-danger {
    background: #dc3545;
    border-color: #dc3545;
}

.recipe-actions-block .btn-danger:hover {
    background: #bb2d3b;
    border-color: #b02a37;
}

/* "Add to Planner" button — matches hero action button dimensions */
.recipe-actions-block .btn-add-to-planner {
    font-size: 1.1rem;
    padding: 15px 40px;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.recipe-actions-block .btn-add-to-planner:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.recipe-info {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.recipe-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex: 1;
    margin: 0 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #6c757d;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

.ingredients-section,
.instructions-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    animation: slideInLeft 0.8s ease-out;
}

.section-title {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e74c3c;
}

.ingredient-item {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.ingredient-item:hover {
    background-color: #f8f9fa;
    padding-left: 14px;
    border-radius: 5px;
}

.ingredient-item:last-child {
    border-bottom: none;
}

/* Whole selectable row is clickable to toggle the checkbox */
.ingredient-selectable {
    cursor: pointer;
}

.ingredient-selectable:hover {
    background-color: #fdecea;
}

/* The name keeps its link appearance and its own cursor */
.ingredient-selectable .ingredient-link {
    cursor: pointer;
}

.ingredient-name {
    font-weight: 500;
    flex-grow: 1;
    min-width: 0;
}

.ingredient-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ingredient-link:hover {
    text-decoration: underline;
}

.ingredient-amount {
    color: #e74c3c;
    font-weight: bold;
    flex-shrink: 0;
    white-space: nowrap;
    text-align: right;
}

/* Ingredient Popover Styles */
.ingredient-popover {
    max-width: 450px !important;
}

.ingredient-popover .popover-body {
    padding: 0;
}

.ingredient-popover-content {
    display: flex;
    width: 415px;
}

.ingredient-popover-image {
    width: 165px;
    height: 110px;
    object-fit: cover;
    flex-shrink: 0;
}

.ingredient-popover-info {
    flex: 1;
    padding: 10px 15px;
}

.ingredient-popover-name {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 8px;
    color: #2c3e50;
}

.ingredient-popover-description {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #666;
    margin: 0;
}

.instructions-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #495057;
}

.instructions-content p {
    margin-bottom: 1rem;
}

.instructions-content em {
    font-style: italic;
    color: #6c757d;
}

.instructions-content strong {
    font-weight: bold;
}

.instructions-content ul,
.instructions-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.instructions-content li {
    margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   Recipe Author Block — clean card, minimal design
   ═══════════════════════════════════════════════════════════════ */
.recipe-author-block {
    background: #fff;
    padding: 24px 28px;
    border-radius: 16px;
    margin: 30px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Flex row: avatar | info | button */
.author-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ── Avatar ──────────────────────────────────────────────────── */
.author-avatar-link {
    flex-shrink: 0;
    text-decoration: none;
}

.author-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f2f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: block;
}

/* SVG placeholder circle */
.author-avatar--placeholder {
    background: #f0f2f5;
    color: #adb5bd;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: unset; /* override — not an <img> */
}

.author-avatar--placeholder svg {
    width: 40px;
    height: 40px;
}

/* ── Info block ──────────────────────────────────────────────── */
.author-info {
    flex: 1;
    min-width: 0;
}

.author-name-link {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author-name-link:hover {
    color: #e74c3c;
}

.author-meta {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
}

.author-meta strong {
    color: #495057;
    font-weight: 600;
}

.author-description {
    font-size: 0.875rem;
    color: #6c757d;
    line-height: 1.55;
    margin: 8px 0 0;
}

/* ── Subscribe / unsubscribe button — outlined pill ─────────── */
.author-actions {
    flex-shrink: 0;
}

.author-actions .btn-subscribe {
    padding: 8px 22px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 20px;
    background: #fff;
    color: #e74c3c;
    border: 1.5px solid #e74c3c;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.author-actions .btn-subscribe:hover {
    background: #e74c3c;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.22);
}

/* Active = already subscribed ("В подписках") — neutral outline */
.author-actions .btn-subscribe.active {
    background: #fff;
    color: #6c757d;
    border-color: #ced4da;
}

.author-actions .btn-subscribe.active:hover {
    background: #f8f9fa;
    color: #495057;
    border-color: #adb5bd;
    transform: none;
    box-shadow: none;
}

.complexity-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.complexity-value {
    font-size: 1.2rem;
    font-weight: bold;
    display: block;
}

.complexity-label {
    font-size: 0.8rem;
}

.recipe-tags {
    margin-top: 20px;
}

.recipe-tag {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    margin: 5px 5px 5px 0;
    text-decoration: none;
    transition: all 0.3s ease;
}

.recipe-tag:hover {
    background: #c0392b;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .recipe-title {
        font-size: 2.5rem;
    }

    .recipe-meta {
        gap: 15px;
    }

    .recipe-meta-item {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .recipe-stats {
        flex-direction: column;
        gap: 10px;
    }

    .stat-item {
        margin: 0;
    }

    .ingredients-section,
    .instructions-section {
        padding: 20px;
    }

    .complexity-badge {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
        display: inline-block;
    }
}

@media (max-width: 576px) {
    .recipe-header {
        height: 50vh;
        min-height: 400px;
        background-attachment: scroll; /* Disable parallax on mobile */
    }

    .recipe-title {
        font-size: 2rem;
    }

    .recipe-subtitle {
        font-size: 1rem;
    }

    .recipe-meta {
        flex-direction: column;
        gap: 10px;
    }

    .ingredient-item {
        padding: 12px 8px;
        align-items: flex-start;
    }

    .ingredient-amount {
        font-size: 0.9rem;
        /* Allow long amounts (e.g. "4 ст. ложки (тесто) + 1/4 л (начинка)") to wrap
           instead of overflowing the row on narrow screens */
        white-space: normal;
        overflow-wrap: anywhere;
        flex-shrink: 1;
        min-width: 0;
        max-width: 55%;
    }
}

/* Comments Section Styles */
.comment-form-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e74c3c;
}

.comment-item {
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.comment-item:hover {
    background-color: #f8f9fa;
    margin: 0 -15px;
    padding: 20px 15px;
    border-radius: 8px;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-author a {
    color: #2c3e50;
    font-weight: 600;
}

.comment-author a:hover {
    color: #e74c3c;
}

.comment-meta {
    font-size: 0.85rem;
}

.comment-text {
    line-height: 1.6;
    color: #495057;
    margin-top: 10px;
}

.comment-login-prompt {
    border: 2px dashed #dee2e6;
    background: #f8f9fa;
}

.comment-login-prompt:hover {
    border-color: #e74c3c;
    background: #fff;
}

/* Rating Stars */
.rating-stars {
    display: inline-flex;
    gap: 3px;
}

.rating-star {
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 1.2rem;
}

.rating-star:hover,
.rating-star.active {
    color: #ffc107;
}

.rating-star.active ~ .rating-star {
    color: #ddd;
}

.rating-display {
    font-size: 0.8rem;
}

/* No Comments State */
.no-comments {
    border: 2px dashed #dee2e6;
    background: #f8f9fa;
    border-radius: 12px;
}

/* Comment Actions */
.comment-actions {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.comment-item:hover .comment-actions {
    opacity: 1;
}

/* Comment Photo */
.comment-photo img {
    max-width: 300px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.comment-photo img:hover {
    transform: scale(1.05);
    border-color: #e74c3c;
}

/* Form Validation */
.form-control:invalid {
    border-color: #dc3545;
}

.form-control:valid {
    border-color: #198754;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

/* Comment Form Animations */
.comment-form-container {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Comments */
@media (max-width: 768px) {
    .recipe-actions-block {
        padding: 20px 0;
    }

    .recipe-actions-block .btn {
        min-width: 160px;
        font-size: 0.95rem;
        padding: 10px 20px;
    }

    .recipe-actions-block .btn-add-to-planner {
        font-size: 1rem;
        padding: 12px 30px;
        border-radius: 30px;
    }

    .recipe-author-block {
        padding: 16px 18px;
    }

    .author-avatar {
        width: 56px;
        height: 56px;
    }

    .author-name-link {
        font-size: 1rem;
    }

    .comment-avatar {
        width: 40px;
        height: 40px;
    }

    .comment-form-container {
        padding: 15px;
    }

    .comment-item {
        padding: 15px 0;
    }

    .rating-stars {
        flex-wrap: wrap;
        gap: 5px;
    }

    .rating-star {
        font-size: 1rem;
    }
}

/* ===== Recipe Feedback Toast ===== */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.recipe-feedback {
    animation: slideInRight 0.3s ease-out;
}

.btn-like.active {
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
    color: white;
}

.btn-like.active:hover {
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
    opacity: 0.9;
}

/* ===== "I cooked this" CTA block ===== */
/* Reuses the planner-cta layout; --cooked modifiers give it an amber accent */
.planner-cta-body--cooked {
    border-left-color: #f59e0b;
}

.planner-cta-icon--cooked {
    background: #fef3c7;
    color: #d97706;
}

/* Social-proof counter inside the CTA text */
.cooked-cta-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #16a34a;
    font-weight: 600;
    white-space: nowrap;
}

/* Toggled state: once marked, the button turns into a calm "done" look */
.btn-cooked.active {
    background-color: #fff;
    border-color: var(--bs-success);
    color: var(--bs-success);
}

.btn-cooked.active:hover {
    background-color: #f0fdf4;
    border-color: var(--bs-success);
    color: var(--bs-success);
}

/* Registration hint for anonymous users (revealed after the first click) */
.cooked-anon-prompt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 24px;
    border-top: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.875rem;
}

.cooked-anon-prompt i {
    margin-top: 3px;
}

.cooked-anon-prompt a {
    color: #b45309;
    font-weight: 600;
}

/* Quick pop animation played when the mark is set */
@keyframes cookedPop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.btn-cooked.cooked-pop {
    animation: cookedPop 0.4s ease-out;
}

/* ===== "Congrats, you cooked it" modal ===== */
.cooked-congrats-icon {
    font-size: 3rem;
    line-height: 1;
}

/* ===== Weights & Measures Table Modal ===== */
#weightsTableModal .modal-body {
    padding: 1.5rem;
}

.weights-table-wrapper {
    /* Если в HTML есть заголовок h1/h2 — скрываем, он уже в modal-header */
}

.weights-table-wrapper > h1,
.weights-table-wrapper > h2 {
    display: none;
}

.weights-table {
    font-size: 0.9rem;
}

.weights-table thead th,
.weights-table tr:first-child td {
    background-color: #f8f9fa !important;
    font-weight: 600;
    color: #495057;
    border-color: #dee2e6;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.weights-table tbody tr:hover {
    background-color: rgba(25, 135, 84, 0.06) !important;
}

.weights-table td {
    vertical-align: middle;
}

#weightsTableModal .table-responsive {
    max-height: 60vh;
    overflow-y: auto;
}

/* Search input inside Weights & Measures modal */
.weights-search-wrapper {
    position: relative;
}

.weights-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
    z-index: 2;
}

.weights-search-input {
    padding-left: 36px;
    padding-right: 36px;
    border-radius: 8px;
    border-color: #dee2e6;
}

.weights-search-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15);
    border-color: #198754;
    outline: none;
}

.weights-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    background: none;
    border: none;
    color: #6c757d;
    padding: 4px 6px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    border-radius: 4px;
}

.weights-search-clear:hover {
    color: #333;
    background-color: #f0f0f0;
}

#weightsTableModal #weightsTableSearch:focus {
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15);
    border-color: #198754;
}

/* Hidden rows during search — use display:none only, visibility:hidden leaves gaps */
@media (max-width: 576px) {
    .weights-table {
        font-size: 0.8rem;
    }

    #weightsTableModal .modal-body {
        padding: 1rem;
    }

    .recipe-actions-block {
        padding: 15px 0;
    }


    .recipe-actions-block .btn {
        min-width: 100%;
        font-size: 0.9rem;
    }

    .recipe-actions-block .btn-add-to-planner {
        font-size: 0.9rem;
        padding: 10px 25px;
        border-radius: 30px;
    }

    .recipe-author-block {
        padding: 16px;
    }

    /* Stack author content vertically and center everything on small screens */
    .author-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-name-link {
        white-space: normal;
    }

    .author-actions {
        width: 100%;
    }

    .author-actions .btn-subscribe {
        width: 100%;
    }

    /* Scope to author block only — don't break comment/form flex rows */
    .comment-form-container .d-flex.align-items-start,
    .comment-item .d-flex.align-items-start {
        flex-direction: row;
        align-items: flex-start;
    }

    /* Comment form: column layout, full-width stretching
       !important needed to override Bootstrap's align-items-start !important */
    .comment-form-container .d-flex.align-items-start {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }

    .comment-form-container .comment-avatar {
        margin-right: 0 !important;
        align-self: flex-start;
    }

    /* Ensure the form area fills full width on mobile */
    .comment-form-container .flex-grow-1 {
        width: 100%;
    }

    /* Comment items: keep compact row — small avatar left, content right */
    .comment-item .comment-avatar {
        flex-shrink: 0;
        width: 36px !important;
        height: 36px !important;
        margin-right: 10px !important;
    }

    /* Critical: min-width:0 lets flex-grow-1 shrink and fill the remaining row */
    .comment-item .flex-grow-1 {
        min-width: 0;
        width: 100%; /* stretch to fill remaining flex row space */
        overflow-wrap: break-word;
        word-break: break-word;
    }

    /* Comment header: stack name/date column, stretch full width */
    .comment-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0;
        width: 100%;
        margin-bottom: 4px !important; /* override Bootstrap mb-2 (8px) */
    }

    /* Tighten spacing between name and date */
    .comment-author {
        line-height: 1.3;
        margin-bottom: 1px;
    }

    .comment-meta {
        margin-top: 0 !important;
        line-height: 1.3;
    }

    /* Reduce gap between header (name/date) and comment text */
    .comment-text {
        margin-top: 6px;
    }

    /* Give each comment item a subtle card look on mobile */
    .comment-item {
        background: #f8f9fa;
        border-radius: 10px;
        padding: 12px !important;
        margin-bottom: 10px;
        border-bottom: none !important;
    }

    /* Disable negative-margin hover effect that breaks mobile layout */
    .comment-item:hover {
        background: #f0f2f5;
        margin: 0 0 10px 0 !important;
        padding: 12px !important;
        border-radius: 10px;
    }

    .d-flex.justify-content-between.align-items-center {
        flex-direction: row;
        gap: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Planner CTA block — below the recipe description
   ═══════════════════════════════════════════════════════════════ */

.recipe-planner-cta {
    margin: 32px 0 24px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ── Loading state ─────────────────────────────────────────── */
.planner-cta-loading {
    display: flex;
    align-items: center;
    padding: 20px 24px;
}

/* ── Shared body layout ────────────────────────────────────── */
.planner-cta-body {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    flex-wrap: wrap;
}

/* ── Suggest state accent ──────────────────────────────────── */
.planner-cta-body {
    border-left: 4px solid #16a34a;
}

/* ── Planned state accent ──────────────────────────────────── */
.planner-cta-body--planned {
    border-left-color: #0d6efd;
    background: #f0f7ff;
}

/* ── Icon circle ───────────────────────────────────────────── */
.planner-cta-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.planner-cta-icon--planned {
    background: #dbeafe;
    color: #0d6efd;
}

/* ── Text content ──────────────────────────────────────────── */
.planner-cta-content {
    flex: 1;
    min-width: 0;
}

.planner-cta-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.planner-cta-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0;
}

.planner-cta-dates {
    font-size: 0.875rem;
    color: #495057;
    font-weight: 500;
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .planner-cta-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .planner-cta-body .btn {
        width: 100%;
        justify-content: center;
    }

    .planner-cta-body .d-flex {
        width: 100%;
    }

    .planner-cta-body .d-flex .btn {
        flex: 1;
    }
}

/* ── Recommended Recipes (bottom-of-page block, desktop) ──────── */
.recommended-recipes {
    padding: 48px 0 64px;
    margin-top: 24px;
    border-top: 1px solid #ececec;
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
}

.recommended-recipes__header {
    text-align: center;
    margin-bottom: 32px;
}

.recommended-recipes__title {
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: #212529;
}

.recommended-recipes__subtitle {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 0;
}

