/* Общие стили сайтов Rich Baby: сброс, кнопки, форма, руководство, кружки, галерея, новости, документы, окна просмотра.
   Цвета и шрифты задаёт css/theme.css сайта через переменные (--a, --a2, --ink, --bg …); у каждого сайта свой облик. */

:root {
  --bg: #fff; --ink: #1b2250; --soft: #5b6290; --line: rgba(20, 30, 80, .14);
  --a: #f58220; --a2: #14a0dc; --a-ink: #fff; --card: #fff; --dark: #0b1b5e; --tint: #f4f6ff;
  --r: 24px; --shadow: 0 14px 34px rgba(11, 27, 94, .14);
  --head: "Rubik", system-ui, sans-serif; --body: "Nunito", system-ui, sans-serif; --bar-h: 72px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.06rem/1.65 var(--body); overflow-x: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--a2); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--a2); outline-offset: 3px; border-radius: 8px; }
.ico { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 90; padding: 10px 16px; border-radius: 12px; background: #fff; color: #000; font-weight: 800; }
.skip-link:focus { top: 12px; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--soft); }
h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.12; color: var(--ink); letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 1.2rem + 3vw, 3.3rem); text-wrap: balance; }
h3 { font-size: 1.4rem; }
.lede { max-width: 60ch; color: var(--soft); font-size: 1.1rem; text-wrap: pretty; }
.kicker { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--a); }
.section { position: relative; padding: clamp(64px, 8vw, 108px) 0; }
.head { display: grid; justify-items: start; gap: 14px; margin-bottom: clamp(28px, 4vw, 50px); }
.head-center { justify-items: center; text-align: center; }
.head-center .lede { margin-inline: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 28px; border: 0; border-radius: 999px; cursor: pointer; font-family: var(--body); font-weight: 800; font-size: 1rem; text-decoration: none; transition: transform .2s, box-shadow .2s, filter .2s; }
.btn-main { background: var(--a); color: var(--a-ink); box-shadow: 0 10px 24px color-mix(in srgb, var(--a) 40%, transparent); }
.btn-line { border: 2px solid currentColor; background: transparent; color: inherit; }
.btn:hover { transform: translateY(-3px); filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }

