/* =============================================================================
   Addendum: page-specific styles (panorama, results, publication, directions)
   ============================================================================= */

/* ── Header bigger ──────────────────────────────────────────────────────── */
.header__inner {
    padding: 18px 32px;
}

/* ── Nav full-width + lang dropdown ─────────────────────────────────────── */
.nav {
    flex: 1;
    margin-left: 16px;
}

/* ── Nav links: bigger, active = underline not filled box ───────────────── */
.nav__link {
    font-size: 16px;
    padding: 10px 14px;
    white-space: nowrap;
    border-radius: var(--r);
}

.nav__link.active {
    color: var(--blue-600);
    background: var(--blue-50);
    font-weight: 700;
    position: relative;
}

.nav__link.active::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 2px;
    background: var(--blue-600);
    border-radius: 2px;
}

/* Language dropdown */
.lang-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto;
}

.lang-dropdown__btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--blue-50);
    border: 1px solid var(--rule);
    border-radius: var(--r-pill);
    padding: 7px 14px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-3);
    cursor: pointer;
    transition: var(--t);
    line-height: 1;
}

.lang-dropdown__btn:hover,
.lang-dropdown.open .lang-dropdown__btn {
    background: var(--blue-600);
    color: #fff;
    border-color: var(--blue-600);
}

.lang-dropdown__btn svg {
    flex-shrink: 0;
    transition: transform .2s ease;
}

.lang-dropdown.open .lang-dropdown__btn svg {
    transform: rotate(180deg);
}

.lang-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: var(--r);
    box-shadow: 0 8px 24px -4px rgba(13,27,62,.15);
    overflow: hidden;
    min-width: 64px;
    z-index: 60;
}

.lang-dropdown.open .lang-dropdown__menu {
    display: block;
}

.lang-dropdown__menu a {
    display: block;
    padding: 9px 18px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-3);
    transition: var(--t);
    white-space: nowrap;
}

.lang-dropdown__menu a:hover {
    background: var(--blue-50);
    color: var(--blue-600);
}

