/* ======================================================================
   RAD — Центр радиационных технологий
   Brand: fresh green #9CCC52 (DNA-helix mark) + charcoal + white
   ====================================================================== */

:root {
    --green: #9CCC52;
    --green-600: #7FB23B;
    --green-700: #6A9A2E;
    --ink: #20262b;
    --ink-soft: #4a555c;
    --muted: #f4f7f0;
    --line: #e3e8df;
    --white: #ffffff;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(32, 38, 43, .08);
    --shadow-lg: 0 18px 48px rgba(32, 38, 43, .14);
    /* One width for the whole site — header, footer, sections, text and card
       grids all share it (centered), so every block lines up on both edges. */
    --maxw: 920px;
    --content-w: var(--maxw);
    --header-h: 80px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "PT Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--white);
    line-height: 1.65;
    font-size: 17px;
}

h1, h2, h3, h4 {
    font-family: "Montserrat", system-ui, sans-serif;
    line-height: 1.2;
    color: var(--ink);
    font-weight: 700;
}

a { color: var(--green-700); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--green-600); }

img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.skip-link {
    position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff;
    padding: 10px 16px; z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; color: #fff; }

/* ---------------------------------------------------------------- Header */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(140%) blur(6px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    min-height: var(--header-h); gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 60px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
    font-family: "Montserrat", sans-serif; font-weight: 800;
    font-size: 28px; letter-spacing: 1px; color: var(--ink);
}
.brand-tagline {
    font-size: 11px; color: var(--ink-soft); letter-spacing: .3px; margin-top: 3px;
    text-transform: lowercase;
}
/* On wide screens (where there's gutter room) hang the green helix into the
   left margin so the "RAD" wordmark lines up with the content's left edge. */
@media (min-width: 1080px) {
    .brand { margin-left: calc(-1 * (60px + 12px)); }  /* mark width + gap */
}

/* Nav */
.main-nav .nav-list {
    list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0;
}
.nav-item { position: relative; }
.nav-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px; border-radius: 8px;
    font-family: "Montserrat", sans-serif; font-weight: 600; font-size: 15px;
    color: var(--ink);
}
.nav-link:hover { color: var(--green-700); background: var(--muted); }
.nav-link.is-active { color: var(--green-700); }
.caret {
    width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid currentColor; opacity: .7;
}
.dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; min-width: 280px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); list-style: none; margin: 0; padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .16s ease;
}
.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown li a {
    display: block; padding: 9px 12px; border-radius: 7px; color: var(--ink); font-size: 15px;
    font-family: "Montserrat", sans-serif; font-weight: 500;
}
.dropdown li a:hover { background: var(--muted); color: var(--green-700); }
.dropdown li a.is-active { color: var(--green-700); }

