/* ═══════════════════════════════════════════════════════════
   DESIGN SYSTEM — Ақтоғай аудандық кітапханасы
   Color: Deep teal primary + warm amber accent
   Type: Montserrat (headings) + Inter (body)
═══════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --p:          oklch(0.32 0.10 225);
  --p-light:    oklch(0.46 0.10 225);
  --p-dark:     oklch(0.21 0.09 225);
  --p-subtle:   oklch(0.94 0.022 225);
  --p-muted:    oklch(0.87 0.038 225);

  --accent:     oklch(0.78 0.14 75);
  --accent-dk:  oklch(0.61 0.13 72);
  --accent-sub: oklch(0.96 0.04 75);

  --ch:         oklch(0.50 0.18 308);
  --ch-dk:      oklch(0.36 0.16 305);
  --ch-sub:     oklch(0.96 0.035 310);

  --oe:         oklch(0.42 0.10 50);
  --oe-dk:      oklch(0.28 0.08 47);
  --oe-sub:     oklch(0.96 0.025 55);

  --bg:         oklch(0.985 0.004 75);
  --bg-alt:     oklch(0.967 0.007 225);
  --surface:    oklch(1.00 0.00 0);

  --tx:         oklch(0.17 0.012 260);
  --tx-2:       oklch(0.38 0.014 240);
  --tx-3:       oklch(0.54 0.011 240);
  --tx-inv:     oklch(0.97 0.004 75);

  --border:     oklch(0.88 0.010 225);
  --border-s:   oklch(0.78 0.020 225);

  --font-h: 'Montserrat', system-ui, sans-serif;
  --font-b: 'Inter', system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-f: 140ms;
  --dur-m: 220ms;
  --dur-s: 360ms;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 9999px;

  --shadow-sm: 0 1px 3px oklch(0.17 0.012 260 / .06), 0 1px 2px oklch(0.17 0.012 260 / .04);
  --shadow-md: 0 4px 14px oklch(0.17 0.012 260 / .09), 0 2px 4px oklch(0.17 0.012 260 / .05);
  --shadow-lg: 0 12px 36px oklch(0.17 0.012 260 / .11), 0 4px 10px oklch(0.17 0.012 260 / .06);

  --header-h: 68px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-b); color: var(--tx); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul { list-style: none; }
address { font-style: normal; }

/* ── A11y ───────────────────────────────────────────────── */
.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; }
.skip-link { position: fixed; top: 1rem; left: 1rem; padding: .6rem 1.2rem; background: var(--p); color: var(--tx-inv); border-radius: var(--r-md); font-weight: 600; z-index: 9999; transform: translateY(-200%); transition: transform var(--dur-m) var(--ease-out); }
.skip-link:focus { transform: none; }
:focus-visible { outline: 2px solid var(--p); outline-offset: 3px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* ── Container ──────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 1.5rem; }
@media (max-width: 768px) { .container { padding-inline: 1rem; } }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.4rem;
  border-radius: var(--r-md); font-family: var(--font-h); font-weight: 600; font-size: .875rem;
  line-height: 1.2; white-space: nowrap; cursor: pointer;
  transition: background var(--dur-f) var(--ease-out), color var(--dur-f), box-shadow var(--dur-f), transform var(--dur-f);
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--p); color: var(--tx-inv); }
.btn--primary:hover { background: var(--p-light); box-shadow: var(--shadow-md); }
.btn--outline { background: transparent; color: var(--p); border: 1.5px solid var(--p); }
.btn--outline:hover { background: var(--p-subtle); }
.btn--ghost { background: transparent; color: var(--p); padding-inline: .4rem; }
.btn--ghost:hover { color: var(--p-dark); }
.btn--sm { padding: .45rem 1rem; font-size: .8125rem; }

/* ── Section ────────────────────────────────────────────── */
.section { padding-block: 5rem; }
.section--alt { background: var(--bg-alt); }
.section__header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2.5rem; }
.section__title { font-family: var(--font-h); font-size: 1.875rem; font-weight: 700; color: var(--tx); line-height: 1.2; letter-spacing: -.02em; }
.section__sub { margin-top: .4rem; font-size: 1rem; color: var(--tx-2); }

@media (max-width: 640px) {
  .section { padding-block: 3rem; }
  .section__header { flex-direction: column; align-items: flex-start; }
  .section__title { font-size: 1.5rem; }
}

