/*
Theme Name: Astra Child
Theme URI: https://camteh.ru
Template: astra
Author: OOO Kamtehenergo
Description: Дочерняя тема Astra с программно сверстанной главной страницей (front-page.php) для ООО «Камтех-Энерго». Цветовая палитра и шрифты — из brandbook.json (Фаза 1 миграции).
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: astra-child
*/

/* ==========================================================================
   BRANDBOOK VARIABLES (see ../../../camteh.local/brandbook.json)
   ========================================================================== */
:root {
    --color-brand-blue: #4285f4;
    --color-brand-blue-hover: #2c6cd6;
    --color-brand-green: #82b440;
    --gradient-accent: linear-gradient(90deg, #00f0ff 0%, #ebacfd 100%);

    --bg-dark-navy-1: #0d192a;
    --bg-dark-navy-2: #1f252f;
    --bg-dark-navy-3: #2f3b4a;
    --bg-footer-top: #242427;
    --bg-light: #f7f8fa;
    --bg-page-light-grey: #e4e6e8;

    --text-body: #14181f;
    --text-post: #3a3a3a;
    --text-muted: #8a90a0;
    --text-on-dark: #ffffff;
    --text-on-dark-muted: #b7c0d1;

    --accent-green: #86d375;
    --accent-cyan: #1fc6d5;
    --accent-salmon: #f47272;
    --accent-light-green: #aae980;
    --accent-lavender: #9f7bfb;
    --accent-orange: #fbb439;

    --font-primary: 'Open Sans', Arial, sans-serif;
    --font-display: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif;

    /* Premium spacing: never less than 90px top/bottom, even on small screens. */
    --section-padding-y: clamp(90px, 9vw, 140px);
    --container-max: 1200px;
    --radius: 8px;
    --shadow-resting: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 25px 35px -8px rgba(0, 0, 0, 0.18);
}

@font-face {
    font-family: 'Century Gothic';
    src: url('fonts/CenturyGothic_gdi.woff') format('woff'),
         url('fonts/CenturyGothic_gdi.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   SITE HEADER (Astra) - applies site-wide, not just the front page, so it
   is intentionally NOT scoped under #front-page.
   ========================================================================== */
#masthead {
    position: relative;
    z-index: 100;
}

#masthead .ast-primary-header-bar {
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 4px 26px rgba(13, 25, 42, 0.09);
    border-bottom: 0 !important;
}

#masthead .site-primary-header-wrap,
#masthead .ast-main-header-bar-alignment,
#masthead .ast-site-identity {
    display: flex;
    align-items: center;
}

#masthead .custom-logo-link img {
    max-height: clamp(38px, 4vw, 52px);
    width: auto;
}

#masthead .main-navigation ul li a {
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Header must show only the logo + menu. Astra's header builder can add a
   phone number / custom HTML item (.ast-header-custom-item) or an HTML-5
   element - none is configured right now, but this stays as a guard so one
   never silently reappears. Also drop the redundant text site title next
   to the logo image - one brand mark is enough. */
#masthead .ast-header-custom-item,
#masthead .ast-builder-html-element,
#masthead .ast-header-html,
#masthead .ast-site-title-wrap {
    display: none !important;
}

/* ==========================================================================
   SCROLL-REVEAL ANIMATIONS (see js/reveal.js)
   ========================================================================== */
.reveal,
.reveal-group > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    will-change: opacity, transform;
}

.reveal.is-visible,
.reveal-group > *.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   BASE / LAYOUT HELPERS
   ========================================================================== */
#front-page * { box-sizing: border-box; }

#front-page {
    font-family: var(--font-primary);
    color: var(--text-body);
    line-height: 1.6;
    overflow-x: hidden;
}

#front-page h1,
#front-page h2,
#front-page h3 {
    font-family: var(--font-display);
    font-weight: 400;
    margin: 0;
}

#front-page a {
    text-decoration: none;
}

#front-page .fp-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

#front-page .fp-section-title {
    font-size: clamp(28px, 4vw, 42px);
    text-align: center;
    margin-bottom: 16px;
    position: relative;
}

#front-page .fp-section-title:after {
    content: '';
    display: block;
    width: 90px;
    height: 3px;
    margin: 22px auto 0;
    border-radius: 3px;
    background: var(--gradient-accent);
}

