/* =========================================================
   HIDDEN MANNA BAKERY
   Customer-facing stylesheet
   ========================================================= */


/* =========================================================
   DESIGN TOKENS
   Change the colors here to change the customer site palette.
   ========================================================= */

:root {

    /* =====================================================
       PRIMARY PALETTE
       ===================================================== */

    --color-primary: #9e3a8c;
    --color-primary-dark: #7a1f6c;
    --color-primary-hover: #8a2f78;

    --color-heading: #5c2440;
    --color-text: #4a2b3a;
    --color-text-soft: #5f3a4d;
    --color-muted: #8a5a72;
    --color-nav: #6d3a52;


    /* =====================================================
       BACKGROUNDS
       ===================================================== */

    --color-background-base: #e1abb4;
    --color-background-light: #fff8f4;
    --color-background-mid: #fbe6ec;
    --color-background-dark: #f7d6e2;

    --color-surface: rgba(255, 255, 255, 0.8);
    --color-surface-light: rgba(255, 255, 255, 0.75);

    --color-lightbox-background: rgba(60, 20, 45, 0.85);


    /* =====================================================
       BACKGROUND GRADIENTS
       ===================================================== */

    --color-background-radial-top: rgba(158, 58, 140, 0.25);
    --color-background-radial-bottom: rgba(233, 160, 120, 0.25);


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

    --color-button-text: #ffffff;
    --color-button-gradient-start: #b04a92;
    --color-button-gradient-end: #8e2f70;


    /* =====================================================
       BORDERS
       ===================================================== */

    --color-border: rgba(166, 88, 120, 0.2);
    --color-border-light: rgba(166, 88, 120, 0.18);
    --color-input-border: rgba(166, 88, 120, 0.4);


    /* =====================================================
       STATUS / SPECIAL COLORS
       ===================================================== */

    --color-error: #c0392b;


    /* =====================================================
       LIGHTBOX
       ===================================================== */

    --color-lightbox-control: #ffffff;
    --color-lightbox-control-hover: #f3d9e5;

    --color-lightbox-button-background: rgba(0, 0, 0, 0.35);
    --color-lightbox-button-background-hover: rgba(0, 0, 0, 0.55);
    --color-lightbox-button-border: rgba(255, 255, 255, 0.5);

    --color-lightbox-delete-border: rgba(255, 255, 255, 0.6);
    --color-lightbox-delete-border-hover: rgba(255, 255, 255, 0.9);
    --color-lightbox-delete-hover: rgba(180, 30, 30, 0.5);


    /* =====================================================
       EFFECTS / SHADOWS
       ===================================================== */

    --color-shadow: rgba(0, 0, 0, 0.4);

    --shadow-card: 0 12px 40px rgba(158, 58, 140, 0.15);
    --shadow-thumbnail: 0 6px 18px rgba(158, 58, 140, 0.1);
    --shadow-button: 0 12px 28px rgba(158, 58, 140, 0.45);
    --shadow-nav: 0 1px 12px rgba(166, 88, 120, 0.08);
    --shadow-lightbox: 0 24px 60px rgba(0, 0, 0, 0.4);


    /* =====================================================
       GENERIC
       ===================================================== */

    --color-white: #ffffff;
}


/* =========================================================
   GLOBAL
   ========================================================= */

body {
    background-color: var(--color-background-base);
    color: var(--color-white);

    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;

    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
}

h1 {
    background-color: var(--color-background-base);
    color: var(--color-heading);
}


/* =========================================================
   CUSTOMER SITE
   ========================================================= */

body.site {
    max-width: none;
    min-height: 100vh;

    padding: 0;
    margin: 0;

    display: flex;
    flex-direction: column;
    align-items: center;

    background:
        radial-gradient(
            1200px 600px at 85% -10%,
            var(--color-background-radial-top),
            transparent 60%
        ),
        radial-gradient(
            900px 500px at -10% 110%,
            var(--color-background-radial-bottom),
            transparent 55%
        ),
        linear-gradient(
            165deg,
            var(--color-background-light) 0%,
            var(--color-background-mid) 55%,
            var(--color-background-dark) 100%
        );

    color: var(--color-text);
    font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}


/* =========================================================
   CUSTOMER NAVIGATION
   ========================================================= */

body.site #nav-container {
    width: 100%;
    max-width: none;

    align-self: stretch;

    margin: 0;
    padding: 0;
}

body.site .site-nav {
    position: sticky;
    top: 0;
    z-index: 100;

    display: flex;
    align-items: center;

    width: 100%;
    box-sizing: border-box;

    margin: 0;
    gap: 28px;
    padding: 16px 32px;

    background: var(--color-surface);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border-bottom: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-nav);
}

body.site .site-nav a {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;

    color: var(--color-nav);

    text-decoration: none;

    transition: color 0.15s ease;
}

