/* ==========================================================================
   LEWB - Base theme CSS
   - premium, clean, modern
   - strong typography + spacing rhythm
   - predictable region layout
   - accessible focus + reduced motion
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

/* -----------------------------
   1) Design tokens
------------------------------ */
:root {
  /* Layout */
  --container-max: 1240px;
  --container-pad: clamp(16px, 3vw, 28px);

  --nav-max: 1680px;
  --nav-pad: clamp(16px, 3vw, 44px);

  /* Header sizing */
  --header-pad-y: 6px;
  --header-inner-h: 52px;
  --header-total-h: calc(var(--header-inner-h) + (var(--header-pad-y) * 2));

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;

  /* Radius */
  --radius-1: 10px;
  --radius-2: 14px;
  --radius-3: 18px;

  /* Typography */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-heading: "Montserrat", sans-serif;

  --text-1: clamp(14px, 0.9vw + 12px, 16px);
  --text-2: clamp(16px, 1vw + 13px, 18px);
  --text-3: clamp(20px, 1.4vw + 14px, 26px);
  --text-4: clamp(26px, 2.2vw + 14px, 40px);
  --text-5: clamp(36px, 3.2vw + 14px, 56px);

  --lh-tight: 1.12;
  --lh-normal: 1.45;
  --lh-relaxed: 1.7;

  /* Colors */
  --bg: #ffffff;
  --bg-dark: #121212;
  --surface: #ffffff;
  --surface-2: #f2f4f8;
  --surface-3: #eef1f6;

  --text: #0b1220;
  --text-muted: rgba(11, 18, 32, 0.72);
  --text-faint: rgba(11, 18, 32, 0.56);

  --border: rgba(11, 18, 32, 0.10);
  --border-strong: rgba(11, 18, 32, 0.16);

  --brand: #f2f4f8;
  --brand-2: #a81c3d;
  --accent: #a81c3d;
  --accent-2: #00b8ff;

  /* Semantic */
  --success: #0a7a3d;
  --warning: #b45a00;
  --danger: #b00020;

  /* Aliases */
  --primary: var(--brand-2);

  /* Effects */
  --shadow-1: 0 1px 2px rgba(11, 18, 32, 0.06), 0 6px 18px rgba(11, 18, 32, 0.06);
  --shadow-2: 0 2px 6px rgba(11, 18, 32, 0.08), 0 18px 42px rgba(11, 18, 32, 0.10);
  --shadow-3: 0 12px 32px rgba(11, 18, 32, 0.16), 0 28px 72px rgba(11, 18, 32, 0.18);
  --ring: 0 0 0 4px rgba(10, 60, 255, 0.18);

  /* Nav typography */
  --nav-fs: clamp(14px, 0.25vw + 13px, 15.5px);
  --nav-fw: 650;
  --nav-fw-active: 750;
  --nav-ls: -0.01em;

  --mega-title-fs: 12.5px;
  --mega-title-fw: 750;
  --mega-title-ls: 0.08em;
  --mega-link-fs: 13.5px;
  --mega-link-fw: 600;
  --mega-link-ls: -0.005em;
}

/* -----------------------------
   2) Base / Reset additions
------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-1);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--brand-2);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
  color: var(--brand-2);
  text-decoration-thickness: 0.08em;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}

/* -----------------------------
   3) Global layout helpers
------------------------------ */
.layout-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Wide grid for header zones */
.site-topbar > .container,
.site-header > .container {
  max-width: var(--nav-max);
  padding-inline: var(--nav-pad);
}

/* Vertical rhythm for blocks */
.block + .block {
  margin-top: var(--space-4);
}

/* Headings */
h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-3) 0;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-5);
}

h2 {
  font-size: var(--text-4);
}

h3 {
  font-size: var(--text-3);
}

p {
  margin: 0 0 var(--space-4) 0;
  color: var(--text-muted);
}

/* Reusable card baseline */
.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
}

/* -----------------------------
   4) Regions - base styling
------------------------------ */

/* Topbar */
.site-topbar {
  background: var(--bg-dark);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
}

.site-topbar .container {
  padding-block: 8px;
}

.site-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.site-topbar__left,
.site-topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  flex-wrap: wrap;
}

.site-topbar__right {
  justify-content: flex-end;
}

.site-topbar a {
  color: rgba(255, 255, 255, 0.84);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: inherit;
  line-height: 1.2;
}

.site-topbar a:hover {
  color: #ffffff;
  text-decoration: none;
}

.site-topbar i,
.site-topbar svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