#front-page .fp-section-lede {
    text-align: center;
    max-width: 640px;
    margin: 0 auto clamp(36px, 5vw, 56px);
    color: var(--text-muted);
    font-size: clamp(15px, 1.4vw, 17px);
}

/* ==========================================================================
   BLOCK 1 - HERO SLIDER (Swiper 11, loaded from CDN - see functions.php)
   ========================================================================== */
#front-page .fp-hero {
    position: relative;
}

/* Astra's own dynamically-generated CSS (astra_page_layout filter in
   functions.php sets body class ast-plain-container/ast-page-builder) emits
   BOTH ".ast-container{max-width:100%}" AND, later in the same inline
   <style> block, an unconditional ".ast-container{max-width:1240px}" for
   its site-wide "container width" setting - same selector, same
   specificity, so the later one wins and still caps our content on wide
   screens. Astra's usual fix for this (negative-margin "alignfull" blocks)
   only applies to Gutenberg block content inside .entry-content, which
   front-page.php never uses (it's a raw custom template) - so it never
   kicks in here either. #content is a real ID that exists on every page,
   giving this selector enough specificity to win regardless of source
   order, without needing !important; scoped to body.home so it only
   affects the front page's own container, not every page's. */
body.home #content .ast-container {
    max-width: 100%;
}

/* Wraps the slider + stats strip so the two of them together fit exactly
   one screen (viewport height minus the ~80px header) with no page scroll.
   Goes edge-to-edge via Astra's own "page-builder" layout (see
   camteh_front_page_layout() in functions.php) instead of the old
   100vw/negative-margin CSS hack, which clipped on wide screens because it
   couldn't see/escape Astra's own content container max-width past ~1200px. */
#front-page .fp-hero-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 80px);
    overflow: hidden;
}

#front-page .fp-hero-swiper {
    flex-grow: 1;
    height: auto;
    min-height: 0; /* allow this flex item to size from flex-grow, not content */
    width: 100%;
    max-width: 100%;
}

#front-page .fp-hero-swiper .swiper-slide {
    width: 100%;
    height: 100%;
}

/* Background photo comes from an inline style (background-image, set in
   front-page.php per slide) - this rule just makes sure it fills the slide
   properly and stays put as a positioning context for the ::before overlay. */
#front-page .fp-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-on-dark);
    padding: 24px;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Dark overlay between the photo and the text (z-index:1 vs. content's 2) -
   the client-provided renders are bright/detailed enough that plain white
   text would get lost without this. */
#front-page .fp-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(17, 24, 39, 0.65);
}

#front-page .fp-slide-content {
    position: relative;
    z-index: 2;
    max-width: 820px;
}

/* Swiper pagination/navigation restyled to match the brand instead of
   Swiper's default blue. */
#front-page .fp-hero-swiper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #fff;
    opacity: 0.5;
}

#front-page .fp-hero-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--color-brand-blue);
}

#front-page .fp-hero-swiper .swiper-button-prev,
#front-page .fp-hero-swiper .swiper-button-next {
    color: #fff;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

#front-page .fp-hero-swiper .swiper-button-prev:hover,
#front-page .fp-hero-swiper .swiper-button-next:hover {
    opacity: 1;
}

#front-page .fp-hero-swiper .swiper-button-prev:after,
#front-page .fp-hero-swiper .swiper-button-next:after {
    font-size: 22px;
}

/* ---- CTA button + scroll hint, stacked vertically and centered.
   Both .fp-btn and .fp-scroll-hint are inline-level elements, so without
   this wrapper they'd flow side by side on the same line instead of the
   arrow sitting under the button. ---- */
#front-page .fp-hero-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

/* ---- Scroll hint (bouncing chevron under the hero CTA) ---- */
#front-page .fp-scroll-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0.85;
    animation: fp-bounce 2s ease-in-out infinite;
}

#front-page .fp-scroll-hint svg {
    width: clamp(26px, 2.6vw, 34px);
    height: clamp(26px, 2.6vw, 34px);
}

#front-page .fp-scroll-hint:hover {
    opacity: 1;
}

@keyframes fp-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(10px); }
}

@media (prefers-reduced-motion: reduce) {
    #front-page .fp-scroll-hint {
        animation: none;
    }
}