body.site .site-nav a:hover {
    color: var(--color-primary);
}


/* =========================================================
   CUSTOMER HERO
   ========================================================= */

body.site .hero {
    flex: none;

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

    text-align: center;

    padding: 48px 24px 32px;
}

body.site .hero h1 {
    background: none;

    margin: 0;

    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    line-height: 1.1;
    letter-spacing: 0.01em;

    color: var(--color-heading);
}

body.site .hero .tagline {
    margin: 14px 0 0;

    font-size: clamp(1rem, 2.2vw, 1.25rem);

    color: var(--color-muted);
}


/* =========================================================
   CUSTOMER CARDS
   ========================================================= */

.hero-card,
.about-card {
    background: var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: 16px;

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

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

body.site .hero-card {
    margin-top: 40px;

    max-width: 520px;

    padding: 28px 32px;
}

body.site .hero-card p,
#about-section .about-card p {
    margin: 0 0 14px;

    line-height: 1.6;

    color: var(--color-text-soft);
}

body.site .hero-card p:last-child,
#about-section .about-card p:last-child {
    margin-bottom: 0;
}

body.site .hero-card .lead,
#about-section .about-card .lead {
    font-weight: 600;

    color: var(--color-heading);
}

body.site .hero-card a,
#about-section .about-card a {
    color: var(--color-primary);

    font-weight: 500;
    text-decoration: none;

    border-bottom: 1px solid rgba(158, 58, 140, 0.35);

    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

body.site .hero-card a:hover,
#about-section .about-card a:hover {
    color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}


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

.button-action {
    display: inline-block;

    padding: 6px 16px;

    font: inherit;
    font-weight: 600;

    color: var(--color-button-text);
    background: var(--color-primary);

    border: 1px solid var(--color-primary);
    border-radius: 8px;

    cursor: pointer;
}

.button-action:hover {
    background: var(--color-primary-hover);
}

body.site .cta,
body.site button.cta {
    display: inline-block;

    padding: 11px 24px;

    font: inherit;
    font-weight: 600;

    color: var(--color-button-text);

    background: linear-gradient(
        135deg,
        var(--color-button-gradient-start),
        var(--color-button-gradient-end)
    );

    border: none;
    border-radius: 8px;

    cursor: pointer;
    text-decoration: none;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

body.site .cta:hover,
body.site button.cta:hover {
    opacity: 0.92;

    transform: translateY(-2px);

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


/* =========================================================
   SHARED PAGE SECTION
   Used by Gallery, About, and Order.
   ========================================================= */

.page-section {
    flex: 1;

    width: 100%;
    max-width: 1100px;

    margin: 0 auto;
    padding: 0 24px 72px;

    box-sizing: border-box;
}


/* =========================================================
   ABOUT PAGE
   ========================================================= */

#about-section .about-card {
    padding: 32px 36px;
}

#about-section .about-card p {
    line-height: 1.7;
}

#about-section .about-actions {
    margin-top: 28px;

    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

#about-section .about-actions .cta {
    margin-top: 0;

    color: var(--color-button-text);
}


/* =========================================================
   GALLERY PAGE
   ========================================================= */

#thumbnails {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(160px, 1fr));

    gap: 16px;
}

#gallery-section #status,
#order-section #status {
    margin: 0 0 16px;

    font-size: 0.95rem;

    color: var(--color-muted);
}

#gallery-section #status.error,
#order-section #status.error {
    color: var(--color-error);
}

#thumbnails .thumb {
    margin: 0;
    padding: 8px;

    background: var(--color-surface-light);

    border: 1px solid var(--color-border-light);
    border-radius: 12px;

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

#thumbnails img {
    display: block;

    width: 100%;
    height: 160px;

    object-fit: cover;

    border-radius: 8px;

    cursor: zoom-in;

    transition: transform 0.15s ease;
}

#thumbnails img:hover {
    transform: scale(1.04);
}


/* =========================================================
   ORDER PAGE
   ========================================================= */

#order-form {
    display: flex;
    flex-direction: column;

    gap: 18px;

    padding: 28px 32px;

    background: var(--color-surface);

    border: 1px solid var(--color-border);
    border-radius: 16px;

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

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#order-form .field {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

#order-form label {
    font-size: 0.85rem;
    font-weight: 600;

    color: var(--color-nav);
}

#order-form input,
#order-form textarea {
    box-sizing: border-box;

    width: 100%;

    padding: 10px 12px;

    background: var(--color-white);
    color: var(--color-text);

    font: inherit;

    border: 1px solid var(--color-input-border);
    border-radius: 8px;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

#order-form input:focus,
#order-form textarea:focus {
    border-color: var(--color-primary);

    box-shadow:
        0 0 0 3px rgba(158, 58, 140, 0.15);
}

