/*
Theme Name: AIT
Theme URI: https://www.ait.ru/
Author: AIT
Description: Light custom theme for the AIT corporate website, based on the approved “Clinical environment” direction.
Version: 0.5.0
Requires at least: 7.1
Requires PHP: 8.3
Text Domain: ait
*/

:root {
    --ink: #17212b;
    --text: #344454;
    --muted: #637382;
    --paper: #ffffff;
    --surface: #f3f7f9;
    --strong: #e6f0f4;
    --line: #d7e2e7;
    --accent: #146c94;
    --accent-dark: #0d4f70;
    --focus: #f2a900;
    --max: 1180px;
    --shadow-image: 0 18px 50px rgba(23, 33, 43, 0.1);
    --shadow-card: 0 12px 34px rgba(23, 33, 43, 0.055);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body, button, input, textarea { font-family: "Avenir Next", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p, h1, h2, h3 { overflow-wrap: break-word; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip-link {
    position: fixed;
    z-index: 10000;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    transform: translateY(-160%);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }
.wrap { width: min(var(--max), calc(100% - 64px)); margin-inline: auto; }

.kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--accent);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.kicker::before { width: 28px; height: 2px; flex: 0 0 auto; border-radius: 2px; background: var(--accent); content: ""; }

.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 21px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.button:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.button.outline { background: var(--paper); color: var(--accent); }
.button.outline:hover { background: var(--surface); color: var(--accent-dark); }

.text-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}
.text-link:hover { color: var(--accent-dark); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.site-header { position: relative; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.98); }
.header-row { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { min-height: 44px; display: inline-flex; align-items: center; flex: 0 0 auto; font-size: 19px; font-weight: 760; letter-spacing: -0.02em; text-decoration: none; }
.brand-image { line-height: 0; }
.brand-logo { width: 176px; height: auto; }
.primary-nav { display: flex; align-items: center; gap: 22px; }
.primary-nav a, .footer-nav a { min-height: 44px; display: flex; align-items: center; color: var(--text); font-size: 14px; font-weight: 620; text-decoration: none; }
.primary-nav a:hover, .footer-nav a:hover { color: var(--accent); }
.mobile-menu { display: none; }
.mobile-menu summary { min-height: 44px; display: flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 700; list-style: none; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu nav { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: min(290px, calc(100vw - 40px)); padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-card); }
.mobile-menu nav a { min-height: 46px; display: flex; align-items: center; padding: 0 12px; border-radius: 8px; color: var(--text); font-weight: 650; text-decoration: none; }
.mobile-menu nav a:hover { background: var(--surface); color: var(--accent); }

.home-hero { padding-top: 64px; }
.home-hero-copy { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.78fr); gap: 56px; align-items: end; }
.home-hero h1 { max-width: 790px; margin: 14px 0 0; font-size: clamp(44px, 4.9vw, 60px); font-weight: 720; line-height: 1.06; letter-spacing: -0.038em; }
.hero-side > p { margin: 0; color: var(--text); font-size: 18px; line-height: 1.62; }
.panorama { position: relative; margin: 42px 0 0; }
.panorama-image { width: 100%; height: 500px; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow-image); }
.image-label { position: absolute; left: 24px; bottom: 24px; width: min(440px, calc(100% - 48px)); padding: 18px 20px; border: 1px solid rgba(215, 226, 231, 0.9); border-radius: 14px; background: rgba(255, 255, 255, 0.94); box-shadow: 0 10px 28px rgba(23, 33, 43, 0.08); backdrop-filter: blur(8px); }
.image-label strong { display: block; font-size: 17px; line-height: 1.3; }
.image-label p { margin: 7px 0 0; color: var(--text); font-size: 14px; line-height: 1.55; }