#front-page .fp-hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: clamp(12px, 1.1vw, 14px);
    color: #9fd0ff;
    margin-bottom: 22px;
    display: inline-block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Slide headline/subtitle - explicit white + shadow (rather than relying on
   inherited color) since these renders are bright/busy enough that text can
   sit on almost any part of the image, not just the darkest corners. */
#front-page .fp-hero h1,
#front-page .fp-hero h2 {
    font-size: clamp(32px, 6vw, 64px);
    line-height: 1.15;
    margin-bottom: 26px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#front-page .fp-hero-subtitle {
    font-size: clamp(16px, 2.2vw, 20px);
    color: rgba(255, 255, 255, 0.88);
    max-width: 640px;
    margin: 0 auto 42px;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#front-page .fp-btn {
    display: inline-block;
    padding: 18px 44px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

#front-page .fp-btn-primary {
    background: var(--gradient-accent);
    /* Dark text for contrast against the light cyan/pink gradient ends. */
    color: var(--bg-dark-navy-1);
    box-shadow: 0 12px 34px rgba(0, 240, 255, 0.28);
}

#front-page .fp-btn-primary:hover {
    transform: scale(1.06);
    box-shadow: 0 16px 42px rgba(235, 172, 253, 0.4);
}

/* ==========================================================================
   BLOCK 2 - NUMBERS (compact, 6 columns, editable via Customizer)
   ========================================================================== */
#front-page .fp-numbers {
    flex-shrink: 0;
    width: 100%;
    max-width: none;
    background: #1f252f;
}

#front-page .fp-numbers-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    width: 100%;
    max-width: none;
    background: #1f252f;
    margin: 0;
    gap: 0;
}

#front-page .fp-number-item {
    text-align: center;
    padding: clamp(12px, 1.6vw, 20px) 8px;
    /* Per-column accent (set inline via --stat-color, brandbook palette). */
    border-top: 2px solid var(--stat-color, var(--color-brand-blue));
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#front-page .fp-number-item:last-child {
    border-right: none;
}

#front-page .fp-number {
    display: inline-block;
    font-family: var(--font-display);
    font-size: clamp(19px, 2vw, 28px);
    font-weight: 700;
    line-height: 1;
    color: var(--stat-color, var(--color-brand-blue));
    border-bottom: 2px solid var(--stat-color, var(--color-brand-blue));
    padding-bottom: 6px;
    margin-bottom: 8px;
}

#front-page .fp-number-label {
    display: block;
    color: var(--text-on-dark-muted);
    font-size: clamp(10px, 0.85vw, 12px);
    line-height: 1.35;
    letter-spacing: 0.02em;
    max-width: 150px;
    margin: 0 auto;
}

/* ==========================================================================
   BLOCK 3 - SERVICES
   ========================================================================== */
#front-page .fp-services {
    background: var(--bg-light);
    padding: var(--section-padding-y) 24px;
}

#front-page .fp-services-grid {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(20px, 3vw, 32px);
}

#front-page .fp-service-card {
    display: block;
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
    border-radius: var(--radius);
    padding: 34px 26px 30px;
    box-shadow: var(--shadow-resting);
    border-top: 4px solid var(--card-accent, var(--color-brand-blue));
    color: var(--text-body);
    transition: all 0.3s ease;
}

#front-page .fp-service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

/* Client-provided illustration, pinned to the top-right corner as a subtle
   watermark behind the text. The source PNGs have white backgrounds -
   mix-blend-mode: multiply drops the white out (multiplying white by
   anything leaves it unchanged, so it reads as "transparent" against the
   card's own white background) without needing pre-cut transparent PNGs.
   Low opacity keeps it decorative rather than competing with the text. */
#front-page .service-illustration {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 140px;
    height: 140px;
    object-fit: contain;
    z-index: 0;
    mix-blend-mode: multiply;
    opacity: 0.15;
    pointer-events: none;
}

/* Text sits above the illustration (z-index:2 vs. its 0). */
#front-page .fp-service-body {
    position: relative;
    z-index: 2;
}

#front-page .fp-service-card h3 {
    font-size: clamp(17px, 1.6vw, 20px);
    font-family: var(--font-primary);
    font-weight: 700;
    margin-bottom: 10px;
}

#front-page .fp-service-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

/* ==========================================================================
   BLOCK 4 - PROJECTS
   ========================================================================== */
#front-page .fp-projects {
    background: #fff;
    padding: var(--section-padding-y) 24px;
}

