/* ============================================================
   THEME 2026 — Composants UI (Header, Drawer, Nav, Button, Lang)
   ============================================================
   Extrait de travel.css mais :
     - SCOPÉ ".theme-2026" au lieu de ".travel-page"
     - PAS de sélecteur global sur balises HTML (a, button, h1-h6, img, svg…)
       → préserve le contenu HTML libre (WebEditor, AiContent, contenu legacy)
     - Toutes les variables CSS (--primary, --secondary, etc.) sont déjà
       injectées par ThemeVars.js sur .theme-2026
   ============================================================ */

/* ------- Focus accessible ------- */
.theme-2026 .tr-focusable:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* ------- Helper RTL pour icônes directionnelles ------- */
[dir="rtl"] .theme-2026 .tr-flip-rtl { transform: scaleX(-1); }

/* ============================================================
   BUTTON (.tr-btn--primary, --secondary, --ghost, --outline)
   ============================================================ */
.theme-2026 .tr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    letter-spacing: .01em;
    border-radius: var(--r-pill);
    padding: 10px 18px;
    font-size: 14px;
    line-height: 1;
    transition: transform .12s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}
.theme-2026 .tr-btn:hover  { transform: translateY(-1px); }
.theme-2026 .tr-btn:active { transform: translateY(0); }

.theme-2026 .tr-btn--sm { padding: 8px 14px;  font-size: 13px; }
.theme-2026 .tr-btn--md { padding: 10px 18px; font-size: 14px; }
.theme-2026 .tr-btn--lg { padding: 14px 26px; font-size: 15px; }

.theme-2026 .tr-btn--primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 6px 14px -8px color-mix(in oklab, var(--primary) 70%, black);
}
.theme-2026 .tr-btn--primary:hover {
    background: color-mix(in oklab, var(--primary) 88%, black);
    color: #ffffff;
}

.theme-2026 .tr-btn--secondary {
    background: var(--secondary);
    color: #ffffff;
    box-shadow: 0 6px 14px -8px color-mix(in oklab, var(--secondary) 70%, black);
}
.theme-2026 .tr-btn--secondary:hover {
    background: color-mix(in oklab, var(--secondary) 88%, black);
    color: #ffffff;
}

.theme-2026 .tr-btn--ghost {
    background: transparent;
    color: var(--ink);
}
.theme-2026 .tr-btn--ghost:hover { background: var(--bg-2); }

.theme-2026 .tr-btn--outline {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line-2);
}
.theme-2026 .tr-btn--outline:hover { border-color: var(--ink-3); }

/* ============================================================
   HEADER — sticky pill flottant
   ============================================================ */
.theme-2026 .tr-header-wrap {
    position: sticky;
    top: 14px;
    z-index: 60;
    padding-inline: 14px;
}

.theme-2026 .tr-header {
    max-width: calc(var(--container) + 40px);
    margin-inline: auto;
    background: color-mix(in oklab, var(--surface) 90%, transparent);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 10px 14px 10px 18px;
}

.theme-2026 .tr-header__brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.theme-2026 .tr-header__brand img {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.theme-2026 .tr-header__nav {
    display: none;
    gap: 4px;
    justify-self: center;
}
.theme-2026 .tr-header__nav .tr-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--r-pill);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.theme-2026 .tr-header__nav .tr-nav-link:hover {
    background: var(--bg-2);
    color: var(--ink);
}
.theme-2026 .tr-header__nav .tr-nav-link[aria-current="true"] {
    color: var(--ink);
    background: var(--bg-2);
}

/* Sous-menu desktop */
.theme-2026 .tr-nav-group {
    position: relative;
    display: inline-flex;
}
.theme-2026 .tr-nav-link--has-sub { gap: 4px; }
.theme-2026 .tr-nav-sub {
    position: absolute;
    min-width: 220px;
    max-width: min(320px, calc(100vw - 16px));
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
    padding: 6px;
    display: none;
    flex-direction: column;
    z-index: 50;
    overflow: visible;
}
.theme-2026 .tr-nav-sub--bottom-start { top: 100%; inset-inline-start: 0; }
.theme-2026 .tr-nav-sub--bottom-end   { top: 100%; inset-inline-end: 0; }