/* Mobile: show all languages inline without dropdown */
@media (max-width: 980px) {
    .lang-dropdown {
        margin-left: 0;
        margin-top: 10px;
        padding-top: 12px;
        border-top: 1px solid var(--rule);
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .lang-dropdown__btn {
        display: none;
    }

    .lang-dropdown__menu {
        display: flex !important;
        position: static;
        background: none;
        border: none;
        box-shadow: none;
        min-width: 0;
        gap: 6px;
        flex-wrap: wrap;
    }

    .lang-dropdown__menu a {
        padding: 6px 12px;
        border-radius: var(--r-pill);
        background: var(--blue-50);
        color: var(--ink-3);
    }

    .lang-dropdown__menu a:hover {
        background: var(--blue-600);
        color: #fff;
    }
}

/* Narrow container for article pages */
.container--narrow { max-width: 880px; }

/* Empty state */
.empty {
    text-align: center;
    font-family: var(--display);
    font-style: italic;
    font-size: 19px;
    color: var(--ink-3);
    padding: 60px 24px;
    background: var(--white);
    border: 1px dashed var(--rule-2);
    border-radius: var(--r-lg);
}

/* Direction stats grid */
.stats__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
@media (max-width: 960px) { .stats__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats__grid { grid-template-columns: 1fr; } }

/* Direction poster fallback when no image */
.dir-poster {
    width: 100%;
    aspect-ratio: 4/5;
    border-radius: var(--r-xl);
    background: linear-gradient(135deg, var(--teal-600), var(--ink));
    color: var(--amber-300);
    display: grid;
    place-items: center;
    font-size: 140px;
    box-shadow: var(--sh-lg);
}

/* Card __title link styling */
.card a, .pub-card h3 a, .lab-card h3 a {
    color: inherit;
}
.pub-card h3, .lab-card h3 {
    font-family: var(--display);
    font-size: 21px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    letter-spacing: -.015em;
    margin-bottom: 10px;
}
.pub-card h3 a:hover, .lab-card h3 a:hover { color: var(--teal-600); }

/* Direct img with lab-card__img / pub-card__img class (not wrapper) */
img.lab-card__img, img.pub-card__img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    display: block;
}
img.lab-card__img { border-radius: var(--r-lg) var(--r-lg) 0 0; }
img.pub-card__img { border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* When card has lab-card / pub-card with .card class — strip card padding for image */
.card.lab-card, .card.pub-card { padding: 0; }
.card.lab-card .lab-card__body, .card.pub-card .pub-card__body { padding: 26px 28px; }

/* When section.page-hero is combined, slight tweak for top section */
.section.page-hero { padding: 110px 0 90px; }
.section.page-hero .section__title { color: var(--paper); margin-bottom: 18px; }
.section.page-hero .section__title::after { background: linear-gradient(90deg, var(--amber-300), var(--paper)); }
.section.page-hero .section__text, .section.page-hero .section__text--center { color: rgba(255,255,255,.85); }
.section.page-hero .eyebrow { color: var(--amber-300); justify-content: center; }
.section.page-hero .eyebrow > span:first-child { background: var(--amber-300); }

/* Pagination — laravel default classes */
.pagination {
    display: flex; justify-content: center; gap: 4px; padding: 0; list-style: none;
    flex-wrap: wrap; margin-top: 40px;
}
.pagination li a, .pagination li span {
    font-family: var(--mono); font-size: 13px; font-weight: 600;
    padding: 9px 16px; border-radius: var(--r-pill);
    border: 1px solid var(--rule); background: var(--white); color: var(--ink-2);
    transition: var(--t); display: inline-block;
}
.pagination li a:hover { background: var(--teal-50); border-color: var(--teal-300); color: var(--teal-700); }
.pagination li.active span, .pagination li[aria-current] span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pagination li.disabled span { opacity: .4; }

/* =============================================================================
   PANORAMA (full-screen 360° tour)
   ============================================================================= */
.pano-stage {
    position: fixed;
    inset: 0;
    top: 80px;          /* below header */
    z-index: 20;
    background: #000;
    overflow: hidden;
}
.pano-viewer {
    position: absolute;
    inset: 0;
    background: #000;
}

/* Overlay info panel (top) */
.pano-overlay {
    position: absolute;
    top: 24px; left: 24px;
    max-width: 460px;
    background: rgba(14,22,20,.78);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    color: var(--paper);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--r-lg);
    padding: 24px 28px 22px;
    z-index: 30;
    box-shadow: 0 24px 56px -16px rgba(0,0,0,.6);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: var(--t);
}
.pano-overlay.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.pano-overlay__close {
    position: absolute;
    top: 10px; right: 12px;
    width: 30px; height: 30px;
    border-radius: 50%;
    color: rgba(255,255,255,.6);
    font-size: 22px;
    line-height: 1;
    display: grid; place-items: center;
    transition: var(--t);
}
.pano-overlay__close:hover { background: rgba(255,255,255,.1); color: var(--amber-300); }
.pano-eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--mono); font-size: 11px; font-weight: 600;
    color: var(--amber-300); letter-spacing: .2em; text-transform: uppercase;
    margin-bottom: 10px;
}
.pano-eyebrow > span:first-child {
    width: 18px; height: 2px; background: var(--amber-300); border-radius: var(--r-pill);
}
.pano-title {
    font-family: var(--display); font-size: 26px; font-weight: 700;
    color: var(--paper); margin-bottom: 8px; line-height: 1.15;
    letter-spacing: -.015em;
}
.pano-desc {
    font-family: var(--serif); font-size: 14.5px;
    color: rgba(255,255,255,.78); line-height: 1.55;
}

/* Thumbnails strip (floating bottom) */
.pano-thumbs.pano-thumbs--floating {
    position: absolute;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(14,22,20,.78);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--r-pill);
    max-width: calc(100vw - 48px);
    overflow-x: auto;
    z-index: 30;
    box-shadow: 0 24px 56px -16px rgba(0,0,0,.6);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
}
.pano-thumbs::-webkit-scrollbar { height: 8px; }
.pano-thumbs::-webkit-scrollbar-track { background: rgba(255,255,255,.06); border-radius: 4px; }
.pano-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.35); border-radius: 4px; }
.pano-thumbs::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.55); }

/* Стрелки прокрутки ленты миниатюр */
.pano-thumbs-nav {
    position: absolute;
    transform: translateY(-50%);
    width: 42px; height: 42px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(14,22,20,.92);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    font-size: 26px; line-height: 1; font-weight: 700;
    cursor: pointer;
    z-index: 36;
    box-shadow: 0 12px 30px -8px rgba(0,0,0,.6);
    transition: var(--t);
}
.pano-thumbs-nav:hover { background: var(--amber-500); color: var(--ink); border-color: var(--amber-500); }
.pano-thumbs-nav--prev { left: 16px; }
.pano-thumbs-nav--next { right: 16px; }
.pano-thumbs.is-grabbing { cursor: grabbing; }
@media (max-width: 720px) {
    .pano-thumbs-nav { display: none !important; }
}

