/*
Theme Name: AMIGD Theme
Theme URI: https://presspilotapp.com
Author: PressPilot
Author URI: https://presspilotapp.com
Description: Custom FSE theme for AMIGD
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: 019f0b41-94e1-70ca-af09-58f85b26eb5a
PressPilot Generator Contract: generated-theme-contract-v1
PressPilot Generator Fingerprint: 6419adf741bf
*/

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;
}

/* 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);
}
