/*
Theme Name: Meadowdale Winery Block Theme
Author: Custom Development
Description: A full-site editing (FSE) block theme where all content, layouts, and colors are 100% editable in the WordPress Site Editor.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
*/

/* Global Layout Breakouts */
html, body {
    overflow-x: hidden;
}

.entry-content .alignfull,
.wp-block-post-content .alignfull,
.wp-site-blocks .alignfull {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

/* Custom Text Shadow Helper */
.hero-text-shadow {
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}

/* Base Image Formatting */
.wp-block-image img {
    border-radius: 0px;
    box-shadow: none;
}

/* Capital Craft Beverage Trail Box */
.trail-banner {
    border: 1px solid #000000;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.trail-banner p {
    font-style: italic;
    font-size: 0.95rem;
    margin: 0;
}

/* Footer Alignment */
footer.wp-block-template-part {
    border-top: 1px solid #dddddd;
}

.footer-grid {
    display: grid;
    grid-template-columns: 90px 1fr 1fr 1fr;
    gap: 35px;
    align-items: start;
    max-width: 1080px;
    margin: 0 auto;
}

.wp-block-social-links .wp-social-link {
    background-color: transparent;
}

.wp-block-social-links .wp-social-link svg {
    fill: currentColor;
    width: 18px;
    height: 18px;
}

/* Winery Card Layout & Flex Alignment */
.winery-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.winery-card-details {
    width: 100%;
}

.winery-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.winery-card-header h4 {
    margin: 0;
    font-size: 1.3rem;
}

.winery-card-abv {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: #444444;
    white-space: nowrap;
}

/* Age Gate Overlay Modal */
body.age-gate-active {
    overflow: hidden !important;
}

.age-gate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.age-gate-card {
    background-color: #ffffff;
    max-width: 520px;
    width: 100%;
    padding: 45px 35px 35px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    text-align: center;
    border-radius: 2px;
}

.age-gate-logo img {
    max-width: 180px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
}

.age-gate-title {
    font-family: var(--wp--preset--font-family--heading, "Marlboro", serif);
    font-size: 2.3rem;
    font-weight: 700;
    color: #000000;
    margin: 0 0 25px 0;
    letter-spacing: 0.5px;
}

.age-gate-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 25px;
}

.age-gate-btn {
    background-color: var(--wp--preset--color--burgundy, #7E322C);
    color: #ffffff;
    border: none;
    padding: 12px 36px;
    font-size: 1.25rem;
    font-family: var(--wp--preset--font-family--heading, "Marlboro", serif);
    font-weight: bold;
    cursor: pointer;
    min-width: 100px;
    transition: background-color 0.2s ease;
}

.age-gate-btn:hover {
    background-color: #632621;
}

.age-gate-subtext {
    font-family: var(--wp--preset--font-family--body, "Geom", sans-serif);
    font-size: 0.95rem;
    color: #1a1a1a;
    margin: 0;
}

/* Age Gate Slide-Up Exit Animation */
.age-gate-overlay.age-gate-exiting {
    animation: ageGateFadeOut 0.4s ease-in-out forwards;
}

.age-gate-overlay.age-gate-exiting .age-gate-card {
    animation: ageGateSlideUpExit 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ageGateSlideUpExit {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-120px);
    }
}

@keyframes ageGateFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Denied Message Hidden Base State */
.age-gate-denied-msg {
    display: none;
    margin-top: 20px;
    margin-bottom: 0;
    font-family: var(--wp--preset--font-family--heading, "Marlboro", serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--wp--preset--color--burgundy, #7E322C);
    letter-spacing: 0.3px;
}

/* Triggered Zoom-In Keyframe Class */
.age-gate-denied-msg.age-gate-zoom-in {
    display: block;
    animation: ageGateZoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes ageGateZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Retailer Store Locator Layout */
.retailer-list {
    max-height: 520px;
    overflow-y: auto;
    padding-right: 12px;
}

.retailer-item {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    margin-bottom: 12px;
    cursor: pointer;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
}

.retailer-item:hover {
    border-color: var(--wp--preset--color--burgundy, #7E322C);
    background-color: #faf5f5;
}

/* Active Highlighted Retailer */
.retailer-item.active {
    border-color: var(--wp--preset--color--burgundy, #7E322C);
    border-left: 5px solid var(--wp--preset--color--burgundy, #7E322C);
    background-color: #fdf3f2;
    box-shadow: 0 4px 12px rgba(126, 50, 44, 0.12);
}

.retailer-item strong {
    font-size: 1.1rem;
    color: #1a1a1a;
}

/* Enforce 16px Side Margins on Mobile */
@media (max-width: 768px) {
    .wp-site-blocks,
    .is-root-container,
    .entry-content > :not(.alignfull) {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* Hide the ABV paragraph if it renders empty */
.winery-card-abv:empty {
  display: none;
}

/* Hide the featured image container if no image exists */
.winery-card .wp-block-post-featured-image:empty,
.winery-card .wp-block-post-featured-image:not(:has(img[src])) {
  display: none !important;
}

.retailer-directions-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 0.6em 1.2em;
    background-color: var(--wp--preset--color--burgundy, #6b1d2f);
    color: #ffffff;
    border: none;
    border-radius: var(--wp--preset--spacing--20, 4px);
    font-size: var(--wp--preset--font-size--small, 0.875rem);
    font-weight: 600;
    line-height: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.retailer-directions-btn:hover,
.retailer-directions-btn:focus {
    opacity: 0.85;
    color: #ffffff;
    text-decoration: none;
}