/**
 * Single Recipe Template Styles
 *
 * @package YaloFSE
 */

body.single-recipe,
body.post-type-recipe {
    background-color: #f9f4f1;
}

/* ==========================================================================
   Recipe Hero (matches page hero pattern; hero.css provides .kb-hero base)
   ========================================================================== */

.single-recipe .recipe-hero.kb-hero {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    position: relative;
}

.recipe-hero__description {
    font-family: var(--font-secondary);
    font-style: italic;
    font-weight: 400;
    color: #fff;
    max-width: 36rem;
    margin: 0 0 20px;
    line-height: 1.45;
    font-size: clamp(16px, 2vw, 22px);
}

.recipe-hero__description,
.recipe-hero__description p,
.recipe-hero__description a,
.recipe-hero__description h1,
.recipe-hero__description h2,
.recipe-hero__description h3,
.recipe-hero__description h4,
.recipe-hero__description h5,
.recipe-hero__description h6,
.recipe-hero__description li {
    font-family: var(--font-secondary);
    font-style: normal;
    color: #fff;
}

.recipe-hero__description p {
    margin: 0 0 0.75em;
}

.recipe-hero__description p:last-child {
    margin-bottom: 0;
}

@media (min-width: 992px) {
    .recipe-hero__description,
    .recipe-hero__description p,
    .recipe-hero__description a,
    .recipe-hero__description h1,
    .recipe-hero__description h2,
    .recipe-hero__description h3,
    .recipe-hero__description h4,
    .recipe-hero__description h5,
    .recipe-hero__description h6,
    .recipe-hero__description li {
        font-size: 18px;
        line-height: 28px;
    }
}

.recipe-hero__print {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-secondary);
    font-size: 15px;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.recipe-hero__print:hover,
.recipe-hero__print:focus {
    color: #fff;
}

.recipe-hero__print-icon {
    display: inline-flex;
    line-height: 0;
}

.recipe-hero__share {
    position: absolute;
    z-index: 3;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 12px 24px;
    background: #002e64;
    border: 1px solid #fff;
    box-sizing: border-box;
}

.recipe-hero__share-link {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.recipe-hero__share-link:hover,
.recipe-hero__share-link:focus {
    color: #fff;
    opacity: 0.85;
}

@media (max-width: 991px) {
    .recipe-hero .kb-hero__content-wrap {
        padding-bottom: 88px;
    }

    .recipe-hero__share {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        border-left: none;
        border-right: none;
        border-bottom: none;
        justify-content: space-evenly;
        padding: 14px 16px;
    }
}

/* ==========================================================================
   Recipe Content
   ========================================================================== */

.recipe-content {
    display: grid;
}

.recipe-content .ingredients,
.recipe-content .directions {
    padding: 24px 0 48px 0;
}

.recipe-content .description {
    padding: 24px 0;
}

@media (min-width: 768px) {
    .recipe-content .description {
        padding: 64px 0;
    }
}

.recipe-content .description p {
    font-size: 22px;
    line-height: var(--line-height-relaxed);
    letter-spacing: var(--letter-spacing-tight);
}

@media (min-width: 768px) {
    .recipe-content .description p {
        font-size: var(--font-size-2xl);
        line-height: var(--line-height-snug);
    }
}

@media (min-width: 1400px) {
    .recipe-content .description p {
        font-size: 32px;
        line-height: var(--line-height-snug);
    }
}

@media (min-width: 1920px) {
    .recipe-content .description p {
        font-size: var(--font-size-4xl);
        line-height: var(--line-height-snug);
    }
}

.recipe-content .description em {
    font-size: var(--font-size-sm);
    font-family: var(--font-secondary);
    line-height: var(--line-height-relaxed);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
}

@media (min-width: 768px) {
    .recipe-content .description em {
        font-size: var(--font-size-base);
    }
}

@media (min-width: 1920px) {
    .recipe-content .description em {
        font-size: 22px;
    }
}

.recipe-content .directions,
.recipe-content .ingredients {
    display: grid;
    grid-template-rows: max-content;
    row-gap: 32px;
}

/* ==========================================================================
   Ingredients
   ========================================================================== */

.recipe-content .ingredients {
    font-family: var(--font-secondary);
}

.recipe-content .ingredients ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--font-secondary);
}

.recipe-content .ingredients ul li {
    display: block;
    padding: 11px 0;
    list-style-type: none;
    font-family: var(--font-secondary);
}

