/* ==========================================================================
   Study4you — shared template (clean HTML5 layout for all inner pages)
   ========================================================================== */

:root {
    --brand: #f28c1f;
    --brand-dark: #d9730a;
    --accent: #b3202a;
    --ink: #1d2433;
    --ink-soft: #4a5568;
    --muted: #7b8494;
    --line: #e6e9ef;
    --bg: #ffffff;
    --bg-soft: #f6f7fa;
    --dark: #151b26;
    --radius: 14px;
    --container: 1180px;
    --shadow: 0 10px 30px rgba(21, 27, 38, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand-dark); }
a:hover { color: var(--accent); }

.container { width: min(var(--container), calc(100% - 40px)); margin: 0 auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.topbar { background: var(--dark); color: #cfd5df; font-size: 13px; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; }
.topbar__phones { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; white-space: nowrap; }
.topbar a:hover { color: var(--brand); }
.topbar__city { color: #9aa3b2; margin-right: 6px; }

/* no backdrop-filter here: it would turn the header into the containing block of the fixed mobile menu */
.site-header { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 28px; min-height: 76px; }
.logo { flex: 0 0 auto; display: block; line-height: 0; }
.logo img { width: 190px; height: auto; }

.nav { flex: 1; display: flex; justify-content: flex-end; }
.nav__list { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav__item { position: relative; }
.nav__link {
    display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; border: 0; border-radius: 10px;
    background: none; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.nav__link:hover, .nav__item.is-open > .nav__link { background: var(--bg-soft); color: var(--brand-dark); }
.nav__link[aria-current="page"] { color: var(--brand-dark); }
.nav__caret { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.nav__item.is-open .nav__caret { transform: translateY(1px) rotate(-135deg); }
.nav__dropdown {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; padding: 10px; margin: 0; list-style: none;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s;
}
.nav__dropdown--cols { columns: 2; column-gap: 8px; min-width: 380px; }
.nav__item.is-open > .nav__dropdown { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) and (min-width: 1025px) {
    .nav__item:hover > .nav__dropdown { opacity: 1; visibility: visible; transform: none; }
}
.nav__dropdown a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; break-inside: avoid; }
.nav__dropdown a:hover { background: var(--bg-soft); color: var(--brand-dark); }

.header-cta {
    flex: 0 0 auto; display: inline-flex; align-items: center; padding: 11px 18px; border-radius: 999px;
    background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.header-cta:hover { background: var(--brand-dark); color: #fff; }

.menu-toggle { display: none; width: 44px; height: 44px; margin-left: auto; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.menu-toggle span { display: block; width: 20px; height: 2px; margin: 4px auto; background: var(--ink); transition: transform .2s, opacity .2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Page hero / breadcrumbs ---------- */
.page-hero {
    position: relative; overflow: hidden; padding: 44px 0 40px;
    background: linear-gradient(120deg, #fff4e8 0%, #fff 55%, #fdeeee 100%);
    border-bottom: 1px solid var(--line);
}
.page-hero::after {
    content: ""; position: absolute; right: -60px; bottom: -80px; width: 320px; height: 320px; border-radius: 50%;
    background: radial-gradient(circle, rgba(242, 140, 31, .18), rgba(242, 140, 31, 0) 70%);
}
.breadcrumbs { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; color: #b7bdc8; }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand-dark); }
.page-hero h1 { position: relative; z-index: 1; max-width: 900px; margin: 0; font-size: clamp(28px, 4vw, 44px); line-height: 1.15; letter-spacing: -0.01em; }

/* ---------- Content ---------- */
.page-main { padding: 44px 0 64px; }
.prose { max-width: 860px; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2em 0 .6em; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; }
.prose h3 { margin: 1.6em 0 .5em; font-size: 20px; line-height: 1.3; }
.prose h4, .prose h5, .prose h6 { margin: 1.4em 0 .4em; font-size: 17px; }
.prose h2::after { content: ""; display: block; width: 48px; height: 3px; margin-top: 12px; border-radius: 2px; background: var(--brand); }
.prose p { margin: 0 0 1em; color: var(--ink-soft); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; color: var(--ink-soft); }
.prose li { margin: .35em 0; }
.prose ul li::marker { color: var(--brand); }
.prose blockquote { margin: 1.5em 0; padding: 18px 22px; border-left: 4px solid var(--brand); background: var(--bg-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.prose figure { margin: 1.5em 0; }
.prose img { display: block; border-radius: var(--radius); }
.prose p img { display: inline-block; vertical-align: middle; }
.prose .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 1.5em 0; }
.prose .gallery img { width: 100%; height: 170px; object-fit: cover; }
.prose .video { position: relative; margin: 1.5em 0; aspect-ratio: 16 / 9; }
.prose .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }
.prose .map iframe { width: 100%; height: 380px; border: 0; border-radius: var(--radius); }
.table-wrap { margin: 1.5em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; color: var(--ink-soft); }
.prose tr:last-child td { border-bottom: 0; }
.prose th, .prose thead td, .prose tr:first-child th { background: var(--bg-soft); color: var(--ink); font-weight: 700; }
.prose tbody tr:nth-child(even) td { background: #fbfbfd; }
.prose .btn, .btn {
    display: inline-flex; align-items: center; justify-content: center; padding: 12px 22px; border-radius: 999px;
    background: var(--brand); color: #fff; font-weight: 700; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn--ghost:hover { background: var(--bg-soft); color: var(--ink); }

/* listing pages (WordPress archives) */
.prose .card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin: 1.5em 0; padding: 0; list-style: none; }
.prose .card-list li { margin: 0; }
.prose .card-list li::marker { content: none; }
.prose .card {
    display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; color: var(--ink); text-decoration: none; transition: box-shadow .2s, transform .2s;
}
.prose a.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.card__media { display: block; aspect-ratio: 16 / 10; background: var(--bg-soft); }
.card__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.card__body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.card__title { font-weight: 700; font-size: 17px; line-height: 1.3; }
.card__text { color: var(--ink-soft); font-size: 14px; }
.card__price { margin-top: auto; color: var(--brand-dark); font-weight: 800; }

/* ---------- CTA ---------- */
.cta { padding: 56px 0; background: var(--dark); color: #fff; }
.cta .container { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.cta h2 { margin: 0 0 10px; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; }
.cta p { margin: 0; color: #c3cad6; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.cta .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.cta .btn--ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: #0f141d; color: #aeb6c4; font-size: 15px; }
.site-footer .container { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 32px; padding: 52px 0 36px; }
.footer-brand__name { display: block; color: #fff; font-size: 24px; font-weight: 800; letter-spacing: .02em; }
.footer-brand__name span { color: var(--brand); }
.footer-brand__tag { display: block; margin-top: 2px; color: #8e97a7; font-size: 13px; }
.site-footer h3 { margin: 0 0 14px; color: #fff; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin: 0 0 8px; }
.site-footer a { color: #aeb6c4; text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.footer-address { margin: 14px 0 0; font-style: normal; line-height: 1.6; }
.socials { display: flex; gap: 10px; margin-top: 18px; }
.socials a { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid #2c3445; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; }
.socials a:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.footer-bottom { border-top: 1px solid #222a38; background: var(--accent); color: #fbe9ea; font-size: 13px; }
.footer-bottom .container { display: block; padding: 14px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .site-header .container { gap: 16px; }
    .nav__link { padding: 10px 9px; font-size: 14px; }
    .header-cta { display: none; }
}

@media (max-width: 1024px) {
    .menu-toggle { display: block; }
    .nav {
        position: fixed; inset: 114px 0 0 0; display: block; padding: 12px 20px 40px; overflow-y: auto;
        background: #fff; border-top: 1px solid var(--line);
        transform: translateX(100%); transition: transform .25s ease; visibility: hidden;
    }
    .nav.is-open { transform: none; visibility: visible; }
    .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
    .nav__item { border-bottom: 1px solid var(--line); }
    .nav__link { width: 100%; justify-content: space-between; padding: 16px 4px; font-size: 16px; border-radius: 0; }
    .nav__link:hover, .nav__item.is-open > .nav__link { background: none; }
    .nav__dropdown, .nav__dropdown--cols {
        position: static; display: none; min-width: 0; columns: 2; padding: 0 0 12px; border: 0; box-shadow: none;
        opacity: 1; visibility: visible; transform: none;
    }
    .nav__item.is-open > .nav__dropdown { display: block; }
    body.nav-open { overflow: hidden; }
    .site-footer .container { grid-template-columns: 1fr 1fr; }
    .cta .container { grid-template-columns: 1fr; }
    .cta__actions { justify-content: flex-start; }
}

@media (max-width: 640px) {
    .container { width: calc(100% - 32px); }
    .topbar .container { justify-content: center; }
    .topbar__note { display: none; }
    .topbar__phones { gap: 14px; justify-content: center; }
    .site-header .container { min-height: 64px; }
    .logo img { width: 150px; }
    .nav { inset: 102px 0 0 0; }
    .nav__dropdown, .nav__dropdown--cols { columns: 1; }
    .page-hero { padding: 30px 0 28px; }
    .page-main { padding: 30px 0 48px; }
    .prose table { font-size: 14px; }
    .prose th, .prose td { padding: 10px; }
    .site-footer .container { grid-template-columns: 1fr; gap: 26px; padding: 40px 0 28px; }
    .cta { padding: 40px 0; }
    .cta__actions .btn { flex: 1 1 100%; }
}
