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

* {
    box-sizing: border-box;
}

:root {
    --paper: #fffdf8;
    --paper-deep: #f4eadb;
    --paper-dark: #e8dbc8;

    --ink: #292722;
    --muted: #70685d;

    --red: #c92f2f;
    --red-dark: #982323;

    --green: #55705a;
    --gold: #d6a94d;

    --line: rgba(77, 58, 38, .20);
    --line-strong: rgba(77, 58, 38, .34);

    --shadow:
        0 10px 26px rgba(45, 33, 21, .12);

    --radius: 16px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(
            180deg,
            #efe5d7 0%,
            #e5d7c4 100%
        );
    font-family:
        Arial,
        Helvetica,
        sans-serif;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.siteShell {
    width: min(
        1180px,
        calc(100% - 28px)
    );

    margin:
        0
        auto;
}


/*
=========================================================
PAGE INTRO
=========================================================
*/

.pageIntro {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;

    padding:
        18px
        0
        14px;
}

.pageIntro h1 {
    margin: 0;

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

    font-size:
        clamp(
            2rem,
            4vw,
            3.2rem
        );

    line-height: 1;
}

.pageIntro p {
    max-width: 720px;

    margin:
        7px
        0
        0;

    color: var(--muted);

    font-size: .96rem;
    line-height: 1.45;
}


/*
=========================================================
FORM
=========================================================
*/

.cookbookForm {
    display: grid;
    gap: 14px;

    padding-bottom: 56px;
}


/*
=========================================================
FORM CARD
=========================================================
*/

.formCard {
    overflow: hidden;

    border:
        1px
        solid
        var(--line-strong);

    border-radius:
        var(--radius);

    background:
        var(--paper);

    box-shadow:
        var(--shadow);
}

.formCardHeader {
    position: relative;

    padding:
        13px
        56px
        11px
        16px;

    background:
        linear-gradient(
            135deg,
            #f7eee1,
            #eadbc5
        );

    border-bottom:
        1px
        solid
        var(--line);
}

.formCardHeader h2 {
    margin: 0;

    font-size: 1.05rem;
    font-weight: 900;
}

.formCardHeader p {
    margin:
        4px
        0
        0;

    color: var(--muted);

    font-size: .84rem;
    line-height: 1.35;
}

.formCardBody {
    padding: 16px;
}

.formCardCollapseButton {
    position: absolute;

    top: 50%;
    right: 14px;

    width: 32px;
    height: 32px;

    transform:
        translateY(-50%);

    display: grid;
    place-items: center;

    padding: 0;

    border:
        1px
        solid
        var(--line);

    border-radius: 50%;

    background:
        rgba(
            255,
            255,
            255,
            .72
        );

    color:
        var(--ink);

    font-size: 1.1rem;
    font-weight: 900;
}

.formCardCollapseButton:hover {
    border-color:
        rgba(
            201,
            47,
            47,
            .38
        );

    background:
        rgba(
            201,
            47,
            47,
            .06
        );
}

.formCard.isCollapsed .formCardHeader {
    border-bottom: 0;
}


/*
=========================================================
FIELDS
=========================================================
*/

.fieldGrid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(
                0,
                1fr
            )
        );

    gap: 14px;
}

.field {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.field[hidden] {
    display: none !important;
}

.field.full {
    grid-column:
        1
        /
        -1;
}

.field label {
    margin-bottom: 6px;

    font-size: .82rem;
    font-weight: 900;
}

input[type="text"],
input[type="url"],
input[type="search"],
textarea,
select {
    width: 100%;

    border:
        1px
        solid
        rgba(
            77,
            58,
            38,
            .24
        );

    border-radius: 10px;

    background:
        #fff;

    color:
        var(--ink);

    padding:
        10px
        11px;

    outline: none;
}

input[type="text"],
input[type="url"],
input[type="search"],
select {
    min-height: 42px;
}

textarea {
    min-height: 100px;

    resize: vertical;

    line-height: 1.45;
}

input:focus,
textarea:focus,
select:focus {
    border-color:
        rgba(
            201,
            47,
            47,
            .55
        );

    box-shadow:
        0
        0
        0
        3px
        rgba(
            201,
            47,
            47,
            .07
        );
}


/*
=========================================================
COOKBOOK PREVIEW
=========================================================
*/

.cookbookPreview {
    display: grid;

    grid-template-columns:
        minmax(
            220px,
            340px
        )
        minmax(
            0,
            1fr
        );

    gap: 18px;

    align-items: stretch;
}

.cookbookPreviewCover {
    min-height: 230px;

    padding: 0;

    overflow: hidden;

    border:
        1px
        solid
        var(--line-strong);

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #efe1ce,
            #dbc7aa
        );

    color:
        inherit;
}

