/**
 * Home Garments - Component Styles
 * Announcement bar, header, navigation, search, buttons, footer, patterns.
 */

/* ---------------------------------------------------------------------------
 * Dark sections: headings and links inherit the light text colour.
 * ------------------------------------------------------------------------ */
.has-dark-background-color :is(h1, h2, h3, h4, h5, h6),
.has-dark-background-color a {
    color: inherit;
}

.has-dark-background-color a:hover {
    color: var(--wp--preset--color--accent-soft);
}

/* Page sections butt together; each section sets its own padding. */
.wp-site-blocks > * {
    margin-block-start: 0;
}

/* ---------------------------------------------------------------------------
 * Announcement bar
 * ------------------------------------------------------------------------ */
.hg-announce {
    padding: 0.55rem 0;
}

.hg-announce p {
    margin: 0;
}

/* ---------------------------------------------------------------------------
 * Header
 * ------------------------------------------------------------------------ */

/* The template-part wrapper would otherwise bound the sticky header to its
   own height; letting it pass through makes the header stick to the page. */
.wp-block-template-part:has(> .hg-header) {
    display: contents;
}

.hg-header {
    position: sticky;
    top: var(--wp-admin--admin-bar--height, 0);
    z-index: 50;
    isolation: isolate;
    background: transparent;
    border-bottom: 1px solid var(--wp--preset--color--border-subtle);
    transition: box-shadow var(--hg-base) var(--hg-ease);
}

/* The blur lives on a pseudo-element: backdrop-filter on the header itself
   would make it the containing block for the fixed-position mobile menu. */
.hg-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-color: color-mix(in srgb, var(--wp--preset--color--base) 92%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

/* Below 600px WordPress makes the admin bar scroll away (position: absolute),
   so the sticky header offsets only above that width. */
@media (max-width: 600px) {
    .admin-bar .hg-header {
        top: 0;
    }
}

.hg-header.is-scrolled {
    box-shadow: var(--hg-shadow-md);
}

.hg-header__inner {
    min-height: var(--hg-header-height);
    gap: 1.5rem;
}

.hg-brand {
    gap: 0.75rem;
    flex: none;
}

.hg-brand .wp-block-site-logo img {
    border-radius: var(--hg-radius-sm);
}

.hg-brand .wp-block-site-title {
    margin: 0;
    white-space: nowrap;
}

/* Navigation links with a growing underline. */
.hg-nav {
    flex: 1 1 auto;
    min-width: 0;
}

.hg-nav .wp-block-navigation-item__content {
    position: relative;
    padding: 0.5rem 0.25rem;
}

.hg-nav .wp-block-navigation-item__content::after {
    content: "";
    position: absolute;
    left: 0.25rem;
    right: 0.25rem;
    bottom: 0.15rem;
    height: 1.5px;
    background: var(--wp--preset--color--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--hg-base) var(--hg-ease);
}

.hg-nav .wp-block-navigation-item__content:hover::after,
.hg-nav .current-menu-item > .wp-block-navigation-item__content::after {
    transform: scaleX(1);
}

/* Hamburger and close buttons. */
.hg-nav .wp-block-navigation__responsive-container-open,
.hg-nav .wp-block-navigation__responsive-container-close {
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: var(--hg-radius-pill);
}

.hg-nav .wp-block-navigation__responsive-container-open svg,
.hg-nav .wp-block-navigation__responsive-container-close svg {
    width: 26px;
    height: 26px;
}

/* Full-screen mobile menu. */
.hg-nav .wp-block-navigation__responsive-container.is-menu-open {
    background: var(--wp--preset--color--base);
    padding: 5rem 1.5rem 2.5rem;
}

.hg-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    gap: 1.25rem;
}

.hg-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    font-family: var(--wp--preset--font-family--fraunces);
    font-size: var(--wp--preset--font-size--xx-large);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    padding: 0.25rem 0;
}

.hg-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content::after {
    display: none;
}

/* Header actions: search, account, bag. */
.hg-actions {
    gap: 0.25rem;
    flex: none;
    align-items: center;
}

.hg-actions .wc-block-customer-account,
.hg-actions .wc-block-mini-cart {
    display: flex;
    align-items: center;
}