#order-form textarea {
    min-height: 120px;
    resize: vertical;
}

#order-form button[type="submit"] {
    align-self: flex-start;

    margin-top: 6px;
    padding: 11px 24px;

    font: inherit;
    font-weight: 600;

    color: var(--color-button-text);

    cursor: pointer;

    background: linear-gradient(
        135deg,
        var(--color-button-gradient-start),
        var(--color-button-gradient-end)
    );

    border: none;
    border-radius: 8px;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

#order-form button[type="submit"]:hover {
    opacity: 0.92;

    transform: translateY(-2px);

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

#order-section #status {
    margin-top: 16px;
}

#rush-warning {
    margin: 0;

    font-size: 0.85rem;
    font-weight: 600;

    color: var(--color-error);
}


/* =========================================================
   LIGHTBOX
   ========================================================= */

#lightbox {
    position: fixed;
    inset: 0;

    width: 100vw;
    height: 100vh;
    height: 100dvh;

    box-sizing: border-box;

    margin: 0;
    padding: 20px;

    background: var(--color-lightbox-background);

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

    z-index: 1000;

    cursor: zoom-out;

    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

#lightbox[hidden] {
    display: none;
}

#lightbox img {
    max-width: 90vw;
    max-height: 85vh;

    object-fit: contain;

    border-radius: 4px;

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

#lightbox-caption {
    margin-top: 10px;

    max-width: 80vw;

    color: var(--color-lightbox-control);

    font-size: 0.9rem;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#lightbox-close,
#lightbox-delete {
    color: var(--color-lightbox-control);

    padding: 8px 12px;

    font: inherit;
    font-size: 1rem;

    background: var(--color-primary);

    border: 1px solid var(--color-primary);
    border-radius: 4px;

    cursor: pointer;

    transition:
        background 0.15s,
        color 0.15s;
}

#lightbox-close:hover,
#lightbox-delete:hover {
    background: var(--color-primary-hover);
}

#lightbox-close {
    position: absolute;

    top: 10px;
    right: 28px;

    padding: 0;

    background: transparent;
    border: none;

    color: var(--color-lightbox-control);

    font-size: 2rem;
    line-height: 1;

    cursor: pointer;
    user-select: none;
}

#lightbox-close:hover {
    color: var(--color-lightbox-control-hover);
}

#lightbox-delete {
    position: absolute;

    top: 16px;
    right: 70px;

    padding: 6px 14px;

    background: transparent;

    border: 1px solid var(--color-lightbox-delete-border);
    border-radius: 999px;

    color: var(--color-lightbox-control);

    font-size: 0.9rem;

    transition:
        background-color 0.2s,
        border-color 0.2s;
}

#lightbox-delete:hover {
    background-color: var(--color-lightbox-delete-hover);
    border-color: var(--color-lightbox-delete-border-hover);
}

#lightbox-delete:disabled {
    opacity: 0.6;
    cursor: default;
}

#lightbox-prev,
#lightbox-next {
    position: absolute;

    top: 50%;

    width: 48px;
    height: 48px;

    padding: 0;

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

    background: var(--color-lightbox-button-background);

    border: 1px solid var(--color-lightbox-button-border);
    border-radius: 50%;

    color: var(--color-lightbox-control);

    font-size: 2rem;
    line-height: 1;

    cursor: pointer;

    transform: translateY(-50%);

    transition:
        background 0.15s ease;
}

#lightbox-prev {
    left: 24px;
}

#lightbox-next {
    right: 24px;
}

#lightbox-prev:hover,
#lightbox-next:hover {
    background: var(--color-lightbox-button-background-hover);
}


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

@media (max-width: 600px) {

    body.site .site-nav {
        gap: 16px;
        padding: 14px 20px;

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

    body.site .hero {
        padding: 48px 20px 56px;
    }

    body.site .hero-card {
        width: 100%;

        box-sizing: border-box;

        padding: 24px 20px;
    }

    .page-section {
        padding-left: 16px;
        padding-right: 16px;
        padding-bottom: 48px;
    }

    #thumbnails {
        grid-template-columns: repeat(2, 1fr);

        gap: 10px;
    }

    #thumbnails img {
        height: 140px;
    }

    #order-form {
        padding: 24px 20px;
    }

    #about-section .about-card {
        padding: 24px 20px;
    }

    body.site .cta,
    body.site button.cta {
        padding: 11px 20px;
    }

    #lightbox {
        padding: 12px;
    }

    #lightbox img {
        max-width: 94vw;
        max-height: 82vh;
    }

    #lightbox-prev,
    #lightbox-next {
        width: 42px;
        height: 42px;

        font-size: 1.7rem;
    }

    #lightbox-prev {
        left: 8px;
    }

    #lightbox-next {
        right: 8px;
    }
}
