/* ==========================================================
   MOSLASHUVCHAN DIZAYN — eng oxirgi qatlam
   Qurilmalar bo'yicha aniq o'lchamlar:
     Katta monitor  ≥ 1600px
     Kompyuter      1440 – 1599px
     Noutbuk        1280 – 1439px
     Kichik noutbuk / iPad (yotiq)   1024 – 1279px
     Planshet / iPad (tik)            768 – 1023px
     Katta telefon                    600 – 767px
     Telefon                          380 – 599px
     Kichik telefon                   < 380px
   + oraliq o'lchamlar uchun avtomatik (clamp) moslashuv
   + ikki barmoq / surilishdan himoya
   ========================================================== */

/* ---------- 0. Barqarorlik: sahifa hech qachon yon tomonga surilmaydi ---------- */
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;   /* telefon burilganda shrift o'zi kattalashmaydi */
  overflow-x: hidden;                                         /* eski brauzerlar uchun */
  touch-action: manipulation;                                 /* ikki marta bosib kattalashtirish o'chadi */
}
@supports (overflow: clip) { html { overflow-x: clip; } }
body { min-width: 0; }
@supports (overflow: clip) { body { overflow-x: clip; } }
img, video, iframe, svg { max-width: 100%; }
img { height: auto; }
.media > img, .banner__slide > img, .cta > img, .page-hero--img > img, .leader__photo img { height: 100%; }
/* Grid/flex ichidagi bloklar uzun matn yoki jadval sababli kengayib ketmasin */
.layout > *, .about > *, .reg > *, .contact > *, .events > *, .news-home > *, .video-layout > *,
.council-hero > *, .map-block > *, .footer__grid > *, .hero__grid > * { min-width: 0; }
p, h1, h2, h3, h4, li, td, a, strong, span { overflow-wrap: break-word; }
.table-wrap, .tabs, .subnav ul { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

/* ---------- 1. Avtomatik (suyuq) o'lchamlar ---------- */
:root {
  --gutter: clamp(16px, 3.2vw, 40px);
  --section-y: clamp(44px, 6vw, 72px);
}
.container { padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.title { font-size: clamp(22px, 1.4rem + 0.9vw, 30px); }
.page-hero h1, .page-hero--img h1 { font-size: clamp(24px, 1.3rem + 1.4vw, 36px); }
.banner__content h1, .banner__content h2 { font-size: clamp(22px, 1rem + 1.9vw, 38px); }
.article__head h1 { font-size: clamp(24px, 1.2rem + 1.6vw, 38px); }
.prose { font-size: clamp(15.5px, 0.95rem + 0.15vw, 17px); max-width: 76ch; }

/* Banner, havolalar va statistika har doim matn bilan bir chiziqda */
.banner, .quick--overlap .quick__grid, .stats__grid {
  width: calc(100% - 2 * var(--gutter)) !important;
  max-width: calc(var(--container) - 2 * var(--gutter)) !important;
}

/* ---------- 2. O'qiladigan minimal shrift va qulay tugmalar ---------- */
.tag, .cat-label, .duration, .calendar__dow, .pill { font-size: 12px; }
small, .meta, .stat span { font-size: max(12.5px, 0.8rem); }

/* Slayder nuqtalari: ko'rinishi ingichka, bosish maydoni katta */
.slider__dots { gap: 4px; }
.slider__dots button { height: 28px !important; background: transparent !important; position: relative; padding: 0 2px; }
.slider__dots button::after { content: ""; position: absolute; left: 2px; right: 2px; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: rgba(255,255,255,.45); }
.slider__dots button.is-active::after { background: #fff; }

/* Faqat sichqonchali qurilmalarda "hover" — telefonda rang yopishib qolmaydi */
@media (hover: none) {
  .card:hover, .course:hover, .news-row:hover, .video-item:hover, .branch:hover, .doc:hover, .quick__item:hover,
  .quick--overlap .quick__item:hover { background: #fff !important; border-color: var(--line) !important; }
  .btn--primary:hover { background: var(--primary); }
  .btn--ghost:hover { background: #fff; }
}

/* Sensorli ekranlar (telefon, planshet): barmoq uchun kamida 40–44px */
@media (pointer: coarse), (max-width: 1023px) {
  .topbar__info a, .topbar__info span { min-height: 40px; }
  .lang-select__btn { min-height: 38px; }
  .socials--sm a { width: 38px; height: 38px; }
  .icon-btn, .calendar__head .icon-btn { width: 42px; height: 42px; }
  .slider__btn { width: 42px !important; height: 42px !important; }
  .calendar__day { min-height: 40px; }
  .table a { display: inline-block; padding: 9px 0; }
  .footer ul li { margin-bottom: 4px; }
  .footer ul a, .footer__contact a { display: inline-block; padding: 7px 0; }
  .crumbs a { display: inline-block; padding: 8px 0; }
  .link { padding: 8px 0; }
  .tabs button { min-height: 40px; }
  .pagination a, .pagination span { min-width: 44px; height: 44px; }
  .form .form__check input { width: 22px; height: 22px; }
  .lang-select__menu button { min-height: 44px; }
  .drop a { padding: 11px 12px; }
  .share a, .share button { width: 42px; height: 42px; }
  .contact__list a { display: inline-block; padding: 6px 0; }
  .news-row h4 a, .card h3 a { display: inline; }
  /* iPhone formaga bosilganda sahifani o'zi kattalashtirmasligi uchun 16px */
  input, select, textarea, .form input, .form select, .form textarea, .input-search input, .search__form input { font-size: 16px !important; }
}


/* Bo'lim sarlavhasi yonidagi qidiruv maydoni */
.section__head .input-search { flex: 0 1 320px; }
.leader a { display: inline-flex; padding: 8px 0; }
.contact-card strong a, .contact__list strong a { display: inline-block; padding: 9px 0; }
.council__nums span { font-size: 12.5px; }
.slider__dots button { min-width: 36px; height: 40px !important; }
a.brand { min-height: 44px; }
.calendar__grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }

/* Mayda tuzatishlar */
.value .course__icon { display: flex; justify-content: flex-start; margin-bottom: 12px; }
[dir="rtl"] .value .course__icon { justify-content: flex-start; }
.timeline__item h3 { margin-top: 0; }
.event { align-items: center; }
.event .btn, .event .pill { flex-shrink: 0; }

/* ==========================================================
   3. QURILMALAR BO'YICHA ALOHIDA O'LCHAMLAR
   ========================================================== */

/* ---- Katta monitor (≥1600px) ---- */
@media (min-width: 1600px) {
  :root { --container: 1360px; }
  .banner { height: 520px !important; }
  .courses, .news { gap: 24px; }
  .students { gap: 28px; }
}

/* ---- Kompyuter (1440–1599px) ---- */
@media (min-width: 1440px) and (max-width: 1599px) {
  :root { --container: 1280px; }
  .banner { height: 480px !important; }
}

/* ---- Noutbuk (1280–1439px) ---- */
@media (min-width: 1280px) and (max-width: 1439px) {
  :root { --container: 1200px; }
  .banner { height: 440px !important; }
  .nav__list > li > a { padding: 10px 9px; font-size: 14px; }
  .quick--overlap .quick__item { padding: 16px 18px !important; }
}

/* ---- Kichik noutbuk / iPad yotiq (1024–1279px) ---- */
@media (min-width: 1024px) and (max-width: 1279px) {
  :root { --container: 100%; }
  .banner { height: 420px !important; }
  .courses { grid-template-columns: repeat(3, 1fr); }
  .news:not(.news--list) { grid-template-columns: repeat(2, 1fr); }
  .students { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .video-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 170px; }
  .news-home { grid-template-columns: 1.25fr 1fr; gap: 20px; }
  .video-layout { grid-template-columns: 1.5fr 1fr; gap: 20px; }
  .events { grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
  .sidebar { position: sticky; grid-template-columns: 1fr; }
  .about, .reg { grid-template-columns: 1fr 1fr; gap: 36px; }
  .contact, .map-block { grid-template-columns: 1fr 1.3fr; }
  .council-hero { grid-template-columns: 1fr 1fr; gap: 36px; }
  .values, .steps, .contact-cards { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .initiatives { grid-template-columns: repeat(3, 1fr); }
  .leaders { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .footer__grid { grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 28px; }
  .quick--overlap .quick__grid { grid-template-columns: repeat(4, 1fr) !important; }
  .quick--overlap .quick__item { border-bottom: 0 !important; padding: 14px 16px !important; }
  .quick--overlap .quick__item:nth-child(2) { border-right: 1px solid var(--line) !important; }
  .quick--overlap .quick__item:last-child { border-right: 0 !important; }
  .quick--overlap .quick__item small { display: none !important; }
  .stats__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Planshet / iPad tik (768–1023px) ---- */
@media (min-width: 768px) and (max-width: 1023px) {
  :root { --container: 100%; --header-h: 70px; }
  .banner { height: 400px !important; }
  .courses, .news, .video-grid, .initiatives { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .news--list { grid-template-columns: repeat(2, 1fr); }
  .students { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 170px; }
  .news-home, .video-layout, .events, .about, .reg, .contact, .layout, .council-hero, .map-block { grid-template-columns: minmax(0, 1fr); }
  .news-side { grid-template-columns: 1fr 1fr; }
  .video-list { grid-template-columns: 1fr 1fr; }
  .video-list .video-item:last-child { grid-column: span 2; }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .council { position: static; }
  .values, .steps, .contact-cards, .leaders { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .quick--overlap .quick__grid { grid-template-columns: 1fr 1fr !important; }
  .stats__grid { grid-template-columns: repeat(4, 1fr); }
  .stat { padding: 18px 8px; }
  .stat strong { font-size: 26px; }
  .collage .media:nth-child(1) { aspect-ratio: 16 / 9; }
  .contact__map, .map-block__map { min-height: 320px; }
}

/* ---- Katta telefon (600–767px) ---- */
@media (min-width: 600px) and (max-width: 767px) {
  .banner { height: 380px !important; }
  .courses, .news, .news--list, .video-grid, .initiatives, .students { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 150px; }
  .values, .steps, .contact-cards, .leaders, .docs { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .stats__grid { grid-template-columns: repeat(4, 1fr); }
  .stat { padding: 16px 6px; }
  .stat strong { font-size: 22px; }
  .stat:nth-child(-n+2) { border-bottom: 0; }
  .stat:nth-child(2) { border-right: 1px solid var(--line); }
}

/* ---- Barcha telefonlar (< 768px) ---- */
@media (max-width: 767px) {
  :root { --header-h: 64px; }
  .topbar__info a.hide-sm, .topbar__info span.hide-md { display: none; }
  .header__inner { height: var(--header-h); }
  .brand__logo { height: 34px; }
  .brand__text strong { font-size: 13px; }
  .brand__text small { font-size: 12px; }
  .header__actions { gap: 8px; }
  .banner__content p { font-size: 15px; }
  .banner__content .btn-row { gap: 8px; }
  .banner__content .btn { padding: 11px 16px; }
  .section__head, .section__head--center { margin-bottom: 20px; }
  .section__head .btn { padding: 11px 14px; font-size: 13.5px; }
  .section__head .input-search { flex: 1 1 100%; }
  .calendar__day { aspect-ratio: auto; min-height: 40px; }
  .news-home, .video-layout, .events, .about, .reg, .contact, .layout, .council-hero, .map-block { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .news-side, .video-list, .sidebar { grid-template-columns: 1fr; }
  .news-row { grid-template-columns: 112px 1fr; gap: 12px; }
  .video-item { grid-template-columns: 128px 1fr; }
  .event { flex-wrap: wrap; gap: 14px; }
  .event__info { flex: 1 1 200px; }
  .event .btn { width: 100%; }
  .reg__form-wrap { padding: 22px 18px; }
  .form__row { grid-template-columns: 1fr; }
  .cta__body { padding: 28px 20px; }
  .cta__body .btn-row { flex-direction: column; align-items: stretch; }
  .map-block__info { padding: 22px 18px; }
  .map-actions { flex-direction: column; }
  .map-actions .btn { width: 100%; }
  .contact__map, .map-block__map { min-height: 280px; }
  .page-hero, .page-hero--img { padding: 24px 0 20px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .tabs { width: 100%; }
  .input-search { max-width: none; min-width: 0; }
  .article__foot { flex-direction: column; align-items: flex-start; }
  .modal__arrow { width: 40px; height: 40px; }
  .to-top { right: 14px; bottom: 14px; }
  [dir="rtl"] .to-top { left: 14px; right: auto; }
}

/* ---- Telefon (380–599px) ---- */
@media (max-width: 599px) {
  .banner { height: 400px !important; }
  .courses, .news, .news--list, .video-grid, .initiatives { grid-template-columns: 1fr; gap: 14px; }
  .students { grid-template-columns: 1fr 1fr; gap: 12px; }
  .gallery-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 140px; gap: 6px; }
  .gallery-grid .g-item.wide { grid-column: span 2; }
  .gallery-grid .g-item.tall { grid-row: span 1; }
  .values, .steps, .contact-cards, .leaders, .docs { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer__brand { grid-column: 1 / -1; }
  .stats__grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 16px 8px; }
  .stat strong { font-size: 24px; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .quick--overlap .quick__grid { grid-template-columns: 1fr 1fr !important; }
  .council__nums { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .news-featured .card__media, .news-featured .media { min-height: 200px; }
}

/* ---- Kichik telefon (< 380px) ---- */
@media (max-width: 379px) {
  :root { --gutter: 14px; }
  .brand__divider, .brand__text { display: none !important; }
  .banner { height: 420px !important; }
  .banner__content .btn-row { flex-direction: column; align-items: stretch; }
  .students { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .news-row { grid-template-columns: 96px 1fr; }
  .video-item { grid-template-columns: 104px 1fr; }
  .calendar { padding: 14px; }
}

/* ---- Telefon yotiq holatda (past ekran) ---- */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 1023px) {
  .banner { height: 320px !important; }
  .banner__content p { display: none; }
  .header { position: relative; }
  .subnav { position: static; }
  .lang-select__menu { max-height: 70vh; }
  .modal__frame--img { height: 80vh; }
}

/* ---- Chop etish ---- */
@media print {
  .topbar, .header, .banner__nav, .quick, .to-top, .footer .socials, .modal, .lang-select { display: none !important; }
  .banner { height: auto !important; }
  body { overflow: visible; }
}

/* ==========================================================
   YUMALOQ TUGMALAR — saytda to'rtburchak tugma qolmaydi
   Matnli tugmalar: kapsula (pill) · Ikonkali tugmalar: doira
   ========================================================== */
:root { --pill: 999px; }

/* Matnli tugmalar */
.btn, .btn--sm, .btn--block, .nav__cta-mobile, .search__form .btn { border-radius: var(--pill) !important; }
.btn { padding-left: 22px; padding-right: 22px; }
.btn--sm { padding-left: 16px; padding-right: 16px; }

/* Ikonkali tugmalar — doira */
.icon-btn, .slider__btn, .to-top, .modal__close, .modal__arrow, .socials a, .share a, .share button,
.calendar__head .icon-btn, .burger { border-radius: 50% !important; }

/* Bo'lim tanlash (tabs) */
.tabs { border-radius: var(--pill) !important; padding: 4px; }
.tabs button { border-radius: var(--pill) !important; padding-left: 16px; padding-right: 16px; }

/* Til tanlash */
.lang-select__btn { border-radius: var(--pill) !important; padding-left: 12px; padding-right: 12px; }
.lang-select__menu { border-radius: 14px !important; }
.lang-select__menu button { border-radius: 10px !important; }

/* Sahifalash — doira */
.pagination a, .pagination span { border-radius: 50% !important; padding: 0; width: 44px; min-width: 44px; }
.pagination a[aria-label] { border-radius: 50% !important; }

/* Slayder nuqtalari — yumaloq chiziqcha */
.slider__dots button::after { border-radius: var(--pill) !important; }

/* Qidiruv va forma maydonlari — yumshoq burchak */
.input-search input, .search__form input { border-radius: var(--pill) !important; }
.search__form input { border: 1px solid var(--line); padding: 10px 18px; background: var(--soft); }
.search__form input:focus { outline: 0; border-color: var(--primary); background: #fff; }
.form input:not([type=checkbox]), .form select { border-radius: 12px !important; }
.form textarea { border-radius: 14px !important; }

/* Menyudagi ochiladigan ro'yxat va mobil menyu bandlari */
.drop { border-radius: 14px !important; }
.drop a { border-radius: 10px; }
@media (max-width: 1180px) {
  .nav__list > li > a { border-radius: 12px !important; }
}

/* Tugma ichidagi ikonka va matn bir chiziqda, aniq markazda */
.icon-btn, .slider__btn, .to-top, .socials a, .share a, .share button { align-items: center; justify-content: center; }
.btn:focus-visible, .icon-btn:focus-visible, .tabs button:focus-visible, .pagination a:focus-visible { outline: 3px solid var(--primary-100); outline-offset: 2px; }