/* ═══════════════════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════════════════ */
.topbar { background: var(--p-dark); color: oklch(.84 .03 225); font-size: .75rem; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 36px; gap: 1rem; }
.topbar__breadcrumb { opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar__right { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.topbar__link { color: oklch(.84 .03 225); opacity: .65; transition: opacity var(--dur-f); }
.topbar__link:hover { opacity: 1; }
.topbar__divider { width: 1px; height: 14px; background: oklch(.84 .03 225 / .2); }

.lang-switch { display: flex; gap: 4px; align-items: center; }
.lang-switch__btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 12px; border-radius: var(--r-sm);
  font-size: .8125rem; font-weight: 700; font-family: var(--font-h);
  color: oklch(.90 .04 225); opacity: .65;
  text-decoration: none; border: 1.5px solid transparent;
  transition: opacity var(--dur-f), background var(--dur-f), border-color var(--dur-f);
  white-space: nowrap; line-height: 1;
}
.lang-switch__btn:hover { opacity: 1; background: oklch(.84 .03 225 / .12); }
.lang-switch__btn--active,
.lang-kk .lang-switch__btn[data-lang="kk"],
.lang-ru .lang-switch__btn[data-lang="ru"] {
  background: oklch(.84 .03 225 / .18);
  border-color: oklch(.84 .03 225 / .35);
  opacity: 1; color: #fff;
}

@media (max-width: 600px) { .topbar__breadcrumb { display: none; } }

/* ═══════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════ */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px oklch(.17 .012 260 / .06);
  height: var(--header-h);
  transition: box-shadow var(--dur-m);
}
.header--scrolled { box-shadow: 0 2px 20px oklch(.17 .012 260 / .11); }

.header__inner { display: flex; align-items: center; gap: 1.25rem; height: 100%; }

/* Logo */
.logo { display: flex; align-items: center; gap: .625rem; flex-shrink: 0; max-width: 400px; }
.logo__icon { flex-shrink: 0; }
.logo__text { display: flex; flex-direction: column; gap: 2px; }
.logo__title { font-family: var(--font-h); font-size: .75rem; font-weight: 700; color: var(--tx); line-height: 1.3; white-space: normal; max-width: 270px; }
.logo__subtitle { font-size: .6rem; color: var(--tx-3); white-space: nowrap; }

/* Nav */
.nav { flex: 1; min-width: 0; overflow: visible; position: relative; }
.nav__list { display: flex; align-items: center; gap: 2px; }
.nav__item { position: relative; }

.nav__link, .nav__link--btn {
  display: flex; align-items: center; gap: .2rem;
  padding: .4rem .6rem; border-radius: var(--r-sm);
  font-size: .8125rem; font-weight: 500; color: var(--tx-2);
  white-space: nowrap;
  transition: color var(--dur-f), background var(--dur-f);
}
.nav__link:hover, .nav__link--btn:hover { color: var(--p); background: var(--p-subtle); }
.nav__arrow { transition: transform var(--dur-m) var(--ease-out); }
.nav__link--btn[aria-expanded="true"] .nav__arrow { transform: rotate(180deg); }

.nav__link--accent { color: var(--oe); font-weight: 600; }
.nav__link--accent:hover { color: var(--oe-dk); background: var(--oe-sub); }
.nav__link--children { color: var(--ch); font-weight: 600; }
.nav__link--children:hover { color: var(--ch-dk); background: var(--ch-sub); }

/* Dropdown */
.nav__dropdown {
  position: absolute; top: 100%; left: 0;
  padding-top: .5rem;                      /* visual gap живёт внутри dropdown */
  background: transparent;
  z-index: 50;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity var(--dur-m) var(--ease-out),
              transform var(--dur-m) var(--ease-out),
              visibility 0ms linear var(--dur-m);  /* задержка скрытия = время анимации */
  transform: translateY(-6px);
}
.nav__dropdown-inner {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: .375rem; min-width: 210px;
}
/* Псевдоэлемент-мост: невидимая зона над dropdown, bridging the gap */
.nav__dropdown::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: .5rem;
}
.nav__item--dropdown:hover .nav__dropdown,
.nav__item--dropdown:focus-within .nav__dropdown,
.nav__item--dropdown .nav__link--btn[aria-expanded="true"] + .nav__dropdown,
.nav__item--dropdown .nav__link--btn[aria-expanded="true"] ~ .nav__dropdown {
  opacity: 1; pointer-events: auto; visibility: visible; transform: none;
  transition: opacity var(--dur-m) var(--ease-out),
              transform var(--dur-m) var(--ease-out),
              visibility 0ms;
}
.nav__dropdown-inner { list-style: none; margin: 0; padding: 0; }
.nav__dropdown-link { display: block; padding: .45rem .75rem; border-radius: var(--r-sm); font-size: .875rem; color: var(--tx-2); transition: color var(--dur-f), background var(--dur-f); }
.nav__dropdown-link:hover { color: var(--p); background: var(--p-subtle); }