/* Руководство */
.leaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 32px; justify-items: center; }
.leaders-1 { grid-template-columns: minmax(0, 780px); justify-content: center; }
.leader { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: center; width: 100%; padding: 28px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
.leader-photo { position: relative; aspect-ratio: 4 / 5; border-radius: calc(var(--r) - 6px); background: var(--a); }
.leader-photo > img, .leader-photo > .avatar { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; border-radius: inherit; }
.leader-years { position: absolute; right: -14px; bottom: -14px; display: grid; place-content: center; width: 84px; height: 84px; border-radius: 50%; background: var(--a2); color: #fff; text-align: center; line-height: 1; box-shadow: 0 8px 18px rgba(0, 0, 0, .25); rotate: 8deg; }
.leader-years strong { font-family: var(--head); font-weight: 800; font-size: 1.8rem; }
.leader-years span { max-width: 9ch; margin-inline: auto; font-size: .54rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.leader-role { display: inline-block; margin-bottom: 8px; padding: 4px 14px; border-radius: 999px; background: var(--a); color: var(--a-ink); font-weight: 800; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
.leader h3 { font-size: clamp(1.45rem, 2.4vw, 2rem); }
.leader-edu { display: grid; gap: 2px; margin-top: 10px; color: var(--soft); }
.leader-edu span { font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--a); }
.leader-about { margin-top: 10px; color: var(--soft); }
.tabset { margin-top: 14px; }
.tabset-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-tab { min-height: 36px; padding: 0 14px; border: 1.5px solid var(--a); border-radius: 999px; background: transparent; font-weight: 800; font-size: .8rem; color: var(--ink); cursor: pointer; transition: background .2s, color .2s; }
.ts-tab.is-on { background: var(--a); color: var(--a-ink); }
.ts-panel { display: none; margin-top: 12px; font-size: .98rem; }
.ts-panel.is-on { display: block; animation: rise .45s cubic-bezier(.2, .8, .3, 1); }
@keyframes rise { from { opacity: 0; translate: 0 10px; } }

/* Кружки и сабақтар */
.clubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 24px; }
.club { position: relative; display: flex; flex-direction: column; border-radius: var(--r); background: var(--card); overflow: hidden; box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.3, 1.5, .5, 1); }
.club:hover { transform: translateY(-6px); }
.club-open { display: flex; flex-direction: column; flex: 1; width: 100%; padding: 0; border: 0; background: none; text-align: left; color: inherit; cursor: default; }
button.club-open { cursor: pointer; }
.club-media { position: relative; display: grid; place-items: center; height: 120px; overflow: hidden; background: var(--a); color: var(--a-ink); }
.club:nth-child(3n+2) .club-media { background: var(--a2); }
.club:nth-child(3n+3) .club-media { background: var(--dark); }
.club-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.extra-ico { position: relative; width: 62px; height: 62px; stroke-width: 2.4; transition: transform .4s cubic-bezier(.3, 1.8, .5, 1); }
.club:hover .extra-ico { transform: scale(1.14) rotate(-8deg); }
.club-body { display: grid; align-content: start; gap: 6px; padding: 16px 22px 24px; }
.club-title { font-family: var(--head); font-weight: 800; font-size: 1.25rem; color: var(--ink); }
.club-meta { font-size: .8rem; font-weight: 800; color: var(--a); }
.club-text { color: var(--soft); font-size: .98rem; }
.story-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 800; color: var(--a2); }
.story-count { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; background: var(--dark); color: #fff; font-size: .82rem; font-weight: 800; }

/* Фото: лента (по умолчанию) — сайт может сделать из .album сетку */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 8px; }
.tab { min-height: 44px; padding: 0 20px; border: 2px solid var(--a); border-radius: 999px; background: transparent; font-weight: 800; font-size: .9rem; color: inherit; cursor: pointer; transition: background .2s, color .2s, transform .15s; }
.tab:hover { transform: translateY(-2px); }
.tab.is-on { background: var(--a); color: var(--a-ink); }
.hall { position: relative; }
.album { display: flex; align-items: center; gap: 28px; padding: 34px max(24px, calc((100vw - 1160px) / 2)) 48px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: max(24px, calc((100vw - 1160px) / 2)); scrollbar-width: none; cursor: grab; }
.album::-webkit-scrollbar { display: none; }
.album.is-drag { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.album figure { flex: none; scroll-snap-align: start; margin: 0; transition: transform .4s cubic-bezier(.3, 1.5, .5, 1); }
.album figure:hover { transform: translateY(-8px); }
.album figure[hidden] { display: none; }
.photo-btn { position: relative; display: block; padding: 0; border: 0; border-radius: var(--r); background: none; cursor: zoom-in; overflow: hidden; box-shadow: var(--shadow); }
.photo-btn img { display: block; width: auto; height: clamp(250px, 46vh, 420px); max-width: min(82vw, 640px); object-fit: cover; pointer-events: none; }
.photo-btn figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 14px; background: linear-gradient(transparent, rgba(8, 14, 50, .85)); color: #fff; font-family: var(--head); font-weight: 700; font-size: 1.05rem; text-align: left; opacity: 0; transition: opacity .3s; }
.photo-btn:hover figcaption, .photo-btn:focus-visible figcaption { opacity: 1; }
.hall-nav { position: absolute; top: 50%; z-index: 5; display: grid; place-items: center; width: 54px; height: 54px; translate: 0 -50%; border: 0; border-radius: 50%; background: var(--a); color: var(--a-ink); cursor: pointer; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); transition: transform .15s; }
.hall-nav:hover { transform: translateY(calc(-50% - 3px)); }
.hall-prev { left: max(10px, calc((100vw - 1260px) / 2)); } .hall-next { right: max(10px, calc((100vw - 1260px) / 2)); }
.hall-hint { text-align: center; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.note { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 34px 20px; border: 2px dashed var(--line); border-radius: var(--r); text-align: center; }

/* Новости */
.stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 26px; }
.story { overflow: hidden; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.3, 1.5, .5, 1); }
.story:hover { transform: translateY(-6px); }
.story-open { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; color: inherit; cursor: pointer; }
.story-img { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--tint); }
.story-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.story:hover .story-img img { transform: scale(1.06); }
.story-img-empty { display: grid; place-items: center; }
.story-img-empty img { width: 28%; height: auto; object-fit: contain; }
.story-body { display: grid; gap: 6px; padding: 18px 24px 26px; }
.story-body time { font-size: .84rem; font-weight: 800; color: var(--a); }
.story-title { font-family: var(--head); font-weight: 800; font-size: 1.25rem; line-height: 1.2; color: var(--ink); }
.story-excerpt { color: var(--soft); font-size: .98rem; }