.proof, .facts { border-block: 1px solid var(--line); background: var(--surface); }
.proof { margin-top: 46px; }
.proof-row, .facts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.proof article, .facts article { padding: 24px 28px 24px 0; }
.proof article + article, .facts article + article { padding-left: 28px; border-left: 1px solid var(--line); }
.proof strong, .facts strong { display: block; font-size: 21px; font-weight: 720; line-height: 1.28; letter-spacing: -0.015em; }
.proof p, .facts p { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.section { padding: 76px 0; }
.section-heading { max-width: 760px; }
.section h2, .cta h2, .split-section h2, .detail-grid h2 { max-width: 780px; margin: 12px 0 0; font-size: clamp(31px, 3vw, 38px); font-weight: 700; line-height: 1.17; letter-spacing: -0.025em; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 34px; }
.archive-products .product-grid { margin-top: 0; }
.product-card { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: var(--shadow-card); }
.product-card-image { display: block; overflow: hidden; background: var(--surface); }
.product-card-image img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 220ms ease; }
.product-card:hover .product-card-image img { transform: scale(1.015); }
.product-card--relationships .product-card-image img { object-position: 38% center; }
.product-card-body { min-height: 285px; display: flex; flex: 1; flex-direction: column; padding: 24px; }
.product-card .index, .capability-card > span, .timeline-item > span, .service-list span { color: var(--accent); font-size: 13px; font-weight: 750; line-height: 1; }
.product-card h2, .product-card h3 { margin: 18px 0 0; font-size: 23px; font-weight: 700; line-height: 1.24; letter-spacing: -0.018em; }
.product-card h2 a, .product-card h3 a { text-decoration: none; }
.product-card h2 a:hover, .product-card h3 a:hover { color: var(--accent); }
.product-card p { margin: 12px 0 0; color: var(--text); font-size: 16px; line-height: 1.58; }
.product-card .text-link { align-self: flex-start; margin-top: auto; padding-top: 22px; }

.feature-section, .company-section, .surface-section { border-block: 1px solid var(--line); background: var(--surface); }
.feature-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.feature-image img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 20px; box-shadow: 0 16px 44px rgba(23, 33, 43, 0.09); }
.feature-copy h2 { margin: 12px 0 0; font-size: clamp(31px, 3vw, 38px); font-weight: 700; line-height: 1.17; letter-spacing: -0.025em; }
.feature-copy > p:not(.kicker), .company-copy > p { margin: 18px 0 0; color: var(--text); font-size: 17px; line-height: 1.68; }
.split-section { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.service-list { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.service-list li { display: flex; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 650; line-height: 1.5; }
.service-list span { min-width: 38px; padding-top: 5px; }
.cta { padding: 72px 0; }
.cta-row { display: flex; align-items: center; justify-content: space-between; gap: 48px; padding: 34px 38px; border-radius: 20px; background: var(--strong); }
.cta-row .button { flex: 0 0 auto; }

.product-hero { padding: 64px 0; }
.product-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr); gap: 56px; align-items: center; }
.product-hero h1 { max-width: 720px; margin: 14px 0 0; font-size: clamp(42px, 4.3vw, 56px); font-weight: 720; line-height: 1.08; letter-spacing: -0.034em; }
.product-hero .lead { max-width: 680px; margin: 20px 0 0; color: var(--text); font-size: 18px; line-height: 1.62; }
.product-hero-image img { width: 100%; height: 470px; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow-image); }
.product-page--relationships .product-hero-image img { object-position: 40% center; }
.facts article { padding-block: 22px; }
.facts strong { font-size: 20px; }
.wide-heading { max-width: 820px; }
.intro { max-width: 760px; margin: 18px 0 0; color: var(--text); font-size: 17px; line-height: 1.64; }
.capability-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 34px; }
.capability-card { padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 10px 30px rgba(23, 33, 43, 0.045); }
.capability-card h3, .timeline-item h3, .role-card h3 { margin: 16px 0 0; font-size: 22px; font-weight: 700; line-height: 1.28; letter-spacing: -0.014em; }
.capability-card p, .timeline-item p, .role-card p { margin: 10px 0 0; color: var(--text); font-size: 16px; line-height: 1.58; }
.detail-grid { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 52px; }
.timeline { border-top: 1px solid var(--line); }
.timeline-item { display: grid; grid-template-columns: 56px 1fr; gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.timeline-item > span { padding-top: 6px; }
.timeline-item h3 { margin-top: 0; font-size: 17px; }
.timeline-item p { margin-top: 5px; font-size: 15px; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.role-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.role-card h3 { margin-top: 0; font-size: 17px; }
.role-card p { margin-top: 8px; font-size: 15px; }

.archive-hero { padding: 72px 0 28px; }
.narrow-heading { max-width: 800px; }
.archive-hero h1, .standard-page h1 { margin: 14px 0 0; font-size: clamp(42px, 4.3vw, 56px); font-weight: 720; line-height: 1.08; letter-spacing: -0.034em; }
.archive-hero .narrow-heading > p:not(.kicker) { max-width: 720px; margin: 20px 0 0; color: var(--text); font-size: 18px; line-height: 1.62; }
.archive-products { padding-top: 28px; }
.standard-page { min-height: 55vh; padding: 72px 0; }
.reading-width { max-width: 800px; }
.entry-content { margin-top: 28px; color: var(--text); font-size: 17px; line-height: 1.7; }
.entry-content h2, .entry-content h3 { color: var(--ink); line-height: 1.25; }
.entry-content h2 { margin: 48px 0 16px; font-size: 28px; letter-spacing: -0.02em; }
.entry-content h3 { margin: 30px 0 12px; font-size: 20px; }
.entry-content p { margin: 0 0 19px; }
.entry-content ul, .entry-content ol { margin: 0 0 24px; padding-left: 24px; }
.entry-content li + li { margin-top: 8px; }
.entry-content a { color: var(--accent); text-underline-offset: 4px; }
.page-lead { color: var(--ink); font-size: 20px; line-height: 1.65; }

.migrated-page-hero { padding: 64px 0; }
.migrated-page-hero-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(380px, 1.15fr); gap: 56px; align-items: center; }
.migrated-page-hero h1 { max-width: 680px; margin: 14px 0 0; font-size: clamp(42px, 4.3vw, 56px); font-weight: 720; line-height: 1.08; letter-spacing: -0.034em; }
.migrated-page-visual img { width: 100%; height: 360px; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow-image); }
.parent-link { min-height: 44px; display: inline-flex; align-items: center; margin-bottom: 18px; color: var(--accent); font-size: 14px; font-weight: 700; text-underline-offset: 4px; }
.migrated-page-content { padding: 72px 0 84px; border-top: 1px solid var(--line); }
.migrated-page-content .entry-content { margin-top: 0; }