/* Flex instead of grid: with an odd number of cards (5), a 3-column grid
   leaves the last row's 2 cards pinned to the left. Flex-wrap +
   justify-content:center lets a short last row center itself instead -
   same fix as .services-grid on the "Услуги" page. */
#front-page .fp-projects-grid {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

#front-page .fp-project-card {
    display: block;
    width: calc(33.333% - 20px);
    min-width: 320px;
    max-width: 400px;
    color: var(--text-body);
    border-radius: var(--radius);
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--shadow-resting);
    transition: all 0.3s ease;
}

#front-page .fp-project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

#front-page .fp-project-thumb {
    aspect-ratio: 4 / 3;
    background: var(--bg-dark-navy-3);
    overflow: hidden;
}

#front-page .fp-project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease-out;
}

#front-page .fp-project-card:hover .fp-project-thumb img {
    transform: scale(1.05);
}

#front-page .fp-project-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-dark-navy-2), var(--bg-dark-navy-3));
}

#front-page .fp-project-card h3 {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(14px, 1.2vw, 16px);
    line-height: 1.4;
    padding: 18px 20px 22px;
    margin: 0;
}

#front-page .fp-projects-more {
    text-align: center;
    margin-top: 46px;
}

#front-page .fp-projects-more a {
    color: var(--color-brand-blue);
    font-weight: 700;
    font-size: 15px;
    border-bottom: 2px solid var(--color-brand-blue);
    padding-bottom: 3px;
}

#front-page .fp-projects-more a:hover {
    color: var(--color-brand-blue-hover);
    border-color: var(--color-brand-blue-hover);
}

/* ==========================================================================
   BLOCK 5 - CONTACTS  (no forms - display only, per 152-FZ)
   ========================================================================== */
/* Light section, deliberately NOT --bg-dark-navy-1/--text-on-dark* (those
   stay dark for the hero/numbers blocks) - a dark contacts block here used
   to visually fuse with the dark global footer right below it, making the
   bottom of the page feel heavy. White/light-grey matches the Услуги and
   Проекты sections above it, and the extra bottom padding keeps it from
   touching the footer. */
#front-page .fp-contacts {
    background: #ffffff;
    padding: var(--section-padding-y) 24px;
    padding-bottom: calc(var(--section-padding-y) + 40px);
}

#front-page .fp-contacts .fp-section-title {
    color: #2a303b;
}

#front-page .fp-contacts .fp-section-lede {
    color: #555555;
}

#front-page .fp-contacts-grid {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(18px, 2.5vw, 26px);
}

#front-page .fp-contact-block {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-top: 3px solid var(--color-brand-blue, #4285f4);
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    padding: 28px 22px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#front-page .fp-contact-block:hover {
    transform: translateY(-7px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

#front-page .fp-contact-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: clamp(11px, 1vw, 13px);
    color: #7a8089;
    margin-bottom: 14px;
}

#front-page .fp-contact-value {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(18px, 2vw, 22px);
    color: #2a303b;
    line-height: 1.4;
}

a.fp-contact-value:hover {
    color: var(--color-brand-blue);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 980px) {
    /* 6 columns -> 3x2: drop the right border at the end of each row
       (every 3rd item) instead of the old 4-col left-border scheme. */
    #front-page .fp-numbers-grid { grid-template-columns: repeat(3, 1fr); }
    #front-page .fp-number-item:nth-child(3n) { border-right: none; }
    #front-page .fp-services-grid { grid-template-columns: repeat(2, 1fr); }
    #front-page .fp-project-card { width: calc(50% - 15px); }
    #front-page .fp-contacts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    /* 6 columns -> 2x3: right border drops at every 2nd item instead; the
       980px breakpoint's nth-child(3n) rule no longer applies at this
       column count, so it needs to be explicitly restored here. */
    #front-page .fp-numbers-grid { grid-template-columns: repeat(2, 1fr); }
    #front-page .fp-number-item:nth-child(3n) { border-right: 1px solid rgba(255, 255, 255, 0.1); }
    #front-page .fp-number-item:nth-child(2n) { border-right: none; }
    #front-page .fp-services-grid { grid-template-columns: 1fr; }
    #front-page .fp-project-card { width: 100%; min-width: 0; max-width: 400px; }
    #front-page .fp-contacts-grid { grid-template-columns: 1fr; }
    #front-page .fp-section-lede { margin-bottom: 40px; }
}

