/*
Theme Name: Tiramisu Restaurant Theme
Theme URI: https://presspilotapp.com
Author: PressPilot
Author URI: https://presspilotapp.com
Description: Custom FSE theme for Tiramisu Restaurant
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: 019f4930-0e2d-7396-a3a8-b2eb44bb1234
PressPilot Generator Contract: generated-theme-contract-v1
PressPilot Generator Fingerprint: 5ac7cf02e05f
*/

header.wp-block-template-part:has(.presspilot-header-overlay) {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 10;
}

header.wp-block-template-part:has(.presspilot-header-overlay) + * {
    margin-block-start: 0;
}

.admin-bar header.wp-block-template-part:has(.presspilot-header-overlay) {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar header.wp-block-template-part:has(.presspilot-header-overlay) {
        top: 46px;
    }
}

/* WooCommerce icon visibility on transparent (dark-overlay) header.
 * Mini-cart + customer-account SVG icons use currentColor — cascading
 * color:base makes them white over the dark hero. The count badge gets
 * !important on both properties because WC's block stylesheet (loaded as
 * a plugin asset after theme CSS) sets an explicit background-color on
 * the badge at equal specificity; !important ensures our rule wins. */
.presspilot-header-overlay .wc-block-mini-cart__button {
    color: var(--wp--preset--color--base);
}

.presspilot-header-overlay .wc-block-mini-cart__quantity-badge {
    background-color: var(--wp--preset--color--base) !important;
    color: var(--wp--preset--color--contrast) !important;
}

.presspilot-header-overlay .wc-block-customer-account a {
    color: var(--wp--preset--color--base);
}

/* WooCommerce mini-cart badge on standard (non-overlay) headers.
 * Specificity (0,1,1): lower than the overlay rule (0,2,0), so the overlay
 * rule wins when .presspilot-header-overlay is present — correct behavior.
 * !important overrides WooCommerce's own badge stylesheet (plugin asset,
 * loaded after theme CSS, equal or lower specificity on standard headers). */
header.wp-block-template-part .wc-block-mini-cart__quantity-badge {
    background-color: var(--wp--preset--color--contrast) !important;
    color: var(--wp--preset--color--base) !important;
}

/* WooCommerce swap: cart/checkout templates render two siblings.
 * .presspilot-has-woo-only wraps the real [woocommerce_cart] / [woocommerce_checkout] shortcode.
 * .presspilot-no-woo wraps the static design preview shown when Woo is inactive.
 * functions.php adds the .presspilot-has-woo body class iff WooCommerce is loaded. */
.presspilot-has-woo-only {
    display: none;
}

.presspilot-has-woo .presspilot-has-woo-only {
    display: block;
}

.presspilot-has-woo .presspilot-no-woo {
    display: none;
}

/* Responsive covers: reduce fixed-px hero/banner heights on small screens and
 * shift the focal point upward so subjects' heads stay in frame.  vh covers
 * (100vh full-bleed heroes) are already viewport-relative — height excluded,
 * but they still benefit from the upward focal shift on short phones. */
@media (max-width: 600px) {
    .wp-block-cover[style*="min-height:480px"] {
        min-height: 280px !important;
    }
    .wp-block-cover[style*="min-height:680px"] {
        min-height: 400px !important;
    }
    .wp-block-cover__image-background {
        object-position: 50% 30% !important;
    }
}

/* Mobile typography: reduce large font-size presets on phones.
 * Desktop :root values (set by theme.json) are untouched. */
@media (max-width: 600px) {
    :root {
        --wp--preset--font-size--x-large: 1.25rem;
        --wp--preset--font-size--2-x-large: 1.5rem;
        --wp--preset--font-size--3-x-large: 1.75rem;
        --wp--preset--font-size--huge: 2rem;
    }
    .pp-stat-number { font-size: 2rem !important; }
    .pp-price-amount { font-size: 1.75rem !important; }
    .pp-step-number { font-size: 1.5rem !important; }
}

/* Mobile spacing: reduce large spacing presets on phones.
 * Desktop :root values (set by theme.json) are untouched. */
@media (max-width: 600px) {
    :root {
        --wp--preset--spacing--60: 2rem;
        --wp--preset--spacing--70: 2.5rem;
        --wp--preset--spacing--80: 3rem;
    }
}

/* Mobile footer: reduce fixed padding on phones. */
@media (max-width: 600px) {
    .pp-footer {
        padding-top: 40px !important;
        padding-bottom: 32px !important;
    }
}

/* Mobile overlay menu: center links and increase size for touch targets.
 * Scoped to .is-menu-open so the desktop inline nav is never affected.
 * Direction-agnostic (centering works in both LTR and RTL). */
.wp-block-navigation__responsive-container.is-menu-open {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    font-size: 1.5rem;
}

/* Portfolio filterable gallery: CSS grid for reliable 4-across layout with compact reflow on filter. */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--wp--preset--spacing--30, 1rem);
}

.portfolio-grid > .wp-block-group {
    margin: 0;
    min-width: 0;
}

.portfolio-grid figure {
    margin: 0;
}

.portfolio-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

@media (max-width: 781px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* Portfolio filter chip styling: accent color for active state, soft outline for inactive. */
.portfolio-filter-wrap .wp-block-button .wp-block-button__link {
    background-color: transparent;
    color: var(--wp--preset--color--contrast, #1a1a1a);
    border: 1px solid var(--wp--preset--color--contrast, #1a1a1a);
    border-radius: 4px;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.portfolio-filter-wrap .wp-block-button.is-active .wp-block-button__link,
.portfolio-filter-wrap .wp-block-button .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--accent, #c2a990);
    color: var(--wp--preset--color--contrast, #1a1a1a);
    border-color: var(--wp--preset--color--accent, #c2a990);
}