.fact-list, .contact-details { margin: 30px 0; border-top: 1px solid var(--line); }
.fact-list > div, .contact-details > div { display: grid; grid-template-columns: minmax(150px, 0.45fr) minmax(0, 1fr); gap: 24px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.fact-list dt, .contact-details dt { color: var(--ink); font-weight: 700; }
.fact-list dd, .contact-details dd { margin: 0; }
.leadership-card { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.leadership-card h2 { margin-top: 0; }
.leadership-card .contact-details { margin-bottom: 0; }

.certificate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin: 30px 0; }
.certificate-card { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-card); }
.certificate-card a { display: block; padding: 22px; background: var(--surface); }
.certificate-card img { width: 100%; height: 430px; object-fit: contain; }
.certificate-card figcaption { min-height: 76px; display: flex; align-items: center; padding: 15px 18px; color: var(--text); font-size: 14px; line-height: 1.5; }
.map-frame { overflow: hidden; margin: 24px 0 42px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.map-frame iframe { width: 100%; height: 480px; display: block; border: 0; }
.related-pages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 54px; padding-top: 28px; border-top: 1px solid var(--line); }
.related-pages a { min-height: 48px; display: flex; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); font-size: 14px; font-weight: 700; text-align: center; text-decoration: none; }
.related-pages a:hover { border-color: var(--accent); background: var(--surface); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.25fr 0.75fr 1fr; gap: 48px; padding: 48px 0; }
.site-footer p, .site-footer address { margin: 8px 0 0; color: var(--text); font-size: 15px; font-style: normal; line-height: 1.7; }
.footer-nav { display: grid; align-content: start; }
.site-footer address a { min-height: 38px; display: flex; align-items: center; }
.site-footer address span { display: block; margin-top: 8px; }
.copyright { padding: 18px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.copyright-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.copyright a { color: var(--accent); text-underline-offset: 3px; }

@media (max-width: 1023px) {
    .wrap { width: min(var(--max), calc(100% - 48px)); }
    .primary-nav, .header-action { display: none; }
    .mobile-menu { position: relative; display: block; }
    .home-hero-copy, .product-hero-grid, .feature-grid, .split-section, .detail-grid { grid-template-columns: 1fr; }
    .migrated-page-hero-grid { grid-template-columns: 1fr; gap: 34px; }
    .migrated-page-visual { max-width: 720px; }
    .home-hero-copy { gap: 26px; }
    .hero-side { max-width: 720px; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-card:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 0.85fr 1.15fr; }
    .product-card:last-child .product-card-image { position: relative; min-height: 260px; }
    .product-card:last-child .product-card-image img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
    .product-card:last-child .product-card-body { min-height: 235px; }
    .feature-grid, .split-section, .detail-grid { gap: 38px; }
    .feature-image { max-width: 680px; }
    .product-hero-grid { gap: 34px; }
    .product-hero-image img { height: 400px; }
    .facts-grid { grid-template-columns: 1fr; }
    .facts article, .facts article + article { padding: 19px 0; border-top: 1px solid var(--line); border-left: 0; }
    .facts article:first-child { border-top: 0; }
}

@media (max-width: 719px) {
    .wrap { width: min(100% - 40px, var(--max)); }
    .header-row { min-height: 68px; }
    .brand-logo { width: 154px; }
    .kicker { font-size: 11px; }
    .home-hero { padding-top: 46px; }
    .home-hero-copy { gap: 20px; }
    .home-hero h1 { font-size: 36px; line-height: 1.1; letter-spacing: -0.03em; }
    .hero-side > p, .product-hero .lead, .archive-hero .narrow-heading > p:not(.kicker) { font-size: 17px; }
    .actions { flex-direction: column; }
    .actions .button { width: 100%; }
    .panorama { margin-top: 30px; }
    .panorama-image { height: 320px; border-radius: 16px; }
    .image-label { position: static; width: auto; padding: 18px 0 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
    .proof { margin-top: 30px; }
    .proof-row { grid-template-columns: 1fr; }
    .proof article, .proof article + article { padding: 19px 0; border-top: 1px solid var(--line); border-left: 0; }
    .proof article:first-child { border-top: 0; }
    .proof strong { font-size: 19px; }
    .section { padding: 58px 0; }
    .section h2, .cta h2, .split-section h2, .detail-grid h2, .feature-copy h2 { font-size: 29px; line-height: 1.2; }
    .product-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 28px; }
    .product-card:last-child { grid-column: auto; display: flex; }
    .product-card:last-child .product-card-image { position: static; min-height: 0; }
    .product-card:last-child .product-card-image img { position: static; height: auto; aspect-ratio: 16 / 10; }
    .product-card-body, .product-card:last-child .product-card-body { min-height: auto; padding: 22px; }
    .product-card h2, .product-card h3 { font-size: 21px; }
    .feature-grid, .split-section, .detail-grid { gap: 30px; }
    .feature-copy > p:not(.kicker), .company-copy > p, .intro { font-size: 16px; }
    .cta { padding: 58px 0; }
    .cta-row { display: block; padding: 28px 24px; }
    .cta .button { width: 100%; margin-top: 24px; }
    .product-hero { padding: 46px 0; }
    .product-hero-grid { gap: 28px; }
    .product-hero h1, .archive-hero h1, .standard-page h1 { font-size: 35px; line-height: 1.1; }
    .product-hero-image img { height: 310px; border-radius: 16px; }
    .capability-grid, .role-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 28px; }
    .capability-card { padding: 22px; }
    .capability-card h3 { font-size: 20px; }
    .timeline-item { grid-template-columns: 44px 1fr; gap: 12px; }
    .archive-hero { padding: 52px 0 18px; }
    .archive-products { padding-top: 18px; }
    .standard-page { padding: 52px 0; }
    .migrated-page-hero { padding: 46px 0; }
    .migrated-page-hero-grid { gap: 26px; }
    .migrated-page-hero h1 { font-size: 35px; line-height: 1.1; }
    .migrated-page-visual img { height: 280px; border-radius: 16px; }
    .migrated-page-content { padding: 50px 0 60px; }
    .page-lead { font-size: 18px; }
    .entry-content { font-size: 16px; }
    .entry-content h2 { margin-top: 38px; font-size: 25px; }
    .fact-list > div, .contact-details > div { grid-template-columns: 1fr; gap: 4px; }
    .certificate-grid { grid-template-columns: 1fr; gap: 16px; }
    .certificate-card img { height: 420px; }
    .map-frame iframe { height: 360px; }
    .related-pages { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; padding: 44px 0; }
    .copyright-row { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