.hg-actions .wc-block-customer-account__account-icon,
.hg-actions .wc-block-mini-cart__button {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hg-radius-pill);
    color: var(--wp--preset--color--contrast);
    background: transparent;
    border: 0;
    transition: background-color var(--hg-fast) var(--hg-ease), color var(--hg-fast) var(--hg-ease);
}

.hg-actions .wc-block-customer-account__account-icon:hover,
.hg-actions .wc-block-mini-cart__button:hover {
    background: var(--wp--preset--color--surface-light);
    color: var(--wp--preset--color--contrast);
}

.hg-actions .wc-block-mini-cart__badge {
    background: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--base);
    border: 0;
    font-weight: 600;
}

/* Search: core "button-only" search. Core toggles .wp-block-search__searchfield-hidden,
   aria-expanded and the input's tab order; this only styles the two states. */
.hg-search {
    position: relative;
    margin: 0;
}

.hg-search .wp-block-search__inside-wrapper {
    border: 0;
    padding: 0;
    background: transparent;
    align-items: center;
}

.hg-search .wp-block-search__input {
    width: 220px;
    height: 40px;
    margin-right: 0.25rem;
    padding: 0 1rem;
    border: 0;
    border-radius: var(--hg-radius-pill);
    background: var(--wp--preset--color--surface-light);
    transition: width var(--hg-base) var(--hg-ease), padding var(--hg-base) var(--hg-ease), opacity var(--hg-fast) var(--hg-ease);
}

.hg-search.wp-block-search__searchfield-hidden .wp-block-search__input {
    width: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
}

.hg-search .wp-block-search__button {
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--hg-radius-pill);
    background: transparent;
    color: var(--wp--preset--color--contrast);
    cursor: pointer;
    transition: background-color var(--hg-fast) var(--hg-ease);
}

.hg-search .wp-block-search__button:hover {
    background: var(--wp--preset--color--surface-light);
}

.hg-search .wp-block-search__button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

@media (max-width: 781px) {
    :root {
        --hg-header-height: 60px;
    }

    .hg-header__inner {
        gap: 0.5rem;
    }

    .hg-brand .wp-block-site-logo {
        display: none;
    }

    /* Opened search drops into a full-width row under the header. */
    .hg-header .hg-search:not(.wp-block-search__searchfield-hidden) {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
        background: var(--wp--preset--color--base);
        border-bottom: 1px solid var(--wp--preset--color--border-subtle);
        box-shadow: var(--hg-shadow-md);
    }

    .hg-header .hg-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__inside-wrapper,
    .hg-header .hg-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__input {
        width: 100%;
    }
}

/* ---------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------ */
.wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    cursor: pointer;
    transition: background-color var(--hg-fast) var(--hg-ease), color var(--hg-fast) var(--hg-ease), border-color var(--hg-fast) var(--hg-ease), transform var(--hg-fast) var(--hg-ease), box-shadow var(--hg-fast) var(--hg-ease);
}

.wp-block-button__link:hover {
    transform: translateY(-1px);
    box-shadow: var(--hg-shadow-md);
}

/* Outline buttons on dark backgrounds. */
.has-dark-background-color .is-style-outline .wp-block-button__link,
.hg-hero .is-style-outline .wp-block-button__link {
    color: var(--hg-light);
    border-color: var(--hg-light);
    background: transparent;
}

.has-dark-background-color .is-style-outline .wp-block-button__link:hover,
.hg-hero .is-style-outline .wp-block-button__link:hover {
    color: var(--hg-ink);
    background: var(--hg-light);
    border-color: var(--hg-light);
}

/* Solid buttons on dark backgrounds invert. */
.has-dark-background-color .wp-block-button:not(.is-style-outline):not(.is-style-ghost) .wp-block-button__link {
    background: var(--hg-light);
    color: var(--hg-ink);
    border-color: var(--hg-light);
}

.has-dark-background-color .wp-block-button:not(.is-style-outline):not(.is-style-ghost) .wp-block-button__link:hover {
    background: var(--wp--preset--color--accent);
    color: var(--hg-light);
    border-color: var(--wp--preset--color--accent);
}

/* Ghost: text with a trailing arrow. */
.is-style-ghost .wp-block-button__link {
    background: transparent;
    border-color: transparent;
    color: var(--wp--preset--color--contrast);
    padding: 0.25rem 0;
    min-height: 0;
    box-shadow: none;
}

