/**
 * Vid Optimus — /maps page (views/site/maps.php). Loaded only by that page, through the
 * layout's $pageStyles. Colour, type and radii come from the tokens in main.css; the page
 * builds on the shared vo-/vh- system and only adds the vm- pieces below.
 */

/* --- hero ------------------------------------------------------------------ */
.vm-hero { padding-bottom: 40px; }
.vm-reel {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px;
    max-width: 1040px; margin: 56px auto 0; align-items: center;
    animation: vo-rise .8s .3s cubic-bezier(.2, .7, .2, 1) both;
}
.vm-reel video {
    width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block;
    border-radius: 18px; background: #111;
    box-shadow: 0 24px 50px -24px rgba(15, 15, 15, .55), 0 0 0 1px rgba(15, 15, 15, .06);
}
.vm-reel video:nth-child(2), .vm-reel video:nth-child(4) { transform: translateY(28px); }
.vm-reel video:nth-child(3) { transform: scale(1.06); box-shadow: 0 30px 60px -24px rgba(255, 0, 0, .45), 0 0 0 1px rgba(15, 15, 15, .06); }

/* --- stats band ------------------------------------------------------------ */
.vm-stats-band { padding: 48px 0 8px; background: #fff; }
.vm-stats {
    list-style: none; margin: 0 auto; padding: 0; max-width: 980px;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid var(--border-light); border-radius: var(--radius-lg); background: var(--surface-1);
}
.vm-stats li { padding: 20px 12px; text-align: center; }
.vm-stats li + li { border-left: 1px solid var(--border-light); }
.vm-stats b {
    display: block; font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 800; letter-spacing: -.03em; color: var(--text); line-height: 1.1;
}
.vm-stats span { display: block; margin-top: 4px; color: var(--text-secondary); font-size: 13.5px; }

/* --- switcher -------------------------------------------------------------- */
.vm-toolbar { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: -24px 0 32px; }
.vm-seg {
    display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px;
    border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border-light);
}
.vh-sec--tint .vm-seg { background: #fff; }
.vm-seg button {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: 10px;
    background: transparent; color: var(--text-secondary); font: 600 14px var(--font-body, Inter), system-ui, sans-serif;
    cursor: pointer; transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.vm-seg button:hover { color: var(--text); }
.vm-seg button[aria-pressed="true"] {
    background: #fff; color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 15, 15, .08), 0 0 0 1px rgba(255, 0, 0, .35);
}
.vh-sec--tint .vm-seg button[aria-pressed="true"] { background: var(--primary-surface); }
.vm-sw {
    display: inline-block; flex-shrink: 0; width: 14px; height: 14px; border-radius: 5px;
    background: linear-gradient(135deg, var(--bg) 55%, var(--ink) 55%);
    box-shadow: inset 0 0 0 1px rgba(15, 15, 15, .18);
}
.vm-note { margin: 0; min-height: 1.5em; color: var(--text-secondary); font-size: 14.5px; text-align: center; }

/* --- cards ----------------------------------------------------------------- */
.vm-grid { display: grid; gap: 18px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.vm-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vm-grid--six { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.vm-grid--wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.vm-card {
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: 18px; background: #fff; border: 1px solid var(--border-light);
    box-shadow: 0 1px 2px rgba(15, 15, 15, .04);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.vm-card:hover { transform: translateY(-4px); border-color: rgba(255, 0, 0, .3); box-shadow: 0 18px 40px -22px rgba(15, 15, 15, .35); }

.vm-media {
    position: relative; display: block; width: 100%; padding: 0; margin: 0; border: 0;
    aspect-ratio: 9 / 16; background: #111; cursor: zoom-in; overflow: hidden;
}
.vm-grid--wide .vm-media { aspect-ratio: 16 / 9; }
.vm-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.vm-num, .vm-new, .vm-zoom {
    position: absolute; top: 12px; z-index: 1;
    font: 700 11px/1 var(--font-body, Inter), system-ui, sans-serif; border-radius: 7px;
}
.vm-num { left: 12px; padding: 6px 8px; color: #fff; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); }
.vm-new { right: 12px; padding: 6px 9px; color: #fff; background: var(--primary); letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 6px 16px -6px rgba(255, 0, 0, .8); }
.vm-zoom {
    top: auto; bottom: 12px; right: 12px; display: grid; place-items: center; width: 32px; height: 32px;
    color: #fff; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); font-size: 12px;
    opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .2s ease;
}
.vm-media:hover .vm-zoom, .vm-media:focus-visible .vm-zoom { opacity: 1; transform: none; }
.vm-media:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }

.vm-said {
    margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--border-light);
    background: var(--surface-1); color: var(--text-secondary); font-size: 12.5px; line-height: 1.45;
}
.vm-said i { margin-right: 5px; color: var(--primary); font-size: 11px; }
.vm-said b { color: var(--text); font-weight: 600; }

.vm-body { padding: 16px 18px 20px; }
.vm-body h3 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 1.08rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.vm-body h3 i { color: var(--primary); font-size: 15px; }
.vm-body p { margin: 8px 0 0; color: var(--text-secondary); font-size: 14.5px; line-height: 1.55; }
.vm-body .vm-use { margin-top: 10px; font-size: 13px; color: var(--text-muted); }
.vm-body .vm-use b { color: var(--text-secondary); font-weight: 600; }
[data-vm-grid="types"] .vm-body { padding: 14px 15px 16px; }
[data-vm-grid="types"] .vm-body p { font-size: 13.5px; }
[data-vm-grid="types"] .vm-body .vm-use { font-size: 12.5px; }
.vm-card--compact .vm-body { padding: 12px 14px 14px; }
.vm-card--compact .vm-body h3 { font-size: .98rem; }

/* 16:9 cards sit on the dark band */
.vm-card--dark { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .1); box-shadow: none; }
.vm-card--dark:hover { border-color: rgba(255, 107, 107, .45); box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .8); }
.vm-card--dark .vm-body h3 { color: #fff; }
.vm-card--dark .vm-body p { color: #AAAAAA; }

/* --- facts ----------------------------------------------------------------- */
.vm-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.vm-fact {
    display: flex; gap: 16px; padding: 24px; border-radius: 18px;
    background: #fff; border: 1px solid var(--border-light);
}
.vm-fact h3 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.vm-fact p { margin: 0; color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; }

/* --- viewer ---------------------------------------------------------------- */
/* Placed by hand: the site's reset zeroes every margin, which is what centres a dialog. */
.vm-lb {
    position: fixed; inset: 0; margin: auto; width: fit-content; height: fit-content;
    padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; overflow: visible;
}
.vm-lb::backdrop { background: rgba(8, 8, 8, .88); backdrop-filter: blur(4px); }
.vm-lb-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px; }
.vm-lb video {
    display: block; max-width: calc(100vw - 32px); max-height: calc(100vh - 120px);
    border-radius: 14px; background: #000; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
}
.vm-lb-bar { display: flex; align-items: center; gap: 10px; color: #fff; }
.vm-lb-bar b { min-width: 12ch; text-align: center; font-size: 15px; }
.vm-lb-btn {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
    color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
}
.vm-lb-btn:hover { background: rgba(255, 255, 255, .18); }
.vm-lb-close { margin-left: 8px; }

/* --- responsive ------------------------------------------------------------ */
@media (max-width: 1240px) {
    .vm-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .vm-grid, .vm-grid--four { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .vm-grid--six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .vm-grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .vm-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .vm-reel { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 40px; }
    .vm-reel video:nth-child(n+4) { display: none; }
    .vm-reel video:nth-child(2) { transform: scale(1.06); }
    .vm-reel video:nth-child(3) { transform: translateY(20px); }
    .vm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .vm-stats li:nth-child(4) { border-left: 0; }
    .vm-stats li:nth-child(n+4) { border-top: 1px solid var(--border-light); }
    .vm-grid, .vm-grid--four, .vm-grid--six { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .vm-grid--wide { grid-template-columns: minmax(0, 1fr); }
    .vm-facts { grid-template-columns: minmax(0, 1fr); }
    .vm-toolbar { margin-top: -28px; }
    .vm-seg button { padding: 8px 11px; font-size: 13px; }
    [data-vm-seg="types"], [data-vm-seg="vehicles"] { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    [data-vm-seg="types"] button, [data-vm-seg="vehicles"] button { justify-content: center; }
    .vm-body { padding: 12px 13px 14px; }
    .vm-body p { font-size: 13.5px; }
    .vm-body .vm-use { display: none; }
    .vm-said { padding: 8px 10px; font-size: 11.5px; }
}
@media (max-width: 420px) {
    .vm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .vm-stats li:nth-child(n) { border-left: 0; border-top: 0; }
    .vm-stats li:nth-child(even) { border-left: 1px solid var(--border-light); }
    .vm-stats li:nth-child(n+3) { border-top: 1px solid var(--border-light); }
    .vm-stats li:last-child { grid-column: 1 / -1; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .vm-reel { animation: none; }
    .vm-card, .vm-card:hover { transition: none; transform: none; }
}
