/* Ideš i piješ — hand-written styles that the prebuilt Tailwind build in
   styles.css doesn't cover: the route map widget, the domaćin carousel, the
   language switch and the cookie-consent banner. Shared by every page. */

/* Language switch: nav on desktop, footer on mobile. The prebuilt Tailwind
   build has no `md:hidden` utility, so this is declared explicitly. 48rem
   matches the site's md breakpoint. */
.iip-lang-mobile { display: block; }
@media (min-width: 48rem) {
    .iip-lang-mobile { display: none; }
}

/* Character-select cards: domaćin videos desaturated until you hover the card.
   Only on hover-capable (pointer) devices — touch screens show full colour. */
.iip-domacin-video {
    transition: filter .5s ease, transform .5s ease;
}

@media (hover: hover) {
    .iip-domacin-video {
        filter: grayscale(1) contrast(1.05);
    }

    .group:hover .iip-domacin-video {
        filter: grayscale(0) contrast(1);
        transform: scale(1.04);
    }
}

@media (prefers-reduced-motion: reduce) {
    .iip-domacin-video { transition: none; }
    .group:hover .iip-domacin-video { transform: none; }
}

/* Browsers drop the trailing padding/margin of a horizontal flex scroll
   container, so the last card would end flush with the edge. A real
   spacer box is counted in scroll width; sized inset − gap so the total
   trailing space (gap + spacer) matches the leading inset. Slider only;
   the desktop grid below has no scroll. */
@media (max-width: 1279px) {
    #iip-domacin-carousel > div::after { content: ""; flex: 0 0 0.5rem; }
}
@media (min-width: 768px) and (max-width: 1279px) {
    #iip-domacin-carousel > div::after { flex-basis: 2rem; }
}

/* Desktop (≥1280px): all five cards fit as a centred grid, capped at
   360px each and shrinking with the viewport below that — no slider.
   The row maxes out at 5 × 360px + four 1rem gaps. Below 1280px it
   becomes a left-aligned horizontal slider. */
@media (min-width: 1280px) {
    #iip-domacin-carousel {
        max-width: calc(5 * 360px + 4 * 1rem);
        margin-left: auto;
        margin-right: auto;
        overflow: visible;
    }
    #iip-domacin-carousel > div {
        display: grid;
        grid-template-columns: repeat(5, minmax(224px, 1fr));
        width: auto;
        margin: 0;
        padding: 0;
    }
    #iip-domacin-carousel > div > .group {
        width: auto;
        scroll-snap-align: unset;
    }
}

#iip-map-root {
    position: relative;
}

#iip-map-root svg {
    display: block;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

#iip-map-root #iip-base {
    stroke: color-mix(in oklab, var(--ip-ink) 16%, transparent);
}

#iip-map-root #iip-anim {
    stroke: var(--ip-ink);
}

#iip-map-root #iip-pts g {
    cursor: pointer;
}

/* Discreet pulsing halo to invite a tap on each stop. */
#iip-map-root .iip-pulse {
    fill: var(--ip-ink);
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(1);
    animation: iip-pulse 2.6s ease-out infinite;
    will-change: transform, opacity;
}

/* Stagger the dots so they don't all breathe in unison. */
#iip-map-root #iip-pts g:nth-child(3n) .iip-pulse { animation-delay: .9s; }
#iip-map-root #iip-pts g:nth-child(3n+1) .iip-pulse { animation-delay: 1.7s; }

/* The opened/selected stop stops pulsing. */
#iip-map-root #iip-pts g.iip-open .iip-pulse {
    animation: none;
    opacity: 0;
}

@keyframes iip-pulse {
    0%   { transform: scale(1);   opacity: .45; }
    70%  { transform: scale(2.4); opacity: 0; }
    100% { transform: scale(2.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    #iip-map-root .iip-pulse { animation: none; opacity: 0; }
}

#iip-map-root .iip-start circle:nth-of-type(1) {
    fill: var(--ip-ink);
}

#iip-map-root .iip-start circle:nth-of-type(2) {
    stroke: var(--ip-ink);
}

#iip-map-root .iip-start text {
    fill: color-mix(in oklab, var(--ip-ink) 55%, transparent);
}

.iip-detail {
    display: none;
    background: var(--ip-ink);
    color: var(--ip-cream);
    border-radius: 1.25rem;
    padding: 22px 24px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.iip-detail.open {
    display: block;
}

.iip-detail.tip {
    position: absolute;
    z-index: 60;
    width: 340px;
    max-width: 80vw;
}

.iip-detail.modal {
    position: fixed;
    z-index: 100;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, 92vw);
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 1.5rem;
    padding: 32px 26px;
}

.iip-detail .iip-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-right: 40px;
}

.iip-detail .iip-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ip-lime);
    color: var(--ip-ink);
    font-weight: 800;
    font-size: 15px;
    flex: none;
}

.iip-detail .iip-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.15;
    color: var(--ip-cream);
}

.iip-detail .iip-desc {
    font-size: 1rem;
    line-height: 1.7;
    color: color-mix(in oklab, var(--ip-cream) 85%, transparent);
    white-space: pre-line;
}

.iip-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: color-mix(in oklab, var(--ip-cream) 14%, transparent);
    color: var(--ip-cream);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}

.iip-close:hover {
    background: var(--ip-lime);
    color: var(--ip-ink);
}

.iip-backdrop {
    display: none;
}

.iip-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: color-mix(in oklab, var(--ip-ink) 72%, transparent);
}

@media (max-width: 767px) {
    #iip-map-root svg {
        width: 100vw;
        max-width: 100vw;
        margin-left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 767px) {
    .hero-title {
        font-size: 24vw;
    }
}

/* Full-bleed carousel: spans the viewport while its first card stays
   aligned with the centered max-w-7xl content above it. */
.iip-bleed-carousel {
    padding-left: max(1.5rem, calc((100vw - 80rem) / 2));
    padding-right: max(1.5rem, calc((100vw - 80rem) / 2));
}

@media (min-width: 768px) {
    .iip-bleed-carousel {
        padding-left: max(3rem, calc((100vw - 80rem) / 2));
        padding-right: max(3rem, calc((100vw - 80rem) / 2));
    }
}

/* Cookie-consent banner (markup is injected by consent.js). */
.ip-consent {
    position: fixed;
    bottom: 16px; left: 16px; right: 16px;
    z-index: 1000;
    max-width: 580px;
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    padding: 18px 20px;
    background: var(--ip-ink);
    color: var(--ip-cream);
    border: 1px solid color-mix(in oklab, var(--ip-cream) 12%, transparent);
    border-radius: 1.25rem;
    box-shadow: 0 10px 34px #00000045;
    animation: ip-consent-in .3s ease;
}
@keyframes ip-consent-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ip-consent__text {
    flex: 220px;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: color-mix(in oklab, var(--ip-cream) 85%, transparent);
}
.ip-consent__actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}
.ip-consent__btn {
    min-height: 42px;
    padding: 0 22px;
    border-radius: 9999px;
    border: 2px solid transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.ip-consent__btn--ghost {
    background: transparent;
    color: var(--ip-cream);
    border-color: color-mix(in oklab, var(--ip-cream) 40%, transparent);
}
.ip-consent__btn--ghost:hover {
    border-color: var(--ip-cream);
}
.ip-consent__btn--primary {
    background: var(--ip-lime);
    color: var(--ip-ink);
}
.ip-consent__btn--primary:hover {
    transform: scale(1.05);
}
@media (prefers-reduced-motion: reduce) {
    .ip-consent { animation: none; }
    .ip-consent__btn--primary:hover { transform: none; }
}