/* Header actions */
.header__actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; padding: .5rem; border-radius: var(--r-sm); }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--tx-2); border-radius: 2px; transition: transform var(--dur-m) var(--ease-out), opacity var(--dur-f); }
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1060px) { .nav { display: none; } .header__actions { display: none; } .hamburger { display: flex; } }
@media (max-width: 480px) { .logo__title { max-width: 160px; font-size: .7rem; } .logo__subtitle { display: none; } .logo__icon img { height: 46px !important; } }

/* Mobile menu */
.mobile-menu { position: fixed; inset: 0; z-index: 200; display: none; }
.mobile-menu.is-open { display: block; }
.mobile-menu__backdrop { position: absolute; inset: 0; background: oklch(.17 .012 260 / .48); backdrop-filter: blur(4px); }
.mobile-menu__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(310px, 90vw); background: var(--surface); box-shadow: var(--shadow-lg); padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; overflow-y: auto; transform: translateX(100%); transition: transform var(--dur-s) var(--ease-out); }
.mobile-menu.is-open .mobile-menu__panel { transform: none; }
.mobile-menu__close { align-self: flex-end; padding: .5rem; border-radius: var(--r-sm); color: var(--tx-2); }
.mobile-nav { display: flex; flex-direction: column; gap: 2px; }
.mobile-nav__link { display: block; padding: .75rem 1rem; border-radius: var(--r-sm); font-size: 1rem; font-weight: 500; color: var(--tx-2); transition: color var(--dur-f), background var(--dur-f); }
.mobile-nav__link:hover { color: var(--p); background: var(--p-subtle); }
.mobile-nav__link--accent { color: var(--oe); font-weight: 600; }
.mobile-nav__link--children { color: var(--ch); font-weight: 600; }
.mobile-menu__lang { display: flex; gap: .5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.mobile-menu__lang { display: flex; gap: 10px; padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); margin-top: .5rem; }
.mobile-menu__lang .lang-switch__btn { flex: 1; text-align: center; padding: .75rem 1rem; border: 1.5px solid var(--border); border-radius: var(--r-md); color: var(--tx-2); opacity: 1; font-family: var(--font-h); font-size: .9375rem; background: var(--bg); }
.mobile-menu__lang .lang-switch__btn--active { background: var(--p-subtle); border-color: var(--p); color: var(--p); }

/* ═══════════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════════ */
.hero { position: relative; overflow: hidden; min-height: 580px; display: flex; align-items: center; }

.hero__bg-img {
  position: absolute; inset: 0;
  background-image: url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?auto=format&fit=crop&w=1920&q=80');
  background-size: cover; background-position: center 40%;
}

.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, oklch(.18 .09 225 / .96) 0%, oklch(.18 .09 225 / .88) 50%, oklch(.22 .09 225 / .70) 100%);
}

.hero__content {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr auto;
  gap: 4rem; align-items: center;
  padding-block: 5rem;
}

.hero__eyebrow { font-size: .8125rem; font-weight: 600; color: oklch(.76 .08 225); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1.25rem; }

.hero__title {
  font-family: var(--font-h);
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  font-weight: 800; color: var(--tx-inv); line-height: 1.12; letter-spacing: -.03em;
  margin-bottom: 1.25rem;
}
.hero__title em { font-style: normal; color: var(--accent); }

.hero__sub { font-size: 1.0625rem; line-height: 1.7; color: oklch(.83 .04 225); max-width: 52ch; margin-bottom: 2rem; }