.pano-thumb {
    flex: 0 0 auto;
    width: 110px;
    border: 2px solid transparent;
    border-radius: var(--r);
    overflow: hidden;
    background: rgba(255,255,255,.05);
    cursor: pointer;
    transition: var(--t);
    text-align: left;
    position: relative;
}
.pano-thumb img {
    width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block;
}
.pano-thumb span {
    display: block;
    padding: 6px 8px 8px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pano-thumb:hover {
    border-color: var(--amber-300);
    transform: translateY(-2px);
}
.pano-thumb.is-active {
    border-color: var(--amber-300);
    box-shadow: 0 0 0 1px var(--amber-300);
}

/* Mobile control buttons */
.pano-controls {
    position: absolute;
    top: 18px; right: 18px;
    display: none;       /* hidden on desktop, shown on mobile */
    flex-direction: column;
    gap: 8px;
    z-index: 35;
}
.pano-ctrl-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(14,22,20,.78);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.14);
    color: var(--paper);
    display: grid; place-items: center;
    cursor: pointer;
    transition: var(--t);
    box-shadow: 0 10px 24px -8px rgba(0,0,0,.5);
}
.pano-ctrl-btn:hover { background: var(--amber-500); color: var(--ink); border-color: var(--amber-500); }

@media (max-width: 720px) {
    .pano-stage { top: 64px; }
    .pano-controls { display: flex; }

    .pano-overlay {
        top: 12px; left: 12px; right: 12px; max-width: none;
        padding: 16px 20px 18px;
    }
    .pano-title { font-size: 19px; }
    .pano-desc { font-size: 13px; }

    .pano-thumbs.pano-thumbs--floating {
        bottom: 12px; left: 12px; right: 12px;
        transform: none;
        max-width: none;
        transform: translateY(calc(100% + 16px));
        opacity: 0;
        pointer-events: none;
        transition: var(--t);
    }
    .pano-thumbs.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .pano-overlay {
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
    }
    .pano-overlay.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
}

/* Hide footer & main padding when panorama is fullscreen */
body:has(.pano-stage) main { min-height: 0; }
body:has(.pano-stage) .footer { display: none; }

/* Pannellum hotspot custom arrow */
.custom-arrow {
    width: 40px !important;
    height: 40px !important;
    background-image: none !important;
    background-color: rgba(212,154,31,.92) !important;
    border-radius: 50% !important;
    border: 3px solid var(--ink) !important;
    box-shadow: 0 0 0 3px rgba(212,154,31,.35) !important;
    cursor: pointer !important;
    transition: var(--t) !important;
    position: relative !important;
}
.custom-arrow::before {
    content: '→';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--ink);
    font-weight: 700;
    font-size: 18px;
    font-family: var(--sans);
}
.custom-arrow:hover {
    transform: scale(1.15) !important;
    background-color: var(--amber-500) !important;
}

/* Pannellum info hotspot tooltip */
div.pnlm-tooltip span {
    background: var(--ink) !important;
    color: var(--paper) !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    font-family: var(--sans) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: var(--r) !important;
    padding: 10px 14px !important;
    box-shadow: 0 12px 24px -8px rgba(0,0,0,.5) !important;
}

/* =============================================================================
   MOBILE — comprehensive fixes (≤ 768px and ≤ 480px)
   ============================================================================= */