@media (max-width: 767px) {
  .site-topbar__inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .site-topbar__left,
  .site-topbar__right {
    justify-content: center;
  }
}

/* Announcement */
.site-announcement {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.site-announcement .container {
  padding-block: var(--space-3);
  color: var(--text);
  font-weight: 600;
}

/* Header */
.site-header {

  position: sticky;
  top: 0;
  z-index: 1000;

  transition:
    background-color 0.44s ease,
    border-color 0.44s ease,
    box-shadow 0.44s ease,
    backdrop-filter 0.44s ease,
    color 0.44s ease;
}

.site-header .container {
  padding-block: var(--header-pad-y);
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-5);
  min-height: var(--header-inner-h);
}

.site-header__brand {
  min-width: 0;
}

.site-header__brand > * {
  min-width: 0;
}

.site-header__main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
}

.site-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  min-width: 0;
}

.site-utility {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  min-width: 0;
}

/* Solid state - inner pages + scrolled */
.site-header--solid,
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.04);
}

/* Overlay state - homepage top */
.site-header--overlay:not(.is-scrolled) {
  background: transparent;
  color: #ffffff;
  border-bottom: 1px solid transparent;
  box-shadow: none;
}

.site-header--overlay:not(.is-scrolled) .nav-toggle {
  color: #ffffff;
}

.site-header--overlay:not(.is-scrolled) .nav-search input.form-search {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.26);
  color: #ffffff;
}

.site-header--overlay:not(.is-scrolled) .nav-search input.form-search::placeholder {
  color: rgba(255, 255, 255, 0.74);
}

.site-header--overlay:not(.is-scrolled) .nav-search input.form-submit {
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.32);
}

/* Header responsive */
@media (max-width: 991px) {
  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-3);
  }

  .site-header__main {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
  }

  .site-header__actions {
    gap: var(--space-2);
  }

  .site-header__actions .nav-search,
  .site-header__actions .site-utility {
    display: none;
  }
}

/* Primary nav wrapper */
.nav-primary {
  min-width: 0;
}

/* Pre-content wrapper */
.site-precontent {
  position: relative;
}

.site-precontent__custom,
.site-breadcrumb,
.site-highlighted,
.site-help,
.site-messages {
  position: relative;
}

.site-precontent__custom .container,
.site-breadcrumb .container,
.site-highlighted .container,
.site-help .container,
.site-messages .container {
  position: relative;
}

/* Breadcrumb */
.site-breadcrumb {
  background: transparent;
}

.site-breadcrumb .container {
  padding-block: var(--space-3);
  color: var(--text-faint);
}

/* Highlighted */
.site-highlighted .container {
  padding-block: var(--space-5);
}

/* Help */
.site-help .container {
  padding-block: var(--space-4);
}

/* Messages */
.site-messages .container {
  padding-block: var(--space-4);
}

/* Hero */
.site-hero {
  background: transparent;
  overflow: clip;
}

/* Main */
.site-main {
  flex: 1;
  padding-block: var(--space-6);
}

/* Content header */
.content-header .container {
  padding-block: var(--space-4);
}

/* Content sections */
.content-first .container,
.content-second .container,
.content-bottom .container {
  padding-block: var(--space-6);
}

/* Main grid layout */
.main-layout {
  padding-block: var(--space-4);
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: start;
}

/* Sidebars */
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
  padding: var(--space-5);
}

/* Main content wrapper */
.main-content {
  min-width: 0;
}

/* Desktop layout with :has() */
@media (min-width: 1024px) {
  @supports selector(:has(*)) {
    .main-grid:has(.sidebar-first):not(:has(.sidebar-second)) {
      grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    }

    .main-grid:has(.sidebar-second):not(:has(.sidebar-first)) {
      grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    }

    .main-grid:has(.sidebar-first):has(.sidebar-second) {
      grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(240px, 300px);
    }
  }
}

/* Sponsors strip */
.site-sponsors {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.site-sponsors .container {
  padding-block: var(--space-6);
}

/* Pre-footer */
.site-prefooter {
  background: var(--surface-3);
  border-top: 1px solid var(--border);
}

.site-prefooter .container {
  padding-block: var(--space-7);
}

.site-prefooter .region-prefooter,
.site-prefooter .region-pre-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  justify-items: start;
}

.site-prefooter .block {
  width: 100%;
}

.site-prefooter .block + .block {
  margin-top: 0;
}

.site-prefooter h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--border-strong);
  display: inline-block;
}

.site-prefooter ul.menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-prefooter ul.menu li {
  margin-bottom: var(--space-2);
}