/* Hero search */
.hero__search-wrap { display: flex; align-items: center; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.hero__search-icon { position: absolute; left: 1.25rem; color: var(--tx-3); pointer-events: none; }
.hero__search-wrap { position: relative; }
.hero__search-input { flex: 1; padding: 1rem 1.25rem 1rem calc(1.25rem + 18px + .75rem); font-family: var(--font-b); font-size: 1rem; color: var(--tx); background: transparent; border: none; outline: none; min-width: 0; }
.hero__search-input::placeholder { color: var(--tx-3); }
.hero__search-btn { flex-shrink: 0; margin: .375rem; padding: .7rem 1.5rem; background: var(--p); color: var(--tx-inv); border-radius: var(--r-lg); font-family: var(--font-h); font-weight: 700; font-size: .9375rem; border: none; cursor: pointer; transition: background var(--dur-f); }
.hero__search-btn:hover { background: var(--p-light); }
@media (max-width: 480px) {
  .hero__search-wrap { overflow: visible; flex-wrap: wrap; border-radius: var(--r-lg); }
  .hero__search-input { border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface); border-bottom: 1px solid var(--border); }
  .hero__search-btn { width: calc(100% - .75rem); margin: 0 .375rem .375rem; border-radius: 0 0 var(--r-lg) var(--r-lg); text-align: center; }
  .hero__eyebrow { font-size: .6875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
}

/* Tags */
.hero__tags { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1.25rem; }
.hero__tags-label { font-size: .875rem; color: oklch(.72 .05 225); }
.hero__tag { padding: .25rem .75rem; background: oklch(.97 .003 75 / .12); border: 1px solid oklch(.97 .003 75 / .22); border-radius: var(--r-full); font-size: .8125rem; color: oklch(.85 .03 225); transition: background var(--dur-f), border-color var(--dur-f); }
.hero__tag:hover { background: oklch(.97 .003 75 / .22); border-color: oklch(.97 .003 75 / .4); }

/* Decorative books */
.hero__books-decor { display: flex; align-items: flex-end; gap: .5rem; height: 240px; flex-shrink: 0; }
.hero__book-spine {
  display: flex; align-items: flex-end; justify-content: center;
  border-radius: 4px 8px 8px 4px;
  padding: .75rem .4rem; writing-mode: vertical-rl;
  font-family: var(--font-h); font-size: .6875rem; font-weight: 700; color: white;
  box-shadow: 4px 6px 18px oklch(.17 .012 260 / .45);
  transition: transform var(--dur-m) var(--ease-out);
  cursor: default; user-select: none;
}
.hero__book-spine:hover { transform: translateY(-10px); }
.hero__book-spine--1 { width: 44px; height: 200px; background: linear-gradient(160deg, oklch(.55 .18 308), oklch(.40 .15 300)); }
.hero__book-spine--2 { width: 40px; height: 170px; background: linear-gradient(160deg, oklch(.50 .14 140), oklch(.36 .12 133)); }
.hero__book-spine--3 { width: 46px; height: 220px; background: linear-gradient(160deg, oklch(.76 .14 75), oklch(.60 .12 68)); color: oklch(.22 .08 72); }
.hero__book-spine--4 { width: 38px; height: 160px; background: linear-gradient(160deg, oklch(.52 .16 0), oklch(.37 .14 352)); }
.hero__book-spine--5 { width: 42px; height: 185px; background: linear-gradient(160deg, oklch(.44 .14 260), oklch(.30 .12 253)); }

@media (max-width: 900px) { .hero__books-decor { display: none; } .hero__content { grid-template-columns: 1fr; } }
@media (max-width: 580px) { .hero__content { padding-block: 3rem; } }

/* ═══════════════════════════════════════════════════════════
   SERVICES BAR
═══════════════════════════════════════════════════════════ */
.services-bar { background: var(--surface); border-bottom: 1px solid var(--border); padding-block: 1.5rem; }
.services-bar__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; }

.svc {
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  padding: 1.25rem 1rem;
  border-radius: var(--r-md); text-decoration: none;
  transition: background var(--dur-f), transform var(--dur-f), box-shadow var(--dur-f);
}
.svc:hover { background: var(--p-subtle); transform: translateY(-3px); box-shadow: var(--shadow-sm); }

.svc__icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--p-subtle); border-radius: var(--r-md); color: var(--p);
  transition: background var(--dur-f), color var(--dur-f);
}
.svc:hover .svc__icon { background: var(--p); color: var(--tx-inv); }

.svc__label { font-family: var(--font-h); font-size: .75rem; font-weight: 600; color: var(--tx-2); text-align: center; line-height: 1.3; transition: color var(--dur-f); }
.svc:hover .svc__label { color: var(--p); }

@media (max-width: 900px) { .services-bar__grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .services-bar__grid { grid-template-columns: repeat(2, 1fr); } }

/* ═══════════════════════════════════════════════════════════
   NEWS
═══════════════════════════════════════════════════════════ */
.news-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: start;
}

.news-side { display: flex; flex-direction: column; gap: 1.25rem; }

/* Base card */
.news-card {
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--border); overflow: hidden;
  transition: box-shadow var(--dur-m) var(--ease-out), transform var(--dur-m) var(--ease-out);
}
.news-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }

/* Featured */
.news-card--featured { display: flex; flex-direction: column; }
.news-card--featured .news-card__img { height: 290px; }