/* ==========================================================================
   PAGE TEMPLATE: "О компании" (page-about.php) - vertical tabs, no reload.
   Not scoped under #front-page - this runs on a normal Astra content page.
   ========================================================================== */
.about-wrapper {
    display: flex;
    gap: 40px;
    margin: 40px 0;
    align-items: flex-start;
}

.about-sidebar {
    flex: 0 0 250px;
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 24px;
}

.about-tab-btn {
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 14px 18px 14px 22px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius);
    transition: background 0.2s ease, color 0.2s ease;
}

/* Left accent rail on the active item, matching the old site's own
   left-menu active-state treatment: solid brand blue (#4285f4) plus a
   light grey background, so the active tab is unmistakable at a glance. */
.about-tab-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 2px;
    background: transparent;
    transition: background 0.2s ease;
}

.about-tab-btn:hover {
    background: var(--bg-light);
    color: var(--text-body);
}

.about-tab-btn.active {
    background: var(--bg-light);
    color: var(--color-brand-blue);
    font-weight: 700;
}

.about-tab-btn.active::before {
    background: var(--color-brand-blue);
}

.about-content-area {
    flex-grow: 1;
    min-width: 0;
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-resting);
    padding: 40px clamp(24px, 4vw, 48px);
}

.about-tab-pane {
    display: none;
}

.about-tab-pane.active {
    display: block;
    animation: fadeSlideUp 0.4s ease forwards;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.about-tab-pane h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(22px, 2.6vw, 30px);
    margin: 0 0 20px;
    color: var(--text-body);
}

.about-tab-pane p {
    color: var(--text-post);
    line-height: 1.7;
    margin: 0 0 16px;
}

.about-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.about-list li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 12px;
    color: var(--text-post);
    line-height: 1.6;
}

.about-list li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-brand-blue);
}

/* Requisites: label/value pairs as a two-column grid instead of a plain
   HTML table - dt/dd land in successive grid cells in source order, so
   they still pair up correctly without extra wrapper markup. */
.about-requisites-grid {
    display: grid;
    grid-template-columns: minmax(200px, 340px) 1fr;
    margin: 0;
}

.about-requisites-grid dt,
.about-requisites-grid dd {
    padding: 14px 0;
    border-bottom: 1px solid var(--bg-page-light-grey);
}

.about-requisites-grid dt {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    padding-right: 24px;
}

.about-requisites-grid dd {
    margin: 0;
    color: var(--text-body);
}

.about-requisites-grid dd a {
    color: var(--color-brand-blue);
}

/* Documents as buttons, not bare links. */
.about-documents-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.about-doc-btn {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: var(--bg-light);
    border-radius: var(--radius);
    color: var(--text-body);
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-resting);
    transition: all 0.3s ease;
}

.about-doc-btn svg {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: var(--color-brand-blue);
}

.about-doc-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    color: var(--color-brand-blue);
}

@media (max-width: 782px) {
    .about-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .about-sidebar {
        flex: none;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        position: static;
    }

    .about-tab-btn {
        width: auto;
        flex: 1 1 auto;
        text-align: center;
        padding-left: 18px;
    }

    /* Active indicator moves from a left rail to a bottom rail once the
       sidebar itself switches from a vertical list to a horizontal row. */
    .about-tab-btn::before {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: auto;
        height: 3px;
    }

    .about-content-area {
        padding: 28px 20px;
    }

    .about-requisites-grid {
        grid-template-columns: 1fr;
    }

    .about-requisites-grid dt {
        padding-bottom: 4px;
        border-bottom: none;
    }

    .about-requisites-grid dd {
        padding-top: 0;
    }
}

/* ==========================================================================
   PAGE TEMPLATE: "Услуги" root (page-services.php) - animated card grid.
   Not scoped under #front-page - runs on a normal Astra content page.
   ========================================================================== */
.services-page-wrapper {
    padding: 40px 0;
}

/* Floats as its own white panel on the page's normal white/transparent
   background - the shadow alone is what separates it visually now that
   the wrapper no longer has a grey backdrop behind it. */
.services-intro-box {
    background: #ffffff;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    line-height: 1.7;
    color: #333;
}