.nav-toggle {
    display: none; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 40px; background: none; border: 1px solid var(--line);
    border-radius: 8px; cursor: pointer; padding: 0 10px;
}
.nav-toggle span { height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------------------------------------------------------- Hero */
.hero {
    position: relative; color: #fff; overflow: hidden;
    background: linear-gradient(135deg, #5d8a2a 0%, #7FB23B 45%, #9CCC52 100%);
}
.hero-bg {
    position: absolute; inset: 0; background-size: cover; background-position: center;
}
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(120deg, rgba(38, 58, 18, .82) 0%, rgba(60, 92, 28, .58) 60%, rgba(90, 130, 40, .42) 100%);
}
.hero-content { position: relative; padding: 88px 0 96px; max-width: var(--content-w); }
.hero-heading {
    color: #fff; font-size: clamp(30px, 5vw, 50px); font-weight: 800; margin: 0 0 18px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}
.hero-intro { font-size: 19px; color: rgba(255, 255, 255, .96); }
.hero-intro p { margin: 0 0 14px; }
.hero-content .btn { margin-top: 16px; }

/* ---------------------------------------------------------------- Buttons */
.btn {
    display: inline-block; padding: 13px 28px; border-radius: 30px;
    font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 15px;
    cursor: pointer; border: 2px solid transparent; transition: all .18s ease;
}
.btn-primary { background: #fff; color: var(--green-700); }
.btn-primary:hover { background: var(--ink); color: #fff; transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--green-700); }
.btn-light:hover { background: var(--green-700); color: #fff; transform: translateY(-2px); }

/* ---------------------------------------------------------------- Sections */
.section { padding: 64px 0; }
.section-muted { background: var(--muted); }
.section-title {
    font-size: clamp(24px, 3.4vw, 34px); margin: 0 0 36px; text-align: left;
    position: relative; padding-bottom: 16px;
}
.section-title::after {
    content: ""; position: absolute; left: 0; bottom: 0;
    width: 64px; height: 4px; background: var(--green); border-radius: 4px;
}

/* Readable text column — left-aligned to the container edge (NOT centered),
   so it shares a left edge with page headings and card grids. */
.prose { max-width: var(--content-w); }
/* The first body element shouldn't add its own top margin on top of the
   section padding (e.g. pages whose content starts with an h2 heading).
   Blocks are wrapped in .block-* divs, so zero the inner element too. */
.prose > :first-child,
.prose > :first-child > :first-child { margin-top: 0; }
.prose.intro, .intro { font-size: 18px; }

/* Rich text */
.richtext h2, .section-heading {
    font-size: clamp(21px, 2.6vw, 27px); margin: 36px 0 14px; color: var(--ink);
}
.richtext h3 { font-size: 21px; margin: 28px 0 12px; }
.richtext h4 { font-size: 18px; margin: 22px 0 10px; }
.richtext p { margin: 0 0 16px; }
.richtext ul, .richtext ol { margin: 0 0 18px; padding-left: 4px; }
.richtext ul { list-style: none; }
.richtext ul li {
    position: relative; padding-left: 30px; margin-bottom: 10px;
}
.richtext ul li::before {
    content: ""; position: absolute; left: 6px; top: 11px;
    width: 9px; height: 9px; border-radius: 50%; background: var(--green);
}
.richtext ol { padding-left: 22px; }
.richtext ol li { margin-bottom: 10px; }
.richtext a { text-decoration: underline; }
.richtext hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }

/* Figures & galleries */
.content-figure { margin: 24px 0; }
.content-figure img { border-radius: var(--radius); box-shadow: var(--shadow); margin-inline: auto; }
.content-figure figcaption {
    font-size: 14px; color: var(--ink-soft); margin-top: 8px; text-align: center;
}
.lead-figure { margin-top: 0; margin-bottom: 30px; }

/* Single-row image carousel (CSS scroll-snap; buttons enhanced by JS). */
.carousel { position: relative; margin: 28px 0; }
.carousel-track {
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: 16px;
    overflow-x: auto; scroll-snap-type: x proximity; scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;  /* hide scrollbar (nav via buttons) */
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-item {
    flex: 0 0 auto; width: clamp(230px, 30%, 280px); scroll-snap-align: start;
}
.carousel-item a {
    display: block; aspect-ratio: 4 / 3; overflow: hidden;
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.carousel-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.carousel-item a:hover img { transform: scale(1.05); }
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
    background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-lg); cursor: pointer;
    font-family: "Montserrat", sans-serif; font-size: 24px; line-height: 1; color: var(--ink);
    display: flex; align-items: center; justify-content: center; padding-bottom: 3px;
    z-index: 2; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.carousel-btn:hover { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-btn[hidden] { display: none; }
.carousel-item a { cursor: zoom-in; }

/* ---------------------------------------------------------------- Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 6vh 7vw; background: rgba(16, 20, 17, .9);
    opacity: 0; transition: opacity .2s ease;
}
.lightbox.is-open { opacity: 1; }
.lightbox[hidden] { display: none; }
.lightbox-img {
    max-width: 100%; max-height: 100%; object-fit: contain;
    border-radius: 8px; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); background: #fff;
}
.lightbox-btn {
    position: absolute; z-index: 2; cursor: pointer; border: none;
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255, 255, 255, .14); color: #fff;
    font-family: "Montserrat", sans-serif; font-size: 30px; line-height: 1;
    display: flex; align-items: center; justify-content: center; padding-bottom: 4px;
    transition: background .15s ease;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, .3); }
.lightbox-close { top: 18px; right: 22px; font-size: 34px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-btn[hidden] { display: none; }
@media (max-width: 600px) {
    .lightbox { padding: 8vh 12px; }
    .lightbox-btn { width: 42px; height: 42px; font-size: 26px; }
    .lightbox-prev { left: 6px; }
    .lightbox-next { right: 6px; }
}

/* ---------------------------------------------------------------- Cards */
.card-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px;
}
@media (max-width: 600px) {
    .card-grid { grid-template-columns: 1fr; }
}
.card {
    display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
    color: var(--ink); transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); color: var(--ink); }
.card-media { aspect-ratio: 3 / 2; background: var(--muted); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.06); }
.card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 19px; margin: 0 0 10px; }
.card-text { color: var(--ink-soft); font-size: 15.5px; margin: 0 0 16px; flex: 1; }
.card-link { color: var(--green-700); font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 15px; }

/* ---------------------------------------------------------------- Page head */
.page-head {
    background: var(--muted); border-bottom: 1px solid var(--line); padding: 40px 0;
}
.page-head h1 { font-size: clamp(26px, 4vw, 40px); margin: 0; }
.breadcrumb { font-size: 14px; color: var(--ink-soft); margin-bottom: 12px; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--green-700); }
.breadcrumb span { margin: 0 6px; opacity: .6; }

/* ---------------------------------------------------------------- Contact */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact-list { list-style: none; margin: 22px 0 0; padding: 0; }
.contact-list li {
    display: flex; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.contact-label {
    flex: 0 0 130px; color: var(--ink-soft); font-family: "Montserrat", sans-serif;
    font-weight: 600; font-size: 14px;
}
.contact-value { color: var(--ink); font-weight: 500; }
.contact-map iframe, .contact-map > * {
    width: 100% !important; min-height: 360px; border: 0; border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- CTA band */
.cta-band { background: linear-gradient(135deg, var(--green-700), var(--green-600)); color: #fff; }
.cta-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 40px 22px; flex-wrap: wrap;
}
.cta-inner p {
    margin: 0; font-size: 20px; font-family: "Montserrat", sans-serif; font-weight: 600;
    flex: 1 1 auto; min-width: 0; max-width: 620px;
}

/* ---------------------------------------------------------------- Footer */
.site-footer { background: #1c2226; color: #c4ccd1; margin-top: 0; }
.footer-inner {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 36px 48px;
    padding: 54px 22px 40px;
}
.footer-brand { max-width: 340px; }
.footer-inner .footer-col { max-width: 400px; }
.footer-mark { width: 64px; margin-bottom: 14px; }
.footer-company { font-family: "Montserrat", sans-serif; font-weight: 700; color: #fff; font-size: 19px; margin: 0 0 4px; }
.footer-sub { font-size: 14px; color: #97a2a9; margin: 0; }
.site-footer h3 {
    color: #fff; font-size: 16px; margin: 0 0 16px; text-transform: uppercase; letter-spacing: .6px;
}
.site-footer p { margin: 0 0 8px; font-size: 15px; }
.site-footer a { color: #c4ccd1; }
.site-footer a:hover { color: var(--green); }
.footer-hours { color: #97a2a9; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 18px 0; }
.footer-bottom .container { font-size: 14px; color: #8a949b; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 880px) {
    .nav-toggle { display: flex; }
    .main-nav {
        position: absolute; top: var(--header-h); left: 0; right: 0;
        background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
        max-height: 0; overflow: hidden; transition: max-height .28s ease;
    }
    .main-nav.open { max-height: 80vh; overflow-y: auto; }
    .main-nav .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 14px 18px; }
    .nav-link { padding: 13px 8px; border-radius: 0; }
    .dropdown {
        position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
        border: none; padding: 0 0 6px 14px; min-width: 0;
    }
    .footer-inner { gap: 28px; }
    .footer-brand, .footer-inner .footer-col { max-width: none; }
    .contact-layout { grid-template-columns: 1fr; }
    .cta-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
    body { font-size: 16px; }
    .brand-name { font-size: 24px; }
    .brand-mark { width: 48px; }
    .hero-content { padding: 60px 22px 64px; }
    .section { padding: 48px 0; }
}