/* Small */
.news-card--sm { display: grid; grid-template-columns: 130px 1fr; align-items: stretch; }
.news-card--sm .news-card__img-link { overflow: hidden; }
.news-card--sm .news-card__img { height: 100%; min-height: 110px; }
.news-card--sm .news-card__body { padding: 1rem; }
.news-card--sm .news-card__title { font-size: .9375rem; }
.news-card--sm .news-card__excerpt { display: none; }

/* Image */
.news-card__img-link { display: block; overflow: hidden; }
.news-card__img {
  width: 100%; background-size: cover; background-position: center;
  background-color: var(--bg-alt);
  transition: transform var(--dur-s) var(--ease-out);
}
.news-card__img-link:hover .news-card__img { transform: scale(1.04); }

/* Body */
.news-card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem; }

.news-card__meta { display: flex; align-items: center; gap: .75rem; }
.news-card__cat {
  font-family: var(--font-h); font-size: .6875rem; font-weight: 700;
  padding: 2px 8px; border-radius: var(--r-sm);
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--cat, var(--p));
  background: color-mix(in oklch, var(--cat, var(--p)) 13%, transparent);
}
.news-card__date { font-size: .75rem; color: var(--tx-3); }

.news-card__title { font-family: var(--font-h); font-weight: 700; line-height: 1.35; color: var(--tx); }
.news-card--featured .news-card__title { font-size: 1.25rem; }
.news-card__title a:hover { color: var(--p); }

.news-card__excerpt { font-size: .9375rem; color: var(--tx-2); line-height: 1.65; }
.news-card__readmore { font-size: .875rem; font-weight: 600; color: var(--p); align-self: flex-start; transition: color var(--dur-f); }
.news-card__readmore:hover { color: var(--p-dark); }