/* Pont invisible (anti-fermeture quand la souris traverse le gap) */
.theme-2026 .tr-nav-sub--bottom-start::before,
.theme-2026 .tr-nav-sub--bottom-end::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -8px;
    height: 8px;
}
.theme-2026 .tr-nav-group:hover > .tr-nav-sub,
.theme-2026 .tr-nav-group:focus-within > .tr-nav-sub {
    display: flex;
}
.theme-2026 .tr-nav-sub__item {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--ink-2);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.theme-2026 .tr-nav-sub__item:hover {
    background: var(--bg-2);
    color: var(--ink);
}
.theme-2026 .tr-nav-sub__item--has-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.theme-2026 .tr-nav-link--placeholder {
    cursor: default;
    user-select: none;
}

/* Sous-menus imbriqués */
.theme-2026 .tr-nav-group--nested { display: block; position: relative; }
.theme-2026 .tr-nav-sub--nested { top: 0; }
.theme-2026 .tr-nav-sub--right-start {
    inset-inline-start: 100%;
    inset-inline-end: auto;
    margin-inline-start: 4px;
}
.theme-2026 .tr-nav-sub--left-start {
    inset-inline-end: 100%;
    inset-inline-start: auto;
    margin-inline-end: 4px;
}
.theme-2026 .tr-nav-sub--right-start::before,
.theme-2026 .tr-nav-sub--left-start::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    height: auto;
}
.theme-2026 .tr-nav-sub--right-start::before { left: -8px; right: auto; }
.theme-2026 .tr-nav-sub--left-start::before  { right: -8px; left: auto; }

.theme-2026 .tr-nav-sub--up.tr-nav-sub--bottom-start,
.theme-2026 .tr-nav-sub--up.tr-nav-sub--bottom-end {
    top: auto;
    bottom: 100%;
}
.theme-2026 .tr-nav-sub--up.tr-nav-sub--bottom-start::before,
.theme-2026 .tr-nav-sub--up.tr-nav-sub--bottom-end::before {
    top: auto;
    bottom: -8px;
}
.theme-2026 .tr-nav-sub--up.tr-nav-sub--right-start,
.theme-2026 .tr-nav-sub--up.tr-nav-sub--left-start {
    top: auto;
    bottom: 0;
}

.theme-2026 .tr-header__tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.theme-2026 .tr-header__burger {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
}
.theme-2026 .tr-header__burger:hover { border-color: var(--ink-3); }

@media (min-width: 960px) {
    .theme-2026 .tr-header__nav { display: inline-flex; }
}
@media (max-width: 640px) {
    .theme-2026 .tr-header {
        grid-template-columns: auto auto;
        padding: 8px 10px 8px 14px;
        gap: 8px;
    }
    .theme-2026 .tr-header__nav { display: none !important; }
    .theme-2026 .tr-header__tools { margin-inline-start: auto; }
    .theme-2026 .tr-header__tools .tr-btn {
        padding: 6px 10px;
        font-size: 12px;
        gap: 5px;
    }
    .theme-2026 .tr-header__tools .tr-btn .tr-btn-label { display: none; }
    .theme-2026 .tr-header__burger { width: 34px; height: 34px; }
    .theme-2026 .tr-lang__trigger { padding: 6px 8px; gap: 0; }
    .theme-2026 .tr-lang__trigger svg,
    .theme-2026 .tr-lang__trigger-code { display: none; }
    .theme-2026 .tr-lang__trigger .tr-lang__flag { margin-inline-end: 0; }
}

/* ============================================================
   LANG SWITCHER
   ============================================================ */
.theme-2026 .tr-lang { position: relative; }
.theme-2026 .tr-lang__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.theme-2026 .tr-lang__trigger:hover { border-color: var(--ink-3); }

