/*
Theme Name: Munch
Theme URI: https://munchgvc.com
Author: Munch
Description: Playful pink block theme for Munch — Gourmet Vegan Cookies. Fully editable in the Site Editor: every section is a native block you can drag, drop, and type on directly.
Version: 1.1.0
Requires at least: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: munch
Tags: block-patterns, full-site-editing, food-and-drink
*/

/* ---------- Header / nav ---------- */
/* Sticky must live on the template-part wrapper: its parent (the page) is
   taller than it, unlike the inner group whose parent is its own height. */
header.wp-block-template-part {
    position: sticky;
    top: 0;
    z-index: 1000;
}

body.admin-bar header.wp-block-template-part {
    top: 32px;
}

.munch-header {
    padding: 1.2rem 3rem;
    background-color: transparent;
    transition: background-color .3s ease, box-shadow .3s ease, padding .3s ease;
}

.munch-header.scrolled {
    background-color: var(--wp--preset--color--blush);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    padding: 1rem 3rem;
}

.munch-header .wp-block-site-logo img {
    height: 60px;
    width: auto;
    transition: height .3s ease;
}

.munch-header.scrolled .wp-block-site-logo img {
    height: 55px;
}

.munch-header .wp-block-navigation a {
    font-weight: 700;
}

.munch-header .wp-block-navigation a:hover {
    color: var(--wp--preset--color--pink);
}

/* ---------- Section styles (pick these in the block "Styles" panel) ---------- */
.is-style-munch-hero {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(135deg, #ffe8f0, #ffd6e7, #fff0d6);
    border-radius: 24px;
}

.is-style-munch-card {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .07);
    transition: transform .2s;
}

.is-style-munch-card:hover {
    transform: translateY(-6px);
}

.is-style-munch-panel-blush {
    background-color: var(--wp--preset--color--blush);
    border-radius: 24px;
    padding: 3rem;
}

.is-style-munch-panel-peach {
    background-color: var(--wp--preset--color--peach);
    border-radius: 24px;
    padding: 3rem;
}

/* Sections span the full panel width like the original site,
   instead of being capped at the global 1100px content width. */
.wp-block-group.is-style-munch-hero > *,
.wp-block-group.is-style-munch-panel-blush > *,
.wp-block-group.is-style-munch-panel-peach > * {
    max-width: none;
}

/* Match the original card's tight internal spacing
   (emoji→title 8px, title→text 8px, text→price 16px). */
.is-style-munch-card > * {
    margin-block-start: 0.5rem;
    margin-block-end: 0;
}

.is-style-munch-card > :first-child {
    margin-block-start: 0;
}

.is-style-munch-card .munch-price {
    margin-block-start: 1rem;
}

/* Our Story portrait: fixed 300x350 crop like the original. */
.is-style-munch-panel-peach .wp-block-columns .wp-block-image img {
    width: 300px;
    height: 350px;
    object-fit: cover;
    border-radius: 20px;
}

/* ---------- Card grids: cap cards at 300px and center, like the original site ---------- */
.wp-block-group.is-layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 300px));
    justify-content: center;
    gap: 2rem;
}

/* ---------- Card helpers ---------- */
.munch-emoji {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: .5rem;
}

.munch-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--wp--preset--color--pink);
}

/* Photo cookie card: image bleeds to the card edges */
.munch-card-photo {
    padding: 0;
    overflow: hidden;
}

.munch-card-photo > .wp-block-image {
    margin: 0 0 1rem;
    position: relative;
}

/* The "cookie packed in the box" look: the original's inset shadow where
   the photo meets the card body, drawn as an overlay so it shows above the image. */
.munch-card-photo > .wp-block-image::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: inset 0 -6px 8px rgba(0, 0, 0, 0.04);
    pointer-events: none;
}

.munch-card-photo > .wp-block-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: top;
    border-radius: 16px 16px 0 0;
    display: block;
}

.munch-card-photo .munch-card-body {
    padding: 0 2rem 2rem;
}

/* Original site centers every h2 by default (legal pages override to left, below). */
h2.wp-block-heading {
    text-align: center;
}

/* ---------- Events ---------- */
/* Content sits flush left inside the card like the original,
   not centered in a capped column. */
.wp-block-group.munch-event-card > * {
    max-width: none;
}

.munch-event-card {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .07);
}

.munch-event-date {
    background: var(--wp--preset--color--blush);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    text-align: center;
}

.munch-event-date .munch-event-day {
    font-size: 2rem;
    font-weight: 800;
    color: var(--wp--preset--color--pink);
    line-height: 1.2;
    margin: 0;
}

.munch-event-date .munch-event-month {
    font-size: .9rem;
    color: var(--wp--preset--color--mauve);
    font-weight: 700;
    margin: 0;
}

/* ---------- Legal pages ---------- */
.munch-legal {
    font-size: 1.15rem;
    line-height: 1.75;
    color: #5a474d;
}

.munch-legal h1 {
    font-size: 2.6rem;
    text-align: left;
}

.munch-legal h2 {
    font-family: var(--wp--preset--font-family--nunito);
    font-size: 1.5rem;
    font-weight: 800;
    color: #d44d77;
    text-align: left;
    margin-top: 1.8rem;
}

.munch-legal-updated {
    color: #b39aa3;
    font-size: 1rem;
}

.munch-note {
    background: #fff5f8;
    border: 1px solid #f3cdda;
    border-radius: 12px;
    padding: 16px 18px;
}

.munch-note strong {
    color: #d44d77;
}

/* ---------- Forms (styles any form plugin dropped inside a .munch-form group) ---------- */
.munch-form input[type="text"],
.munch-form input[type="email"],
.munch-form input[type="tel"],
.munch-form input[type="date"],
.munch-form select,
.munch-form textarea {
    padding: 1rem;
    border: 2px solid var(--wp--preset--color--rose);
    border-radius: 12px;
    font-family: var(--wp--preset--font-family--nunito);
    font-size: 1rem;
    background: #fff;
    width: 100%;
    transition: border-color .2s;
}

.munch-form input:focus,
.munch-form select:focus,
.munch-form textarea:focus {
    outline: none;
    border-color: var(--wp--preset--color--pink);
}

.munch-form textarea {
    min-height: 150px;
    resize: vertical;
}

.munch-form button[type="submit"],
.munch-form input[type="submit"] {
    background-color: var(--wp--preset--color--pink);
    color: #fff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color .2s, transform .2s;
}

.munch-form button[type="submit"]:hover,
.munch-form input[type="submit"]:hover {
    background-color: var(--wp--preset--color--pink-dark);
    transform: scale(1.02);
}

/* ---------- Buttons ---------- */
.wp-block-button__link:hover {
    transform: scale(1.05);
}

.wp-block-button__link {
    transition: background-color .2s, transform .2s;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .munch-header {
        padding: 1rem 1.5rem;
    }

    .munch-header.scrolled {
        padding: .6rem 1.5rem;
    }

    .is-style-munch-hero {
        padding: 3rem 1.25rem;
    }

    .is-style-munch-panel-blush,
    .is-style-munch-panel-peach {
        padding: 2rem 1.25rem;
    }

    main.wp-block-group {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    .wp-block-group.is-layout-grid {
        grid-template-columns: 1fr;
    }

    .is-style-munch-panel-peach .wp-block-columns .wp-block-image img {
        width: 100%;
        height: 250px;
    }
}