/* Ingredient title/header styling */
.recipe-content .ingredients ul li.ingredient-title {
    padding: 0;
    margin-top: var(--spacing-lg);
    font-weight: 700;
}

.recipe-content .ingredients ul li.ingredient-title:first-child {
    margin-top: 0;
}

/* ==========================================================================
   Directions
   ========================================================================== */

.recipe-content .directions ol {
    display: grid;
    grid-template-rows: 1fr;
    row-gap: var(--spacing-2xl);
    list-style: none;
    counter-reset: step-ctr;
    margin: 0;
    padding: 0;
}

@media (min-width: 992px) {
    .recipe-content .directions ol {
        row-gap: 72px;
    }
}

.recipe-content .directions ol li {
    counter-increment: step-ctr;
    display: flex;
}

.recipe-content .directions ol li:nth-child(-n+9)::before {
    content: counter(step-ctr);
}

.recipe-content .directions ol li::before {
    flex: 0 0 36px;
    content: counter(step-ctr);
    float: left;
    color: var(--color-dark);
    font-size: 20px;
    margin-right: var(--spacing-md);
    font-family: var(--font-secondary);
    font-weight: 700;
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-normal);
}

@media (min-width: 768px) {
    .recipe-content .directions ol li::before {
        flex-basis: 40px;
        font-size: 26px;
    }
}

@media (min-width: 992px) {
    .recipe-content .directions ol li::before {
        margin-right: 0;
    }
}

@media (min-width: 1400px) {
    .recipe-content .directions ol li::before {
        flex-basis: 44px;
        font-size: 30px;
    }
}

@media (min-width: 1920px) {
    .recipe-content .directions ol li::before {
        font-size: 34px;
    }
}

/* Direction title/header styling */
.recipe-content .directions h3.direction-title {
    font-weight: 700;
    margin: var(--spacing-2xl) 0 var(--spacing-lg) 0;
    font-family: var(--font-primary);
    font-size: var(--font-size-xl);
}

.recipe-content .directions h3.direction-title:first-child {
    margin-top: 0;
}

/* Recipe Content Grid Layout */
@media (min-width: 992px) {
    .recipe-content {
        grid-template-columns: repeat(12, 1fr);
        column-gap: 32px;
    }

    .recipe-content .ingredients {
        grid-column-start: 1;
        grid-column-end: 6;
        padding: 64px 0;
        height: max-content;
        position: sticky;
        top: 150px;
    }

    .recipe-content .recipe-directions {
        grid-column-start: 7;
        grid-column-end: 13;
    }

    .recipe-content .recipe-directions .directions {
        padding: 64px 0;
    }
}

/* ==========================================================================
   Recipe meta (Serves / prep / cook) — directly below hero
   ========================================================================== */

.recipe-meta {
    padding: 24px 0;
    margin: 0;
}

.recipe-meta .recipe-meta__line {
    font-family: var(--font-primary);
    font-style: italic;
    font-weight: 400;
    color: #333333;
    font-size: 18px;
    line-height: 1.45;
    text-align: left;
    margin: 0;
}

@media (min-width: 992px) {
    .recipe-meta {
        padding-top: 80px;
    }

    .recipe-meta .recipe-meta__line {
        font-size: 24px;
    }
}

/* ==========================================================================
   Single Recipe Page Specific
   ========================================================================== */

.single-recipe .related-recipe-thumb img {
    width: 100%;
    height: auto;
}

/* ==========================================================================
   Related Recipes Section
   ========================================================================== */

.sr-related {
    margin-top: 64px;
    margin-bottom: 64px;
}

.sr-related .container {
    max-width: 1180px;
    padding-left: 20px;
    padding-right: 20px;
}

.sr-related__header {
    border-top: 2px solid #bed2cb;
    padding-top: 20px;
    margin-bottom: 40px;
}

.sr-related__title {
    margin: 0 0 20px;
    font-family: var(--font-secondary);
    font-size: 24px;
    line-height: 1.08;
    color: #333333;
}

.sr-related__view-all {
    font-family: var(--font-secondary);
    font-size: 16px;
    line-height: 1.15;
    color: #002e64;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sr-related__mobile-slider {
    display: block;
}

.sr-related__top-grid,
.sr-related__desktop-slider-wrap {
    display: none;
}

