/* ==========================================================================
   MECCANICA Theme Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CUSTOM PROPERTIES
   -------------------------------------------------------------------------- */

:root {
    --color-primary: #D96B1C;
    --color-dark: #1A1A1A;
    --color-text: #333333;
    --color-gray: #999999;
    --color-light-gray: #CCCCCC;
    --color-bg: #FFFFFF;
    --color-teal: #053a49;

    --font-mono: 'IBM Plex Mono', 'Courier New', Courier, monospace;
    --font-sans: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --header-height: 90px;
    --footer-height: 60px;
    --wp-admin-bar: 0px;
}

/* WordPress Admin Bar offset */
.admin-bar {
    --wp-admin-bar: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar {
        --wp-admin-bar: 46px;
    }
}

/* --------------------------------------------------------------------------
   RESET & BASE
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    height: 100dvh; /* Dynamic viewport height — accounts for mobile browser chrome */
    -webkit-text-size-adjust: 100%;
}

body {
    height: 100%;
    height: 100dvh;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Safe area for notched phones */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* All pages: flex column, viewport-locked, no vertical scroll */
body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* WordPress admin bar pushes html down via margin-top: 32px.
   Compensate so the body doesn't extend beyond the viewport. */
body.admin-bar {
    height: calc(100dvh - var(--wp-admin-bar));
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   HEADER
   -------------------------------------------------------------------------- */

.site-header {
    position: fixed;
    top: var(--wp-admin-bar);
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 40px;
    background: var(--color-bg);
    height: var(--header-height);
}

/* Branding (logo + subtitle / category nav) */
.header-branding {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.site-logo .custom-logo-link {
    display: inline-block;
}

.site-logo .custom-logo {
    height: 32px;
    width: auto;
}

.site-logo .logo-text {
    font-family: var(--font-sans);
    font-size: 26px;
    font-weight: 800;
    color: var(--color-dark);
    text-decoration: none;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Subtitle (non-homepage) */
.site-subtitle {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-teal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Category navigation (homepage only) */
.gallery-cat-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.gallery-cat-nav .cat-link {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-teal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
    cursor: pointer;
    white-space: nowrap;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
}

.gallery-cat-nav .cat-link:hover,
.gallery-cat-nav .cat-link.active {
    color: var(--color-teal);
    border-bottom-color: var(--color-primary);
}

.gallery-cat-nav .cat-separator {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-teal);
    user-select: none;
}

/* Primary Navigation */
.main-nav {
    flex-shrink: 0;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 0;
    padding: 0;
}

.main-nav li {
    list-style: none;
}

.main-nav a {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 400;
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

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

.main-nav .current-menu-item > a,
.main-nav .current_page_item > a,
.main-nav .current-menu-ancestor > a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* --------------------------------------------------------------------------
   MOBILE CTA BAR (hidden on desktop)
   -------------------------------------------------------------------------- */

.mobile-cta-bar {
    display: none;
}

/* --------------------------------------------------------------------------
   MOBILE MENU TOGGLE
   -------------------------------------------------------------------------- */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    z-index: 101;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-dark);
    transition: 0.3s;
}

/* --------------------------------------------------------------------------
   MOBILE MENU OVERLAY
   -------------------------------------------------------------------------- */

.mobile-menu-overlay {
    position: fixed;
    top: var(--wp-admin-bar);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    z-index: 300;
    padding: 30px;
    padding-bottom: calc(30px + env(safe-area-inset-bottom));
    flex-direction: column;
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    color: var(--color-dark);
    padding: 0;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    flex-shrink: 0;
}

.mobile-menu-nav {
    margin-top: 50px;
}

.mobile-menu-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-nav li {
    list-style: none;
}

.mobile-menu-nav a {
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 400;
    color: var(--color-dark);
    text-decoration: none;
    display: block;
    padding: 8px 0;
}

.mobile-menu-nav a:hover {
    color: var(--color-primary);
}

.mobile-menu-footer {
    margin-top: auto;
    text-align: right;
    font-family: var(--font-sans);
    font-size: 10px;
    color: var(--color-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.8;
}

/* --------------------------------------------------------------------------
   HOMEPAGE GALLERY (Horizontal Scroll)
   -------------------------------------------------------------------------- */

.gallery-container {
    flex: 1;
    min-height: 0;
    margin-top: var(--header-height);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.gallery-container::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    flex-shrink: 0;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.gallery-item img {
    height: 100%;
    width: auto;
    max-width: none;
    display: block;
    object-fit: cover;
}

/* Overlay text on image */
.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(217, 107, 28, 0.75);
    color: #fff;
    padding: 18px 25px;
}

.gallery-item-overlay h3 {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.gallery-item-overlay p {
    font-family: var(--font-sans);
    font-size: 11px;
    line-height: 1.5;
    opacity: 0.92;
}

/* Empty state */
.gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    padding: 40px;
    color: var(--color-gray);
    font-family: var(--font-sans);
    font-size: 16px;
}

.gallery-empty p {
    margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   MENU PAGE (Horizontal Scroll)
   -------------------------------------------------------------------------- */

.menu-panels-container {
    flex: 1;
    min-height: 0;
    margin-top: var(--header-height);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 15px;
    overflow: hidden;
}

.menu-panel {
    height: 100%;
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.menu-panel img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

/* --------------------------------------------------------------------------
   MASTER CLASSES PAGE
   -------------------------------------------------------------------------- */

.master-classes-layout {
    display: grid;
    grid-template-columns: 35% 1fr;
    flex: 1;
    min-height: 0;
    margin-top: var(--header-height);
}

.master-classes-image {
    position: relative;
    overflow: hidden;
}

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

.master-classes-content {
    padding: 40px 60px 80px;
    overflow-y: auto;
}

.master-classes-content .page-title {
    font-family: var(--font-sans);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 30px;
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
}

.master-classes-text {
    column-count: 2;
    column-gap: 50px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.7;
    color: var(--color-text);
}

.master-classes-text p {
    margin-bottom: 1.2em;
}

/* --------------------------------------------------------------------------
   CONTACT PAGE
   -------------------------------------------------------------------------- */

.contact-layout {
    display: grid;
    grid-template-columns: 30% 25% 1fr;
    flex: 1;
    min-height: 0;
    margin-top: var(--header-height);
}

.contact-image {
    position: relative;
    overflow: hidden;
}

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

.contact-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 50px;
}

.contact-info .page-title {
    font-family: var(--font-sans);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.contact-info .entry-content {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text);
}

.contact-info .entry-content p {
    margin-bottom: 1em;
}

/* Contact Form */
.contact-form-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
}

.contact-form {
    display: flex;
    flex-direction: column;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid var(--color-light-gray);
    border-bottom: none;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    border-radius: 0;
}

.contact-form textarea {
    border-bottom: 1px solid var(--color-light-gray);
    min-height: 200px;
    resize: vertical;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: var(--color-primary);
    position: relative;
    z-index: 1;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--color-gray);
    font-weight: 400;
}

.contact-form button[type="submit"] {
    margin-top: 20px;
    padding: 14px 30px;
    background: var(--color-dark);
    color: #fff;
    border: none;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
    align-self: flex-start;
}

.contact-form button[type="submit"]:hover {
    background: var(--color-primary);
}

.contact-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    margin-top: 15px;
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.4;
}

.form-message.success {
    color: #2e7d32;
}

.form-message.error {
    color: #c62828;
}

/* --------------------------------------------------------------------------
   DEFAULT PAGE (Fallback)
   -------------------------------------------------------------------------- */

.default-page {
    margin-top: calc(var(--header-height) + var(--wp-admin-bar));
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 35% 1fr;
}

.default-page .entry-thumbnail {
    overflow: hidden;
}

.default-page .entry-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.default-page .entry-body {
    padding: 40px 60px 80px;
}

.default-page .entry-title {
    font-family: var(--font-sans);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 30px;
}

.default-page .entry-content {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.7;
}

.default-page .entry-content p {
    margin-bottom: 1.2em;
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */

.site-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 500;
    color: var(--color-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.7;
    background: var(--color-bg);
    padding: 8px 40px;
}

.footer-copyright .copyright-line {
    display: block;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-social .social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--color-gray);
    transition: color 0.25s ease, transform 0.25s ease;
}

.footer-social .social-icon svg {
    width: 100%;
    height: 100%;
}

.footer-social .social-icon:hover {
    color: var(--color-primary);
    transform: translateY(-2px);
}


/* --------------------------------------------------------------------------
   WORDPRESS DEFAULTS
   -------------------------------------------------------------------------- */

.wp-block-image img {
    max-width: 100%;
    height: auto;
}

.alignleft {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* --------------------------------------------------------------------------
   LIGHTBOX (Menu Page)
   -------------------------------------------------------------------------- */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   RESPONSIVE — TABLET (≤ 1024px)
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    :root {
        --header-height: 70px;
    }

    .main-nav ul {
        gap: 14px;
    }

    .main-nav a {
        font-size: 14px;
    }

    .master-classes-layout {
        grid-template-columns: 30% 1fr;
    }

    .master-classes-content {
        padding: 30px 40px 80px;
    }

    .master-classes-text {
        column-gap: 35px;
        font-size: 14px;
    }

    .contact-layout {
        grid-template-columns: 30% 1fr 35%;
    }

    .contact-info {
        padding: 30px 35px;
    }

    .contact-form-wrap {
        padding: 30px;
    }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — MOBILE (≤ 768px)
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    :root {
        --header-height: 120px;
    }

    /* -- Header -- */
    .site-header {
        padding: 10px 20px 6px;
        flex-wrap: wrap;
        align-items: center;
    }

    .header-branding {
        gap: 2px;
        max-width: calc(100% - 50px); /* Leave room for hamburger */
    }

    /* -- Mobile CTA Bar -- */
    .mobile-cta-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        order: 3;
        padding: 10px 0 10px;
    }

    .mobile-cta-call {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: 1.5px solid var(--color-gray);
        color: var(--color-gray);
        flex-shrink: 0;
        transition: color 0.2s, border-color 0.2s;
    }

    .mobile-cta-call svg {
        width: 15px;
        height: 15px;
    }

    .mobile-cta-call:active {
        color: var(--color-primary);
        border-color: var(--color-primary);
    }

    .mobile-cta-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 32px;
        font-family: var(--font-sans);
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1px;
        border: 1.5px solid var(--color-dark);
        color: var(--color-dark);
        background: transparent;
        text-decoration: none;
        white-space: nowrap;
        transition: background 0.2s, color 0.2s;
    }

    .mobile-cta-btn:active {
        background: var(--color-dark);
        color: #fff;
    }

    .mobile-cta-btn--primary {
        background: var(--color-primary);
        border-color: var(--color-primary);
        color: #fff;
    }

    .mobile-cta-btn--primary:active {
        background: #c45e17;
        border-color: #c45e17;
    }

    .site-logo .custom-logo {
        height: 22px;
    }

    .site-logo .logo-text {
        font-size: 18px;
        letter-spacing: 1.5px;
    }

    /* Category nav: horizontal scrollable strip on mobile */
    .gallery-cat-nav {
        gap: 5px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 2px;
        max-width: 100%;
    }

    .gallery-cat-nav::-webkit-scrollbar {
        display: none;
    }

    .gallery-cat-nav .cat-link {
        font-size: 9px;
        letter-spacing: 0.3px;
        /* Touch-friendly: make the tap area bigger */
        padding: 4px 0;
        min-height: 28px;
        display: inline-flex;
        align-items: center;
    }

    .gallery-cat-nav .cat-separator {
        font-size: 9px;
    }

    .site-subtitle {
        font-size: 9px;
        letter-spacing: 0.3px;
    }

    /* -- Hide desktop nav, show hamburger -- */
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        /* Touch-friendly: min 44×44px tap target */
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }

    /* -- Mobile Menu Overlay -- */
    .mobile-menu-overlay {
        padding: 20px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .mobile-menu-header .site-logo .custom-logo {
        height: 20px;
    }

    .mobile-menu-close {
        font-size: 28px;
        /* Touch-friendly tap target */
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-nav {
        margin-top: 40px;
    }

    .mobile-menu-nav a {
        font-size: 20px;
        /* Touch-friendly: min 44px height per menu item */
        padding: 10px 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .mobile-menu-footer {
        font-size: 9px;
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* -- Gallery: still horizontal, full viewport height -- */
    .gallery-container {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .gallery-item img {
        height: 100%;
        width: auto;
        max-width: none;
    }

    /* -- Menu: stack vertically, allow vertical scroll -- */
    .menu-panels-container {
        flex-direction: column;
        align-items: stretch;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        padding: 10px;
    }

    .menu-panel {
        height: auto;
        width: 100%;
    }

    .menu-panel img {
        width: 100%;
        height: auto;
        max-height: none;
    }

    /* Overlay: slightly smaller on mobile */
    .gallery-item-overlay {
        padding: 14px 18px;
    }

    .gallery-item-overlay h3 {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .gallery-item-overlay p {
        font-size: 10px;
    }

    /* -- Master Classes: stack vertically, scroll whole page -- */
    .master-classes-layout {
        grid-template-columns: 1fr;
        min-height: auto;
        overflow-y: auto;
    }

    .master-classes-image {
        height: auto;
        overflow: visible;
    }

    .master-classes-image img {
        width: 100%;
        height: auto !important;
        object-fit: contain;
    }

    .master-classes-content {
        padding: 24px 20px 100px;
        overflow-y: visible;
    }

    .master-classes-content .page-title {
        font-size: 18px;
        letter-spacing: 2px;
        margin-bottom: 20px;
    }

    .master-classes-text {
        column-count: 1;
        font-size: 14px;
        line-height: 1.65;
    }

    /* -- Contact: stack vertically -- */
    .contact-layout {
        grid-template-columns: 1fr;
        min-height: auto;
        overflow-y: auto;
    }

    .contact-image {
        height: 35vh;
        height: 35dvh;
    }

    .contact-info {
        padding: 24px 20px 16px;
        justify-content: flex-start;
    }

    .contact-info .page-title {
        font-size: 18px;
        letter-spacing: 2px;
        margin-bottom: 12px;
    }

    .contact-info .entry-content {
        font-size: 14px;
    }

    .contact-form-wrap {
        padding: 0 20px 100px;
    }

    /* Touch-friendly form fields */
    .contact-form input[type="text"],
    .contact-form input[type="email"],
    .contact-form textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 14px 16px;
        min-height: 48px; /* Touch-friendly */
    }

    .contact-form textarea {
        min-height: 160px;
    }

    .contact-form button[type="submit"] {
        min-height: 48px;
        font-size: 14px;
        padding: 14px 28px;
        width: 100%; /* Full width on mobile */
        align-self: stretch;
        text-align: center;
    }

    .form-message {
        font-size: 14px;
        text-align: center;
    }

    /* -- Default page: stack vertically -- */
    .default-page {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .default-page .entry-thumbnail {
        height: 35vh;
        height: 35dvh;
    }

    .default-page .entry-body {
        padding: 24px 20px 100px;
    }

    .default-page .entry-title {
        font-size: 18px;
    }

    .default-page .entry-content {
        font-size: 14px;
    }

    /* -- Footer -- */
    .site-footer {
        font-size: 8px;
        padding: 20px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .footer-social {
        gap: 10px;
    }

    .footer-social .social-icon {
        width: 16px;
        height: 16px;
    }


    /* Empty state */
    .gallery-empty {
        padding: 30px 20px;
        font-size: 14px;
    }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — SMALL MOBILE (≤ 480px)
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
    :root {
        --header-height: 110px;
    }

    .site-header {
        padding: 6px 14px 4px;
    }

    .mobile-cta-call {
        width: 28px;
        height: 28px;
    }

    .mobile-cta-call svg {
        width: 13px;
        height: 13px;
    }

    .mobile-cta-btn {
        height: 28px;
        font-size: 9px;
    }

    .site-logo .custom-logo {
        height: 18px;
    }

    .site-logo .logo-text {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .site-subtitle {
        font-size: 8px;
    }

    .gallery-cat-nav .cat-link {
        font-size: 7.5px;
        padding: 3px 0;
    }

    .gallery-cat-nav .cat-separator {
        font-size: 7.5px;
    }

    .mobile-menu-nav a {
        font-size: 18px;
    }

    .gallery-item-overlay {
        padding: 10px 14px;
    }

    .gallery-item-overlay h3 {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .gallery-item-overlay p {
        font-size: 9px;
    }

    .master-classes-image {
        height: auto;
    }

    .contact-image,
    .default-page .entry-thumbnail {
        height: 30vh;
        height: 30dvh;
    }

    .master-classes-content,
    .default-page .entry-body {
        padding: 20px 16px 90px;
    }

    .contact-info {
        padding: 20px 16px 12px;
    }

    .contact-form-wrap {
        padding: 0 16px 90px;
    }
}

/* --------------------------------------------------------------------------
   RESPONSIVE — LANDSCAPE MOBILE
   -------------------------------------------------------------------------- */

@media (max-height: 500px) and (orientation: landscape) {
    :root {
        --header-height: 46px;
    }

    .site-header {
        padding: 8px 16px 4px;
    }

    .mobile-cta-bar {
        display: none;
    }

    .site-logo .custom-logo {
        height: 18px;
    }

    .site-logo .logo-text {
        font-size: 16px;
    }

    .gallery-cat-nav .cat-link,
    .gallery-cat-nav .cat-separator {
        font-size: 8px;
    }

    /* Landscape gallery: images fill the short height, scroll works great */
    .gallery-item-overlay {
        padding: 8px 14px;
    }

    .gallery-item-overlay h3 {
        font-size: 10px;
        margin-bottom: 2px;
    }

    .gallery-item-overlay p {
        font-size: 9px;
    }

    /* Landscape stacked pages: use side-by-side even on mobile */
    .master-classes-layout {
        grid-template-columns: 40% 1fr;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .master-classes-image {
        height: auto;
    }

    .master-classes-content {
        padding: 16px 24px 60px;
    }

    .master-classes-content .page-title {
        font-size: 16px;
        margin-bottom: 14px;
    }

    .master-classes-text {
        column-count: 1;
        font-size: 13px;
    }

    .contact-layout {
        grid-template-columns: 35% 1fr;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .contact-image {
        height: auto;
    }

    .contact-info {
        padding: 16px 20px;
    }

    .contact-info .page-title {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .contact-form-wrap {
        padding: 16px 20px;
    }

    .contact-form input[type="text"],
    .contact-form input[type="email"] {
        min-height: 40px;
        padding: 10px 14px;
    }

    .contact-form textarea {
        min-height: 100px;
    }

    .contact-form button[type="submit"] {
        min-height: 40px;
        padding: 10px 20px;
    }

    /* Footer in landscape */
    .site-footer {
        font-size: 7px;
    }

    .footer-social .social-icon {
        width: 14px;
        height: 14px;
    }

    /* Mobile menu: adjust for landscape */
    .mobile-menu-nav {
        margin-top: 20px;
    }

    .mobile-menu-nav a {
        font-size: 16px;
        padding: 6px 0;
        min-height: 36px;
    }
}

/* --------------------------------------------------------------------------
   HIGH-DPI / RETINA HELPER
   -------------------------------------------------------------------------- */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .gallery-item img,
    .menu-panel img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* --------------------------------------------------------------------------
   REDUCED MOTION — Accessibility
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .gallery-container,
    .menu-panels-container {
        scroll-behavior: auto;
    }

    .mobile-menu-overlay {
        transition: none;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}

/* --------------------------------------------------------------------------
   SMOOTH SCROLL BEHAVIOR
   -------------------------------------------------------------------------- */

.gallery-container,
.menu-panels-container {
    scroll-behavior: smooth;
}

/* When JS controls scroll, we disable CSS smooth for immediate response */
.gallery-container.js-scrolling,
.menu-panels-container.js-scrolling {
    scroll-behavior: auto;
}

/* --------------------------------------------------------------------------
   PRINT STYLES
   -------------------------------------------------------------------------- */

@media print {
    .site-header,
    .site-footer,
    .mobile-menu-overlay,
    .mobile-menu-toggle,
    .gallery-cat-nav {
        display: none !important;
    }

    body {
        overflow: auto !important;
    }

    .gallery-container,
    .menu-panels-container {
        position: static;
        flex-direction: column;
        overflow: visible;
    }

    .gallery-item,
    .menu-panel {
        height: auto;
        page-break-inside: avoid;
    }

    .gallery-item img,
    .menu-panel img {
        height: auto;
        width: 100%;
    }
}