.site-prefooter ul.menu a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s ease, color 0.2s ease;
}

.site-prefooter ul.menu a::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-top: 2px solid var(--brand-2);
  border-right: 2px solid var(--brand-2);
  transform: rotate(45deg);
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.site-prefooter ul.menu a:hover {
  transform: translateX(4px);
  color: var(--brand-2);
}

.site-prefooter ul.menu a:hover::before {
  opacity: 1;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.site-footer .container {
  padding-block: var(--space-7);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-bottom .container {
  padding-block: var(--space-4);
  color: var(--text-faint);
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Offcanvas - Mobile menu
   ========================================================================== */

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text);
  border-radius: 50%;
  box-shadow: none;
  transition: all 0.2s ease;
}

.nav-toggle:hover {
  background-color: var(--surface-2);
  color: var(--primary);
  box-shadow: none;
}

.nav-toggle .icon-bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition:
    transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 0.2s ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] .icon-bar:nth-child(2) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .icon-bar:nth-child(3) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .icon-bar:nth-child(4) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Desktop / mobile visibility */
@media (min-width: 992px) {
  .nav-toggle {
    display: none;
  }
}

@media (max-width: 991px) {
  .nav-primary {
    display: none;
  }
}

/* Overlay wrapper */
.site-offcanvas {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

body.offcanvas-open .site-offcanvas {
  display: flex;
}

/* Backdrop */
.offcanvas-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, 0.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

/* Panel */
.offcanvas-panel {
  position: relative;
  width: min(100vw - 48px, 400px);
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Header */
.offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.offcanvas-title {
  font-size: var(--text-2);
  font-weight: 700;
  color: var(--text);
}

.offcanvas-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  box-shadow: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-faint);
}

.offcanvas-close:hover {
  color: var(--primary);
  background: var(--surface-2);
  border-radius: 50%;
  box-shadow: none;
}

/* Body */
.offcanvas-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

/* Menu inside offcanvas */
.offcanvas-body .block-menu ul.menu,
.offcanvas-body ul.menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.offcanvas-body li {
  position: relative;
  border-bottom: 1px solid var(--surface-2);
}

.offcanvas-body ul.menu ul.menu {
  display: flex;
  flex-direction: column;
}

.offcanvas-body ul.menu ul.menu[hidden],
.offcanvas-body ul.menu[hidden] {
  display: none !important;
}

.offcanvas-body li > a {
  display: block;
  padding: 12px 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.offcanvas-body ul.menu ul.menu li {
  padding-left: var(--space-4);
  border-bottom: none;
}

.offcanvas-body ul.menu ul.menu li a {
  font-weight: 400;
  font-size: 0.95em;
  padding: 8px 0;
}

/* Submenu toggles */
.oc-subtoggle {
  position: absolute;
  top: 8px;
  right: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.oc-subtoggle::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-faint);
  border-bottom: 2px solid var(--text-faint);
  transform: rotate(45deg);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.oc-subtoggle[aria-expanded="true"]::after {
  transform: rotate(225deg);
  border-color: var(--primary);
}

/* -----------------------------
   5) Forms
------------------------------ */
input,
select,
textarea,
button {
  font: inherit;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
select,
textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  box-shadow: 0 1px 0 rgba(11, 18, 32, 0.02);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  box-shadow: var(--ring);
  border-color: rgba(10, 60, 255, 0.35);
}

/* Buttons baseline */
button,
input[type="submit"],
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  text-decoration: none;
  font-weight: 700;
}

button:hover,
input[type="submit"]:hover,
.button:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}

/* ==========================================================================
   Search in header
   ========================================================================== */
.nav-search {
  justify-self: end;
  min-width: 320px;
}

.nav-search .search-block-form {
  display: block;
}

.nav-search .search-block-form > form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.nav-search .search-block-form .form-item {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-search .search-block-form .form-actions {
  margin: 0;
  display: flex;
  flex: 0 0 auto;
}

.nav-search input.form-search {
  height: 44px;
  width: 100%;
  min-width: 0;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.nav-search input.form-search:focus-visible {
  outline: none;
  border-color: rgba(10, 60, 255, 0.35);
  box-shadow: var(--ring);
  background: #ffffff;
}

.nav-search input.form-submit {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.06s ease;
}

.nav-search input.form-submit:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}

.nav-search input.form-submit:active {
  transform: translateY(1px);
}

@media (max-width: 900px) {
  .nav-search {
    min-width: 0;
    width: 100%;
  }
}