.sr-related__mobile-slider-track .slick-list {
    overflow: visible;
}

.sr-related-card {
    position: relative;
    overflow: hidden;
}

.sr-related-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.sr-related-card__thumb {
    aspect-ratio: 1;
}

.sr-related-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sr-related-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.08));
}

.sr-related-card__title {
    margin: 0 0 14px;
    color: #fff;
    font-family: var(--font-primary);
    font-style: normal;
    font-size: 22px;
    line-height: 1.5;
    letter-spacing: 0.5px;
}

.sr-related-card__meta {
    margin: 0 0 18px;
    color: #fff;
    font-family: var(--font-secondary);
    font-size: 14px;
    line-height: 1.35;
}

.sr-related-card__cta {
    margin: 0;
}

.sr-related__mobile-slider-track .slick-dots {
    display: flex !important;
    justify-content: center;
    align-items: center;
    list-style: none !important;
    padding: 0 !important;
    margin: 14px 0 0 !important;
    bottom: -34px;
}

.sr-related__mobile-slider-track .slick-dots li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    list-style: none !important;
    width: 14px;
    height: 14px;
    margin: 0 7px;
}

.sr-related__mobile-slider-track .slick-dots li::marker {
    content: "";
}

.sr-related__mobile-slider-track .slick-dots li button {
    display: block;
    width: 14px;
    height: 14px;
    padding: 0;
    font-size: 0;
    line-height: 0;
    border: 0;
    background: transparent;
}

.sr-related__mobile-slider-track .slick-dots li button:before {
    content: "";
    position: static;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: block;
    font-size: 14px;
    color: #27508f;
    opacity: 1;
    background: currentColor;
}

.sr-related__mobile-slider-track .slick-dots li.slick-active button:before {
    color: #002e64;
}

@media (min-width: 992px) {
    .sr-related {
        margin-top: 84px;
        margin-bottom: 84px;
    }

    .sr-related__header {
        margin-bottom: 40px;
    }

    .sr-related__title {
        font-size: 36px;
        margin-bottom: 20px;
    }

    .sr-related__view-all {
        font-size: 16px;
    }

    .sr-related__mobile-slider {
        display: none;
    }

    .sr-related__top-grid {
        display: grid;
        grid-template-columns: 1.06fr 1fr;
        grid-auto-rows: minmax(220px, auto);
        gap: 10px;
        margin-bottom: 14px;
    }

    .sr-related-card--feature {
        grid-row: span 2;
        min-height: 470px;
    }

    .sr-related-card--small {
        min-height: 230px;
    }

    .sr-related-card--feature .sr-related-card__thumb,
    .sr-related-card--small .sr-related-card__thumb {
        aspect-ratio: auto;
        height: 100%;
    }

    .sr-related-card--feature .sr-related-card__link,
    .sr-related-card--small .sr-related-card__link {
        height: 100%;
    }

    .sr-related-card--feature .sr-related-card__thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .sr-related-card .sr-related-card__overlay {
        opacity: 0;
        transition: opacity 0.22s ease;
    }

    .sr-related-card:hover .sr-related-card__overlay,
    .sr-related-card:focus-within .sr-related-card__overlay {
        opacity: 1;
    }

    .sr-related-card__title {
        font-size: 26px;
        line-height: 1.2;
    }

    .sr-related-card__meta {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .sr-related__desktop-slider-wrap {
        display: block;
        position: relative;
    }

    .sr-related__desktop-slider-track {
        margin: 0 -4px;
    }

    .sr-related-slide-card {
        padding: 0 4px;
    }

    .sr-related-slide-card__link {
        display: block;
        color: inherit;
        text-decoration: none;
    }

    .sr-related-slide-card__thumb {
        aspect-ratio: 1.22;
        overflow: hidden;
    }

    .sr-related-slide-card__thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .sr-related-slide-card__link {
        position: relative;
    }

    .sr-related-slide-card__overlay {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding: 20px 24px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.08));
        opacity: 0;
        transition: opacity 0.22s ease;
    }

    .sr-related-slide-card:hover .sr-related-slide-card__overlay,
    .sr-related-slide-card:focus-within .sr-related-slide-card__overlay {
        opacity: 1;
    }

    .sr-related-slide-card__title {
        margin: 0 0 14px;
        color: #fff;
        font-family: var(--font-primary);
        font-style: normal;
        font-size: 26px;
        line-height: 1.2;
        letter-spacing: 0.5px;
    }

    .sr-related-slide-card__meta {
        margin: 0 0 12px;
        color: #fff;
        font-family: var(--font-secondary);
        font-size: 12px;
        line-height: 1.35;
    }

    .sr-related-slide-card__cta {
        margin: 0;
    }

    .sr-related__arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 34px;
        height: 46px;
        border: 0;
        background: transparent;
        color: #002e64;
        font-size: 54px;
        line-height: 1;
        padding: 0;
        z-index: 3;
        cursor: pointer;
    }

    .sr-related__arrow span {
        display: block;
        transform: translateY(-3px);
    }

    .sr-related__arrow--prev {
        left: -34px;
    }

    .sr-related__arrow--next {
        right: -34px;
    }

    .sr-related__arrow:hover,
    .sr-related__arrow:focus,
    .sr-related__arrow:active {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        outline: none;
    }
}

