/* Editorial vehicle story: image-led, factual and deliberately lighter than a
   dashboard. S580 keeps its own dedicated route and stylesheet. */

.detail-page {
    --detail-blue: #4c87ff;
    --detail-blue-bright: #80adff;
    --detail-ink: #05070a;
    --detail-surface: #0c1119;
    --detail-line: rgba(137, 177, 255, .15);
    background: var(--detail-ink);
}

.detail-page .container { max-width: 1320px; }

.detail-page .header {
    background: linear-gradient(180deg, rgba(3, 6, 10, .9), rgba(3, 6, 10, .42));
    backdrop-filter: blur(14px);
}

.detail-page .video-section {
    min-height: 660px;
    height: min(88vh, 920px);
    background: #05070a;
}

.detail-page .video-bg {
    object-fit: cover;
    object-position: center;
    transform: scale(1.005);
}

.detail-page .video-overlay {
    background:
        linear-gradient(90deg, rgba(2, 5, 9, .86) 0%, rgba(2, 5, 9, .3) 55%, rgba(2, 5, 9, .08) 100%),
        linear-gradient(180deg, rgba(2, 5, 9, .2) 30%, rgba(2, 5, 9, .95) 100%);
}

.detail-page .video-content {
    width: min(1320px, calc(100% - 3rem));
    padding-bottom: clamp(3.5rem, 8vh, 7rem);
}

.detail-page .video-kicker,
.detail-page .gallery-kicker,
.detail-kicker {
    margin-bottom: .9rem;
    color: var(--detail-blue-bright);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .21em;
    text-transform: uppercase;
}

.detail-page .video-title {
    max-width: 1120px;
    font-size: clamp(3.4rem, 7.5vw, 7.8rem);
    line-height: .9;
    letter-spacing: -.055em;
}

.video-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .25);
}

.video-meta a {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: #fff;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.video-meta a i { color: var(--detail-blue-bright); }

.vehicle-summary {
    padding: clamp(4rem, 7vw, 7rem) 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    background:
        radial-gradient(circle at 82% 15%, rgba(59, 117, 223, .12), transparent 27rem),
        #070a0f;
}

.vehicle-summary__container {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(380px, 1.25fr) minmax(240px, .65fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
}

.vehicle-summary__identity h2 {
    margin-bottom: 1.25rem;
    color: #fff;
    font-size: clamp(2.2rem, 4vw, 4.2rem);
    font-weight: 600;
    line-height: .96;
    letter-spacing: -.04em;
}

.vehicle-summary__identity h2 span {
    display: block;
    color: #91a0b9;
}

.vehicle-summary__identity > p:last-child {
    max-width: 520px;
    color: #8d99ac;
    line-height: 1.7;
}

.vehicle-summary__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--detail-line);
    border-left: 1px solid var(--detail-line);
}

.vehicle-summary__facts div {
    min-width: 0;
    padding: 1.35rem;
    border-right: 1px solid var(--detail-line);
    border-bottom: 1px solid var(--detail-line);
}

.vehicle-summary__facts dt,
.vehicle-summary__offer > p {
    margin-bottom: .45rem;
    color: #647189;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.vehicle-summary__facts dd {
    overflow-wrap: anywhere;
    color: #f5f7fb;
    font-size: clamp(1rem, 1.7vw, 1.3rem);
    font-weight: 600;
}

.vehicle-summary__offer {
    padding-left: clamp(1.5rem, 3vw, 3rem);
    border-left: 1px solid var(--detail-line);
}

.vehicle-summary__offer > strong {
    display: block;
    margin-bottom: 1.4rem;
    color: #fff;
    font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.vehicle-summary__offer > div {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: .7rem;
}

.detail-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    padding: .85rem 1.15rem;
    border: 1px solid transparent;
    border-radius: .7rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-align: center;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.detail-button--primary {
    background: linear-gradient(145deg, #326eda, var(--detail-blue));
    color: #fff;
}

.detail-button--secondary {
    border-color: var(--detail-line);
    background: rgba(255, 255, 255, .025);
    color: #d7deeb;
}

.detail-button:hover { transform: translateY(-2px); }
.detail-button--primary:hover { background: #69a0ff; }
.detail-button--secondary:hover { border-color: rgba(128, 173, 255, .55); }

.detail-page .carousel-section {
    padding: clamp(5rem, 9vw, 9rem) 0 !important;
    background: #05070a !important;
}

.detail-page .gallery-heading {
    max-width: none;
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.detail-page .gallery-heading h2 {
    max-width: 820px;
    font-size: clamp(2.5rem, 5.5vw, 5.8rem);
    letter-spacing: -.05em;
}

.detail-page .gallery-credit {
    padding-bottom: .4rem;
    border-bottom: 1px solid rgba(255, 255, 255, .24);
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(.75rem, 1.6vw, 1.35rem);
}

.story-frame {
    position: relative;
    grid-column: 1 / -1;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 1.1rem;
    background: #0c1118;
}

.story-frame--1 { aspect-ratio: 16 / 8.4; }
.story-frame--2 { grid-column: 1 / 8; aspect-ratio: 4 / 3; }
.story-frame--3 { grid-column: 8 / 13; aspect-ratio: 4 / 3; }
.story-frame--4 { grid-column: 2 / 12; aspect-ratio: 16 / 8.5; margin-top: clamp(1rem, 4vw, 3.5rem); }

.story-frame::after {
    content: "";
    position: absolute;
    inset: 45% 0 0;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .72));
    pointer-events: none;
}

.story-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}

.story-frame:hover img { transform: scale(1.018); }

.story-frame figcaption {
    position: absolute;
    z-index: 2;
    right: 1.25rem;
    bottom: 1.15rem;
    left: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.story-frame figcaption span { color: var(--detail-blue-bright); }

.detail-page .car-detail {
    padding: clamp(5rem, 9vw, 9rem) 0;
    background:
        radial-gradient(circle at 10% 10%, rgba(50, 110, 218, .11), transparent 30rem),
        linear-gradient(180deg, #090d14, #05070a);
}

.detail-page .car-detail__container { display: block; }

.car-detail__lead {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .55fr);
    align-items: end;
    gap: clamp(2.5rem, 8vw, 8rem);
    margin-bottom: clamp(3rem, 6vw, 5.5rem);
}

.car-detail__lead h2 {
    max-width: 800px;
    margin-bottom: 1.25rem;
    color: #fff;
    font-size: clamp(2.5rem, 5vw, 5.2rem);
    line-height: .95;
    letter-spacing: -.05em;
}

.car-detail__lead > div > p:last-child {
    max-width: 640px;
    color: #8995a9;
    line-height: 1.75;
}

.provenance-card {
    display: grid;
    padding: 1.5rem;
    border: 1px solid var(--detail-line);
    border-radius: 1rem;
    background: rgba(12, 17, 25, .78);
}

.provenance-card span {
    margin-bottom: .35rem;
    color: #637087;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.provenance-card strong {
    margin-bottom: 1.25rem;
    overflow-wrap: anywhere;
    color: #f2f5fa;
    font-size: .92rem;
}

.provenance-card a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--detail-line);
    color: var(--detail-blue-bright);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.detail-page .car-detail__specs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
    margin-top: 0;
}