.cookbookPreviewMedia {
    position: relative;

    width: 100%;
    height: 100%;
    min-height: 230px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}

.cookbookPreviewMedia img {
    width: 100%;
    height: 100%;

    min-height: 230px;

    object-fit: cover;

    display: block;
}

.cookbookPreviewPlaceholder {
    font-size: 4rem;
}

.cookbookPreviewMediaAction {
    position: absolute;

    left: 50%;
    bottom: 12px;

    transform:
        translateX(-50%);

    padding:
        7px
        11px;

    border-radius: 999px;

    background:
        rgba(
            33,
            29,
            25,
            .78
        );

    color: #fff;

    font-size: .76rem;
    font-weight: 900;

    white-space: nowrap;
}

.cookbookPreviewBody {
    display: flex;
    flex-direction: column;

    justify-content: center;

    padding:
        10px
        6px;
}

.cookbookPreviewCategory {
    color:
        var(--red);

    font-size: .72rem;
    font-weight: 900;

    letter-spacing: 1.1px;

    text-transform:
        uppercase;
}

.cookbookPreviewBody h2 {
    margin:
        5px
        0
        8px;

    font-size:
        clamp(
            1.6rem,
            3vw,
            2.4rem
        );

    line-height: 1.05;
}

.cookbookPreviewBody p {
    max-width: 680px;

    margin: 0;

    color:
        var(--muted);

    line-height: 1.48;
}

.cookbookPreviewMeta {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 16px;

    padding-top: 12px;

    border-top:
        1px
        solid
        var(--line);
}

.cookbookPreviewMeta span {
    padding:
        6px
        9px;

    border:
        1px
        solid
        var(--line);

    border-radius: 999px;

    background:
        rgba(
            255,
            255,
            255,
            .65
        );

    color:
        var(--muted);

    font-size: .8rem;
}


/*
=========================================================
COVER CONTROLS
=========================================================
*/

.coverControls {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(
                0,
                1fr
            )
        );

    gap: 14px;
}

.coverControls:has(
    #selectedCoverEmojiField:not([hidden])
) {
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
}

.selectedCoverEmoji {
    min-height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 8px 12px;

    border:
        1px
        solid
        rgba(77, 58, 38, .24);

    border-radius: 10px;

    background: #fff;

    font-size: 1.8rem;
    line-height: 1;
}

.coverControls > .button {
    grid-column:
        1
        /
        -1;

    justify-self:
        start;
}


/*
=========================================================
BUTTONS
=========================================================
*/

.button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding:
        9px
        15px;

    border:
        1px
        solid
        rgba(
            77,
            58,
            38,
            .24
        );

    border-radius: 999px;

    text-decoration: none;

    font-weight: 900;
}

.button[hidden] {
    display: none !important;
}

.buttonSecondary {
    background:
        #eee4d6;

    color:
        var(--ink);
}

.buttonPrimary {
    background:
        linear-gradient(
            180deg,
            #d53a3a,
            #bf2929
        );

    border-color:
        var(--red);

    color:
        #fff;

    box-shadow:
        0
        5px
        14px
        rgba(
            201,
            47,
            47,
            .18
        );
}

.button:hover {
    filter:
        brightness(.98);
}


/*
=========================================================
SELECTED RECIPES
=========================================================
*/

.selectedRecipes {
    margin-bottom: 16px;

    padding: 12px;

    border:
        1px
        solid
        var(--line);

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #f8efe2,
            #efe0ca
        );
}

.selectedRecipesHeader {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 10px;

    margin-bottom: 10px;
}

.selectedRecipesHeader strong {
    font-size: .9rem;
}

#selectedRecipeCount {
    min-width: 30px;

    padding:
        4px
        8px;

    border-radius: 999px;

    background:
        rgba(
            255,
            255,
            255,
            .72
        );

    border:
        1px
        solid
        var(--line);

    text-align: center;

    font-size: .78rem;
    font-weight: 900;
}

.selectedRecipeList {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}

.selectedRecipesEmpty {
    color:
        var(--muted);

    font-size: .84rem;
}