.is-style-ghost .wp-block-button__link::after {
    content: "\2192";
    font-size: 1.1em;
    line-height: 1;
    transition: transform var(--hg-base) var(--hg-ease);
}

.is-style-ghost .wp-block-button__link:hover {
    transform: none;
    box-shadow: none;
    color: var(--wp--preset--color--accent);
}

.is-style-ghost .wp-block-button__link:hover::after {
    transform: translateX(4px);
}

/* ---------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------ */
.hg-footer .wp-block-site-title {
    margin-bottom: 1rem;
}

.hg-footer__about {
    max-width: 36ch;
    opacity: 0.8;
}

.hg-footer h5 {
    opacity: 0.55;
    margin-bottom: 1rem;
}

.hg-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.6rem;
}

.hg-footer__links a,
.hg-footer__contact {
    opacity: 0.85;
    font-size: var(--wp--preset--font-size--small);
}

.hg-footer__links a:hover {
    opacity: 1;
}

.hg-footer__social {
    margin-top: 1.5rem;
}

.hg-footer__social .wp-social-link {
    opacity: 0.8;
    transition: opacity var(--hg-fast) var(--hg-ease), transform var(--hg-fast) var(--hg-ease);
}

.hg-footer__social .wp-social-link:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.hg-footer__rule {
    margin-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
    opacity: 1;
}

.hg-footer__bottom {
    opacity: 0.7;
    gap: 1rem 2rem;
}

.hg-footer__bottom p {
    margin: 0;
}

.hg-payments {
    display: flex;
    gap: 0.5rem;
}

.hg-payments svg {
    width: 36px;
    height: 24px;
}

@media (max-width: 781px) {
    .hg-footer__grid {
        row-gap: 2rem;
    }

    .hg-footer__bottom {
        justify-content: center;
        text-align: center;
    }
}

/* ---------------------------------------------------------------------------
 * Sections (homepage patterns)
 * ------------------------------------------------------------------------ */
.hg-section {
    padding-block: clamp(3rem, 7vw, 6rem);
}

.hg-section__head {
    gap: 1rem 2rem;
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.hg-section__head h2 {
    margin: 0;
}

.hg-section__head .wp-block-buttons {
    margin: 0 0 0.35rem;
}

.hg-section__head.is-centered h2 {
    margin-inline: auto;
    max-width: 20ch;
}

/* Hero */
/* Caps the block's inline 86vh so very tall screens don't get a giant hero. */
.hg-hero {
    min-height: min(86vh, 900px) !important;
    color: var(--hg-light);
}

.hg-hero .wp-block-cover__inner-container {
    text-align: center;
    padding-block: clamp(3rem, 8vw, 5rem);
}

.hg-hero h1 {
    color: var(--hg-light);
    max-width: 14ch;
    margin: 0 auto 1rem;
    text-shadow: 0 2px 24px rgba(20, 19, 17, 0.3);
}

.hg-hero .hg-eyebrow {
    color: var(--wp--preset--color--accent-soft);
}

.hg-hero__lead {
    max-width: 44ch;
    margin: 0 auto;
    font-size: var(--wp--preset--font-size--large);
    opacity: 0.9;
}

.hg-hero .wp-block-buttons {
    margin-top: 1.75rem;
}

.hg-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link {
    background: var(--hg-light);
    color: var(--hg-ink);
    border-color: var(--hg-light);
}

.hg-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
    background: var(--wp--preset--color--accent);
    color: var(--hg-light);
    border-color: var(--wp--preset--color--accent);
}

@media (max-width: 781px) {
    .hg-hero {
        min-height: min(72vh, 640px) !important;
    }
}

/* Trust strip */
.hg-trust {
    padding-block: 1.25rem;
}

.hg-trust .hg-trust__items {
    gap: 1rem 2rem;
}

.hg-trust .hg-trust__item {
    flex: 1 1 140px;
    gap: 0.75rem;
    justify-content: center;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 500;
}

.hg-trust__item .hg-icon {
    width: 22px;
    height: 22px;
    color: var(--wp--preset--color--accent);
}

.hg-trust__item p {
    margin: 0;
}

@media (max-width: 781px) {
    .hg-trust .hg-trust__item {
        justify-content: flex-start;
    }
}

