/* RAYERTECH — T1 Energy theme, inner pages
   Detail-hero, galleries, video, lightbox, supply panel, vendors. */

.detail-page {
    position: relative;
}

.section--tight {
    padding-top: 72px;
}

body.detail-lightbox-open {
    overflow: hidden;
}

/* ─────────── Detail Hero (light) ─────────── */

.detail-hero {
    position: relative;
    padding: 156px 0 88px;
    background: var(--bg);
    overflow: hidden;
}

.detail-hero__media,
.detail-hero__overlay {
    position: absolute;
}

.detail-hero__media {
    top: 156px;
    bottom: 88px;
    left: auto;
    right: max(24px, calc((100% - 1240px) / 2));
    width: min(48%, 560px);
    border-radius: var(--radius-card-lg);
    overflow: hidden;
    background: var(--color-onyx);
}

.detail-hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: none;
}

.detail-hero--its .detail-hero__media img {
    object-position: center 44%;
}

.detail-hero__media--supply {
    background: var(--color-onyx);
}

.detail-hero__overlay {
    display: none;
}

.detail-hero__content {
    position: relative;
    z-index: 1;
    color: var(--text);
}

.detail-hero__content > * {
    max-width: min(48%, 560px);
}

.detail-hero__content > .hero-actions {
    flex-wrap: wrap;
}

.detail-hero__content h1,
.detail-hero__stats strong,
.supply-card h3,
.detail-lightbox figcaption {
    font-family: var(--font-display);
    font-weight: 300;
    letter-spacing: -0.005em;
    color: var(--text);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.25s ease;
}

.back-link::before {
    content: "←";
    color: var(--text-soft);
}

.back-link:hover,
.back-link:focus-visible {
    color: var(--text);
}

.detail-hero__content .eyebrow,
.detail-hero__content .eyebrow--light {
    color: var(--text-muted);
}

.detail-hero__content h1 {
    margin: 22px 0 0;
    max-width: 12ch;
    font-size: clamp(2.4rem, 5.5vw, 4rem);
    line-height: 1.04;
}

.detail-hero__content p {
    margin: 24px 0 0;
    max-width: 32rem;
    color: var(--text-soft);
    font-size: clamp(0.98rem, 1.3vw, 1.08rem);
    line-height: 1.4;
}

.detail-hero .hero-actions {
    margin-top: 30px;
}

.detail-hero .btn-primary {
    background: var(--color-onyx);
    color: var(--color-white);
    border-color: var(--color-onyx);
}

.detail-hero .btn-primary:hover,
.detail-hero .btn-primary:focus-visible {
    background: var(--color-carbon);
    border-color: var(--color-carbon);
    color: var(--color-white);
}

.detail-hero .btn-secondary {
    background: var(--color-white);
    color: var(--color-onyx);
    border-color: var(--color-carbon);
}

.detail-hero .btn-secondary:hover,
.detail-hero .btn-secondary:focus-visible {
    background: var(--color-onyx);
    color: var(--color-white);
    border-color: var(--color-onyx);
}

.detail-hero__stats,
.detail-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-hero__stats {
    margin-top: 28px;
}

.detail-hero__stats span,
.detail-strip span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-soft);
    font-size: 0.84rem;
    letter-spacing: 0.01em;
    backdrop-filter: none;
}

.detail-strip {
    padding: 28px;
    border-radius: var(--radius-card-text);
    border: 1px solid var(--border);
    background: var(--color-white);
    box-shadow: none;
}

.detail-section-heading h2,
.supply-card h3,
.detail-lightbox figcaption {
    color: var(--text);
}

.detail-section-heading h2 {
    max-width: 14ch;
}

.detail-section-heading--wide h2 {
    max-width: 28ch;
}

/* ─────────── Galleries & cards (inner) ─────────── */

.gallery-grid,
.supply-panel,
.vendor-grid,
.video-grid {
    display: grid;
    gap: 14px;
}

.video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.video-card {
    overflow: hidden;
    border-radius: var(--radius-card-text);
    border: 1px solid var(--border);
    background: var(--color-white);
    box-shadow: none;
    transition: border-color 0.25s ease;
}

.video-card:hover,
.video-card:focus-within {
    border-color: var(--border-strong);
}

.video-card__media {
    aspect-ratio: 16 / 9;
    background: var(--color-onyx);
}

.video-card video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--color-onyx);
}

.video-card__body {
    padding: 22px 26px 26px;
}