.selectedRecipeChip {
    display: inline-flex;

    align-items: center;
    gap: 7px;

    padding:
        7px
        10px;

    border:
        1px
        solid
        rgba(
            77,
            58,
            38,
            .24
        );

    border-radius: 999px;

    background:
        rgba(
            255,
            255,
            255,
            .78
        );

    color:
        var(--ink);

    font-size: .8rem;
    font-weight: 800;
}

.selectedRecipeChip:hover {
    border-color:
        rgba(
            201,
            47,
            47,
            .45
        );

    background:
        rgba(
            201,
            47,
            47,
            .05
        );
}


/*
=========================================================
RECIPE BROWSER GRID
=========================================================
*/

.recipeBrowserGrid {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(
                0,
                1fr
            )
        );

    gap: 14px;
}

.recipeBrowserEmpty {
    grid-column:
        1
        /
        -1;

    padding: 28px;

    border:
        1px
        dashed
        var(--line-strong);

    border-radius: 12px;

    background:
        rgba(
            255,
            255,
            255,
            .48
        );

    color:
        var(--muted);

    text-align: center;

    line-height: 1.45;
}

.recipeBrowserCard {
    min-width: 0;

    overflow: hidden;

    display: flex;
    flex-direction: column;

    border:
        1px
        solid
        var(--line);

    border-radius: 13px;

    background:
        #fffdf9;

    box-shadow:
        0
        6px
        16px
        rgba(
            45,
            33,
            21,
            .07
        );

    transition:
        transform .14s ease,
        border-color .14s ease,
        box-shadow .14s ease;
}

.recipeBrowserCard:hover {
    transform:
        translateY(-2px);

    border-color:
        rgba(
            201,
            47,
            47,
            .30
        );

    box-shadow:
        0
        10px
        22px
        rgba(
            45,
            33,
            21,
            .10
        );
}

.recipeBrowserCard.isSelected {
    border-color:
        rgba(
            85,
            112,
            90,
            .62
        );

    box-shadow:
        0
        0
        0
        2px
        rgba(
            85,
            112,
            90,
            .09
        );
}

.recipeBrowserMedia {
    aspect-ratio:
        16
        /
        9;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #eee2d1,
            #dbc8ac
        );
}

.recipeBrowserMedia img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

.recipeBrowserMediaFallback {
    width: 100%;
    height: 100%;

    display: grid;
    place-items: center;

    font-size: 2.8rem;
}

.recipeBrowserCardBody {
    flex: 1;

    display: flex;
    flex-direction: column;

    padding: 12px;
}

.recipeBrowserCategory {
    margin-bottom: 5px;

    color:
        var(--red);

    font-size: .67rem;
    font-weight: 900;

    letter-spacing: .9px;

    text-transform:
        uppercase;
}

.recipeBrowserTitle {
    margin:
        0
        0
        7px;

    font-size: 1rem;
    line-height: 1.2;
}

