/**
 * Homepage section chooser modal.
 * Hidden by default; JS adds .is-visible. See section-modal.js.
 *
 * Two panels (Metal / Stone). Hovering a panel plays its hero video and
 * widens it to 70% of the screen; a single site logo sits centred on top.
 */

.awd-section-modal {
    display: none;
}

.awd-section-modal.is-visible {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #1a1a1a;
}

body.awd-modal-open {
    overflow: hidden;
}

/* Single centred logo, dead-centre of the screen */
.awd-section-modal-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: none;
    text-align: center;
}

/* max-height/max-width with both dimensions auto keeps the logo's aspect
   ratio intact — it can never distort, whatever the base theme's img rules. */
.awd-section-modal-logo img {
    display: block;
    margin: 0 auto;
    width: auto;
    height: auto;
    max-height: 80px;
    max-width: min(80vw, 400px);
    object-fit: contain;
}

.awd-section-panel {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex: 1 1 0;
    background-color: #2b2b2b;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Hero video preview: hidden until the panel is hovered */
.awd-section-panel-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.awd-section-panel:hover .awd-section-panel-video {
    opacity: 1;
}

.awd-section-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.70);
    transition: background 0.4s ease;
}

.awd-section-panel:hover::before {
    background: rgba(0, 0, 0, 0.25);
}

/* Fills the panel so the heading can sit centred while the button is pinned
   to the bottom (absolutely positioned within this box). */
.awd-section-panel-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.awd-section-panel-title {
    font-family: var(--font-body);
    color: var(--awd-text-light);
    font-size: clamp(28px, 5vw, 36px);
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin: 0;
}

/* "View Collection" call-to-action: sits just below the title, hidden until
   the panel is hovered/focused, then fades in and rises into place. Reserves
   its own space (in-flow) so the title doesn't shift on hover. */
.awd-section-cta {
    display: inline-block;
    margin-top: 1.25rem;
    color: #fff;
    font-size: 0.8rem;
    line-height: 1;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 6px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.awd-section-panel:hover .awd-section-cta,
.awd-section-panel:focus-visible .awd-section-cta {
    opacity: 1;
    transform: translateY(0);
}

.awd-section-panel:focus-visible {
    outline: none;
}

@media (max-width: 768px) {
    .awd-section-modal.is-visible {
        flex-direction: column;
    }

    /* Stacked panels: logo sits dead-centre of the screen, over the seam */
    .awd-section-modal-logo {
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .awd-section-modal-logo img {
        max-height: 60px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .awd-section-panel::before,
    .awd-section-panel-video,
    .awd-section-cta {
        transition: none;
    }

    .awd-section-cta {
        transform: none;
    }
}