@media (min-width: 1200px) {
    .sr-related-card__title,
    .sr-related-slide-card__title {
        font-size: 32px;
        line-height: 1.3;
    }
}

.related-recipes {
    padding-top: 64px;
}

@media (min-width: 992px) {
    .related-recipes {
        padding-top: 96px;
    }
}

/* Related recipes on single recipe page */
section.recipes_list.related {
    overflow: hidden;
}

section.recipes_list.related h2 {
    margin-top: 80px;
}

@media (min-width: 992px) {
    section.recipes_list.related h2 {
        margin-top: 160px;
    }
}

@media (min-width: 992px) {
    section.recipes_list.related h2,
    section.recipes_list.related .divider-sm {
        grid-column-start: 2;
        grid-column-end: 14;
    }
}

section.recipes_list.related .container {
    padding: 0;
    overflow: hidden;
}

section.recipes_list.related .recipes {
    display: none;
    margin-bottom: 80px;
}

@media (min-width: 768px) {
    section.recipes_list.related .recipes {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
        overflow-x: visible;
        padding: 0 32px;
    }
}

@media (min-width: 992px) {
    section.recipes_list.related .recipes {
        margin-bottom: 120px;
    }
}

section.recipes_list.related .slides {
    margin: 48px 0;
}

@media (min-width: 768px) {
    section.recipes_list.related .slides {
        display: none;
    }
}

section.recipes_list.related .slides .recipe-card {
    transition: background var(--transition-fast);
    padding: 12px;
    border-radius: 24px;
}

section.recipes_list.related .slides .glide__arrows {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

section.recipes_list.related .slides .glide__arrows .glide__arrow {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: var(--color-white);
    color: var(--color-dark);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    margin: 0 0.5rem;
    cursor: pointer;
}

section.recipes_list.related .slides .glide__arrows .glide__arrow:hover {
    background: var(--color-dark);
    color: var(--color-white);
}

section.recipes_list.related .slides .glide__arrows .glide__arrow:hover svg path {
    fill: var(--color-white);
}

section.recipes_list.related .slides .glide__arrows .glide__arrow--left svg {
    transform: rotate(90deg);
}

section.recipes_list.related .slides .glide__arrows .glide__arrow--right svg {
    transform: rotate(-90deg);
}

/* ==========================================================================
   Notes (WYSIWYG)
   ========================================================================== */

.recipe-notes {
    margin-top: var(--spacing-xl);
}

.recipe-notes__content {
    font-family: var(--font-secondary);
    color: #333333;
}

.recipe-notes__content > *:first-child {
    margin-top: 0;
}

.recipe-notes__content > *:last-child {
    margin-bottom: 0;
}

.recipe-notes__content p,
.recipe-notes__content li {
    font-size: 16px;
    line-height: 1.5;
}

.recipe-notes__content ul,
.recipe-notes__content ol {
    margin: 0 0 1em 1.25em;
    padding: 0;
}

.recipe-notes__content a {
    color: #002e64;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Match directions title sizing; secondary sans + normal weight even if WYSIWYG wraps in <strong>. */
.recipe-notes__content h4 {
    font-weight: 400;
    margin: var(--spacing-2xl) 0 var(--spacing-lg) 0;
    font-family: var(--font-secondary);
    font-size: var(--font-size-xl);
}

.recipe-notes__content h4 strong {
    font-weight: 400;
}

.recipe-notes__content h4:first-child {
    margin-top: 0;
}