.recipeBrowserDescription {
    display: -webkit-box;

    margin:
        0
        0
        10px;

    overflow: hidden;

    color:
        var(--muted);

    font-size: .82rem;
    line-height: 1.4;

    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.recipeBrowserMeta {
    display: flex;
    flex-wrap: wrap;

    gap: 6px;

    margin-top: auto;
    margin-bottom: 10px;
}

.recipeBrowserMeta span {
    padding:
        4px
        7px;

    border-radius: 999px;

    background:
        #f0e6d8;

    color:
        #655d53;

    font-size: .72rem;
}

.recipeBrowserCardBody > .button {
    width: 100%;
}


/*
=========================================================
SEARCH
=========================================================
*/

.recipeBrowserToolbar {
    display: grid;

    grid-template-columns:
        minmax(
            0,
            1fr
        )
        auto;

    gap: 10px;
}


/*
=========================================================
VISIBILITY
=========================================================
*/

.radioGroup {
    display: flex;
    flex-wrap: wrap;

    gap: 9px;
}

.choice {
    display: inline-flex;

    align-items: center;

    gap: 7px;

    padding:
        9px
        12px;

    border:
        1px
        solid
        var(--line);

    border-radius: 999px;

    background:
        rgba(
            255,
            255,
            255,
            .75
        );

    font-size: .86rem;
    font-weight: 800;
}

.choice input {
    margin: 0;
}

.choice:has(input:checked) {
    border-color:
        rgba(
            201,
            47,
            47,
            .42
        );

    background:
        rgba(
            201,
            47,
            47,
            .07
        );

    color:
        var(--red-dark);
}


/*
=========================================================
SUBMIT BAR
=========================================================
*/

.submitBar {
    position: sticky;

    bottom: 0;

    z-index: 20;

    display: flex;
    flex-wrap: wrap;

    align-items: center;

    gap: 10px;

    padding: 10px;

    border:
        1px
        solid
        var(--line-strong);

    border-radius: 14px;

    background:
        rgba(
            232,
            219,
            200,
            .96
        );

    backdrop-filter:
        blur(10px);

    box-shadow:
        0
        -3px
        20px
        rgba(
            50,
            40,
            30,
            .08
        );
}

.submitBarSpacer {
    flex:
        1
        1
        auto;
}

.backLink {
    color:
        var(--red);

    text-decoration: none;

    font-size: .86rem;
    font-weight: 900;
}


/*
=========================================================
MEDIA MODAL
=========================================================
*/

.mediaModalOverlay,
.loginRequiredOverlay {
    position: fixed;

    inset: 0;

    z-index: 1100;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 18px;

    background:
        rgba(
            43,
            33,
            24,
            .64
        );

    backdrop-filter:
        blur(7px);
}

.mediaModalOverlay[hidden],
.loginRequiredOverlay[hidden] {
    display:
        none
        !important;
}

.mediaModal {
    width:
        min(
            860px,
            100%
        );

max-height:
    calc(
        100vh
        -
        36px
    );

    overflow-y: auto;

    padding: 18px;

    border:
        1px
        solid
        var(--line-strong);

    border-radius: 18px;

    background:
        linear-gradient(
            145deg,
            #fffaf2,
            #efdfc8
        );

    box-shadow:
        0
        28px
        70px
        rgba(
            34,
            24,
            15,
            .32
        );
}

.mediaModalHeader {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    gap: 15px;

    margin-bottom: 14px;
}

.mediaModalHeader h2 {
    margin: 0;
}

.mediaModalHeader p {
    margin:
        4px
        0
        0;

    color:
        var(--muted);
}

.mediaModalClose {
    flex:
        0
        0
        auto;

    width: 36px;
    height: 36px;

    padding: 0;

    border:
        1px
        solid
        var(--line);

    border-radius: 50%;

    background:
        rgba(
            255,
            255,
            255,
            .7
        );

    font-size: 1.35rem;
}

.mediaWorkbench {
    display: grid;

    grid-template-columns:
        minmax(
            0,
            1fr
        )
        minmax(
            280px,
            .85fr
        );

    gap: 14px;

    align-items: start;
}

.mediaControls {
    display: grid;

    gap: 14px;
}

.mediaPreview {
    min-height: 250px;

    overflow: hidden;

    display: flex;

    aspect-ratio: 4 / 3;
    min-height: 0;

    align-items: center;
    justify-content: center;

    border:
        1px
        solid
        var(--line);

    border-radius: 12px;

    background:
        #eadbc5;
}

.mediaPreview img {
    width: 100%;
    height: 100%;

    max-height: 360px;

    object-fit: cover;

    display: block;
}

.mediaPreviewEmpty {
    padding: 24px;

    color:
        var(--muted);

    text-align: center;
}

.mediaModalActions {
    display: flex;

    justify-content: flex-end;

    gap: 9px;

    margin-top: 14px;
}

/*
=========================================================
COOKBOOK EMOJI PICKER
=========================================================
*/

.emojiCoverActions {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}

.emojiSearch {
    width: 100%;
    margin-top: -2px;
}

.emojiSearch[hidden] {
    display: none !important;
}

.emojiSuggestionStatus {
    overflow-x: auto;
    overflow-y: hidden;

    white-space: nowrap;

    padding:
        8px
        10px;

    border-top:
        1px
        solid
        var(--line);

    border-bottom:
        1px
        solid
        var(--line);

    background:
        rgba(
            77,
            58,
            38,
            .05
        );

    color:
        var(--muted);

    font-size: .82rem;

    line-height: 1.4;

    scrollbar-width: none;
}

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

.emojiSuggestionStatus[hidden],
.cookbookEmojiResults[hidden] {
    display:
        none
        !important;
}

.cookbookEmojiResults {
    display: grid;

    grid-template-columns:
    repeat(
        5,
        minmax(
            0,
            1fr
        )
    );

    gap: 8px;

    height: 250px;

    overflow-y: auto;

    padding: 10px;

    border:
        1px
        solid
        var(--line);

    border-radius: 12px;

    background:
        rgba(
            255,
            255,
            255,
            .62
        );
}

.cookbookEmojiButton {
    min-width: 0;

    min-height: 72px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 5px;

    padding:
        8px
        5px;

    border:
        1px
        solid
        var(--line);

    border-radius: 10px;

    background:
        #fff;

    color:
        var(--ink);

    transition:
        transform .12s ease,
        border-color .12s ease,
        background .12s ease;
}

.cookbookEmojiSymbol {
    display: block;

    font-size: 1.7rem;

    line-height: 1;
}

.cookbookEmojiLabel {
    display: block;

    width: 100%;

    color:
        var(--muted);

    font-size: .68rem;
    font-weight: 800;

    line-height: 1.2;

    text-align: center;

    white-space: normal;

    overflow-wrap: normal;
word-break: normal;
}

.cookbookEmojiButton:hover {
    transform:
        translateY(-1px);

    border-color:
        rgba(
            201,
            47,
            47,
            .45
        );

    background:
        #fff8f3;
}

.cookbookEmojiButton.isSelected {
    border-color:
        var(--red);

    background:
        rgba(
            201,
            47,
            47,
            .08
        );

    box-shadow:
        0
        0
        0
        2px
        rgba(
            201,
            47,
            47,
            .08
        );
}

.cookbookCoverEmoji {
    display: block;

    font-size:
        clamp(
            4.5rem,
            10vw,
            7rem
        );

    line-height: 1;
}

.mediaPreviewEmoji {
    display: grid;
    place-items: center;

    width: 100%;
    min-height: 250px;

    padding: 24px;

    font-size:
        clamp(
            5rem,
            12vw,
            8rem
        );

    line-height: 1;
}

/*
=========================================================
LOGIN MODAL
=========================================================
*/

.loginRequiredModal {
    width:
        min(
            480px,
            100%
        );

    padding: 24px;

    border:
        1px
        solid
        var(--line-strong);

    border-radius: 18px;

    background:
        linear-gradient(
            145deg,
            #fffaf2,
            #efdfc8
        );

    box-shadow:
        0
        28px
        70px
        rgba(
            34,
            24,
            15,
            .32
        );

    text-align: center;
}

.loginRequiredModal h2 {
    margin:
        0
        0
        8px;
}

.loginRequiredModal p {
    margin: 0;

    color:
        var(--muted);

    line-height: 1.5;
}

.loginRequiredActions {
    display: flex;

    justify-content: center;
    flex-wrap: wrap;

    gap: 9px;

    margin-top: 18px;
}

body.media-modal-open,
body.login-required-open {
    overflow: hidden;
}


/*
=========================================================
VERSION
=========================================================
*/

.version {
    margin-top: 10px;

    color:
        #5e554c;

    font-size: .74rem;

    text-align: right;
}


/*
=========================================================
RESPONSIVE
=========================================================
*/

@media (max-width: 980px) {

    .recipeBrowserGrid {
    grid-template-columns:
        repeat(
            2,
            minmax(
                0,
                1fr
            )
        );
}
}


@media (max-width: 780px) {

    .fieldGrid,
    .coverControls,
    .cookbookPreview,
    .mediaWorkbench {
        grid-template-columns:
            1fr;
    }

.mediaPreview {
    order: -1;
}

    .recipeBrowserToolbar {
        grid-template-columns:
            1fr;
    }

    .recipeBrowserToolbar .button {
        width: 100%;
    }

    .cookbookPreviewCover {
        min-height: 200px;
    }

    .cookbookPreviewMedia {
        min-height: 200px;
    }

}


@media (max-width: 620px) {

    .siteShell {
        width:
            min(
                100%
                -
                18px,
                1180px
            );
    }

    .pageIntro {
        padding-top: 12px;
    }

    .recipeBrowserGrid {
        grid-template-columns:
            1fr;
    }

    .formCardHeader {
        padding-left: 13px;
    }

    .formCardBody {
        padding: 13px;
    }

    .submitBar {
        margin-left: -4px;
        margin-right: -4px;

        border-radius:
            12px
            12px
            0
            0;
    }

    .submitBar .button {
        flex:
            1
            1
            130px;
    }

    .submitBarSpacer {
        display: none;
    }

    .backLink {
        width: 100%;

        padding-top: 3px;

        text-align: center;
    }
}