/* Flex instead of grid: with an odd number of cards (5), a 3-column grid
   leaves the last row's 2 cards pinned to the left. Flex-wrap +
   justify-content:center lets a short last row center itself instead. */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.service-card {
    position: relative;
    display: block;
    overflow: hidden;
    /* ~3 per row on desktop; min/max-width keep cards from getting too
       narrow or too wide as they wrap down to 2, then 1, per row. */
    width: calc(33.333% - 20px);
    min-width: 320px;
    max-width: 400px;
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-resting);
    /* Corporate-dark bottom rail, matching the old site's own service cards. */
    border-bottom: 6px solid #2a303b;
    color: var(--text-body);
    text-decoration: none;
    opacity: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease forwards;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fixed-height, centered icon stage - keeps the client's illustrations
   (some much larger/differently-proportioned than others) from stretching
   the card or breaking the grid's row heights. */
.service-card-thumb {
    height: 220px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
    /* Clips the hover zoom below so the enlarged image can't spill out
       over the card body/rounded corners. */
    overflow: hidden;
}

.service-card-thumb img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    /* Source PNGs have white backgrounds - multiply drops the white out
       against this box's own near-white background, same treatment as the
       front-page service card illustrations. */
    mix-blend-mode: multiply;
    transition: transform 0.4s ease;
}

.service-card:hover .service-card-thumb img {
    transform: scale(1.08);
}

.service-card-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 64px 24px 24px;
    min-height: 88px;
}

.service-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    font-family: var(--font-primary);
    line-height: 1.4;
    transition: color 0.3s ease;
}

.service-card:hover .service-card-title {
    color: var(--color-brand-blue, #4285f4);
}

/* Round arrow button, bottom-right corner of the card. */
.service-card-arrow {
    position: absolute;
    right: 20px;
    bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #2a303b;
    color: #ffffff;
    transition: background 0.3s ease, transform 0.3s ease;
}

.service-card-arrow svg {
    width: 18px;
    height: 18px;
}

.service-card:hover .service-card-arrow {
    background: var(--color-brand-blue);
    transform: rotate(45deg);
}

@media (max-width: 980px) {
    .service-card {
        width: calc(50% - 15px);
    }
}

@media (max-width: 600px) {
    .service-card {
        width: 100%;
        min-width: 0;
        max-width: 400px;
    }

    .services-intro-box {
        padding: 24px;
    }
}

/* ==========================================================================
   PAGE TEMPLATE: Service detail (page-service-single.php)
   ========================================================================== */
.single-service-wrapper {
    display: flex;
    gap: 40px;
    margin: 32px 0 60px;
    align-items: flex-start;
}

.service-content {
    flex-grow: 1;
    min-width: 0;
}

.service-content h1 {
    border-left: 4px solid var(--color-brand-blue);
    padding-left: 20px;
    margin-bottom: 28px;
    line-height: 1.3;
}

.service-content h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(20px, 2.2vw, 26px);
    margin: 32px 0 16px;
    color: var(--text-body);
}

.service-content h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-body);
    margin: 24px 0 10px;
}

.service-content p {
    color: var(--text-post);
    line-height: 1.7;
    margin: 0 0 16px;
}

.service-content ul {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.service-content ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    color: var(--text-post);
    line-height: 1.6;
}

.service-content ul li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-brand-blue);
}

.service-sidebar {
    flex: 0 0 300px;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 24px;
}

.service-director-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 26px 24px;
}

.service-director-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.service-director-name {
    margin: 0 0 16px;
    font-family: var(--font-display);
    font-size: 19px;
    color: var(--text-body);
}

.service-director-contacts {
    list-style: none;
    margin: 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--bg-page-light-grey);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-director-contacts li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
}

.service-director-contacts li span {
    color: var(--text-muted);
    font-size: 12px;
}

.service-director-contacts li a {
    color: var(--color-brand-blue);
    font-weight: 600;
}

.service-sidebar-thumb {
    border-radius: var(--radius);
    overflow: hidden;
    line-height: 0;
}