/* Category tiles */
.hg-tiles .hg-tiles__grid {
    gap: 1.25rem;
}

.hg-tile {
    position: relative;
    overflow: hidden;
    border-radius: var(--hg-radius-md);
    aspect-ratio: 4 / 5;
    min-height: 0;
    isolation: isolate;
}

.hg-tile .wp-block-cover__image-background {
    transition: transform var(--hg-slow) var(--hg-ease);
}

.hg-tile:hover .wp-block-cover__image-background {
    transform: scale(1.04);
}

.hg-tile .wp-block-cover__background {
    background-image: linear-gradient(180deg, rgba(20, 19, 17, 0) 40%, rgba(20, 19, 17, 0.75) 100%);
    transition: opacity var(--hg-base) var(--hg-ease);
}

.hg-tile:hover .wp-block-cover__background {
    opacity: 0.85;
}

.hg-tile .wp-block-cover__inner-container {
    padding: 1.5rem;
}

.hg-tile h3 {
    color: var(--hg-light);
    margin: 0 0 0.35rem;
}

.hg-tile .is-style-ghost .wp-block-button__link {
    color: var(--hg-light);
    font-size: var(--wp--preset--font-size--x-small);
}

.hg-tile .is-style-ghost .wp-block-button__link:hover {
    color: var(--wp--preset--color--accent-soft);
}

/* The whole tile is the link target: the overlay extends past the small inner
   container and is clipped to the tile by its overflow:hidden. */
.hg-tile .is-style-ghost .wp-block-button__link::before {
    content: "";
    position: absolute;
    inset: -100vmax;
}

@media (max-width: 781px) {
    .hg-tile {
        aspect-ratio: 4 / 3;
    }
}

/* Editorial split */
.hg-editorial .wp-block-columns {
    gap: clamp(2rem, 6vw, 5rem);
}

.hg-editorial__image img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--hg-radius-md);
    box-shadow: var(--hg-shadow-lg);
}

.hg-editorial__copy p:not(.hg-eyebrow) {
    color: var(--wp--preset--color--contrast-muted);
    max-width: 46ch;
}

.hg-editorial__copy .wp-block-buttons {
    margin-top: 0.5rem;
}

/* Lookbook */
.hg-lookbook .hg-marquee {
    margin-block: 0.5rem 2.5rem;
}

.hg-lookbook .hg-marquee__track img {
    width: clamp(200px, 22vw, 320px);
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--hg-radius-md);
}

/* Testimonials */
.hg-testimonials .wp-block-columns {
    gap: 1.25rem;
}

.hg-testimonial {
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border-subtle);
    border-radius: var(--hg-radius-md);
    box-shadow: var(--hg-shadow-sm);
    padding: 2rem;
    transition: transform var(--hg-base) var(--hg-ease), box-shadow var(--hg-base) var(--hg-ease);
}

.hg-testimonial:hover {
    transform: translateY(-4px);
    box-shadow: var(--hg-shadow-md);
}

.hg-testimonial__stars {
    display: flex;
    gap: 2px;
    color: var(--wp--preset--color--accent);
    margin-bottom: 1rem;
}

.hg-testimonial__stars .hg-icon {
    width: 16px;
    height: 16px;
}

.hg-testimonial__quote {
    font-family: var(--wp--preset--font-family--fraunces);
    font-size: var(--wp--preset--font-size--large);
    line-height: 1.4;
    margin-bottom: 1.25rem;
}

.hg-testimonial__name {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--contrast-muted);
    margin: 0;
}

/* Newsletter band */
.hg-newsletter {
    text-align: center;
}

.hg-newsletter .hg-eyebrow {
    color: var(--wp--preset--color--accent-soft);
}

.hg-newsletter h2 {
    max-width: 18ch;
    margin: 0 auto 0.75rem;
}

.hg-newsletter p:not(.hg-eyebrow) {
    max-width: 44ch;
    margin: 0 auto;
    opacity: 0.8;
}

.hg-newsletter .wp-block-buttons {
    margin-top: 1.75rem;
}

