/* ==========================================================================
   Редизайн публичного сайта — 19.11.2026
   По мотивам сайтов министерств на gov.uz (Минсельхоз и др.): герб и название ведомства в шапке,
   быстрые входы («интерактивные услуги»), пункты разделов с акцентной полосой, полный подвал.
   Современнее, но в рамке государственного сайта: сине-белая гамма, Montserrat, сдержанные углы.
   Подключён после site.css и gov-theme.css, только переопределяет. Шрифты — через --fs (доступность).
   ========================================================================== */
:root {
  --muted: #5A6472;          /* подписи: 5.6:1 к фону #F1F3F5 (было #707070 — 4.4:1) */
  --line: #E2E7EE;           /* границы карточек: заметнее на сером фоне */
  --tint: rgba(2, 74, 168, .09);
  --r: 10px;
}
[data-theme="dark"] { --muted: #9DB0C4; --line: #22344A; --tint: rgba(143, 176, 218, .14); }

/* --- Шапка: герб, логотип и название ведомства --- */
.masthead__in { min-height: 88px; }
.masthead__brand { display: flex; align-items: center; gap: 14px; text-decoration: none; min-width: 0; }
.masthead__titles { display: flex; align-items: center; gap: 14px; min-width: 0; }
.masthead__emblem { width: 56px; height: 56px; object-fit: contain; flex: none; }
.masthead__logo { height: 52px; width: auto; flex: none; }
.masthead__name { display: block; max-width: 30ch; padding-left: 14px; border-left: 1px solid var(--line);
  font-size: calc(16px * var(--fs)); line-height: 1.25; font-weight: 700; color: var(--green-deep); }
[data-theme="dark"] .masthead__name { color: var(--ink); }
@media (max-width: 900px) {
  .masthead__in { min-height: 72px; }
  .masthead__emblem { width: 44px; height: 44px; } .masthead__logo { height: 40px; }
  .masthead__name { font-size: calc(13px * var(--fs)); max-width: 22ch; padding-left: 10px; }
  .masthead__brand, .masthead__titles { gap: 10px; }
}
@media (max-width: 420px) { .masthead__logo { display: none; } }

/* --- Верхняя полоса на телефоне: одна строка вместо пяти --- */
@media (max-width: 700px) {
  .topline__in { flex-wrap: wrap; row-gap: 6px; padding-top: 6px; padding-bottom: 6px; }
  .topline__left { width: 100%; justify-content: space-between; }
  .topline__social, .toplineclock, .sitemapbtn { display: none !important; }
  .topline__right { width: 100%; display: flex; align-items: center; gap: 8px; }
  .topline__right .langpick { flex: 1; } .topline__right .langpick select { width: 100%; }
}

/* --- Первый экран: фото опытных полей под синей заливкой, текст слева, цифры сети --- */
.hero.hero--photo {
  position: relative; overflow: hidden; color: #fff; text-align: left;
  background:
    linear-gradient(90deg, rgba(1, 37, 79, .96) 0%, rgba(1, 50, 110, .88) 42%, rgba(1, 61, 140, .45) 100%),
    var(--hero-img) center 55% / cover no-repeat, #01254F;
}
.hero--photo .hero__in { position: relative; z-index: 1; display: grid; gap: 36px; padding: 64px 20px 88px; text-align: left; }
.hero--photo .hero__text { max-width: 720px; }
.hero--photo .hero__badge { margin: 0 0 14px; font-size: calc(12.5px * var(--fs)); letter-spacing: .08em; font-weight: 600; color: #BFD6F2; }
.hero--photo h1 { margin: 0 0 14px; max-width: none; text-transform: none; letter-spacing: -.01em;
  font-size: calc(clamp(28px, 2.6vw + 12px, 46px) * var(--fs)); line-height: 1.12; font-weight: 800; color: #fff; }
.hero--photo .hero__lead { margin: 0 0 26px; max-width: 52ch; font-size: calc(17px * var(--fs)); color: #DCE8F6; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 8px;
  font-weight: 700; font-size: calc(15px * var(--fs)); text-decoration: none; border: 2px solid transparent; }
.hbtn .ico { width: 18px; height: 18px; }
.hbtn--light { background: #fff; color: #013D8C; }
.hbtn--light:hover { background: #E8F0FA; }
.hbtn--ghost { border-color: rgba(255, 255, 255, .7); color: #fff; }
.hbtn--ghost:hover { background: rgba(255, 255, 255, .12); }
.hbtn:focus-visible { outline: 3px solid #FFD25E; outline-offset: 2px; }
.hero__figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; max-width: 880px;
  border-top: 1px solid rgba(255, 255, 255, .28); }
.hfig { padding: 16px 16px 0 0; display: flex; flex-direction: column-reverse; gap: 2px; }
.hfig + .hfig { padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, .22); }
.hfig dd { margin: 0; font-size: calc(34px * var(--fs)); line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.hfig dt { font-size: calc(13.5px * var(--fs)); color: #C9DBF1; }
@media (max-width: 760px) {
  .hero--photo .hero__in { padding: 40px 16px 72px; gap: 26px; }
  .hero__figs { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .hfig:nth-child(odd) { padding-left: 0; border-left: 0; }
  .hfig dd { font-size: calc(28px * var(--fs)); }
  .hbtn { flex: 1 1 auto; justify-content: center; }
}

/* --- Быстрые входы: белая панель на краю первого экрана --- */
.quick { position: relative; z-index: 2; margin-top: -44px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 10px 30px rgba(1, 37, 79, .12); overflow: hidden; }
.quick__i { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-height: 112px; padding: 20px 18px;
  color: var(--ink); text-decoration: none; border-right: 1px solid var(--line); }
.quick__i:last-child { border-right: 0; }
.quick__i:hover { background: var(--tint); }
.quick__i:hover .quick__t { color: var(--green); }
.quick__i:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.quick__ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--tint); color: var(--green); }
.quick__ic .ico { width: 22px; height: 22px; }
.quick__t { font-weight: 700; font-size: calc(14.5px * var(--fs)); line-height: 1.3; }
@media (max-width: 1100px) { .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick__i:nth-child(3n) { border-right: 0; } .quick__i:nth-child(-n+3) { border-bottom: 1px solid var(--line); } }
@media (max-width: 560px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: -36px; }
  .quick__i { min-height: 96px; padding: 16px 14px; border-bottom: 1px solid var(--line); }
  .quick__i:nth-child(3n) { border-right: 1px solid var(--line); } .quick__i:nth-child(2n) { border-right: 0; } }

/* --- Заголовки разделов: акцентная полоса слева (приём сайтов министерств), без капса --- */
.sec__title { text-transform: none; letter-spacing: -.01em; padding-left: 14px; border-left: 4px solid var(--gold);
  font-size: calc(26px * var(--fs)); line-height: 1.2; }
.sec__head { margin-bottom: 22px; }
.pagehead h1, .newshead h1 { text-transform: none; letter-spacing: -.01em; }
.sec__more { font-weight: 700; }

/* --- Новости: аккуратные карточки без пустот --- */
.feat3card { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.feat3card__excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }
.feat3card__excerpt:empty { display: none; }
.feat3card__title { text-transform: none; }
.feat3card__foot { margin-top: auto; }
.nrows { border: 1px solid var(--line); border-radius: var(--r); }
.ncard { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }

/* --- Разделы и полезные ссылки: карточка со значком и полосой слева (как у министерств) --- */
.dirs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dir.dir--ic { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 16px 14px 18px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--r);
  text-decoration: none; color: var(--ink); }
.dir.dir--ic:hover { border-color: var(--gold); border-left-color: var(--gold); background: var(--card); }
.dir.dir--ic:hover .dir__t { color: var(--green); }
.dir__ic { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 10px; background: var(--tint); color: var(--green); }
.dir__ic .ico { width: 21px; height: 21px; }
.dir.dir--ic .dir__t { flex: 1; min-width: 0; text-transform: none; font-size: calc(15px * var(--fs)); font-weight: 700; line-height: 1.3; letter-spacing: 0; }
.dir.dir--ic .dir__arrow { flex: none; }
@media (max-width: 1000px) { .dirs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .dirs { grid-template-columns: minmax(0, 1fr); } }

/* --- Новости: рубрики сверх первых восьми — по раскрытию --- */
.catmore { margin: 6px 0 4px; }
.catmore > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; cursor: pointer;
  border: 1px dashed var(--gold); border-radius: 6px; color: var(--green); font-weight: 700; list-style: none; }
.catmore > summary::-webkit-details-marker { display: none; }
.catmore > summary::after { content: "▾"; font-size: 12px; }
.catmore[open] > summary::after { content: "▴"; }
.catmore > .catfilter { margin-top: 10px; }

/* --- Организации: значок здания, если логотипа нет или он не загрузился --- */
.orgfig { position: relative; }
.orgfig__ph { display: grid; place-items: center; margin: 0 auto 12px;
  width: 112px; height: 112px; border-radius: 50%; background: var(--tint); color: var(--green); }
.orgfig__ph .ico { width: 48px; height: 48px; }
.orgfig img { position: relative; z-index: 1; background: var(--card); }

/* --- Подвал: контакты и ссылки читаются --- */
.foot__contacts a { text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) { .hbtn, .quick__i, .dir { transition: none; } }

/* крупные карточки новостей тянутся под высоту списка справа — растёт фото, а не пустое место под текстом */
@media (min-width: 1001px) {
  .newsrow .feat3card__img { aspect-ratio: auto; flex: 1 1 auto; min-height: 230px; }
  .newsrow .feat3card__body { flex: 0 0 auto; }
}

/* --- Внутренние страницы: шапка с крошками, оглавление раздела, боковое меню, карточки людей --- */
.pagehead, .newshead { background: linear-gradient(180deg, var(--card) 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.pagehead h1, .newshead h1 { font-size: calc(clamp(24px, 1.6vw + 14px, 34px) * var(--fs)); line-height: 1.2; color: var(--green-deep); }
[data-theme="dark"] .pagehead h1, [data-theme="dark"] .newshead h1 { color: var(--ink); }
.breadcrumb a { font-weight: 600; }
.seclist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.seclist__item { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 14px 16px 14px 18px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--r);
  color: var(--ink); text-decoration: none; }
.seclist__item:hover { border-color: var(--gold); border-left-color: var(--gold); }
.seclist__item:hover .seclist__t { color: var(--green); }
.seclist__t { flex: 1; min-width: 0; font-weight: 700; font-size: calc(15.5px * var(--fs)); text-transform: none; }
.seclist__a { flex: none; width: 20px; height: 20px; color: var(--green); }
@media (max-width: 700px) { .seclist { grid-template-columns: minmax(0, 1fr); } }
.secside { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.secside__item { min-height: 48px; }
.secside__item.active { font-weight: 700; }
.lcard, .pcard, .figgrid--logos figure { border-radius: var(--r); }
.pagebody > p, .pagebody > ul, .pagebody > ol, .article__body > p { max-width: 78ch; }
.pagebody > p, .article__body > p { line-height: 1.7; }
/* заглушка организации — только когда логотипа нет (или он не загрузился: onerror убирает <img>) */
.orgfig:has(img) .orgfig__ph { display: none; }
@media (max-width: 760px) { .hero--photo h1 { font-size: calc(26px * var(--fs)); overflow-wrap: break-word; hyphens: auto; } }
/* узкий экран: сетка первого экрана не шире окна, длинное слово заголовка переносится */
.hero--photo .hero__in { grid-template-columns: minmax(0, 1fr); }
.hero--photo h1, .hero--photo .hero__badge { overflow-wrap: anywhere; }
@media (max-width: 400px) {
  .hero--photo h1 { font-size: calc(23px * var(--fs)); }
  .sec__head { flex-wrap: wrap; row-gap: 10px; }
  .hfig dd { font-size: calc(24px * var(--fs)); }
}
/* планшет: верхняя полоса не помещалась (кнопка «Войти» уходила за край на 768–1024) — прячем часы, затем соцсети */
@media (max-width: 1150px) { .toplineclock, .sitemapbtn { display: none !important; } }
@media (max-width: 960px) { .topline__social { display: none !important; } }
.uzmap__picker { max-width: 100%; box-sizing: border-box; }
.uzmap__picker select { max-width: 100%; min-width: 0; }
/* панель быстрых входов: боковой отступ, когда экран уже ширины сайта */
@media (max-width: 1240px) { .quick { margin-left: 16px; margin-right: 16px; } }
/* 320–360: самое длинное слово заголовка («сельскохозяйственных») помещается целиком */
@media (max-width: 360px) { .hero--photo h1 { font-size: calc(21px * var(--fs)); } }

/* --- Версия для слабовидящих (Codex P2, 19.11.2026): первый экран без фото, кнопки контрастные ---
   site.css в режиме «Qora fon» красит все ссылки жёлтым с !important — белая кнопка давала жёлтое на белом. */
[data-a11y="high"], [data-a11y="high-dark"] { --tint: transparent; }
[data-a11y="high"] .hero.hero--photo, [data-a11y="high-dark"] .hero.hero--photo { background: var(--bg); color: var(--ink); border-bottom: 2px solid var(--line); }
[data-a11y] .hero--photo h1, [data-a11y] .hero--photo .hero__badge, [data-a11y] .hero--photo .hero__lead,
[data-a11y] .hfig dd, [data-a11y] .hfig dt { color: var(--ink) !important; }
[data-a11y] .hero__figs, [data-a11y] .hfig + .hfig { border-color: var(--line); }
[data-a11y="high"] .hbtn--light { background: #000; color: #fff !important; }
[data-a11y="high"] .hbtn--ghost { border-color: #000; color: #000 !important; }
[data-a11y="high-dark"] .hbtn--light { background: #ffff00; color: #000 !important; }
[data-a11y="high-dark"] .hbtn--ghost { border-color: #ffff00; color: #ffff00 !important; }
[data-a11y] .quick__ic, [data-a11y] .dir__ic { border: 2px solid var(--line); }
[data-a11y] .quick { margin-top: 16px; }
[data-a11y] .masthead__name { color: var(--ink) !important; }
/* «Организации системы» в верхней полосе — на жёлтом акценте подпись чёрная (было белое на жёлтом) */
[data-a11y="high-dark"] .orgsbtn, [data-a11y="high-dark"] .orgsbtn:hover { color: #000 !important; }