.service-sidebar-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.service-sidebar-cta {
    display: block;
    text-align: center;
    padding: 16px 20px;
    border-radius: var(--radius);
    background: var(--color-brand-blue);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.service-sidebar-cta:hover {
    background: var(--color-brand-blue-hover);
    color: #fff;
}

@media (max-width: 782px) {
    .single-service-wrapper {
        flex-direction: column;
    }

    .service-sidebar {
        flex: none;
        width: 100%;
        position: static;
    }
}

/* ==========================================================================
   PAGE TEMPLATE: "Проекты" root (page-projects.php) - card grid, structurally
   identical to "Услуги"'s .services-grid/.service-card (see that section
   above) but under its own .project-card-* classes, since these cards show
   real photography (object-fit: cover, no blend mode) instead of icons.
   ========================================================================== */
.projects-page-wrapper {
    padding: 40px 0;
}

.projects-intro-box {
    background: #ffffff;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    line-height: 1.7;
    color: #333;
}

.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.project-card {
    position: relative;
    display: block;
    overflow: hidden;
    width: calc(33.333% - 20px);
    min-width: 320px;
    max-width: 400px;
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-resting);
    border-bottom: 6px solid #2a303b;
    color: var(--text-body);
    text-decoration: none;
    opacity: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease forwards;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.project-card-thumb {
    height: 220px;
    width: 100%;
    background: #fafafa;
    overflow: hidden;
}

.project-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.project-card:hover .project-card-thumb img {
    transform: scale(1.08);
}

.project-card-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 64px 24px 24px;
    min-height: 88px;
}

.project-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    font-family: var(--font-primary);
    line-height: 1.4;
    transition: color 0.3s ease;
}

.project-card:hover .project-card-title {
    color: var(--color-brand-blue, #4285f4);
}

.project-card-arrow {
    position: absolute;
    right: 20px;
    bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #2a303b;
    color: #ffffff;
    transition: background 0.3s ease, transform 0.3s ease;
}

.project-card-arrow svg {
    width: 18px;
    height: 18px;
}

.project-card:hover .project-card-arrow {
    background: var(--color-brand-blue);
    transform: rotate(45deg);
}

@media (max-width: 980px) {
    .project-card {
        width: calc(50% - 15px);
    }
}

@media (max-width: 600px) {
    .project-card {
        width: 100%;
        min-width: 0;
        max-width: 400px;
    }

    .projects-intro-box {
        padding: 24px;
    }
}

/* ==========================================================================
   PAGE TEMPLATE: Project detail (single-projects.php) - title + collapsible
   modern-project-table (several of these run 40-60+ rows).
   ========================================================================== */
.project-single-wrapper {
    margin: 40px 0;
}

.project-single-wrapper h1 {
    margin-bottom: 24px;
}

/* Sub-heading used inside the aggregated "Диагностика" post's content
   (turbine/electrical/structural sub-tables concatenated under their own
   <h3> - see the one-off script that built that post). */
.projects-subtable-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 22px;
    margin: 40px 0 0;
}

.projects-subtable-title:first-child {
    margin-top: 0;
}

.table-collapse-wrapper {
    position: relative;
    max-height: 400px;
    overflow-x: auto;
    overflow-y: hidden;
    transition: max-height 0.5s ease;
}

.table-collapse-wrapper::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.table-collapse-wrapper.expanded {
    max-height: 20000px;
}

.table-collapse-wrapper.expanded::after {
    opacity: 0;
}

.toggle-table-btn {
    display: block;
    margin: 24px auto 0;
    padding: 14px 32px;
    background: #2a303b;
    color: #ffffff;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.toggle-table-btn:hover {
    background: var(--color-brand-blue);
}

.toggle-table-btn span {
    display: inline-block;
    transition: transform 0.3s ease;
}

.table-collapse-wrapper.expanded ~ .toggle-table-btn span {
    transform: rotate(180deg);
}

.project-back-link {
    display: inline-block;
    margin-top: 30px;
    color: var(--color-brand-blue);
    font-weight: 600;
    text-decoration: none;
}

.project-back-link:hover {
    text-decoration: underline;
}

/* modern-project-table: rebuilt by the migration parser from raw Bitrix
   <table class="table_border" border="1" ...> dumps - the old inline
   borders/attributes are stripped, only rowspan/colspan survive since a
   couple of tables (e.g. diagnostika-elektrotekhnicheskogo) rely on them. */
.modern-project-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    background: #fff;
}

.modern-project-table th,
.modern-project-table td {
    padding: 15px 20px;
    border: none;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}

.modern-project-table th {
    background: #2a303b;
    color: #ffffff;
    font-weight: 600;
}

