/* File: /css/recipes.css
   Version inherited from /pages/recipes.php
*/

* {
    box-sizing: border-box;
}

:root {
    --paper: #fffdf8;
    --cream: #fffaf1;
    --red: #c92f2f;
    --ink: #292722;
    --muted: #716d64;
    --border: rgba(48, 42, 32, .14);
    --shadow: 0 10px 28px rgba(55, 43, 28, .13);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: linear-gradient(
    to bottom,
    #e9dfd1 0%,
    #e2d3c0 35%,
    #d2bda4 70%,
    #cbb397 100%
);

    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.siteShell {
    width: min(1500px, calc(100% - 28px));
    margin: 0 auto;
}

.siteHeader {
    position: relative;
    overflow: hidden;
    padding: 18px 0 14px;
    background: linear-gradient(
        135deg,
        #1f1b19,
        #2a211f 58%,
        #7d2525 145%
    );
}

.siteHeader::before {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    right: 4%;
    top: -350px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    box-shadow:
        0 0 0 60px rgba(255, 255, 255, .025),
        0 0 0 120px rgba(255, 255, 255, .018);
}

.headerTop {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand {
    flex: 1;
    min-width: 0;
}

.brandName {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 5vw, 4.2rem);
    line-height: .92;
    letter-spacing: -2px;
}

.brandName a {
    display: inline-block;
    text-decoration: none;
}

.brandMain {
    color: white;
}

.brandNoAds {
    color: #e43a3a;
}

.brandTagline {
    margin-top: 8px;
    color: #d8cec5;
    font-size: clamp(.9rem, 2vw, 1.05rem);
}

.accountButton {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--paper);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.pageIntro {
    margin: 18px 0 4px;
}

.pageIntro h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3rem);
}

.pageIntro p {
    max-width: 760px;
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.recipeRows {
    padding: 2px 0 6px;
}

.recipeRow {
    margin-top: 14px;
}

.rowHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 3px;
}

.rowHeadingGroup {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
    gap: 14px;
}

.rowTitleWrap {
    min-width: 0;
    flex-shrink: 0;
}

.rowHeadingIcon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}

.rowHeadingIcon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rowTitle {
    margin: 0;
    color: #332a24;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(2.85rem, 4.4vw, 3.45rem);
    font-weight: 700;
    line-height: .91;
    letter-spacing: 0;
}

.rowSubtitle {
    margin-top: 0px;
    color: #716d64;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 1rem;
    font-style: italic;
    line-height: 1.35;
}

.rowHeadingRule {
    position: relative;

    height: 1px;
    min-width: 45px;
    flex: 1;

    margin-left: 5px;
    margin-right: 5px;

    background: linear-gradient(
        to right,
        rgba(157, 86, 63, .48),
        rgba(157, 86, 63, .48)
    );
}

.rowHeadingDiamond {
    position: absolute;

    right: 0;
    left: auto;
    top: 50%;

    width: 7px;
    height: 7px;

    background: #b35342;

    transform:
        translate(50%, -50%)
        rotate(45deg);

    box-shadow:
        0 0 0 3px rgba(179, 83, 66, .08);
}

.rowControls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.rowArrow {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(50, 40, 30, .08);
}

.rowArrow:hover {
    color: var(--red);
    border-color: rgba(201, 47, 47, .35);
}

/* =========================================================
   CATEGORY ROW HEADER — MODE 2
   Line / diamond / arrows align with the TITLE,
   while the subtitle remains below.
   ========================================================= */

.rowHeaderMode2 .rowHeader {
    position: relative;
    align-items: flex-start;
}

.rowHeaderMode2 .rowHeadingGroup {
    position: relative;
    align-items: flex-start;
}

/*
 * The title is line-height: 1 and currently roughly 55px tall
 * on desktop. This puts the horizontal rule through the
 * vertical center of the title itself.
 */
.rowHeaderMode2 .rowHeadingRule {
    margin-top: calc(.5em + 1px);
}

/*
 * Put the navigation controls on the same horizontal axis
 * as the rule/diamond.
 */
.rowHeaderMode2 .rowControls {
    margin-top: calc(
        (clamp(2.85rem, 4.4vw, 3.45rem) - 38px) / 2
    );
}

/* =========================================================
   CATEGORY ROW HEADER — MODE 3

   Title + rule + diamond + arrows share one center line.
   Subtitle gets its own row and does NOT affect rule width.
   ========================================================= */

.rowHeaderMode3 .rowHeader {
    display: grid;

    grid-template-columns:
        44px
        max-content
        minmax(45px, 1fr)
        auto;

    grid-template-rows:
        minmax(0, auto)
        auto;

    column-gap: 14px;
    row-gap: 0;

    align-items: center;
}


/* Let the existing pieces participate directly
   in the rowHeader grid. */

.rowHeaderMode3 .rowHeadingGroup {
    display: contents;
}

.rowHeaderMode3 .rowTitleWrap {
    display: contents;
}


/* Icon spans title + subtitle */

.rowHeaderMode3 .rowHeadingIcon {
    grid-column: 1;
    grid-row: 1 / 3;

    align-self: start;
}


/* TITLE */

.rowHeaderMode3 .rowTitle {
    grid-column: 2;
    grid-row: 1;

    align-self: center;
}


/* LINE + DIAMOND

   Because this occupies column 3 directly after the
   title column, the subtitle can no longer push it away.
*/