.video-card__body span {
    display: inline-flex;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.video-card__body h3 {
    margin: 0;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    letter-spacing: -0.005em;
    line-height: 1.3;
}

.presentation-link {
    position: relative;
    display: block;
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-card-text);
    background: var(--color-white);
    box-shadow: none;
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.25s ease;
}

.presentation-link__media {
    aspect-ratio: 21 / 9;
    overflow: hidden;
    background: var(--color-onyx);
}

.presentation-link__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    transition: transform 0.45s var(--ease);
}

.presentation-link:hover .presentation-link__media img,
.presentation-link:focus-visible .presentation-link__media img {
    transform: scale(1.03);
}

.presentation-link__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px 96px 26px 28px;
}

.presentation-link span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.presentation-link strong {
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    font-weight: 300;
    letter-spacing: -0.005em;
    line-height: 1.15;
}

.presentation-link::after {
    content: "↗";
    position: absolute;
    right: 26px;
    bottom: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-pill);
    background: var(--color-onyx);
    color: var(--color-white);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 400;
}

.presentation-link:hover,
.presentation-link:focus-visible {
    border-color: var(--border-strong);
}

.gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-card {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    overflow: hidden;
    border-radius: var(--radius-card-text);
    background: var(--color-onyx);
    box-shadow: none;
    cursor: zoom-in;
    text-align: left;
}

.gallery-card img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    transition: transform 0.4s var(--ease);
}

.gallery-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 14, 18, 0) 50%, rgba(15, 14, 18, 0.62) 100%);
    pointer-events: none;
}

.gallery-card__caption {
    position: absolute;
    right: 22px;
    bottom: 22px;
    left: 22px;
    z-index: 1;
    color: var(--color-white);
    font-size: 0.92rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.gallery-card:hover img,
.gallery-card:focus-visible img {
    transform: scale(1.04);
}

/* ─────────── Supply / vendor ─────────── */

.supply-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.supply-card,
.vendor-tile {
    border: 1px solid var(--border);
    background: var(--color-white);
    box-shadow: none;
    transition: border-color 0.25s ease;
}

.supply-card {
    padding: 30px;
    border-radius: var(--radius-card-text);
}

.supply-card:hover,
.supply-card:focus-within {
    border-color: var(--border-strong);
}

.supply-card h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: -0.005em;
}

.supply-card p {
    margin: 14px 0 0;
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.4;
}

.vendor-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.vendor-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 128px;
    padding: 22px;
    border-radius: var(--radius-element);
}

.vendor-tile:hover,
.vendor-tile:focus-within {
    border-color: var(--border-strong);
}

.vendor-tile img {
    max-width: 100%;
    max-height: 56px;
    width: auto;
    filter: grayscale(1);
    opacity: 0.7;
    transition: filter 0.25s ease, opacity 0.25s ease;
}

.vendor-tile--lg img {
    max-height: 84px;
}

.vendor-tile--xl {
    padding: 12px;
}

.vendor-tile--xl img {
    max-height: 104px;
}

.vendor-tile--accent img {
    filter: grayscale(1) brightness(0.5);
}

.vendor-tile:hover img,
.vendor-tile:focus-within img {
    filter: none;
    opacity: 1;
}

/* ─────────── Brand cloud (integration hero) ─────────── */

.brand-cloud {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 8px;
    padding: 18px;
    background: var(--color-onyx);
}

.brand-cloud__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    overflow: hidden;
}

.brand-cloud__logo img {
    width: auto;
    height: auto;
    max-width: 88%;
    max-height: min(100%, 48px);
    object-fit: contain;
    filter: none;
    opacity: 1;
}

/* Compact wordmark PNGs carry lots of internal whitespace — let them fill the chip */
.brand-cloud__logo--xl img {
    max-width: 100%;
    max-height: min(100%, 60px);
}

/* RAYERTECH mark closes the grid: no chip, white symbol */
.brand-cloud__logo--brand {
    background: transparent;
}

.brand-cloud__logo--brand img {
    max-width: 72%;
    max-height: min(100%, 52px);
    opacity: 0.92;
    filter: brightness(0) invert(1);
}

/* ─────────── Lightbox ─────────── */

.detail-lightbox {
    position: fixed;
    inset: 0;
    z-index: 180;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 14, 18, 0.86);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease;
}

.detail-lightbox[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.detail-lightbox__dialog {
    position: relative;
    width: min(1040px, 100%);
}

.detail-lightbox__close {
    position: absolute;
    top: -16px;
    right: -4px;
    z-index: 1;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-pill);
    background: rgba(139, 139, 139, 0.5);
    color: var(--color-white);
    font-size: 1.5rem;
    cursor: pointer;
}