.modern-project-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.modern-project-table tbody tr:hover {
    background-color: #f1f5f9;
    transition: 0.2s;
}

@media (max-width: 782px) {
    .modern-project-table th,
    .modern-project-table td {
        padding: 12px 14px;
        font-size: 14px;
    }
}

/* ==========================================================================
   PAGE TEMPLATE: "Контакты" (page-contacts.php) - two centered office
   cards, no form. post_content is deliberately unused/cleared - the old
   raw content was a Bitrix feedback <form> (152-FZ forbids forms/personal-
   data collection on this site), so the cards are hardcoded in the
   template instead of read from the_content().
   ========================================================================== */
.contacts-page-wrapper {
    padding: 60px 0;
    background-color: #f4f5f7;
}

.contacts-page-wrapper h1 {
    text-align: center;
}

.offices-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.office-card {
    background: #ffffff;
    padding: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    width: calc(50% - 20px);
    min-width: 300px;
    max-width: 500px;
    text-align: center;
    border-top: 4px solid var(--color-brand-blue, #4285f4);
}

.office-card h3 {
    margin-bottom: 20px;
    color: #2a303b;
}

.office-card .office-address {
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}

.contact-link {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: 0.3s;
}

.contact-link:hover {
    color: var(--color-brand-blue, #4285f4);
}

/* ==========================================================================
   GLOBAL FOOTER (footer.php) - dark 3-column footer shown on every page,
   recreated from the old site's design. No feedback form (152-FZ).
   ========================================================================== */

/* Sticky footer: #page (opened in Astra parent's header.php) becomes the
   flex column, #content (the actual page content wrapper) grows to fill
   any leftover viewport height on short pages, pushing <footer> down to
   the bottom instead of leaving a gap under it. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#page {
    display: flex;
    flex-direction: column;
    flex: 1;
}

#content {
    flex: 1 0 auto;
}

.site-footer {
    background-color: #2a303b;
    color: #a0a5ad;
    font-size: 14px;
}

.custom-footer-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.footer-columns {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-col {
    flex: 1;
    min-width: 250px;
}

.footer-col-logo img {
    max-width: 200px;
    height: auto;
}

.footer-phone a {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: block;
    margin-bottom: 15px;
    transition: color 0.3s;
}

.footer-phone a:hover,
.footer-email a:hover,
.footer-services-list a:hover {
    color: var(--color-brand-blue, #4285f4);
}

.footer-address,
.footer-email {
    margin-bottom: 10px;
    line-height: 1.6;
}

.footer-email a {
    color: #a0a5ad;
    text-decoration: none;
}

.footer-heading {
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-services-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-services-list li {
    margin-bottom: 12px;
    line-height: 1.4;
}

.footer-services-list a {
    color: #a0a5ad;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-bottom-bar {
    background-color: #222730;
    padding: 20px;
    text-align: left;
}

.footer-copyright {
    max-width: 1200px;
    margin: 0 auto;
    color: #7a8089;
    font-size: 13px;
}

@media (max-width: 782px) {
    .custom-footer-wrapper {
        padding: 40px 20px;
    }

    .footer-columns {
        flex-direction: column;
        gap: 32px;
    }

    .footer-col {
        min-width: 0;
        text-align: center;
    }

    .footer-col-logo img {
        margin: 0 auto;
    }

    .footer-bottom-bar {
        text-align: center;
    }
}

/* ==========================================================================
   COOKIE CONSENT BANNER (footer.php + js/cookie-notice.js) - 152-FZ.
   Slides up from off-screen (bottom: -100px -> 0) once js/cookie-notice.js
   adds .show, after checking localStorage so it doesn't reappear once
   accepted. No form/personal data collected - a single dismiss button.
   ========================================================================== */
.cookie-notice-banner {
    position: fixed;
    bottom: -100px;
    left: 0;
    width: 100%;
    background: #2a303b;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: bottom 0.5s ease;
    font-size: 14px;
    flex-wrap: wrap;
    text-align: center;
}

.cookie-notice-banner.show {
    bottom: 0;
}

.cookie-notice-text a {
    color: var(--color-brand-blue, #4285f4);
    text-decoration: underline;
}

.cookie-btn {
    background: var(--color-brand-blue, #4285f4);
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.cookie-btn:hover {
    background: #3367d6;
}
