/*
 * Deliberate deviations from the approved design CSS.
 *
 * Kept separate so styles.css / components.css stay byte-comparable with
 * design/, and can be re-copied if the design is updated.
 * Loaded last, so these win.
 */

/* --- Card hovers -----------------------------------------------------------
 * The design lifts cards 4-5px and drops --shadow-lg (0 30px 70px) under them,
 * which reads as the card jumping and a dark pool forming underneath.
 * Softer lift, tighter shadow, same intent.
 */
:root {
    --shadow-hover: 0 6px 18px rgba(20, 23, 25, .07);
}

.card:hover,
.whycard:hover,
.seriescard:hover,
.modelcard:hover,
.project-card:hover,
.speccard:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.usecase:hover {
    transform: translateY(-2px);
}

.chip:hover {
    transform: translateY(-1px);
}

/* Ease the motion so it settles rather than snapping. */
.card,
.whycard,
.seriescard,
.modelcard,
.project-card,
.speccard,
.usecase,
.chip {
    transition: transform .25s cubic-bezier(.4, 0, .2, 1),
                box-shadow .25s cubic-bezier(.4, 0, .2, 1),
                border-color .25s ease;
}

@media (prefers-reduced-motion: reduce) {
    .card:hover,
    .whycard:hover,
    .seriescard:hover,
    .modelcard:hover,
    .project-card:hover,
    .speccard:hover,
    .usecase:hover,
    .chip:hover {
        transform: none;
    }
}

/* --- Gallery lightbox ------------------------------------------------------
 * The design's gallery tiles carry a "Skatīt" hover overlay but nothing opens.
 * Built here rather than in components.css so the design CSS stays comparable.
 */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    background: rgba(17, 36, 28, .92);
    backdrop-filter: blur(4px);
}

.lightbox[hidden] {
    display: none;
}

.lightbox__stage {
    margin: 0;
    max-width: min(1100px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.lightbox__stage img {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    border-radius: var(--r-sm, 10px);
    display: block;
}

.lightbox__stage figcaption {
    color: rgba(255, 255, 255, .82);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.lightbox__close,
.lightbox__nav {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
    border-radius: 999px;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex: none;
    transition: background .2s, border-color .2s;
}

.lightbox__close:hover,
.lightbox__nav:hover {
    background: rgba(124, 194, 66, .9);
    border-color: transparent;
}

.lightbox__nav {
    width: 46px;
    height: 46px;
}

.lightbox__nav svg {
    width: 22px;
    height: 22px;
}

.lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
}

.lightbox__close svg {
    width: 20px;
    height: 20px;
}

.gallery__item:focus-visible {
    outline: 2px solid var(--green, #7cc242);
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .lightbox {
        padding: 12px;
    }

    /* Arrows would crowd the image; swipe-free navigation is the close button
       plus reopening another tile. */
    .lightbox__nav {
        width: 38px;
        height: 38px;
    }
}

/* --- Contacts map ----------------------------------------------------------
 * Static map image in site styling instead of an embedded Google Maps frame:
 * no third party script, no API key, no cookie consent implications.
 */
.staticmap {
    position: relative;
    display: block;
    border-radius: var(--radius, 18px);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--paper);
    aspect-ratio: 16 / 11;
}

.staticmap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(.75) contrast(.96);
}

.staticmap__pin {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -100%);
    color: var(--amber);
    filter: drop-shadow(0 2px 6px rgba(20, 23, 25, .35));
}

.staticmap__label {
    position: absolute;
    left: 16px;
    bottom: 16px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* --- Language switcher ------------------------------------------------------
 * The design styles `.lang button`. We render <a> so switching language is a
 * real navigation (crawlable, middle-clickable), which meant none of the
 * design's rules applied. Same look, applied to links.
 */
.lang a {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    padding: 4px 7px;
    border-radius: 5px;
    color: rgba(255, 255, 255, .55);
    text-decoration: none;
    transition: color .15s;
}

.lang a.active,
.lang a:hover {
    color: #fff;
}

.nav.scrolled .lang a,
.nav--solid .lang a {
    color: var(--text-mute);
}

.nav.scrolled .lang a.active,
.nav--solid .lang a.active {
    color: var(--ink);
}

.mobnav__lang a {
    text-decoration: none;
    color: inherit;
}