.detail-page .specs-section {
    margin-bottom: 0;
    padding: clamp(1.35rem, 2.6vw, 2.25rem);
    border: 1px solid rgba(137, 177, 255, .12);
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(17, 25, 38, .92), rgba(9, 14, 22, .92));
}

.detail-page .specs-title {
    margin-bottom: 1.4rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--detail-line);
    color: #f7f9fc;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.detail-page .specs-grid { grid-template-columns: 1fr; gap: 0; }

.detail-page .spec-item {
    gap: 1.25rem;
    padding: .78rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, .055);
    border-radius: 0;
    background: transparent;
}

.detail-page .spec-item:last-child { border-bottom: 0; }
.detail-page .spec-label { color: #718097; }
.detail-page .spec-value { color: #eef2f8; text-align: right; }

.detail-page .features-list {
    grid-template-columns: 1fr;
    gap: 0;
}

.detail-page .features-list li {
    padding: .72rem 0 .72rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .055);
    color: #a4afc0;
}

.detail-page .features-list li:last-child { border-bottom: 0; }
.detail-page .features-list li::before { color: var(--detail-blue-bright); }

.detail-cta {
    padding: 0 0 clamp(5rem, 9vw, 9rem);
    background: #05070a;
}

.detail-cta__container {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 3rem;
    padding: clamp(2rem, 5vw, 4.5rem);
    border: 1px solid rgba(137, 177, 255, .25);
    border-radius: 1.25rem;
    background:
        radial-gradient(circle at 85% 5%, rgba(103, 157, 255, .26), transparent 23rem),
        linear-gradient(135deg, #112a57, #0a1425 65%);
}

.detail-cta h2 {
    margin-bottom: .85rem;
    color: #fff;
    font-size: clamp(2.2rem, 4vw, 4.25rem);
    line-height: .96;
    letter-spacing: -.045em;
}

.detail-cta__container > div:first-child > p:last-child {
    max-width: 650px;
    color: #aebbd0;
    line-height: 1.65;
}

.detail-cta__actions {
    display: flex;
    flex: 0 0 auto;
    gap: .7rem;
}

@media (max-width: 1050px) {
    .vehicle-summary__container { grid-template-columns: 1fr 1fr; }
    .vehicle-summary__offer {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.5rem 0 0;
        border-top: 1px solid var(--detail-line);
        border-left: 0;
    }
    .vehicle-summary__offer > strong { margin: 0 auto 0 1rem; }
    .vehicle-summary__offer > div { flex-direction: row; }
}

@media (max-width: 760px) {
    .detail-page .container { width: calc(100% - 2rem); }
    .detail-page .video-section { min-height: 580px; height: 78vh; }
    .detail-page .video-content { width: calc(100% - 2rem); }
    .detail-page .video-bg { object-position: center; }
    .video-meta { align-items: flex-start; flex-direction: column; gap: 1rem; }
    .vehicle-summary__container,
    .car-detail__lead { grid-template-columns: 1fr; }
    .vehicle-summary__offer { display: block; }
    .vehicle-summary__offer > strong { margin: 0 0 1.25rem; }
    .vehicle-summary__offer > div { flex-direction: column; }
    .detail-page .gallery-heading { align-items: flex-start; }
    .story-frame--1,
    .story-frame--2,
    .story-frame--3,
    .story-frame--4 {
        grid-column: 1 / -1;
        aspect-ratio: 4 / 3;
        margin-top: 0;
    }
    .detail-page .car-detail__specs { grid-template-columns: 1fr; }
    .detail-cta__container { align-items: flex-start; flex-direction: column; }
    .detail-cta__actions { width: 100%; flex-direction: column; }
}

@media (max-width: 460px) {
    .vehicle-summary__facts { grid-template-columns: 1fr; }
    .detail-page .video-title { font-size: clamp(3rem, 17vw, 4.8rem); }
    .story-frame figcaption { right: .85rem; bottom: .8rem; left: .85rem; }
    .detail-page .specs-section { padding: 1.2rem; }
    .detail-page .spec-item { align-items: flex-start; flex-direction: column; gap: .3rem; }
    .detail-page .spec-value { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    .story-frame img,
    .detail-button { transition: none; }
}