@media (max-width: 599px) {
    .hg-section__head:not(.is-centered) {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---------------------------------------------------------------------------
 * Page heads, blog grid, single post, search form, 404, pagination
 * ------------------------------------------------------------------------ */
.hg-page-head {
    text-align: center;
    margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.hg-page-head h1,
.hg-page-head .wp-block-query-title {
    max-width: 18ch;
    margin: 0 auto 0.75rem;
}

.hg-page-head__description,
.hg-page-head .wp-block-term-description {
    color: var(--wp--preset--color--contrast-muted);
    max-width: 52ch;
    margin: 0 auto;
}

.hg-page-head .wp-block-post-terms a {
    color: inherit;
}

.hg-posts__grid.is-layout-grid {
    gap: 2.5rem 1.5rem;
}

.hg-post-card__image {
    overflow: hidden;
    border-radius: var(--hg-radius-md);
    margin-bottom: 1rem;
    background: var(--wp--preset--color--surface-light);
}

.hg-post-card__image img {
    transition: transform var(--hg-slow) var(--hg-ease);
}

.hg-post-card:hover .hg-post-card__image img {
    transform: scale(1.03);
}

.hg-post-card__date {
    margin-bottom: 0.35rem;
}

.hg-post-card h2 {
    margin-bottom: 0.5rem;
}

.hg-post-card .wp-block-post-excerpt__excerpt {
    margin-bottom: 0.5rem;
}

.hg-post-card .wp-block-post-excerpt__more-link {
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
    color: var(--wp--preset--color--contrast);
}

.hg-single__meta {
    gap: 0.5rem 1rem;
    color: var(--wp--preset--color--contrast-muted);
    font-size: var(--wp--preset--font-size--small);
}

.hg-single__meta p,
.hg-single__meta div {
    margin: 0;
}

.hg-single__image img {
    border-radius: var(--hg-radius-md);
}

.hg-single__image {
    margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.hg-single .wp-block-post-content,
.hg-page .wp-block-post-content {
    line-height: 1.7;
}

.hg-single .wp-block-post-content :is(h2, h3) {
    margin-top: 2rem;
}

.hg-single__nav {
    max-width: 720px;
    margin: 3rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--wp--preset--color--border-subtle);
    gap: 1rem;
}

.hg-single__nav a {
    font-weight: 500;
}

/* Full search form (search page, 404). */
.hg-search-form {
    max-width: 460px;
    margin: 1.5rem auto 0;
}

.hg-search-form .wp-block-search__inside-wrapper {
    border: 1px solid var(--wp--preset--color--border-subtle);
    border-radius: var(--hg-radius-pill);
    background: var(--wp--preset--color--surface);
    padding: 0.25rem 0.25rem 0.25rem 1.25rem;
}

.hg-search-form .wp-block-search__input {
    border: 0;
    background: transparent;
    padding: 0.5rem 0;
}

.hg-search-form .wp-block-search__input:focus {
    outline: none;
}

.hg-search-form .wp-block-search__inside-wrapper:focus-within {
    border-color: var(--wp--preset--color--contrast);
    box-shadow: 0 0 0 2px var(--wp--preset--color--accent);
}

.hg-search-form .wp-block-search__button {
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--hg-radius-pill);
    background: var(--wp--preset--color--contrast);
    color: var(--wp--preset--color--base);
    cursor: pointer;
}

.hg-search-form .wp-block-search__button:hover {
    background: var(--wp--preset--color--accent);
}

.hg-search-form .wp-block-search__button svg {
    fill: currentColor;
    width: 20px;
    height: 20px;
}

.hg-404 {
    text-align: center;
    min-height: 55vh;
}

.hg-404 h1 {
    margin: 0 auto 1rem;
}

.hg-404 p:not(.hg-eyebrow) {
    max-width: 44ch;
    margin: 0 auto;
    color: var(--wp--preset--color--contrast-muted);
}

.hg-404 .wp-block-buttons {
    margin-top: 1.5rem;
}

.hg-empty {
    padding-block: 2rem;
}

/* Pagination (blog and shop). */
.wp-block-query-pagination {
    margin-top: 3rem;
    gap: 0.5rem;
    align-items: center;
}

.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--hg-radius-pill);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 500;
    transition: background-color var(--hg-fast) var(--hg-ease), color var(--hg-fast) var(--hg-ease);
}