/* Документы и вакансии */
.docs-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.doc-sets { display: grid; gap: 20px; margin-top: 20px; }
.doc-set, .jobs { padding: 26px 28px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); }
.jobs { background: var(--dark); color: #fff; }
.jobs h3 { color: #fff; }
.doc-set h3, .jobs h3 { margin-bottom: 12px; }
.doc-set li { display: grid; gap: 2px; padding: 10px 0; border-top: 1.5px dotted var(--line); }
.doc-set li:first-child { border-top: 0; }
.doc-set a { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; color: var(--ink); }
.doc-set a:hover { color: var(--a); }
.doc-set a .ico { color: var(--a); }
.doc-set small { margin-left: 32px; color: var(--soft); font-weight: 700; }
.job { margin-top: 14px; padding-top: 14px; border-top: 1.5px dashed rgba(255, 255, 255, .35); }
.job summary { cursor: pointer; font-weight: 800; }
.job p { margin-top: 8px; opacity: .85; }
.job a { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 800; color: var(--a); }

/* Контакты и форма */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 70px); align-items: start; }
.contact-info { display: grid; gap: 14px; justify-items: start; }
.contact-phone { font-family: var(--head); font-weight: 800; font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.15; text-decoration: none; color: var(--a); }
.contact-list { display: grid; gap: 12px; margin-top: 6px; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.contact-list .ico { margin-top: .22em; color: var(--a); }
.contact-list a { text-underline-offset: 3px; }
.social-label { margin-top: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: .78rem; opacity: .7; }
.socials { display: flex; flex-wrap: wrap; gap: 12px; }
.socials a { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 2px solid currentColor; border-radius: 999px; font-weight: 800; text-decoration: none; color: inherit; transition: background .2s, color .2s, transform .2s; }
.socials a:hover { background: var(--a); border-color: var(--a); color: var(--a-ink); transform: translateY(-3px); }
.form { position: relative; padding: 42px 36px 34px; border-radius: calc(var(--r) + 8px); background: #fff; color: #1b2250; box-shadow: 0 30px 70px rgba(0, 0, 0, .25); }
.seal { position: absolute; top: -34px; right: 30px; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); overflow: hidden; }
.seal img { width: 100%; height: 100%; object-fit: cover; }
.form h3 { max-width: calc(100% - 90px); font-size: 2rem; color: #1b2250; }
.form label { display: block; margin: 16px 0 6px; font-weight: 800; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: #59608a; }
.form input:not([type="checkbox"]), .form select, .form textarea { width: 100%; padding: 13px 18px; border: 2px solid #e1e5f7; border-radius: 16px; background: #f7f8ff; font-weight: 700; color: #1b2250; transition: box-shadow .2s, border-color .2s; }
.form input::placeholder, .form textarea::placeholder { color: rgba(27, 34, 80, .35); }
.form select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231b2250' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; background-size: 14px; padding-right: 42px; }
.form textarea { resize: vertical; min-height: 100px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 0; border-color: var(--a); box-shadow: 0 0 0 5px color-mix(in srgb, var(--a) 25%, transparent); background: #fff; }
.form .consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; font-size: .9rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: #59608a; }
.form .consent input { flex: none; width: 22px; height: 22px; margin-top: 2px; accent-color: var(--a); }
.form .btn { width: 100%; margin-top: 22px; }
.form-note { display: none; margin-top: 14px; font-weight: 800; color: #0f8f4c; }
.form-note.show { display: block; }
.form-note.error { color: #d23b2e; }
.hp-field { position: absolute; left: -9999px; }

/* Просмотр фото и новости */
.lightbox { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px; background: rgba(8, 12, 40, .94); }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; text-align: center; }
.lightbox img { max-height: 80vh; max-width: min(1000px, 78vw); border-radius: 20px; box-shadow: 0 30px 70px rgba(0, 0, 0, .6); }
.lightbox figcaption { margin-top: 12px; color: #fff; font-family: var(--head); font-weight: 700; font-size: 1.3rem; }
.lb-close, .lb-nav, .nd-close, .nd-nav { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--a); color: var(--a-ink); cursor: pointer; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.lb-close { position: absolute; top: 16px; right: 16px; }
.news-dialog { width: min(780px, calc(100% - 24px)); max-height: 90vh; padding: 0; border: 0; border-radius: calc(var(--r) + 6px); background: #fff; color: #1b2250; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); overflow: auto; }
.news-dialog::backdrop { background: rgba(8, 12, 40, .82); }
.nd-close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.nd-stage { position: relative; background: #0a0f33; }
.nd-img { display: block; width: 100%; height: min(58vh, 470px); object-fit: contain; }
.nd-nav { position: absolute; top: 50%; translate: 0 -50%; display: none; width: 46px; height: 46px; }
.nd-prev { left: 12px; } .nd-next { right: 12px; }
.nd-counter { position: absolute; left: 12px; bottom: 12px; display: none; padding: 2px 12px; border-radius: 999px; background: rgba(0, 0, 0, .65); color: #fff; font-weight: 800; font-size: .9rem; }
.has-many .nd-nav { display: grid; } .has-many .nd-counter { display: block; }
.nd-thumbs { display: none; gap: 8px; padding: 10px 12px; overflow-x: auto; background: #f1f3ff; }
.has-many .nd-thumbs { display: flex; }
.nd-thumbs button { flex: none; width: 72px; height: 54px; padding: 0; border: 3px solid transparent; border-radius: 12px; overflow: hidden; background: none; cursor: pointer; opacity: .7; }
.nd-thumbs button.is-active { border-color: var(--a); opacity: 1; }
.nd-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.nd-body { padding: 24px 30px 34px; }
.nd-gallery[hidden] + .nd-body { padding-top: 62px; }
.nd-body time { font-weight: 800; color: var(--a); }
.nd-body h3 { margin: .15em 0 .5em; font-size: 1.9rem; color: #1b2250; }

/* Появление при прокрутке */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease var(--delay, 0s), transform .9s cubic-bezier(.2, .9, .3, 1) var(--delay, 0s); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

@media (max-width: 1000px) { .contact-grid, .docs-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .leader { grid-template-columns: 1fr; justify-items: center; text-align: center; padding-bottom: 34px; }
  .leader-photo { width: 220px; }
  .leader > div:last-child { display: grid; justify-items: center; }
  .tabset-bar { justify-content: center; }
}
@media (max-width: 640px) {
  .wrap { width: min(1160px, 100% - 32px); }
  .form { padding: 38px 20px 28px; }
  .seal { right: 18px; width: 62px; height: 62px; }
  .hall-nav { width: 44px; height: 44px; }
  .photo-btn img { height: clamp(210px, 38vh, 340px); }
}
@media (max-width: 520px) { .tab { min-height: 40px; padding: 0 14px; font-size: .84rem; } }