.detail-lightbox__actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 14px;
}

.detail-lightbox__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: var(--radius-pill);
    background: rgba(139, 139, 139, 0.5);
    color: var(--color-white);
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.detail-lightbox__action:hover,
.detail-lightbox__action:focus-visible {
    background: rgba(255, 255, 255, 0.18);
}

.detail-lightbox__action--close {
    min-width: 128px;
}

.detail-lightbox figure {
    margin: 0;
    padding: 18px;
    border-radius: var(--radius-card);
    background: var(--color-white);
    box-shadow: none;
}

.detail-lightbox img {
    display: block;
    width: 100%;
    max-height: 76svh;
    object-fit: contain;
    border-radius: var(--radius-element);
    background: var(--color-chalk);
}

.detail-lightbox figcaption {
    margin-top: 16px;
    font-size: 1.35rem;
    font-weight: 300;
}

/* ─────────── Responsive ─────────── */

@media (max-width: 1120px) {

    .gallery-grid,
    .vendor-grid,
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .supply-panel {
        grid-template-columns: 1fr;
    }

    .detail-hero {
        padding: 156px 0 72px;
    }

    .detail-hero__media {
        position: relative;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 360px;
        margin-bottom: 32px;
    }

    .detail-hero__content {
        max-width: none;
    }
}

@media (max-width: 860px) {
    .detail-hero {
        min-height: auto;
        padding: 124px 0 64px;
    }

    .detail-hero__media {
        height: 280px;
    }

    .detail-hero__content h1 {
        max-width: none;
        font-size: clamp(2rem, 8vw, 3.2rem);
        line-height: 1.06;
    }

    .detail-strip,
    .supply-card {
        border-radius: var(--radius-card);
    }

    .brand-cloud {
        padding: 12px;
        gap: 6px;
    }

    .brand-cloud__logo {
        padding: 5px 7px;
        border-radius: 8px;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .detail-lightbox {
        align-items: flex-start;
        padding: 14px 14px calc(92px + env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    .detail-lightbox__close {
        top: 8px;
        right: 8px;
        background: rgba(15, 14, 18, 0.72);
    }

    .detail-lightbox__actions {
        position: fixed;
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
        left: 14px;
        z-index: 2;
        display: grid;
        grid-template-columns: 52px minmax(0, 1fr) 52px;
        padding: 8px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: var(--radius-card);
        background: rgba(15, 14, 18, 0.92);
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
        backdrop-filter: blur(18px);
    }

    .detail-lightbox__action {
        min-height: 48px;
        padding: 0 12px;
        border-radius: var(--radius-element);
    }

    .detail-lightbox__action--close {
        min-width: 0;
    }
}

@media (max-width: 640px) {

    .gallery-grid,
    .vendor-grid,
    .video-grid {
        grid-template-columns: 1fr;
    }

    .gallery-card,
    .vendor-tile,
    .video-card {
        border-radius: var(--radius-card);
    }

    .video-card__body {
        padding: 20px;
    }

    .presentation-link {
        margin-top: 12px;
        border-radius: var(--radius-card);
    }

    .presentation-link__media {
        aspect-ratio: 16 / 10;
    }

    .presentation-link__body {
        gap: 8px;
        padding: 20px 72px 22px 20px;
    }

    .presentation-link strong {
        width: 100%;
    }

    .presentation-link::after {
        right: 16px;
        bottom: 16px;
        width: 40px;
        height: 40px;
    }

    .detail-strip {
        padding: 22px;
        border-radius: var(--radius-card);
    }

    .detail-lightbox {
        align-items: flex-start;
        padding: 14px 14px calc(92px + env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    .detail-lightbox figure {
        padding: 12px;
        border-radius: var(--radius-card);
    }

    .detail-lightbox figcaption {
        font-size: 1.1rem;
    }

    .detail-lightbox__close {
        top: 8px;
        right: 8px;
        background: rgba(15, 14, 18, 0.72);
    }

    .detail-lightbox__actions {
        position: fixed;
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
        left: 14px;
        z-index: 2;
        display: grid;
        grid-template-columns: 52px minmax(0, 1fr) 52px;
        padding: 8px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: var(--radius-card);
        background: rgba(15, 14, 18, 0.92);
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
        backdrop-filter: blur(18px);
    }

    .detail-lightbox__action {
        min-height: 48px;
        padding: 0 12px;
        border-radius: var(--radius-element);
    }

    .detail-lightbox__action--close {
        min-width: 0;
    }
}