@media (max-width: 768px) {

    /* ── Prevent any horizontal overflow ── */
    html, body { overflow-x: hidden; max-width: 100%; }

    /* ── Responsive tables ── */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

    /* ── Container horizontal padding ── */
    .container,
    .hs__inner, .hf__grid, .hfeat__inner, .hdark__inner,
    .hnews__inner, .hcta__inner, .kpi-band__grid {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* ── Header ── */
    .header__inner { padding: 12px 16px !important; }

    /* ── Section vertical padding ── */
    .section                          { padding: 60px 0; }
    .section.page-hero                { padding: 70px 0 50px; }
    .vision                           { padding: 70px 0; }
    .hfeat                            { padding: 60px 0; }
    .hnews                            { padding: 60px 0; }
    .hdark                            { padding: 60px 0; }
    .hcta                             { padding: 60px 0; }
    .kpi-band                         { padding: 48px 0; }

    /* ── All big headings: prevent overflow + word break ── */
    h1, h2, h3,
    .hs__h1, .section__title, .page-hero__title,
    .hfeat__h2, .hdark__left h2, .hcta__h2 {
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    /* ── Page hero title ── */
    .page-hero__title {
        font-size: clamp(26px, 7vw, 36px);
        letter-spacing: -.025em;
        line-height: 1.1;
    }
    .page-hero__subtitle {
        font-size: 15px;
        line-height: 1.6;
    }
    .page-hero { padding: 72px 0 54px; }

    /* ── Home hero (hs) ── */
    .hs__photo       { min-height: 260px; }
    .hs__card        { padding: 36px 20px; }
    .hs__h1          { font-size: clamp(26px, 7vw, 36px); letter-spacing: -.025em; }
    .hs__lede        { font-size: 15px; margin-bottom: 24px; }
    .hs__actions     { flex-direction: column; align-items: stretch; gap: 10px; }
    .hs__btn-white,
    .hs__btn-ghost   { justify-content: center; }

    /* ── Home features strip ── */
    .hf__grid                        { grid-template-columns: 1fr !important; }
    .hf__item                        { border-right: 0 !important; border-bottom: 1px solid var(--rule); padding: 24px 20px; }
    .hf__item:last-child             { border-bottom: 0; }

    /* ── Home feature section ── */
    .hfeat__float { display: none; }
    .hfeat__h2    { font-size: clamp(24px, 6.5vw, 34px); }

    /* ── Dark stats section ── */
    .hdark__left h2   { font-size: clamp(24px, 6.5vw, 34px); }
    .hdark__stat-num  { font-size: 32px; }

    /* ── CTA section ── */
    .hcta__h2 { font-size: clamp(24px, 7vw, 36px); }

    /* ── Section title ── */
    .section__title { font-size: clamp(22px, 6vw, 34px); }

    /* ── KPI strip ── */
    .kpi-item         { padding: 22px 18px; }
    .kpi-item__num    { font-size: clamp(36px, 8vw, 52px); }

    /* ── Cards grid: 1 col on narrow ── */
    .cards-grid--2 { grid-template-columns: 1fr; }

    /* ── Rounded image on about page ── */
    .rounded-img { min-height: 220px; }

    /* ── Timeline ── */
    .timeline { padding-left: 52px; }
    .timeline::before { left: 16px; }
    .timeline__marker { left: -52px; width: 38px; height: 38px; font-size: 12px; }

    /* ── Structure panel ── */
    .structure__panel-head  { padding: 24px 18px; }
    .structure__cards       { padding: 18px; }
    .structure__panel-title { font-size: clamp(20px, 5.5vw, 28px); }
    .structure__panel-desc  { font-size: 14.5px; }

    /* ── Lab / pub card image ── */
    .lab-card__img, .pub-card__img { aspect-ratio: 16/9; }
    .card.lab-card .lab-card__body,
    .card.pub-card .pub-card__body { padding: 18px 18px; }

    /* ── News cards: disable hover expand on touch ── */
    .hnews__card         { max-height: none; cursor: default; }
    .hnews__card:hover   { max-height: none; transform: none; box-shadow: none; border-color: var(--rule); z-index: 1; }
    .hnews__detail       { opacity: 1; max-height: none; padding-top: 10px; }
    .hnews__card-body h3 { -webkit-line-clamp: unset; }

    /* ── Prevent grid/flex cards from overflowing viewport on mobile ── */
    .hnews__grid, .hdark__services, .hf__grid { max-width: 100%; }
    .hnews__card, .hdark__svc, .hf__item      { min-width: 0; max-width: 100%; }
    .hnews__card *, .hdark__svc *             { min-width: 0; }
    .hnews__photo img                         { max-width: 100%; }

    /* ── Footer ── */
    .footer__inner   { padding: 48px 20px 32px; }
    .footer__grid    { grid-template-columns: 1fr; gap: 24px; }
    .footer__brand   { max-width: 100%; }

    /* ── Contact cards ── */
    .contacts-grid { grid-template-columns: 1fr; }

    /* ── Vision pills ── */
    .vision__pill  { padding: 9px 16px; font-size: 13px; }
    .vision__bg    { display: none; }

    /* ── Panorama overlay on small screen ── */
    .pano-overlay  { top: 8px; left: 8px; right: 8px; padding: 14px 16px; }
    .pano-title    { font-size: 17px; }
}

@media (max-width: 480px) {

    /* ── Even tighter container ── */
    .container,
    .hs__inner, .hf__grid, .hfeat__inner, .hdark__inner,
    .hnews__inner, .hcta__inner, .kpi-band__grid {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* ── Home hero photo: hide on very small, show only card ── */
    .hs__photo { min-height: 220px; }
    .hs__h1    { font-size: clamp(24px, 8.5vw, 32px); }

    /* ── Page hero ── */
    .page-hero__title { font-size: clamp(24px, 8.5vw, 30px); }
    .page-hero        { padding: 56px 0 40px; }

    /* ── Btn: full width in hero ── */
    .btn { padding: 13px 22px; font-size: 13.5px; }

    /* ── Lab / pub card body padding ── */
    .lab-card__body, .pub-card__body { padding: 18px; }

    /* ── Dark services: 1 col ── */
    .hdark__services { grid-template-columns: 1fr !important; }

    /* ── Stats grid: 1 col ── */
    .stats__grid { grid-template-columns: 1fr !important; }

    /* ── News head: stack ── */
    .hnews__head { flex-direction: column; align-items: flex-start; gap: 12px; }

    /* ── Section title ── */
    .section__title { font-size: clamp(20px, 7vw, 28px); padding-bottom: 18px; }
}