.theme-2026 .tr-lang__menu {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.theme-2026 .tr-lang__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin: 0;
    border: none;
    outline: none;
    border-radius: var(--r-sm);
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    font: inherit;
    font-size: 13px;
    color: var(--ink-2);
    text-align: start;
    width: 100%;
    cursor: pointer;
}
.theme-2026 .tr-lang__item:hover {
    background: var(--bg-2);
    color: var(--ink);
}
.theme-2026 .tr-lang__item[aria-current="true"] {
    color: var(--primary);
    background: color-mix(in oklab, var(--primary) 8%, white);
}
.theme-2026 .tr-lang__flag {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 50%;
    margin-inline-end: 8px;
}
.theme-2026 .tr-lang__short {
    font-variant-caps: all-small-caps;
    letter-spacing: .08em;
    color: var(--ink-3);
    font-weight: 700;
}

/* ============================================================
   MOBILE DRAWER
   ============================================================ */
.theme-2026 .tr-drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(10,14,20,.42);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    animation: t26-fade-in .18s forwards;
}
@keyframes t26-fade-in { to { opacity: 1; } }

.theme-2026 .tr-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    width: min(420px, 94vw);
    background: var(--surface);
    z-index: 91;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    animation: t26-drawer-in .24s cubic-bezier(.2,.9,.25,1) forwards;
}
[dir="rtl"] .theme-2026 .tr-drawer { transform: translateX(-100%); }
@keyframes t26-drawer-in { to { transform: translateX(0); } }

.theme-2026 .tr-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}
.theme-2026 .tr-drawer__head img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.theme-2026 .tr-drawer__close,
.theme-2026 .tr-drawer__grouphead {
    font: inherit;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}
.theme-2026 .tr-drawer__close {
    width: 40px;
    height: 40px;
    border-radius: var(--r-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-2);
}
.theme-2026 .tr-drawer__close:hover { background: var(--bg-2); color: var(--ink); }

.theme-2026 .tr-drawer__body {
    overflow-y: auto;
    padding: 12px 14px 24px;
    flex: 1;
}

.theme-2026 .tr-drawer__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    width: 100%;
    text-align: start;
    margin-top: 8px;
    text-decoration: none;
}
.theme-2026 .tr-drawer__item:hover { background: var(--bg-2); }

.theme-2026 .tr-drawer__group {
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
}
.theme-2026 .tr-drawer__grouphead {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
    width: 100%;
    text-align: start;
    background: var(--bg);
}
.theme-2026 .tr-drawer__grouphead:hover { background: var(--bg-2); }
.theme-2026 .tr-drawer__grouphead .tr-drawer__chev {
    margin-inline-start: auto;
    color: var(--ink-3);
    transition: transform .18s ease;
}
.theme-2026 .tr-drawer__grouphead[aria-expanded="true"] .tr-drawer__chev {
    transform: rotate(90deg);
}
[dir="rtl"] .theme-2026 .tr-drawer__grouphead[aria-expanded="true"] .tr-drawer__chev {
    transform: rotate(-90deg);
}

.theme-2026 .tr-drawer__group .tr-drawer__item {
    margin-top: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--line);
    font-weight: 500;
    color: var(--ink-2);
    background: var(--surface);
    padding-inline-start: 24px;
}
.theme-2026 .tr-drawer__group .tr-drawer__item:hover { background: var(--bg-2); color: var(--ink); }

.theme-2026 .tr-drawer__item--placeholder {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: var(--ink-2);
    font-weight: 500;
    cursor: default;
    user-select: none;
    background: var(--surface);
}
.theme-2026 .tr-drawer__group .tr-drawer__item--placeholder {
    border-top: 1px solid var(--line);
    padding-inline-start: 24px;
}

.theme-2026 .tr-drawer__socials {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}
.theme-2026 .tr-drawer__socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--r-md);
    background: var(--bg-2);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.theme-2026 .tr-drawer__socials a:hover { background: var(--line); color: var(--ink); }

.theme-2026 .tr-drawer__foot {
    padding: 14px 18px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 10px;
}