@media (max-width: 1024px) { .news-grid { grid-template-columns: 1fr; } .news-side { display: grid; grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .news-side { grid-template-columns: 1fr; } .news-card--sm { grid-template-columns: 100px 1fr; } }

/* ═══════════════════════════════════════════════════════════
   MINI-SITE BANNERS
═══════════════════════════════════════════════════════════ */
.mini-sites { padding-block: 1.5rem 5rem; }
.mini-sites__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.mini-banner {
  position: relative; overflow: hidden; border-radius: var(--r-xl);
  display: block; min-height: 240px; text-decoration: none;
  transition: transform var(--dur-m) var(--ease-out), box-shadow var(--dur-m) var(--ease-out);
}
.mini-banner:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.mini-banner__img { position: absolute; inset: 0; background-size: cover; background-position: center; }

.mini-banner__overlay {
  position: absolute; inset: 0;
}
.mini-banner--children .mini-banner__overlay {
  background: linear-gradient(110deg, oklch(.36 .16 305 / .92) 0%, oklch(.46 .18 308 / .75) 100%);
}
.mini-banner--history .mini-banner__overlay {
  background: linear-gradient(110deg, oklch(.24 .08 47 / .93) 0%, oklch(.38 .10 52 / .78) 100%);
}

.mini-banner__body {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 2rem 2rem;
  color: white; height: 100%;
}

.mini-banner__icon {
  flex-shrink: 0; width: 68px; height: 68px;
  display: flex; align-items: center; justify-content: center;
  background: white; border-radius: var(--r-lg);
}
.mini-banner--children .mini-banner__icon { color: var(--ch); }
.mini-banner--history .mini-banner__icon { color: var(--oe); }

.mini-banner__text { flex: 1; min-width: 0; }
.mini-banner__title { font-family: var(--font-h); font-size: 1.5rem; font-weight: 800; line-height: 1.2; margin-bottom: .5rem; }
.mini-banner__desc { font-size: .875rem; opacity: .88; line-height: 1.5; }

.mini-banner__arrow {
  flex-shrink: 0; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: white; border-radius: var(--r-full);
  transition: transform var(--dur-m) var(--ease-out);
}
.mini-banner--children .mini-banner__arrow { color: var(--ch); }
.mini-banner--history .mini-banner__arrow { color: var(--oe); }
.mini-banner:hover .mini-banner__arrow { transform: translateX(5px); }

@media (max-width: 860px) { .mini-sites__grid { grid-template-columns: 1fr; } }
@media (max-width: 500px) { .mini-banner__title { font-size: 1.25rem; } .mini-banner__desc { display: none; } .mini-banner__icon { width: 54px; height: 54px; } }

/* ═══════════════════════════════════════════════════════════
   BOOKS ROW
═══════════════════════════════════════════════════════════ */
.books-row {
  display: flex; gap: 1.5rem;
  overflow-x: auto; padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}

.book-card { flex-shrink: 0; width: 150px; cursor: pointer; transition: transform var(--dur-m) var(--ease-out); }
.book-card:hover { transform: translateY(-8px); }

.book-card__wrap { position: relative; margin-bottom: .875rem; }

.book-card__cover {
  width: 150px; height: 210px;
  border-radius: 3px 10px 10px 3px;
  box-shadow: 5px 7px 22px oklch(.17 .012 260 / .18);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.book-card__cover--photo {
  background-size: cover; background-position: center;
  background-repeat: no-repeat;
}

.book-card__spine {
  position: absolute; top: 0; left: 0; bottom: 0; width: 14px;
  background: oklch(.17 .012 260 / .22);
}

.book-card__title-on-cover {
  position: absolute; inset: 0; padding: 1rem .875rem .75rem 1.25rem;
  display: flex; align-items: flex-start;
  font-family: var(--font-h); font-size: .75rem; font-weight: 700;
  color: white; line-height: 1.35; word-break: break-word;
  text-shadow: 0 1px 4px oklch(.17 .012 260 / .4);
}

.book-card__title { font-family: var(--font-h); font-size: .875rem; font-weight: 700; color: var(--tx); line-height: 1.3; margin-bottom: .25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-card__author { font-size: .75rem; color: var(--tx-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-card__year { font-size: .6875rem; color: var(--tx-3); }

/* ═══════════════════════════════════════════════════════════
   SINGLE BOOK
═══════════════════════════════════════════════════════════ */
.single-book-layout { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: start; }
.single-book-cover__img { width: 100%; border-radius: 4px 12px 12px 4px; box-shadow: 8px 12px 32px oklch(.17 .012 260 / .22); display: block; }
.single-book-cover__gradient { width: 100% !important; height: 340px !important; border-radius: 4px 12px 12px 4px; }
.single-book-meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin-bottom: 24px; }
.single-book-meta dt { font-weight: 600; color: var(--tx-2); font-size: .9rem; white-space: nowrap; }
.single-book-meta dd { margin: 0; color: var(--tx); font-size: .9rem; }
.single-book-desc { margin-top: 20px; line-height: 1.8; color: var(--tx-2); font-size: .95rem; }
.single-book-actions { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .single-book-layout { grid-template-columns: 1fr; gap: 24px; }
  .single-book-cover__img { max-width: 200px; margin: 0 auto; }
  .single-book-cover__gradient { max-width: 200px; height: 280px !important; margin: 0 auto; }
  .single-book-info { text-align: left; }
}

/* ═══════════════════════════════════════════════════════════
   EXHIBITIONS
═══════════════════════════════════════════════════════════ */
.exh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

.exh-card { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--border); overflow: hidden; transition: box-shadow var(--dur-m), transform var(--dur-m); }
.exh-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-5px); }

.exh-card__img {
  height: 210px; position: relative; overflow: hidden;
  background-size: cover; background-position: center; background-color: var(--bg-alt);
  transition: transform var(--dur-s) var(--ease-out);
}
.exh-card:hover .exh-card__img { transform: scale(1.04); }

.exh-card__badge {
  position: absolute; top: .875rem; left: .875rem;
  font-family: var(--font-h); font-size: .6875rem; font-weight: 700;
  padding: 3px 9px; border-radius: var(--r-full);
  text-transform: uppercase; letter-spacing: .04em;
}
.exh-card__badge--new { background: var(--accent); color: oklch(.22 .08 72); }
.exh-card__badge--ongoing { background: oklch(.62 .18 140); color: white; }

.exh-card__body { padding: 1.25rem; display: flex; flex-direction: column; gap: .6rem; }
.exh-card__title { font-family: var(--font-h); font-size: 1.0625rem; font-weight: 700; color: var(--tx); line-height: 1.3; }
.exh-card__desc { font-size: .875rem; color: var(--tx-2); line-height: 1.6; }
.exh-card__link { font-size: .875rem; font-weight: 600; color: var(--p); align-self: flex-start; transition: color var(--dur-f); }
.exh-card__link:hover { color: var(--p-dark); }

@media (max-width: 900px) { .exh-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .exh-grid { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════════
   STATS STRIP
═══════════════════════════════════════════════════════════ */
.stats-strip { background: var(--p); padding-block: 3rem; }
.stats-strip__inner { display: flex; align-items: center; justify-content: center; gap: 0; flex-wrap: wrap; }

.stat { display: flex; flex-direction: column; align-items: center; gap: .375rem; padding: 1rem 2.5rem; text-align: center; }
.stat__num { font-family: var(--font-h); font-size: 2.5rem; font-weight: 800; color: var(--tx-inv); line-height: 1; letter-spacing: -.03em; }
.stat__label { font-size: .875rem; color: oklch(.80 .05 225); font-weight: 500; }

.stat-divider { width: 1px; height: 56px; background: oklch(.80 .05 225 / .25); }

@media (max-width: 760px) {
  .stats-strip__inner { gap: 0; }
  .stat { padding: .75rem 1.5rem; }
  .stat__num { font-size: 2rem; }
  .stat-divider { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   PARTNERS
═══════════════════════════════════════════════════════════ */
/* ── Portals slider ───────────────────────────────────── */
.portals-slider {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.portals-viewport {
  flex: 1;
  overflow: hidden;
  border-radius: var(--r-md);
}

.portals-track {
  display: flex;
  gap: 1rem;
  transition: transform .45s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Each slide — width is set by JS via --visible */
.portal-slide {
  flex: 0 0 calc((100% - var(--gap, 2rem)) / var(--visible, 3));
  display: block;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: white;
  box-shadow: var(--shadow-sm);
  line-height: 0;
  transition: transform var(--dur-m) var(--ease-out),
              box-shadow var(--dur-m) var(--ease-out);
}
.portal-slide:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.portal-slide img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: .875rem 1.25rem;
  background: white;
}

/* Arrow buttons */
.portals-arrow {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: var(--tx-2);
  cursor: pointer;
  transition: background var(--dur-f), border-color var(--dur-f),
              color var(--dur-f), box-shadow var(--dur-f);
  flex-shrink: 0;
}
.portals-arrow:hover {
  background: var(--p);
  border-color: var(--p);
  color: white;
  box-shadow: var(--shadow-sm);
}
.portals-arrow:disabled { opacity: .35; pointer-events: none; }

/* Dots */
.portals-dots {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: 1.25rem;
}
.portals-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-s);
  border: none; cursor: pointer;
  transition: background var(--dur-f), transform var(--dur-f);
  padding: 0;
}
.portals-dot--active {
  background: var(--p);
  transform: scale(1.35);
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */
.footer { background: var(--p-dark); color: oklch(.78 .03 225); padding-top: 4rem; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 2.5rem; padding-bottom: 3rem; border-bottom: 1px solid oklch(.78 .03 225 / .12); }

.logo--footer { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.footer-logo__title { color: var(--tx-inv); max-width: 190px; font-size: .875rem; }
.footer-logo__sub { color: oklch(.66 .03 225); max-width: 190px; font-size: .6875rem; }

.footer__desc { font-size: .875rem; line-height: 1.7; color: oklch(.65 .03 225); max-width: 36ch; margin-bottom: 1.25rem; }

.footer__socials { display: flex; gap: .625rem; }
.footer__social { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: oklch(.78 .03 225 / .10); border-radius: var(--r-sm); color: oklch(.78 .03 225); transition: background var(--dur-f), color var(--dur-f); }
.footer__social:hover { background: var(--accent); color: oklch(.22 .08 72); }

.footer__col-title { font-family: var(--font-h); font-size: .6875rem; font-weight: 700; color: var(--tx-inv); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 1.25rem; }
.footer__links { display: flex; flex-direction: column; gap: .625rem; }
.footer__link { font-size: .875rem; color: oklch(.65 .03 225); transition: color var(--dur-f); }
.footer__link:hover { color: var(--tx-inv); }

.footer__address { display: flex; flex-direction: column; gap: .875rem; }
.footer__contact { display: flex; align-items: flex-start; gap: .625rem; font-size: .875rem; color: oklch(.65 .03 225); }
.footer__contact svg { flex-shrink: 0; margin-top: 1px; }
.footer__contact a:hover { color: var(--tx-inv); }
.footer__hours { display: flex; align-items: flex-start; gap: .625rem; font-size: .875rem; color: oklch(.65 .03 225); }
.footer__hours svg { flex-shrink: 0; margin-top: 2px; }
.footer__hours p { line-height: 1.7; }

.footer__bottom { display: flex; align-items: center; justify-content: space-between; padding-block: 1.5rem; gap: 1.5rem; }
.footer__copy { font-size: .75rem; color: oklch(.50 .02 225); }
.footer__bottom-links { display: flex; gap: 1.5rem; }
.footer__bottom-link { font-size: .75rem; color: oklch(.50 .02 225); transition: color var(--dur-f); }
.footer__bottom-link:hover { color: oklch(.72 .03 225); }

@media (max-width: 1024px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .footer__grid { grid-template-columns: 1fr; gap: 2rem; } .footer__bottom { flex-direction: column; align-items: flex-start; gap: .75rem; } .footer__bottom-links { flex-direction: column; gap: .4rem; } }

/* ═══════════════════════════════════════════════════════════
   SCROLL REVEAL (safe — elements start visible)
═══════════════════════════════════════════════════════════ */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.reveal.revealed { opacity: 1; transform: none; }

/* ═══════════════════════════════════════════════════════════
   UX FIXES — hero, services, oelketanu page responsive
═══════════════════════════════════════════════════════════ */

/* Services labels — increase from 12px to 13px everywhere */
.svc__label { font-size: .8125rem !important; }

/* Services: reduce padding on mobile, keep 3 cols at 600px */
@media (max-width: 600px) {
  .services-bar__grid { grid-template-columns: repeat(3, 1fr); }
  .svc { padding: .875rem .5rem; gap: .5rem; }
  .svc__icon { width: 48px; height: 48px; }
  .svc__label { font-size: .75rem !important; }
}

/* Hero search — prevent button clipping on small screens */
@media (max-width: 480px) {
  .hero__search-wrap { flex-wrap: wrap; border-radius: var(--r-lg); }
  .hero__search-input { padding-block: .875rem; font-size: .9375rem; }
  .hero__search-btn { width: calc(100% - .75rem); margin: 0 .375rem .375rem; border-radius: var(--r-md); }
}

/* Hero eyebrow — hide on very small screens, avoid mid-word break */
@media (max-width: 480px) {
  .hero__eyebrow { font-size: .6875rem; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ── Oelketanu page — responsive CSS classes ─────── */
.oe-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 64px; align-items: center; }
.oe-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 56px; }
.oe-4col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.oe-img  { border-radius: 16px; overflow: hidden; height: 260px; }
.oe-img img { width: 100%; height: 100%; object-fit: cover; }

.oe-timeline { position: relative; max-width: 720px; margin: 0 auto 64px; }
.oe-timeline::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: oklch(0.88 0.04 225); transform: translateX(-50%); }
.oe-tl-item { display: flex; align-items: center; gap: 24px; margin-bottom: 40px; }
.oe-tl-item--l { flex-direction: row; }
.oe-tl-item--r { flex-direction: row-reverse; }
.oe-tl-text { flex: 1; }
.oe-tl-text--l { text-align: right; }
.oe-tl-text--r { text-align: left; }
.oe-tl-year { color: oklch(0.32 0.10 225); font-size: .95rem; font-weight: 700; }
.oe-tl-title { font-size: 1rem; font-weight: 600; margin: 4px 0; }
.oe-tl-body { font-size: .88rem; color: oklch(0.45 0.04 225); line-height: 1.6; }
.oe-tl-dot { width: 16px; height: 16px; border-radius: 50%; background: oklch(0.32 0.10 225); border: 3px solid #fff; box-shadow: 0 0 0 3px oklch(0.32 0.10 225); flex-shrink: 0; z-index: 1; }
.oe-tl-space { flex: 1; }

.oe-person { background: #fff; border-radius: 14px; padding: 24px; border: 1px solid oklch(0.92 0.02 225); box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.oe-person__icon { width: 56px; height: 56px; border-radius: 50%; background: oklch(0.32 0.10 225 / .1); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; color: oklch(0.32 0.10 225); }
.oe-person__name { font-size: 1rem; font-weight: 700; margin: 0 0 4px; color: oklch(0.20 0.06 225); }
.oe-person__years { font-size: .8rem; color: oklch(0.56 0.05 225); margin: 0 0 10px; }
.oe-person__desc { font-size: .88rem; color: oklch(0.35 0.04 225); line-height: 1.6; margin: 0; }

@media (max-width: 860px) {
  .oe-2col { grid-template-columns: 1fr; }
  .oe-img { height: 220px; }
  .oe-4col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .oe-3col { grid-template-columns: repeat(2, 1fr); }
  .oe-timeline::before { left: 20px; }
  .oe-tl-item--l,
  .oe-tl-item--r { flex-direction: row; }
  .oe-tl-text--l { text-align: left; }
  .oe-tl-space { display: none; }
}
@media (max-width: 480px) {
  .oe-3col { grid-template-columns: 1fr; }
  .oe-4col { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* ── Cabinet plugin form UX ─────────────────────── */
@media (max-width: 580px) {
  .alc-form input, .alc-form select, .alc-form textarea { font-size: 1rem; }
}