.wp-block-query-pagination .page-numbers:hover,
.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
    background: var(--wp--preset--color--surface-light);
    color: var(--wp--preset--color--contrast);
}

.wp-block-query-pagination .page-numbers.current {
    background: var(--wp--preset--color--contrast);
    color: var(--wp--preset--color--base);
}

@media (max-width: 1023px) {
    .hg-posts__grid.is-layout-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 599px) {
    .hg-posts__grid.is-layout-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------------------------------------------------------------------------
 * Theme toggle (sun / moon)
 * ------------------------------------------------------------------------ */
.hg-theme-toggle {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: var(--hg-radius-pill);
    background: transparent;
    color: var(--wp--preset--color--contrast);
    cursor: pointer;
    transition: background-color var(--hg-fast) var(--hg-ease), transform var(--hg-base) var(--hg-ease);
}

.hg-theme-toggle:hover {
    background: var(--wp--preset--color--surface-light);
}

.hg-theme-toggle:active {
    transform: rotate(-20deg) scale(0.92);
}

.hg-theme-toggle svg {
    width: 20px;
    height: 20px;
}

.hg-theme-toggle .hg-icon-sun,
html[data-theme="dark"] .hg-theme-toggle .hg-icon-moon {
    display: none;
}

html[data-theme="dark"] .hg-theme-toggle .hg-icon-sun {
    display: block;
}

/* ---------------------------------------------------------------------------
 * Motion: hero entrance, button press
 * ------------------------------------------------------------------------ */
.hg-hero .wp-block-cover__image-background {
    animation: hg-settle 1.8s var(--hg-ease) both;
}

.hg-hero .wp-block-cover__inner-container > * {
    animation: hg-rise 0.9s var(--hg-ease) both;
}

.hg-hero .wp-block-cover__inner-container > :nth-child(2) { animation-delay: 120ms; }
.hg-hero .wp-block-cover__inner-container > :nth-child(3) { animation-delay: 240ms; }
.hg-hero .wp-block-cover__inner-container > :nth-child(4) { animation-delay: 360ms; }

.wp-block-button__link:active,
.single_add_to_cart_button:active,
.hg-sticky-atc__button:active {
    transform: scale(0.97) !important;
}

/* ---------------------------------------------------------------------------
 * Homepage: header floats over the hero until the page scrolls
 * ------------------------------------------------------------------------ */
body.home .wp-site-blocks > main {
    margin-top: calc(-1 * var(--hg-header-height) - 1px);
}

body.home .hg-header:not(.is-scrolled) {
    border-bottom-color: transparent;
}

body.home .hg-header:not(.is-scrolled)::before {
    background-color: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

body.home .hg-header:not(.is-scrolled) :is(.wp-block-site-title a, .wp-block-navigation-item__content, .wc-block-mini-cart__button, .wc-block-customer-account a, .wc-block-customer-account__account-icon, .wp-block-search__button, .hg-theme-toggle, .wp-block-navigation__responsive-container-open) {
    color: var(--hg-light);
}

body.home .hg-header:not(.is-scrolled) :is(.wc-block-mini-cart__button, .wc-block-customer-account__account-icon, .wp-block-search__button, .hg-theme-toggle):hover {
    background: rgba(247, 243, 238, 0.16);
}

/* The header background must not paint solid over the hero. */
.hg-header.has-base-background-color {
    background-color: transparent !important;
}

/* ---------------------------------------------------------------------------
 * Mid-size screens: keep the menu on one line; long site titles truncate
 * ------------------------------------------------------------------------ */
.hg-brand .wp-block-site-title {
    max-width: 28vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 600px) and (max-width: 1180px) {
    .hg-header__inner {
        gap: 0.75rem;
    }

    .hg-nav .wp-block-navigation__container {
        gap: 0.9rem;
    }

    .hg-nav .wp-block-navigation-item__content {
        font-size: 0.8125rem;
    }
}

/* Shop and product pages start close to the header. */
.hg-shop.hg-section,
.hg-single-product.hg-section {
    padding-top: clamp(1.25rem, 3vw, 2.25rem);
}

/* Checkout header */
.hg-checkout-header__secure {
    margin: 0;
    color: var(--wp--preset--color--contrast-muted);
}

.hg-checkout.hg-section {
    padding-top: clamp(1.25rem, 3vw, 2.25rem);
}