.rowHeaderMode3 .rowHeadingRule {
    grid-column: 3;
    grid-row: 1;

    align-self: center;

    width: 100%;
    min-width: 45px;

    margin: 0;
}


/* BUTTONS — same exact row/center as title and rule */

.rowHeaderMode3 .rowControls {
    grid-column: 4;
    grid-row: 1;

    align-self: center;

    margin: 0;
}


/* SUBTITLE — completely independent second row */

.rowHeaderMode3 .rowSubtitle {
    grid-column: 2 / 5;
    grid-row: 2;

    margin-top: 0px;
}

.rowTrack {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 250px;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;

    scrollbar-width: none;
    -ms-overflow-style: none;
}

.rowTrack::-webkit-scrollbar {
    display: none;
}

.recipeCard {
    min-height: 310px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    scroll-snap-align: start;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--paper);
    box-shadow: 0 5px 16px rgba(50, 40, 30, .07);
    text-decoration: none;
    transition:
        transform .16s ease,
        box-shadow .16s ease;
}

.recipeCard:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.recipeImage {
    height: 145px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 70% 25%,
            rgba(255, 255, 255, .6),
            transparent 27%
        ),
        linear-gradient(
            135deg,
            rgba(201, 47, 47, .17),
            rgba(214, 169, 77, .36)
        );
    font-size: 3.5rem;
}

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

.recipeMediaFallback {
    font-size: 3.4rem;
}

.recipeBody {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 13px 14px 14px;
}

.recipeLabel {
    color: var(--red);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.recipeTitle {
    margin: 5px 0 6px;
    font-size: 1.04rem;
    line-height: 1.2;
}

.recipeBlurb {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.4;
}

.recipeMeta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 10px;
}

.recipeMeta span {
    padding: 4px 7px;
    border-radius: 999px;
    background: #efe1ce;
    color: #5e554b;
    font-size: .72rem;
    font-weight: 800;
}

.emptyRow {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 253, 248, .88);
    color: var(--muted);
}

.browsePanel {
    margin: 10px 0 0;
    padding: 13px 16px 12px;

    border: 1px solid #b9a68e;
    border-top: 2px solid #fffdf7;
    border-bottom: 2px solid #9f8a70;

    border-radius: 20px;

    background: linear-gradient(
        180deg,
        #fffdf7 0%,
        #f3e6d3 100%
    );

    box-shadow:
        0 6px 12px rgba(65, 45, 27, .18),
        inset 0 2px 0 rgba(255, 255, 255, .95),
        inset 0 -2px 0 rgba(91, 61, 36, .10);
}

.searchPanelHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.advancedSearchLink {
    padding: 5px 10px;
    border: 1px solid rgba(201, 47, 47, .28);
    border-radius: 999px;
    background: rgba(201, 47, 47, .05);
    color: var(--red);
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.advancedSearchLink:hover {
    background: var(--red);
    color: white;
}

.browsePanel h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.browsePanel p {
    margin: 5px 0 0;
    color: var(--muted);
}

.searchPanel {
    margin-top: 5px;
    display: flex;
    gap: 10px;
}

.searchPanel input {
    flex: 1;
    min-width: 0;
    padding: 8px 11px;

    border: 1px solid #b5a38d;
    border-top-color: #97836b;

    border-radius: 10px;

    background: #fffaf2;

    box-shadow:
        inset 0 2px 4px rgba(58, 40, 24, .16),
        0 1px 0 rgba(255, 255, 255, .95);
}

.searchButton {
    padding: 6px 10px;
    border: 0;
    border-radius: 10px;
    background: var(--red);
    color: white;
    font-weight: 900;
    cursor: pointer;
}

.version {
    padding: 10px 0 22px;
    color: #5f574e;
    text-align: right;
    font-size: .78rem;
}

/* NAVIGATION */

.mainNav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f8f3eb;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid rgba(0, 0, 0, .12);
    backdrop-filter: blur(12px);
}

.navInner {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.navInner::-webkit-scrollbar {
    display: none;
}

.navInner a {
    padding: 13px 15px;
    border-radius: 9px;
    font-size: .92rem;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none;
}

.navInner a:hover {
    background: rgba(201, 47, 47, .08);
    color: var(--red);
}

@media (max-width: 650px) {
    .siteShell {
        width: min(100% - 18px, 1500px);
    }

    .siteHeader {
        padding: 12px 0 10px;
    }

    .headerTop {
        align-items: flex-start;
    }

    .brandName {
        letter-spacing: -1px;
    }

    .brandTagline {
        display: none;
    }

    .accountButton {
        padding: 8px 11px;
        font-size: .8rem;
    }

    .rowHeader {
        gap: 9px;
        margin-bottom: 9px;
    }

    .rowHeadingGroup {
        gap: 9px;
    }

    .rowTitle {
        font-size: clamp(1.4rem, 6vw, 1.8rem);
    }

    .rowSubtitle {
        margin-top: 2px;
        font-size: .72rem;
    }

    .rowHeadingRule {
        min-width: 18px;
        margin-left: 1px;
    }

    .rowControls {
        display: none;
    }

    .rowTrack {
        grid-auto-columns: minmax(175px, 72vw);
    }

    .recipeImage {
        height: 125px;
    }

    .searchPanel {
        flex-direction: column;
    }
}