
:root{
  --primary-50:#fff5f6; --primary-100:#ffe5e8; --primary-200:#ffcbd2; --primary-300:#ff9aa8; --primary-400:#ff6073;
  --primary-500:#e03244; --primary-600:#c8102e; --primary-700:#a50d25; --primary-800:#7d0a1c; --primary-900:#4f0611;
  --bg:#ffffff; --text:#1f2328; --muted:#667085; --border:#ececec; --shadow:0 10px 30px rgba(0,0,0,.06);
  /* Added variables referenced later */
  --radius-lg:16px; --surface-elevated:#fff; --shadow-md:0 4px 16px rgba(0,0,0,.12);
}

*{box-sizing:border-box}
html,body{height:100%}
html{scroll-behavior:smooth}
body{
  margin:0; color:var(--text); background:var(--bg);
  font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

.container{max-width:1100px; margin:0 auto; padding:0 20px}
.muted{color:var(--muted)}
.banner{height:10px; background:linear-gradient(90deg,var(--primary-600),var(--primary-400) 40%, var(--primary-600));}
.banner-bottom{margin-top:60px}
.skip-link{position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden}
.skip-link:focus{position:fixed; left:16px; top:16px; width:auto; height:auto; padding:10px 14px; background:#fff; box-shadow:var(--shadow); border-radius:10px; z-index:10000}
.app-shell{display:flex; min-height:calc(100vh - 20px)}
mark{background:var(--primary-100); color:inherit; padding:.15em .3em; border-radius:.3em}
.pill{display:inline-flex; align-items:center; gap:6px; font-weight:700; font-size:12px; padding:6px 10px; background:var(--primary-50); color:var(--primary-800); border:1px solid var(--primary-200); border-radius:999px}

/* Sidebar */
.sidebar{
  width:280px; flex:0 0 280px; background:#fff; border-right:1px solid var(--border); padding:18px;
  display:flex; flex-direction:column; gap:12px; transition:width .2s ease;
  overflow-y:auto; overflow-x:hidden; position:sticky; top:0;
  height: calc(100dvh - 20px);  /* 10px top + 10px bottom banners */
}
.sidebar::-webkit-scrollbar { width:6px }
.sidebar::-webkit-scrollbar-thumb { background-color:var(--primary-200); border-radius:3px }
.sidebar::-webkit-scrollbar-thumb:hover { background-color:var(--primary-400) }
.sidebar__header{display:flex; align-items:center; justify-content:space-between; gap:10px}
.brand{display:inline-flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.3px; text-decoration:none; color:inherit}
.logo{width:28px; height:28px; border-radius:8px; box-shadow:0 2px 8px rgba(200,16,46,.35)}
.sidebar__toggle, .sidebar__close{border:1px solid var(--border); background:#fff; padding:8px; border-radius:10px; box-shadow:0 2px 8px rgba(0,0,0,.04); cursor:pointer}
.sidebar__toggle:hover, .sidebar__close:hover{background:var(--primary-50)}
.sidebar__close{display:none}
.sidebar__footer{margin-top:auto; font-size:14px}
.nav{display:flex; flex-direction:column; gap:6px}
.nav__section{margin:16px 4px 6px; font-size:12px; text-transform:uppercase; color:var(--muted); letter-spacing:.6px; font-weight:700}
.nav__link{display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; text-decoration:none; color:var(--text); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.nav__link:hover{background:var(--primary-50)}
.nav__link.active{background:var(--primary-100); color:var(--primary-800); box-shadow:inset 0 0 0 1px var(--primary-200)}
.nav .icon{width:20px; display:inline-block; text-align:center}
.sidebar.collapsed{width:120px; flex-basis:120px}
.sidebar.collapsed .label{display:none !important}
.sidebar.collapsed .nav__section{display:none}
.sidebar.collapsed .nav__link{justify-content:center; padding:0}
.sidebar.collapsed .sidebar__footer{display:none}

/* Content Area */
.content-area{flex:1; display:flex; flex-direction:column; min-width:0; background:linear-gradient(180deg, #fff, #fff 55%, var(--primary-50) 100%)}
.topbar{height:56px; display:flex; align-items:center; gap:10px; padding:0 16px; border-bottom:1px solid var(--border); background:#fff; position:sticky; top:0; z-index:10}
.topbar__title{font-weight:800}
.hamburger-mobile{display:none; border:1px solid var(--border); background:#fff; padding:8px; border-radius:10px; box-shadow:0 2px 8px rgba(0,0,0,.04); cursor:pointer}
.hamburger-mobile:hover{background:var(--primary-50)}
.content{padding:28px 24px; max-width:1100px; width:100%; margin:0 auto}
[hidden]{display:none !important}
.hero-card{padding:10px 0}
.hero-card__content{background:#fff; border:1px solid var(--border); border-radius:16px; box-shadow:var(--shadow); padding:26px}
.badge{display:inline-flex; align-items:center; gap:8px; font-size:12px; font-weight:700; letter-spacing:.6px; text-transform:uppercase; color:var(--primary-700); background:var(--primary-100); padding:6px 10px; border-radius:999px}
h1{font-size:36px; line-height:1.15; margin:14px 0 12px}
h2{font-size:28px; margin:18px 0 10px} h3{font-size:22px} h4{font-size:18px} h5{font-size:16px} h6{font-size:14px; text-transform:uppercase; color:var(--muted); letter-spacing:.6px}
p{margin:12px 0}
code,kbd{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace}
code{background:#f7f7f9; border:1px solid var(--border); padding:.2em .45em; border-radius:8px}
kbd{background:#111; color:#fff; padding:.2em .45em; border-radius:6px}
.cta-row{display:flex; gap:12px; flex-wrap:wrap}
.btn{display:inline-flex; align-items:center; gap:8px; font-weight:700; border:1px solid transparent; padding:10px 14px; border-radius:12px; text-decoration:none; cursor:pointer}
.btn-primary{background:var(--primary-600); color:#fff; box-shadow:0 6px 20px rgba(200,16,46,.25)}
.btn-primary:hover{background:var(--primary-700)}
.btn-ghost{background:#fff; color:var(--primary-700); border-color:var(--primary-200)}
.btn-ghost:hover{background:var(--primary-50)}
.grid.two{display:grid; grid-template-columns:1fr; gap:7px}
.grid.five{display:grid; grid-template-columns:repeat(5,1fr); gap:6px}
@media (min-width:900px){ .grid.two{grid-template-columns:1fr 1fr} }

.table-wrap{overflow:auto; border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow); background:#fff}
table{width:100%; border-collapse:collapse; min-width:520px}
th,td{padding:12px 14px; text-align:left; border-bottom:1px solid var(--border)}
thead th{background:linear-gradient(180deg,#fff, #fff 60%, var(--primary-50)); position:sticky; top:0; z-index:1}
.table-compact th, .table-compact td{padding:10px 12px}

/* ===== Footer (consolidated) ===== */
.site-footer{
  background:#fff; border-top:1px solid var(--border);
  padding:2rem 1rem;
}
.footer-grid{display:grid; grid-template-columns:1fr; gap:20px}
.credits{color:var(--muted); font-size:14px}
@media (min-width:760px){ .footer-grid{grid-template-columns: 2fr 1fr} }

@media (max-width:980px){
  .sidebar{
    position:fixed;
    inset:10px auto 10px 10px;
    width:82%;
    max-width:360px;

    /* Use the available height minus the insets */
    height:calc(100dvh - 20px);

    border:1px solid var(--border);
    border-radius:16px;
    box-shadow:var(--shadow);

    /* Keep the drawer fully off-screen when closed */
    transform:translate3d(-120%,0,0);
    opacity:0;
    visibility:hidden;
    pointer-events:none;

    /* Smooth, reliable animation + paint hint */
    transition:transform .25s ease, opacity .25s ease, visibility .25s;
    will-change: transform;

    /* Ensure it always stacks ABOVE the overlay */
    z-index:100;
  }

  .sidebar.open{
    transform:translate3d(0,0,0);
    opacity:1;
    visibility:visible;
    pointer-events:auto;
  }

  /* If desktop state persisted as 'collapsed', neutralise it on mobile */
  .sidebar.collapsed{
    width:82%;
    flex-basis:auto;
  }

  .hamburger-mobile{ display:inline-flex }

  /* Overlay (scrim) under the drawer */
  body.menu-open{ overflow:hidden; height:100dvh; position:fixed; width:100% }

  /* Mobile: only show the ✕ close button when the drawer is open */
  .sidebar__toggle{ display:none }
  .sidebar__close{ display:none }
  .sidebar.open .sidebar__close{ display:inline-flex }
}

/* ===============================
   Slideshow Component
   =============================== */

.slideshow {
  --slide-ratio: 16 / 9;         /* Aspect ratio */
  --radius: var(--radius-lg);
  --surface: var(--surface-elevated);
  --shadow: var(--shadow-md);

  position: relative;
  margin-block: 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Header (optional title/badge) */
.slideshow__header { padding: 1.25rem 1.25rem 0 1.25rem }
.slideshow__title { margin: .5rem 0 0 0 }

/* Viewport defines the responsive slide area */
.slideshow__viewport {
  width: 100%;
  aspect-ratio: var(--slide-ratio);
  height: auto;                   /* Height auto-adjusts with width */
  max-height: min(80svh, 720px);  /* Don’t exceed viewport height */
  position: relative;
  overflow: hidden;
  outline: none;
}

/* Track of slides */
.slideshow__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  height: 100%;
  transition: transform 420ms cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}

/* Each slide */
.slide {
  position: relative;
  height: 85%;
  overflow: hidden;
  isolation: isolate;
}
.slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;  /* Use 'contain' if you want no cropping */
}
.slide figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: .75rem 1rem;
  /* Fallback for browsers without color-mix */
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .9rem;
  line-height: 1.2;
  z-index: 3;
}
@supports (background: color-mix(in oklab, #000 55%, transparent)) {
  .slide figcaption { background: color-mix(in oklab, #000 55%, transparent) }
}

/* Controls (buttons + dots) */
.slideshow__controls {
  position: absolute;
  inset: auto 0 0 0;              /* Stick to bottom */
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem 1.1rem 1rem;
}

.slideshow__btn,
.slideshow__toggle {
  display: inline-grid;
  place-items: center;
  border-radius: 9999px;
  padding: .5rem .65rem;
  color: inherit;
  background: transparent;
}

.slideshow__dots {
  display: inline-flex;
  gap: .5rem;
  justify-content: center;
  align-items: center;
}
.slideshow__dots button {
  width: .7rem;
  height: .7rem;
  border-radius: 9999px;
  border: 0;
  /* Fallback */
  background: currentColor;
  opacity: .25;
}
@supports (background: color-mix(in oklab, currentColor 25%, transparent)) {
  .slideshow__dots button {
    background: color-mix(in oklab, currentColor 25%, transparent);
    opacity: .6;
  }
}
.slideshow__dots button[aria-selected="true"] {
  width: 1.6rem;
  border-radius: 9999px;
  opacity: 1;
  background: currentColor;
}

/* Hover / focus states */
.slideshow__btn:hover,
.slideshow__toggle:hover { filter: brightness(1.05) }
.slideshow__btn:focus-visible,
.slideshow__toggle:focus-visible,
.slideshow__dots button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  .slideshow__track { transition: none }
}

/* On narrow screens, change ratio to 4:3 for better fit */
@media (max-width: 560px) {
  .slideshow { --slide-ratio: 4 / 3 }
  .slideshow__viewport { max-height: 70svh }
}

/* ===== Footer layout ===== */
.footer-logos {
  display: flex !important;
  flex-wrap: nowrap;            /* single line by default */
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1rem;
}
@media (max-width: 900px) { .footer-logos { flex-wrap: wrap } }

.logo-tile {
  flex: 0 1 auto;               /* allow to shrink */
  min-width: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 1px 11px;
}

/* Shared image behavior (no distortion) */
.footer-logo {
  width: auto; height: auto; max-width: 100%;
  object-fit: contain; display: block;
}

/* Per-logo tuning */
.logo-uts    { max-height: 60px; max-width: clamp(160px, 28vw, 540px) }
.logo-madrid { max-height: 90px; max-width: 160px }
.logo-jaen   { max-height: 80px; max-width: clamp(160px, 22vw, 360px) }
.logo-lille  { max-height: 60px; max-width: clamp(170px, 22vw, 380px) }
.logo-hagen  { max-height: 60px; max-width: clamp(140px, 20vw, 300px) }
.logo-ulster { max-height: 60px }

@media (max-width: 768px) {
  .logo-uts     { max-height: 76px }
  .logo-madrid  { max-height: 100px }
  .logo-jaen    { max-height: 82px }
  .logo-lille   { max-height: 88px }
  .logo-hagen   { max-height: 80px }
  .logo-ulster  { max-height: 86px }
}
@media (max-width: 480px) {
  .logo-uts     { max-height: 68px }
  .logo-madrid  { max-height: 92px }
  .logo-jaen    { max-height: 74px }
  .logo-lille   { max-height: 78px }
  .logo-hagen   { max-height: 72px }
  .logo-ulster  { max-height: 78px }
}

/* ===============================
   Toggle Table (Tabs) Component
   =============================== */
.toggle-table {
  background:#fff; border:1px solid var(--border); border-radius:16px;
  box-shadow: var(--shadow);
}

.toggle-table__tabs {
  display:flex; gap:8px; flex-wrap:wrap;
  padding:10px; border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,#fff,#fff 60%,var(--primary-50));
}
.toggle-table__tabs [role="tab"]{
  appearance:none; border:1px solid var(--border); background:#fff;
  padding:10px 14px; border-radius:12px; font-weight:700; cursor:pointer;
}
.toggle-table__tabs [role="tab"][aria-selected="true"]{
  background:var(--primary-100); color:var(--primary-800);
  box-shadow: inset 0 0 0 1px var(--primary-200);
}

.toggle-table__panel { display:none; padding:14px }
.toggle-table__panel.is-active { display:block }

.toggle-table .note {
  font-size: 14px; color: var(--muted); margin: 8px 0 0;
}

.toggle-table .kvs td:first-child{
  width: 38%; font-weight: 700;
}

/* small helpers for inline badges/labels */
.inline-badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 8px; font-size:12px; font-weight:700;
  color:var(--primary-800); background:var(--primary-50);
  border:1px solid var(--primary-200); border-radius:999px;
}

/* Mobile drawer controls */
@media (max-width:980px){
  /* Hide the desktop collapse (three lines) inside the sidebar on mobile */
  .sidebar__toggle{ display:none }

  /* Only show the ✕ close button when the drawer is actually open */
  .sidebar__close{ display:none }
  .sidebar.open .sidebar__close{ display:inline-flex }
}

/* Add to style.css */
.close-icon {
  position: relative;
  width: 24px;
  height: 24px;
  display: inline-block;
}

.close-icon::before,
.close-icon::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 2px;
  background: #333; /* adjust color */
  transform-origin: center;
}

.close-icon::before {
  transform: rotate(45deg);
}
.close-icon::after {
  transform: rotate(-45deg);
}

/* ==========================================================================
   Overlay & Mobile Drawer — Unified, Clean Rules
   Ensures the scrim never shows without the drawer and fixes stacking order.
   ========================================================================== */
[data-overlay] {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: saturate(120%) blur(1px);
  z-index: 900; /* below the sidebar */
  transition: opacity 160ms ease-in-out;
  opacity: 1;
}
[data-overlay][hidden] {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

@media (max-width: 980px) {
  /* Sidebar drawer sits above overlay on mobile */
  .sidebar {
    z-index: 1000; /* ensure above overlay */
    /* The following properties are commonly expected for a drawer;
       keep them if they're already defined elsewhere */
    will-change: transform;
  }

  /* Show the hamburger trigger on mobile if you use such a class */
  .hamburger-mobile {
    display: inline-flex;
  }

  /* Only show the ✕ close control when open (optional classes) */
  .sidebar__toggle { display: none; }
  .sidebar__close { display: none; }
  .sidebar.open .sidebar__close { display: inline-flex; }
}
