/*
Theme Name: Voenschet themes
Theme URI: https://voenschet.ru
Author: Varlamov V.V.
Description: Enhanced WP Theme for Voenschet.ru
Version: 2.2.0
Text Domain: voenschet.ru
License: GPL-2.0-or-later
*/

/* ==================== CSS CUSTOM PROPERTIES ==================== */
:root {
    /* Primary Colors */
    --c-primary: #0d3a7a;
    --c-primary-dark: #0a2d5f;
    --c-primary-light: #e7f1ff;
    --c-primary-rgb: 13, 58, 122;

    /* Secondary Colors */
    --c-secondary: #6c757d;
    --c-secondary-light: #adb5bd;
    --c-secondary-dark: #495057;

    /* Neutral Colors */
    --c-text: #212529;
    --c-text-light: #525252;
    --c-text-muted: #595959;
    --c-bg: #f8f9fa;
    --c-surface: #fff;
    --c-surface-alt: #f1f3f4;
    --c-white: #fff;
    --c-black: #000;

    /* Status Colors */
    --c-success: #28a745;
    --c-warning: #ffc107;
    --c-danger: #dc3545;
    --c-info: #17a2b8;

    /* Border & Dividers */
    --c-border: #dee2e6;
    --c-border-light: #e9ecef;
    --c-border-dark: #adb5bd;

    /* Layout */
    --header-h: 4rem;
    --wrap-pad: 1.5rem;
    --wrap-max: 1320px;
    --sidebar-w: 280px;

    /* Border Radius */
    --r-xs: 0.125rem;
    --r-sm: 0.25rem;
    --r: 0.5rem;
    --r-lg: 0.75rem;
    --r-xl: 1rem;
    --r-2xl: 1.5rem;
    --r-full: 9999px;

    /* Shadows */
    --sh-xs: 0 1px 2px rgba(0,0,0,0.05);
    --sh-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --sh: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --sh-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --sh-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --sh-inner: inset 0 2px 4px rgba(0,0,0,0.06);

    /* Transitions */
    --tr-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --tr: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --tr-slow: 0.45s cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* Typography */
    --font-body: Tahoma, Geneva, sans-serif;
    --font-heading: "Trebuchet MS", Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Spacing */
    --space-0: 0;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Footer colors */
    --footer-bg: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    --footer-text: #e0e0e0;
    --footer-link: #adb5bd;
    --footer-link-hover: #fff;

    /* Bootstrap Overrides */
    --bs-blue: var(--c-primary);
    --bs-primary: var(--c-primary);
    --bs-primary-rgb: var(--c-primary-rgb);
}

/* ==================== BASE STYLES ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--c-text);
    background-color: var(--c-bg);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== TYPOGRAPHY ==================== */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--c-text);
    margin-bottom: var(--space-4);
    letter-spacing: -0.025em;
}

h1, .h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-4xl)); }
h2, .h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl)); }
h3, .h3 { font-size: clamp(var(--text-xl), 3vw, var(--text-2xl)); }
h4, .h4 { font-size: var(--text-xl); }
h5, .h5 { font-size: var(--text-lg); }
h6, .h6 { font-size: var(--text-base); }

p, ul, ol, dl { margin-bottom: var(--space-5); }
ul, ol { padding-left: var(--space-6); }
li { margin-bottom: var(--space-2); }
ul li::marker { color: var(--c-primary); }
ol li::marker { color: var(--c-primary); font-weight: 600; }

blockquote {
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-6);
    border-left: 4px solid var(--c-primary);
    background: var(--c-primary-light);
    font-style: italic;
    border-radius: 0 var(--r) var(--r) 0;
    position: relative;
}

blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 4rem;
    color: var(--c-primary);
    opacity: 0.2;
    font-family: Georgia, serif;
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--c-surface-alt);
    padding: 0.125rem 0.375rem;
    border-radius: var(--r-xs);
    color: var(--c-danger);
    border: 1px solid var(--c-border-light);
}

pre {
    font-family: var(--font-mono);
    background: var(--c-surface-alt);
    padding: var(--space-4);
    border-radius: var(--r);
    overflow-x: auto;
    margin: var(--space-5) 0;
    border: 1px solid var(--c-border);
    tab-size: 4;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
    border: none;
}

/* ==================== LINKS ==================== */
a {
    color: var(--c-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--tr-fast);
}

a:hover { color: var(--c-primary-dark); }

a:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

/* ==================== IMAGES & MEDIA ==================== */
img, video { max-width: 100%; height: auto; display: block; }
svg { max-width: 100%; height: auto; display: inline-block; }
img { border-radius: var(--r); }
figure { margin: var(--space-6) 0; }

figcaption {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--c-text-light);
    text-align: center;
    font-style: italic;
}

/* ==================== LAYOUT COMPONENTS ==================== */
.container {
    width: 100%;
    padding: 0 var(--wrap-pad);
    margin: 0 auto;
}

@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: var(--wrap-max); } }

.content-area { padding-top: var(--header-h); }

/* ==================== HEADER & NAVIGATION ==================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    min-height: 64px;
    background: var(--c-surface);
    box-shadow: var(--sh-sm);
    z-index: var(--z-fixed);
    border-bottom: 1px solid var(--c-border-light);
    transition: background-color var(--tr), box-shadow var(--tr), border-color var(--tr);
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--sh);
}

.navbar {
    padding: 0 !important;
    height: 100%;
    min-height: 64px;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--c-text) !important;
    text-decoration: none;
    padding: 0 var(--space-4);
    transition: color var(--tr), transform var(--tr);
}

.navbar-brand:hover {
    color: var(--c-primary) !important;
    transform: translateX(2px);
}

.navbar-brand img {
    height: 2.5rem;
    margin-right: var(--space-3);
}

.navbar-nav {
    height: 100%;
    align-items: center;
}

.navbar-nav .nav-link {
    padding: var(--space-3) var(--space-4) !important;
    font-weight: 500;
    color: var(--c-text) !important;
    border-radius: var(--r);
    position: relative;
    margin: 0 var(--space-1);
    transition: color var(--tr-fast), background-color var(--tr-fast), transform var(--tr-fast);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--c-primary);
    transition: width var(--tr-fast);
}

.navbar-nav .nav-link:hover {
    color: var(--c-primary) !important;
    background: var(--c-primary-light);
    transform: translateY(-1px);
}

.navbar-nav .nav-link:hover::after { width: 80%; }

.navbar-nav .nav-link.active {
    color: var(--c-white) !important;
    background: var(--c-primary);
    box-shadow: var(--sh-sm);
}

.navbar-nav .nav-link.active::after { display: none; }

/* Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: var(--sh-lg);
    border-radius: var(--r);
    padding: var(--space-2);
    margin-top: var(--space-2);
    min-width: 220px;
}

.dropdown-item {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--r-sm);
    font-weight: 500;
    color: var(--c-text);
    transition: background-color var(--tr-fast), color var(--tr-fast), transform var(--tr-fast);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--c-primary);
    color: var(--c-white);
    transform: translateX(4px);
}

.dropdown-item.active {
    background: var(--c-primary-light);
    color: var(--c-primary);
}

/* Mobile Menu */
.navbar-toggler {
    border: none;
    padding: var(--space-2);
    border-radius: var(--r);
    transition: background-color var(--tr-fast);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-toggler:hover { background: var(--c-surface-alt); }
.navbar-toggler:focus { box-shadow: none; outline: 2px solid var(--c-primary); outline-offset: 2px; }

@media (max-width: 991.98px) {
    .navbar-collapse {
        position: fixed;
        top: var(--header-h);
        right: 0;
        bottom: 0;
        width: min(320px, 80vw);
        background: var(--c-surface);
        padding: var(--space-4);
        padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        transform: translateX(100%);
        transition: transform var(--tr-slow);
        overflow-y: auto;
        z-index: var(--z-fixed); /* Ð¢Ð°ÐºÐ¾Ð¹ Ð¶Ðµ ÐºÐ°Ðº header */
    }

    .navbar-collapse.show { transform: translateX(0); }

    .navbar-nav {
        height: auto;
        margin-top: var(--space-4);
    }

    .navbar-nav .nav-link {
        margin: var(--space-1) 0 !important;
        padding: var(--space-4) !important;
        text-align: center;
        background: var(--c-surface-alt);
    }

    .navbar-nav .nav-link::after { display: none; }
}

/* ==================== TABLES ==================== */
.table-responsive {
    border-radius: var(--r-lg);
    box-shadow: var(--sh);
    background: var(--c-surface);
    margin: var(--space-6) 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table {
    margin-bottom: 0;
    font-size: var(--text-sm);
}

.table thead th {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
    color: var(--c-white);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: var(--text-xs);
    padding: var(--space-4) var(--space-3);
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr { transition: background-color var(--tr-fast); }
.table tbody tr:hover { background: var(--c-primary-light); }

.table tbody td {
    padding: var(--space-3);
    vertical-align: middle;
    border-color: var(--c-border-light);
}

.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(0, 0, 0, 0.02); }
.table-bordered { border: none; }
.table-bordered > :not(caption) > * > * { border-width: 1px; border-color: var(--c-border-light); }

.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-track { background: var(--c-surface-alt); }
.table-responsive::-webkit-scrollbar-thumb { background: var(--c-border-dark); border-radius: var(--r-full); }
.table-responsive::-webkit-scrollbar-thumb:hover { background: var(--c-secondary); }

.table caption {
    caption-side: bottom;
    padding: var(--space-3);
    color: var(--c-text-light);
    font-size: var(--text-sm);
    font-style: italic;
    text-align: left;
}

/* ==================== CARDS ==================== */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border-light);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-sm);
    transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-lg);
    border-color: var(--c-primary-light);
}

.card-header {
    padding: var(--space-4) var(--space-6);
    background: linear-gradient(135deg, var(--c-surface-alt), var(--c-surface));
    border-bottom: 1px solid var(--c-border);
    font-weight: 600;
}

.card-body {
    padding: var(--space-6);
    min-height: 180px;
    contain: layout style;
}

.card-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--c-text);
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--c-text-light);
    margin-bottom: var(--space-3);
}

.card-text {
    color: var(--c-text-light);
    margin-bottom: var(--space-5);
    line-height: var(--leading-relaxed);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    background: var(--c-surface-alt);
    border-top: 1px solid var(--c-border);
    font-size: var(--text-sm);
    color: var(--c-text-light);
}

.card-img-overlay {
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-6);
}

.card-img-overlay .card-title,
.card-img-overlay .card-text { color: var(--c-white); }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--r);
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    transition: transform var(--tr-fast), box-shadow var(--tr-fast), background-color var(--tr-fast), color var(--tr-fast), border-color var(--tr-fast);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before { width: 300px; height: 300px; }

.btn-primary {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
    color: var(--c-white);
    box-shadow: 0 4px 6px rgba(var(--c-primary-rgb), 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(var(--c-primary-rgb), 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(var(--c-primary-rgb), 0.3);
}

.btn-secondary {
    background: var(--c-secondary);
    color: var(--c-white);
}

.btn-secondary:hover {
    background: var(--c-secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--sh);
}

.btn-outline-primary {
    color: var(--c-primary);
    border-color: var(--c-primary);
    background: transparent;
}

.btn-outline-primary:hover {
    color: var(--c-white);
    background: var(--c-primary);
    border-color: var(--c-primary);
    box-shadow: 0 4px 6px rgba(var(--c-primary-rgb), 0.3);
}

.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--text-sm); }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--text-lg); }

.btn-group {
    box-shadow: var(--sh-sm);
    border-radius: var(--r);
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
    box-shadow: none;
}

.btn-group .btn:not(:last-child) { border-right: 1px solid rgba(0, 0, 0, 0.1); }

/* ==================== FORMS ==================== */
.form-group, .mb-3 { margin-bottom: var(--space-5); }

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    color: var(--c-text);
    font-size: var(--text-sm);
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    font-family: inherit;
    line-height: var(--leading-normal);
    color: var(--c-text);
    background: var(--c-surface);
    border: 2px solid var(--c-border);
    border-radius: var(--r);
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast), background-color var(--tr-fast);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 4px rgba(var(--c-primary-rgb), 0.1);
    background: var(--c-surface);
}

.form-control::placeholder { color: var(--c-text-muted); }

.form-control:disabled,
.form-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--c-surface-alt);
}

.input-group {
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--sh-sm);
}

.input-group-text {
    background: var(--c-surface-alt);
    border: 2px solid var(--c-border);
    border-right: none;
    color: var(--c-text-light);
    font-weight: 500;
}

.input-group .form-control { border-left: none; }

.is-valid { border-color: var(--c-success); }
.is-valid:focus { border-color: var(--c-success); box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1); }
.is-invalid { border-color: var(--c-danger); }
.is-invalid:focus { border-color: var(--c-danger); box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1); }

.valid-feedback, .invalid-feedback {
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

.form-check {
    padding-left: 1.75rem;
    margin-bottom: var(--space-3);
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    margin-left: -1.75rem;
    border: 2px solid var(--c-border);
    transition: background-color var(--tr-fast), border-color var(--tr-fast), box-shadow var(--tr-fast);
}

.form-check-input:checked {
    background-color: var(--c-primary);
    border-color: var(--c-primary);
}

.form-check-input:focus { box-shadow: 0 0 0 4px rgba(var(--c-primary-rgb), 0.1); }
.form-check-label { font-weight: 400; cursor: pointer; }
.form-switch .form-check-input { width: 2.5rem; border-radius: 1.25rem; }
.form-switch .form-check-input:checked { background-position: right center; }

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-8) 0;
}

.page-item .page-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--c-text);
    background: var(--c-surface);
    border: 2px solid var(--c-border);
    border-radius: var(--r);
    text-decoration: none;
    overflow: hidden;
    transition: transform var(--tr-fast), background-color var(--tr-fast), color var(--tr-fast), border-color var(--tr-fast), box-shadow var(--tr-fast);
}

.page-item .page-link:hover {
    background: var(--c-primary);
    color: var(--c-white);
    border-color: var(--c-primary);
    transform: translateY(-2px);
    box-shadow: var(--sh-sm);
}

.page-item.active .page-link {
    background: var(--c-primary);
    color: var(--c-white);
    border-color: var(--c-primary);
    box-shadow: var(--sh);
    z-index: 3;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1;
    border-radius: var(--r-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-pill {
    padding-right: var(--space-3);
    padding-left: var(--space-3);
}

/* ==================== ALERTS ==================== */
.alert {
    position: relative;
    padding: var(--space-4) var(--space-6);
    margin-bottom: var(--space-5);
    border: 1px solid transparent;
    border-radius: var(--r);
    font-size: var(--text-sm);
}

.alert-dismissible { padding-right: 3rem; }

.alert-dismissible .btn-close {
    position: absolute;
    top: 50%;
    right: var(--space-4);
    transform: translateY(-50%);
    padding: 0;
    opacity: 0.5;
    transition: opacity var(--tr-fast);
}

.alert-dismissible .btn-close:hover { opacity: 1; }

.alert-primary { background: var(--c-primary-light); border-color: var(--c-primary); color: var(--c-primary-dark); }
.alert-success { background: rgba(40, 167, 69, 0.1); border-color: var(--c-success); color: #155724; }
.alert-warning { background: rgba(255, 193, 7, 0.1); border-color: var(--c-warning); color: #856404; }
.alert-danger { background: rgba(220, 53, 69, 0.1); border-color: var(--c-danger); color: #721c24; }

/* ==================== MODALS ==================== */
.modal-backdrop.show {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    border: none;
    border-radius: var(--r-lg);
    box-shadow: var(--sh-xl);
}

.modal-header {
    background: var(--c-surface-alt);
    border-bottom: 1px solid var(--c-border);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding: var(--space-5) var(--space-6);
}

.modal-title { font-weight: 600; font-size: var(--text-xl); }
.modal-body { padding: var(--space-6); }

.modal-footer {
    background: var(--c-surface-alt);
    border-top: 1px solid var(--c-border);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    padding: var(--space-4) var(--space-6);
}

/* ==================== TOOLTIPS & POPOVERS ==================== */
.tooltip { font-size: var(--text-sm); }

.tooltip-inner {
    background: var(--c-text);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--r);
    max-width: 250px;
}

.popover {
    border: none;
    border-radius: var(--r);
    box-shadow: var(--sh-lg);
}

.popover-header {
    background: var(--c-surface-alt);
    border-bottom: 1px solid var(--c-border);
    font-weight: 600;
    padding: var(--space-3) var(--space-4);
}

.popover-body { padding: var(--space-4); }

/* ==================== BREADCRUMBS ==================== */
.breadcrumb-wrapper { font-size: 0.875rem; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    list-style: none;
    background: transparent;
    color: var(--c-text-muted);
}

.breadcrumb a {
    color: var(--c-text-light);
    text-decoration: none;
    transition: color var(--tr-fast);
}

.breadcrumb a:hover { color: var(--c-primary); text-decoration: none; }
.breadcrumb .breadcrumb_last { color: var(--c-text); font-weight: 500; }

.breadcrumb-item + .breadcrumb-item { padding-left: 0.5rem; }

.breadcrumb-item + .breadcrumb-item::before {
    content: "â€º";
    color: var(--c-text-muted);
    padding-right: 0.5rem;
    font-size: 1rem;
    opacity: 0.7;
}

.breadcrumb-item a {
    color: var(--c-text-light);
    text-decoration: none;
    transition: color var(--tr-fast);
}

.breadcrumb-item a:hover { color: var(--c-primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--c-text); font-weight: 500; }

/* ==================== PROGRESS BARS ==================== */
.progress {
    height: 1rem;
    overflow: hidden;
    background: var(--c-surface-alt);
    border-radius: var(--r-full);
    box-shadow: var(--sh-inner);
}

.progress-bar {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.2) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* ==================== SPINNERS ==================== */
.spinner-border { width: 2rem; height: 2rem; border-width: 0.2rem; }
.spinner-border-sm { width: 1rem; height: 1rem; border-width: 0.15rem; }
.spinner-grow { width: 2rem; height: 2rem; }
.spinner-grow-sm { width: 1rem; height: 1rem; }

/* ==================== SECTIONS & LAYOUT ==================== */
.section { padding: var(--space-16) 0; }
.section-sm { padding: var(--space-12) 0; }
.section-lg { padding: var(--space-24) 0; }

/* Section title - Ñ‚Ð¾Ð»ÑŒÐºÐ¾ Ð´Ð»Ñ Ð³Ð»Ð°Ð²Ð½Ð¾Ð¹ Ð¸ Ð°Ñ€Ñ…Ð¸Ð²Ð¾Ð², ÐÐ• Ð´Ð»Ñ ÐºÐ°Ð»ÑŒÐºÑƒÐ»ÑÑ‚Ð¾Ñ€Ð¾Ð² */
.front-page .section-title,
.archive .section-title,
.home .section-title,
#main-content > .container > .section-title {
    font-family: var(--font-heading);
    font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
    font-weight: 700;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    text-align: center;
    color: var(--c-primary);
    position: relative;
}

.front-page .section-title::after,
.archive .section-title::after,
.home .section-title::after,
#main-content > .container > .section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--c-primary), transparent);
    border-radius: var(--r-full);
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--c-text-light);
    text-align: center;
    margin-bottom: var(--space-8);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: var(--leading-relaxed);
}

/* ==================== GRID SYSTEM ==================== */
.grid { display: grid; gap: var(--space-6); }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

@media (max-width: 992px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ==================== UTILITIES ==================== */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-justify { text-align: justify !important; }
.text-primary { color: var(--c-primary) !important; }
.text-secondary { color: var(--c-secondary) !important; }
.text-success { color: var(--c-success) !important; }
.text-danger { color: var(--c-danger) !important; }
.text-warning { color: var(--c-warning) !important; }
.text-info { color: var(--c-info) !important; }
.text-muted { color: var(--c-text-muted) !important; }
.text-light { color: var(--c-text-light) !important; }
.text-white { color: var(--c-white) !important; }

.bg-primary { background-color: var(--c-primary) !important; }
.bg-secondary { background-color: var(--c-secondary) !important; }
.bg-success { background-color: var(--c-success) !important; }
.bg-danger { background-color: var(--c-danger) !important; }
.bg-warning { background-color: var(--c-warning) !important; }
.bg-info { background-color: var(--c-info) !important; }
.bg-light { background-color: var(--c-bg) !important; }
.bg-dark { background-color: var(--c-text) !important; }
.bg-white { background-color: var(--c-white) !important; }

.border { border: 1px solid var(--c-border) !important; }
.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid var(--c-border) !important; }
.border-end { border-right: 1px solid var(--c-border) !important; }
.border-bottom { border-bottom: 1px solid var(--c-border) !important; }
.border-start { border-left: 1px solid var(--c-border) !important; }

.rounded { border-radius: var(--r) !important; }
.rounded-0 { border-radius: 0 !important; }
.rounded-sm { border-radius: var(--r-sm) !important; }
.rounded-lg { border-radius: var(--r-lg) !important; }
.rounded-xl { border-radius: var(--r-xl) !important; }
.rounded-2xl { border-radius: var(--r-2xl) !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-pill { border-radius: var(--r-full) !important; }

.shadow-none { box-shadow: none !important; }
.shadow-sm { box-shadow: var(--sh-sm) !important; }
.shadow { box-shadow: var(--sh) !important; }
.shadow-lg { box-shadow: var(--sh-lg) !important; }
.shadow-xl { box-shadow: var(--sh-xl) !important; }

.d-none { display: none !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-block { display: block !important; }
.d-grid { display: grid !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-row-reverse { flex-direction: row-reverse !important; }
.flex-column-reverse { flex-direction: column-reverse !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-wrap-reverse { flex-wrap: wrap-reverse !important; }
.flex-fill { flex: 1 1 auto !important; }
.flex-grow-0 { flex-grow: 0 !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.flex-shrink-1 { flex-shrink: 1 !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.justify-content-evenly { justify-content: space-evenly !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-baseline { align-items: baseline !important; }
.align-items-stretch { align-items: stretch !important; }

.align-self-auto { align-self: auto !important; }
.align-self-start { align-self: flex-start !important; }
.align-self-end { align-self: flex-end !important; }
.align-self-center { align-self: center !important; }
.align-self-baseline { align-self: baseline !important; }
.align-self-stretch { align-self: stretch !important; }

.gap-0 { gap: 0 !important; }
.gap-1 { gap: var(--space-1) !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }
.gap-5 { gap: var(--space-5) !important; }

.m-0 { margin: 0 !important; }
.m-auto { margin: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-auto { margin-top: auto !important; margin-bottom: auto !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: var(--space-1) !important; }
.p-2 { padding: var(--space-2) !important; }
.p-3 { padding: var(--space-3) !important; }
.p-4 { padding: var(--space-4) !important; }
.p-5 { padding: var(--space-5) !important; }

.w-25 { width: 25% !important; }
.w-50 { width: 50% !important; }
.w-75 { width: 75% !important; }
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }
.h-25 { height: 25% !important; }
.h-50 { height: 50% !important; }
.h-75 { height: 75% !important; }
.h-100 { height: 100% !important; }
.h-auto { height: auto !important; }

.position-static { position: static !important; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }

.overflow-auto { overflow: auto !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-visible { overflow: visible !important; }
.overflow-scroll { overflow: scroll !important; }

/* ==================== RESPONSIVE UTILITIES ==================== */
@media (min-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-sm-inline { display: inline !important; }
    .d-sm-inline-block { display: inline-block !important; }
    .d-sm-block { display: block !important; }
    .d-sm-grid { display: grid !important; }
    .d-sm-flex { display: flex !important; }
    .d-sm-inline-flex { display: inline-flex !important; }
}
@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-inline { display: inline !important; }
    .d-md-inline-block { display: inline-block !important; }
    .d-md-block { display: block !important; }
    .d-md-grid { display: grid !important; }
    .d-md-flex { display: flex !important; }
    .d-md-inline-flex { display: inline-flex !important; }
}
@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-inline { display: inline !important; }
    .d-lg-inline-block { display: inline-block !important; }
    .d-lg-block { display: block !important; }
    .d-lg-grid { display: grid !important; }
    .d-lg-flex { display: flex !important; }
    .d-lg-inline-flex { display: inline-flex !important; }
}
@media (min-width: 1200px) {
    .d-xl-none { display: none !important; }
    .d-xl-inline { display: inline !important; }
    .d-xl-inline-block { display: inline-block !important; }
    .d-xl-block { display: block !important; }
    .d-xl-grid { display: grid !important; }
    .d-xl-flex { display: flex !important; }
    .d-xl-inline-flex { display: inline-flex !important; }
}
@media (min-width: 1400px) {
    .d-xxl-none { display: none !important; }
    .d-xxl-inline { display: inline !important; }
    .d-xxl-inline-block { display: inline-block !important; }
    .d-xxl-block { display: block !important; }
    .d-xxl-grid { display: grid !important; }
    .d-xxl-flex { display: flex !important; }
    .d-xxl-inline-flex { display: inline-flex !important; }
}

/* ==================== BACK TO TOP BUTTON ==================== */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2350a2;
    color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, background 0.2s, box-shadow 0.2s;
    z-index: var(--z-fixed);
}

.back-to-top.is-visible,
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: #1e3f8a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.back-to-top:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.back-to-top[hidden] { display: none; }

@media (max-width: 575px) {
    .back-to-top { bottom: 15px; right: 15px; width: 44px; height: 44px; }
}

/* ==================== FOOTER ==================== */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: var(--space-16) 0 var(--space-8);
    margin-top: auto;
    content-visibility: auto;
    contain-intrinsic-size: 800px;
    position: relative;
    z-index: 100; /* Ð’Ñ‹ÑˆÐµ Ñ€ÐµÐºÐ»Ð°Ð¼Ñ‹, Ð½Ð¾ Ð½Ð¸Ð¶Ðµ header */
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-widget-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--c-white);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    position: relative;
}

.footer-widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--c-primary);
    border-radius: var(--r-full);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-links a {
    color: var(--footer-link);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color var(--tr-fast), transform var(--tr-fast);
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) 0;
}

.footer-links a:hover {
    color: var(--footer-link-hover);
    transform: translateX(4px);
}

.footer-bottom {
    padding-top: var(--space-8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: var(--text-sm);
    color: rgba(224, 224, 224, 0.7);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

.footer-meta {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-menu li { margin: 0; }

.social-links {
    display: flex;
    gap: var(--space-3);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--r-full);
    color: var(--footer-link);
    text-decoration: none;
    transition: background-color var(--tr-fast), color var(--tr-fast), transform var(--tr-fast);
}

.social-links a:hover {
    background: var(--c-primary);
    color: var(--c-white);
    transform: translateY(-2px);
}

.site-footer .touch-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    text-decoration: none !important;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: inherit;
    transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.site-footer .touch-link svg { width: 22px; height: 22px; transition: transform 0.2s; }

.site-footer .touch-link:hover,
.site-footer .touch-link:focus {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.22);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    outline: none;
}

.site-footer .touch-link[href*="vk.com"]:hover {
    background: rgba(70,130,180,0.12) !important;
    border-color: rgba(70,130,180,0.35) !important;
    color: #7fb3ff !important;
}

.site-footer .touch-link[href*="t.me"]:hover {
    background: rgba(0,136,204,0.12) !important;
    border-color: rgba(0,136,204,0.35) !important;
    color: #66c2ff !important;
}

.site-footer a { color: #bfc5d2 !important; text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: #fff !important; }

@media (max-width: 768px) {
    .footer-content { grid-template-columns: 1fr; gap: var(--space-6); text-align: center; }
    .footer-widget-title::after { left: 50%; transform: translateX(-50%); }
    .footer-bottom { flex-direction: column; text-align: center; }
    .social-links { gap: 8px; }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes bounce { 0%, 20%, 53%, 80%, 100% { transform: translateY(0); } 40%, 43% { transform: translateY(-30px); } 70% { transform: translateY(-15px); } 90% { transform: translateY(-4px); } }

.animate-fade-in { animation: fadeIn 0.6s ease-out; }
.animate-fade-in-up { animation: fadeInUp 0.8s ease-out; }
.animate-fade-in-down { animation: fadeInDown 0.6s ease-out; }
.animate-slide-in-left { animation: slideInLeft 0.8s ease-out; }
.animate-slide-in-right { animation: slideInRight 0.8s ease-out; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-bounce { animation: bounce 1s infinite; }

/* Loading states */
.loading { position: relative; overflow: hidden; }
.loading::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}
@keyframes loading { 0% { left: -100%; } 100% { left: 100%; } }

.skeleton {
    background: linear-gradient(90deg, var(--c-surface-alt) 25%, var(--c-border-light) 50%, var(--c-surface-alt) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
}
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ==================== ACCESSIBILITY ==================== */
.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute;
    top: -40px; left: 6px;
    background: var(--c-primary);
    color: var(--c-white);
    padding: 8px 16px;
    text-decoration: none;
    border-radius: var(--r);
    z-index: 100000;
    transition: top var(--tr-fast);
}
.skip-link:focus { top: 6px; }

*:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0; }

/* ==================== PRINT STYLES ==================== */
@media print {
    *, *::before, *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    a, a:visited { text-decoration: underline; }
    a[href]::after { content: ' (' attr(href) ')'; }
    img { page-break-inside: avoid; }
    h1, h2, h3 { page-break-after: avoid; }
    .site-header, .site-footer, .navbar, .btn, .back-to-top { display: none !important; }
    .content-area { padding-top: 0; }
    .table { border-collapse: collapse !important; }
    .table td, .table th { background-color: #fff !important; }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .animate-pulse, .animate-bounce { animation: none; }
}

/* ==================== HIGH CONTRAST ==================== */
@media (prefers-contrast: high) {
    :root {
        --c-border: #000;
        --c-text-light: var(--c-text);
        --sh-sm: 0 0 0 1px #000;
        --sh: 0 0 0 2px #000;
        --sh-lg: 0 0 0 3px #000;
    }
    .btn { border-width: 3px; }
    .form-control, .form-select { border-width: 3px; }
}

/* ==================== DARK MODE ==================== */
[data-bs-theme="dark"] {
    --c-primary: #3680ff;
    --c-primary-dark: #1a5ed8;
    --c-primary-light: #1a3a6b;
    --c-secondary: #adb5bd;
    --c-text: #f3f4f6;
    --c-text-light: #b6bcc4;
    --c-text-muted: #7d8590;
    --c-bg: #0d1117;
    --c-surface: #161b22;
    --c-surface-alt: #21262d;
    --c-border: #30363d;
    --c-border-light: #262c34;
    --c-border-dark: #484f58;
    --footer-bg: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    --footer-text: #f3f4f6;
    --footer-link: #b6bcc4;
    --footer-link-hover: #fff;
}

[data-bs-theme="dark"] body { color: var(--c-text); background: var(--c-bg); }
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4, [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 { color: var(--c-white); }

[data-bs-theme="dark"] .card { background: var(--c-surface); border-color: var(--c-border); }
[data-bs-theme="dark"] .card-header, [data-bs-theme="dark"] .card-footer { background: var(--c-surface-alt); border-color: var(--c-border); }

[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select {
    background: var(--c-surface); color: var(--c-text); border-color: var(--c-border);
}
[data-bs-theme="dark"] .form-control:focus, [data-bs-theme="dark"] .form-select:focus {
    background: var(--c-surface); color: var(--c-text); border-color: var(--c-primary);
}
[data-bs-theme="dark"] .form-control::placeholder { color: var(--c-text-muted); }

[data-bs-theme="dark"] .table { color: var(--c-text); }
[data-bs-theme="dark"] .table thead th {
    background: linear-gradient(135deg, var(--c-surface-alt), var(--c-surface));
    color: var(--c-text); border-color: var(--c-border);
}
[data-bs-theme="dark"] .table tbody tr:hover { background: rgba(54, 128, 255, 0.1); }
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(255, 255, 255, 0.02); }

[data-bs-theme="dark"] .dropdown-menu { background: var(--c-surface); border-color: var(--c-border); }
[data-bs-theme="dark"] .dropdown-item { color: var(--c-text); }
[data-bs-theme="dark"] .dropdown-item:hover, [data-bs-theme="dark"] .dropdown-item:focus { background: var(--c-primary); color: var(--c-white); }

[data-bs-theme="dark"] .pagination .page-link { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
[data-bs-theme="dark"] .pagination .page-link:hover { background: var(--c-primary); color: var(--c-white); border-color: var(--c-primary); }
[data-bs-theme="dark"] .pagination .page-item.active .page-link { background: var(--c-primary); color: var(--c-white); border-color: var(--c-primary); }

[data-bs-theme="dark"] .breadcrumb a { color: var(--c-text-light); }
[data-bs-theme="dark"] .breadcrumb a:hover { color: var(--c-primary-light); }
[data-bs-theme="dark"] .breadcrumb .breadcrumb_last { color: var(--c-text); }
[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: var(--c-text-muted); }

[data-bs-theme="dark"] .modal-content { background: var(--c-surface); color: var(--c-text); }
[data-bs-theme="dark"] .modal-header, [data-bs-theme="dark"] .modal-footer { background: var(--c-surface-alt); border-color: var(--c-border); }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

[data-bs-theme="dark"] .alert-primary { background: rgba(54, 128, 255, 0.15); border-color: var(--c-primary); color: #a8c8ff; }

[data-bs-theme="dark"] .site-header { background: var(--c-surface); border-bottom-color: var(--c-border); }
[data-bs-theme="dark"] .site-header.scrolled { background: rgba(22, 27, 34, 0.95); }
[data-bs-theme="dark"] .navbar-nav .nav-link:hover { background: rgba(54, 128, 255, 0.1); }

[data-bs-theme="dark"] code { background: var(--c-surface-alt); color: #ff7b72; }
[data-bs-theme="dark"] pre { background: var(--c-surface-alt); border-color: var(--c-border); }
[data-bs-theme="dark"] blockquote { background: rgba(54, 128, 255, 0.1); border-color: var(--c-primary); }

/* ==================== WORDPRESS SPECIFIC ==================== */
.alignleft { float: left; margin-right: var(--space-4); margin-bottom: var(--space-4); }
.alignright { float: right; margin-left: var(--space-4); margin-bottom: var(--space-4); }
.aligncenter { display: block; margin-left: auto; margin-right: auto; margin-bottom: var(--space-4); }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); }
.alignwide { max-width: calc(100% + 10vw); margin-left: -5vw; margin-right: -5vw; }

.wp-block-image { margin-bottom: var(--space-6); }
.wp-block-image img { height: auto; max-width: 100%; }
.wp-block-image.is-style-rounded img { border-radius: var(--r-full); }

.wp-block-quote {
    margin: var(--space-8) 0;
    padding: var(--space-6);
    border-left: 4px solid var(--c-primary);
    background: var(--c-primary-light);
    font-size: var(--text-lg);
}

.wp-block-pullquote {
    padding: var(--space-8) 0;
    text-align: center;
    border-top: 4px solid var(--c-primary);
    border-bottom: 4px solid var(--c-primary);
}

.wp-block-separator { border: none; border-top: 2px solid var(--c-border); margin: var(--space-8) auto; max-width: 100px; }
.wp-block-separator.is-style-wide { max-width: 100%; }
.wp-block-separator.is-style-dots { border: none; text-align: center; line-height: 1; height: auto; }
.wp-block-separator.is-style-dots::before { content: "Â·Â·Â·"; color: var(--c-text-light); font-size: var(--text-2xl); letter-spacing: 1em; padding-left: 1em; }

.wp-block-gallery {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    margin-bottom: var(--space-6);
}
.wp-block-gallery.columns-2 { grid-template-columns: repeat(2, 1fr); }
.wp-block-gallery.columns-3 { grid-template-columns: repeat(3, 1fr); }
.wp-block-gallery.columns-4 { grid-template-columns: repeat(4, 1fr); }
.wp-block-gallery .wp-block-image { margin: 0; }

.comment-list { list-style: none; padding: 0; }
.comment { margin-bottom: var(--space-6); padding: var(--space-4); background: var(--c-surface-alt); border-radius: var(--r); }
.comment-author { display: flex; align-items: center; margin-bottom: var(--space-3); }
.comment-author .avatar { width: 48px; height: 48px; border-radius: var(--r-full); margin-right: var(--space-3); }
.comment-metadata { font-size: var(--text-sm); color: var(--c-text-light); margin-bottom: var(--space-3); }
.comment-content { margin-bottom: var(--space-3); }
.reply { font-size: var(--text-sm); }

.widget { margin-bottom: var(--space-8); }
.widget-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--c-primary);
}
.widget ul { list-style: none; padding: 0; }
.widget ul li { padding: var(--space-2) 0; border-bottom: 1px solid var(--c-border-light); }
.widget ul li:last-child { border-bottom: none; }

.search-form { display: flex; gap: var(--space-2); }
.search-form .search-field {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--c-border);
    border-radius: var(--r);
    font-size: var(--text-sm);
}
.search-form .search-submit {
    padding: var(--space-3) var(--space-6);
    background: var(--c-primary);
    color: var(--c-white);
    border: none;
    border-radius: var(--r);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--tr-fast);
}
.search-form .search-submit:hover { background: var(--c-primary-dark); }

.wp-block-navigation { margin-bottom: var(--space-6); }
.wp-block-navigation ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-4); }
.wp-block-navigation a { color: var(--c-text); text-decoration: none; font-weight: 500; transition: color var(--tr-fast); }
.wp-block-navigation a:hover { color: var(--c-primary); }

/* ==================== FINAL BOOTSTRAP OVERRIDES ==================== */
.btn-primary {
    --bs-btn-bg: var(--c-primary);
    --bs-btn-border-color: var(--c-primary);
    --bs-btn-hover-bg: var(--c-primary-dark);
    --bs-btn-hover-border-color: var(--c-primary-dark);
    --bs-btn-active-bg: var(--c-primary-dark);
    --bs-btn-active-border-color: var(--c-primary-dark);
}
.text-bg-primary { background-color: var(--c-primary) !important; color: var(--c-white) !important; }

/* ==================== RELATED POSTS ==================== */
.vs-related-posts {
    margin-top: var(--space-10);
    padding: var(--space-6);
    background: var(--c-surface);
    border-radius: var(--r-lg);
    border: 1px solid var(--c-border-light);
    box-shadow: var(--sh-sm);
    content-visibility: auto;
    contain-intrinsic-size: 420px;
}

.vs-related-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--c-primary);
    margin: 0 0 var(--space-4);
}

.vs-related-title::before {
    content: "";
    width: 6px;
    height: 24px;
    border-radius: var(--r-full);
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
}

.vs-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-3);
    grid-template-columns: 1fr;
}

.vs-related-item {
    background: var(--c-surface-alt);
    border-radius: var(--r);
    border: 1px solid var(--c-border-light);
    padding: var(--space-3) var(--space-4);
    transition: transform var(--tr-fast), box-shadow var(--tr-fast), border-color var(--tr-fast), background-color var(--tr-fast);
}

.vs-related-link {
    display: block;
    color: var(--c-text);
    font-weight: 600;
    font-size: var(--text-base);
    line-height: var(--leading-snug);
    text-decoration: none;
}

.vs-related-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh);
    border-color: rgba(var(--c-primary-rgb), 0.5);
    background: var(--c-surface);
}

.vs-related-item:hover .vs-related-link { color: var(--c-primary-dark); }

@media (min-width: 768px) { .vs-related-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .vs-related-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

[data-bs-theme="dark"] .vs-related-posts { background: var(--c-surface); border-color: var(--c-border); }
[data-bs-theme="dark"] .vs-related-item { background: var(--c-surface-alt); border-color: var(--c-border); }
[data-bs-theme="dark"] .vs-related-item:hover { background: var(--c-surface); border-color: var(--c-primary); }

/* ==================== CONTENT LINKS ==================== */
.entry-content a:not(.btn):not(.nav-link) { text-decoration: none; }
.entry-content a:not(.btn):not(.nav-link):hover { text-decoration: none; }

/* ==================== FRONT PAGE ==================== */
.home a, .page-template-front-page a { text-decoration: none !important; }

/* Hero section */
.home .hero, .page-template-front-page .hero {
    min-height: 160px;
    contain: layout style;
}

.home .hero-title, .page-template-front-page .hero-title {
    font-size: clamp(1.35rem, 2.5vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.2;
    min-height: 1.5em;
}

.home .hero-subtitle, .page-template-front-page .hero-subtitle {
    margin: 0.25rem 0 0.75rem;
    color: var(--c-text-light);
    line-height: 1.5;
    min-height: 2.5em;
}

.home .hero-cta .btn, .page-template-front-page .hero-cta .btn {
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Tiles */
.home .voen-tile, .page-template-front-page .voen-tile {
    background: var(--c-surface);
    color: var(--c-text);
    border: 2px solid var(--c-surface-alt);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-sm);
    padding: 1rem 0.75rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-base);
    font-weight: 600;
    min-height: 56px;
    text-align: center;
    text-decoration: none;
    transition: background var(--tr-fast), color var(--tr-fast), box-shadow var(--tr-fast), border-color var(--tr-fast), transform var(--tr-fast);
}

.home .voen-tile:hover, .home .voen-tile:focus-visible,
.page-template-front-page .voen-tile:hover, .page-template-front-page .voen-tile:focus-visible {
    background: var(--c-primary-light);
    color: var(--c-primary-dark);
    box-shadow: var(--sh-lg);
    border-color: var(--c-primary-light);
    transform: translateY(-2px) scale(1.02);
    text-decoration: none;
}

.voen-tiles-grid { min-height: 200px; contain: layout style; }

/* Calculator chips */
.home { --calc-ico-box: 40px; --calc-ico-svg: 20px; }

.home .calc-chips-grid, .page-template-front-page .calc-chips-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.home .chip-ico, .page-template-front-page .chip-ico {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.7rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7fbff 0%, #eef4ff 100%);
    border: 1px solid #dbe7ff;
    text-decoration: none;
    color: #13305f;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 1px 6px rgba(37,72,140,0.06);
    min-height: 56px;
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s, border-color 0.12s;
}

.home .chip-ico:hover, .home .chip-ico:focus-visible,
.page-template-front-page .chip-ico:hover, .page-template-front-page .chip-ico:focus-visible {
    border-color: #b7cffb;
    background: linear-gradient(180deg, #f1f7ff 0%, #e6f0ff 100%);
    box-shadow: 0 3px 14px rgba(30,63,128,0.12);
    text-decoration: none;
}

.home .chip-ico__icon, .page-template-front-page .chip-ico__icon {
    width: var(--calc-ico-box);
    height: var(--calc-ico-box);
    min-width: var(--calc-ico-box);
    flex: 0 0 var(--calc-ico-box);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    border-radius: 10px;
    background: #e9f2ff;
    border: 1px solid #cfe0ff;
}

.home .chip-ico__icon svg, .page-template-front-page .chip-ico__icon svg {
    width: var(--calc-ico-svg);
    height: var(--calc-ico-svg);
    display: block;
}

.home .chip-ico__text, .page-template-front-page .chip-ico__text {
    flex: 1 1 auto;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Calculator list */
.home .calc-list, .page-template-front-page .calc-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home .calc-list-link, .page-template-front-page .calc-list-link {
    display: flex;
    align-items: center;
    background: #f6fafd;
    color: #143669;
    border: 1px solid #e3eaf2;
    border-radius: 8px;
    font-weight: 600;
    padding: 0.48em 0.65em;
    font-size: 0.96em;
    transition: background 0.16s, box-shadow 0.16s, color 0.12s, border-color 0.15s;
    box-shadow: 0 1px 4px rgba(33,55,104,0.02);
    text-decoration: none;
}

.home .calc-list-link:hover, .home .calc-list-link:focus-visible,
.page-template-front-page .calc-list-link:hover, .page-template-front-page .calc-list-link:focus-visible {
    background: #eaf3ff;
    color: #0a2b5c;
    border-color: #bad5ff;
    box-shadow: 0 2px 10px rgba(21,47,95,0.06);
    text-decoration: none;
}

.home .calc-list-link .calc-ico, .page-template-front-page .calc-list-link .calc-ico {
    width: var(--calc-ico-box);
    height: var(--calc-ico-box);
    min-width: var(--calc-ico-box);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    border-radius: 10px;
    color: #5191db;
}

.home .calc-list-link .calc-ico svg, .page-template-front-page .calc-list-link .calc-ico svg {
    width: var(--calc-ico-svg);
    height: var(--calc-ico-svg);
}

.home .calc-list-link .chevron, .page-template-front-page .calc-list-link .chevron {
    margin-left: auto;
    color: #b0bccc;
    display: inline-flex;
    transition: color 0.13s;
}

.home .calc-list-link:hover .chevron, .page-template-front-page .calc-list-link:hover .chevron { color: #4176d1; }

/* All calculators button */
.home .calc-all-btn, .page-template-front-page .calc-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.75rem 1.1rem;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
    background: #2350a2;
    color: #fff !important;
    border: none;
    border-radius: 14px;
    text-decoration: none !important;
    box-shadow: 0 6px 16px rgba(35,80,162,0.18);
    transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}

.home .calc-all-btn:hover, .home .calc-all-btn:focus-visible,
.page-template-front-page .calc-all-btn:hover, .page-template-front-page .calc-all-btn:focus-visible {
    background: #1f4a98;
    box-shadow: 0 8px 22px rgba(35,80,162,0.22);
    transform: translateY(-1px);
}

.home .calc-all-btn .all-ico, .page-template-front-page .calc-all-btn .all-ico {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255,255,255,0.14);
}

.home .calc-all-btn .all-ico svg, .page-template-front-page .calc-all-btn .all-ico svg {
    width: 16px;
    height: 16px;
    display: block;
    color: #fff;
}

/* Breakpoints */
@media (min-width: 420px) {
    .home .calc-chips-grid, .page-template-front-page .calc-chips-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 600px) {
    .home { --calc-ico-box: 36px; --calc-ico-svg: 18px; }
    .home .voen-tile, .page-template-front-page .voen-tile { min-height: 48px; padding: 0.6rem 0.7rem; font-size: 0.92rem; }
    .home .calc-list-link, .page-template-front-page .calc-list-link { font-size: 0.93em; padding: 0.36em 0.45em; }
}
@media (max-width: 360px) {
    .home .calc-chips-grid, .page-template-front-page .calc-chips-grid { grid-template-columns: 1fr; }
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
    .home .hero, .page-template-front-page .hero { animation: vsFrontFadeIn 0.4s ease-out; }
    @keyframes vsFrontFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
    .home .voen-tile, .home .calc-list-link, .home .chip-ico, .home .hero { transition: none !important; animation: none !important; }
}

/* Dark mode front page */
[data-bs-theme="dark"] .home .calc-list-link, [data-bs-theme="dark"] .page-template-front-page .calc-list-link {
    background: #232b39;
    color: #d7e6ff;
    border-color: #293650;
    box-shadow: 0 1px 7px rgba(16,24,40,0.08);
}
[data-bs-theme="dark"] .home .calc-list-link:hover, [data-bs-theme="dark"] .page-template-front-page .calc-list-link:hover {
    background: #1a2235;
    color: #b5d0fd;
    border-color: #4067a9;
}
[data-bs-theme="dark"] .home .calc-all-btn, [data-bs-theme="dark"] .page-template-front-page .calc-all-btn {
    background: #284a85;
    box-shadow: 0 6px 16px rgba(24,40,80,0.35);
}
[data-bs-theme="dark"] .home .calc-all-btn:hover, [data-bs-theme="dark"] .page-template-front-page .calc-all-btn:hover { background: #3360b0; }

/* ==================== HEADER EXTRAS ==================== */
.officer-logo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--c-primary-light);
    box-shadow: 0 2px 6px rgba(13,110,253,0.07);
    margin-right: 0.53rem;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

[data-bs-theme="dark"] .officer-logo { background: var(--c-primary-dark); }

.theme-toggle {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.theme-toggle:hover { background: var(--c-surface-alt); }
.theme-toggle:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

.theme-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
}

.theme-icon.dark-mode { display: none; }
[data-bs-theme="dark"] .theme-icon.dark-mode { display: inline; }
[data-bs-theme="dark"] .theme-icon.light-mode { display: none; }

/* Header search */
.search-form-header { display: flex; align-items: center; margin-left: 1rem; }

.search-form-header input[type="search"] {
    padding: 0.5rem 0.75rem;
    border-radius: 1.5rem 0 0 1.5rem;
    border: 1px solid var(--c-border);
    font-size: 0.875rem;
    width: 120px;
    transition: all 0.2s ease;
    background: var(--c-surface);
    color: var(--c-text);
}

.search-form-header input[type="search"]:focus {
    width: 180px;
    border-color: var(--c-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(21,97,214,0.25);
}

.search-form-header button {
    border-radius: 0 1.5rem 1.5rem 0;
    border: 1px solid var(--c-primary);
    border-left: none;
    padding: 0.5rem 0.75rem;
    background: var(--c-primary);
    color: #fff;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form-header button:hover { background: var(--c-primary-dark); }

/* Burger */
.burger-icon { width: 24px; height: 18px; position: relative; transition: transform 0.3s ease; }

.burger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--c-text);
    border-radius: 1px;
    position: absolute;
    transition: all 0.3s ease;
}

.burger-line:nth-child(1) { top: 0; }
.burger-line:nth-child(2) { top: 8px; }
.burger-line:nth-child(3) { top: 16px; }

.navbar-toggler.active .burger-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.navbar-toggler.active .burger-line:nth-child(2) { opacity: 0; }
.navbar-toggler.active .burger-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: 1rem; }

/* Mobile socials */
.mobile-social-links { display: none; }

.mobile-social-links .touch-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    background: var(--c-surface-alt);
    color: var(--c-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-social-links .touch-link:hover,
.mobile-social-links .touch-link:focus {
    color: var(--c-primary);
    background: rgba(21,97,214,0.08);
    transform: translateY(-1px);
}

@media (max-width: 991.98px) {
    .navbar { padding: 0.25rem 0; }
    .navbar-brand { font-size: 1rem; }
    .officer-logo { width: 32px; height: 32px; margin-right: 0.5rem; }
    .theme-toggle { font-size: 1.25rem; width: 40px; height: 40px; }
    .search-form-header { margin: 1rem 0 0 0; width: 100%; }
    .search-form-header input[type="search"] { width: 100%; font-size: 1rem; flex: 1; }
    .search-form-header input[type="search"]:focus { width: 100%; }
    .header-actions { gap: 0.25rem; margin-left: 0.5rem; }
}

@media (max-width: 575.98px) {
    .navbar-brand { font-size: 0.9rem; }
    .officer-logo { width: 28px; height: 28px; }
    .mobile-social-links {
        display: flex;
        justify-content: center;
        gap: 1rem;
        padding: 1rem 0;
        border-top: 1px solid var(--c-border);
        margin-top: 1rem;
    }
}

/* WP admin bar fix - Ð£Ð¡Ð˜Ð›Ð•ÐÐÐ«Ð• Ð¡Ð¢Ð˜Ð›Ð˜ */
body.admin-bar .site-header {
    top: 32px !important;
}

body.admin-bar .content-area {
    padding-top: calc(var(--header-h) + 32px) !important;
}

/* ÐœÐ¾Ð±Ð¸Ð»ÑŒÐ½Ð¾Ðµ Ð¼ÐµÐ½ÑŽ Ñ‚Ð¾Ð¶Ðµ ÑÐ´Ð²Ð¸Ð³Ð°ÐµÐ¼ */
body.admin-bar .navbar-collapse {
    top: calc(var(--header-h) + 32px) !important;
}

@media (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px !important;
    }
    body.admin-bar .content-area {
        padding-top: calc(var(--header-h) + 46px) !important;
    }
    body.admin-bar .navbar-collapse {
        top: calc(var(--header-h) + 46px) !important;
    }
}

/* ÐÐ° Ð¾Ñ‡ÐµÐ½ÑŒ Ð¼Ð°Ð»ÐµÐ½ÑŒÐºÐ¸Ñ… ÑÐºÑ€Ð°Ð½Ð°Ñ… WP admin bar Ð¼Ð¾Ð¶ÐµÑ‚ Ð±Ñ‹Ñ‚ÑŒ ÑÐºÑ€Ñ‹Ñ‚ */
@media (max-width: 600px) {
    body.admin-bar .site-header {
        top: 0 !important;
    }
    body.admin-bar .content-area {
        padding-top: var(--header-h) !important;
    }
    body.admin-bar .navbar-collapse {
        top: var(--header-h) !important;
    }
}

/* ==================== ADS - Ð¢ÐžÐ›Ð¬ÐšÐž Ð¦Ð•ÐÐ¢Ð Ð˜Ð ÐžÐ’ÐÐÐ˜Ð• ==================== */
.caramel-hero-desktop,
.caramel-hero-mobile,
.caramel-ad,
.caramel-ad-mobile,
.caramel-ad-comments,
.caramel-front-mob,
.dc-feed {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ==================== CONTRAST FIX - WCAG AA ==================== */
/* Hero subtitle */
.hero-subtitle, .home .hero-subtitle, .page-template-front-page .hero-subtitle { color: #525252 !important; }
[data-bs-theme="dark"] .hero-subtitle { color: #b8b8b8 !important; }

/* Date badges */
.news-grid .card time, .news-grid time[datetime], .card time[datetime], time.published, time.updated {
    background-color: #ffc107 !important;
    color: #000 !important;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Footer links */
.footer-links, .footer-links a, a.footer-links, .site-footer .footer-links, .footer-menu a { color: #d1d5db !important; }
.footer-links a:hover, a.footer-links:hover, .footer-menu a:hover { color: #ffffff !important; }

/* Footer widget title */
h3.footer-widget-title, .footer-widget-title { color: #ffffff !important; }

/* Copyright & Cookie notice */
.copyright, p.copyright, .cookie-notice, p.cookie-notice, .site-footer .text-white-50 { color: #9ca3af !important; }
.cookie-notice a { color: #93c5fd !important; }
.cookie-notice a:hover { color: #ffffff !important; }

/* Text muted */
.text-muted { color: #525252 !important; }
[data-bs-theme="dark"] .text-muted { color: #a3a3a3 !important; }
.site-footer .text-muted, .site-footer small.text-muted { color: #9ca3af !important; }

/* Card meta */
.card .text-muted, .card .entry-meta, .card .post-meta { color: #525252 !important; }

/* Hero strong */
.hero strong, .hero-subtitle strong { color: #0d3a7a !important; }

/* Placeholders */
::placeholder { color: #6b7280 !important; opacity: 1; }

/* Widget links */
.widget a:not(.btn), .sidebar a:not(.btn), aside a:not(.btn):not(.calc-list-link):not(.chip-ico), .list-unstyled a:not(.btn) { color: #0056b3; }
.widget a:not(.btn):hover, .sidebar a:not(.btn):hover, aside a:not(.btn):hover, .list-unstyled a:not(.btn):hover { color: #003d80; }

/* Links on light background */
.bg-light a:not(.btn), .widget.bg-light a:not(.btn), .p-3.bg-light a:not(.btn) { color: #004085; }
.bg-light a:not(.btn):hover, .widget.bg-light a:not(.btn):hover { color: #002752; }

/* Card title links */
.card-title a { color: #1a1a1a; }
.card-title a:hover { color: #0056b3; }

/* Dark theme widget links */
[data-bs-theme="dark"] .widget a:not(.btn), [data-bs-theme="dark"] .sidebar a:not(.btn), [data-bs-theme="dark"] aside a:not(.btn):not(.calc-list-link):not(.chip-ico) { color: #93c5fd; }
[data-bs-theme="dark"] .widget a:not(.btn):hover, [data-bs-theme="dark"] .sidebar a:not(.btn):hover, [data-bs-theme="dark"] aside a:not(.btn):hover { color: #bfdbfe; }
[data-bs-theme="dark"] .card-title a { color: #f3f4f6; }
[data-bs-theme="dark"] .card-title a:hover { color: #93c5fd; }

/* ==================== NEWS (front-page) ==================== */

/* Main news - Ð³Ð¾Ñ€Ð¸Ð·Ð¾Ð½Ñ‚Ð°Ð»ÑŒÐ½Ð°Ñ ÐºÐ°Ñ€Ñ‚Ð¾Ñ‡ÐºÐ° */
.news-main {
  display: flex;
  gap: var(--space-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--space-5);
  transition: box-shadow 0.2s ease;
}

.news-main:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.news-main__img-link {
  flex-shrink: 0;
  width: 45%;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a5f 0%, #0d47a1 100%);
}

.news-main__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.news-main:hover .news-main__img {
  transform: scale(1.03);
}

.news-main__body {
  flex: 1;
  padding: var(--space-5) var(--space-5) var(--space-5) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-main__date {
  font-size: 0.85rem;
  color: var(--c-primary);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.news-main__title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 var(--space-3) 0;
}

.news-main__title a {
  color: var(--c-text);
  text-decoration: none;
}

.news-main__title a:hover {
  color: var(--c-primary);
}

.news-main__excerpt {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--c-text-light);
  margin-bottom: var(--space-4);
}

/* News grid - ÑÐµÑ‚ÐºÐ° ÐºÐ°Ñ€Ñ‚Ð¾Ñ‡ÐµÐº */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.news-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover {
  border-color: var(--c-primary-light);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.news-card__img-link {
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a5f 0%, #0d47a1 100%);
}

.news-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.news-card:hover .news-card__img {
  transform: scale(1.05);
}

.news-card__body {
  padding: var(--space-3);
}

.news-card__date {
  display: block;
  font-size: 0.75rem;
  color: var(--c-primary);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.news-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

.news-card__title a {
  color: var(--c-text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__title a:hover {
  color: var(--c-primary);
}

/* Responsive */
@media (max-width: 991.98px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .news-main__title {
    font-size: 1.25rem;
  }
}

@media (max-width: 767.98px) {
  .news-main {
    flex-direction: column;
    gap: 0;
  }
  
  .news-main__img-link {
    width: 100%;
    aspect-ratio: 16/9;
  }
  
  .news-main__body {
    padding: var(--space-4);
  }
  
  .news-main__title {
    font-size: 1.15rem;
  }
  
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
}

@media (max-width: 575.98px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .news-card {
    display: flex;
    flex-direction: column;
  }
  
  .news-card__img-link {
    width: 100%;
    aspect-ratio: 16/9;
  }
  
  .news-card__body {
    padding: var(--space-4);
  }
  
  .news-card__title {
    font-size: 1.1rem;
  }
  
  .news-card__title a {
    -webkit-line-clamp: 3;
  }
}

/* Dark theme */
[data-bs-theme="dark"] .news-main,
[data-bs-theme="dark"] .news-card {
  background: var(--c-surface);
  border-color: var(--c-border);
}

[data-bs-theme="dark"] .news-main:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .news-main__title a,
[data-bs-theme="dark"] .news-card__title a {
  color: var(--c-text);
}

[data-bs-theme="dark"] .news-main__title a:hover,
[data-bs-theme="dark"] .news-card__title a:hover {
  color: var(--c-primary-light);
}

[data-bs-theme="dark"] .news-main__date,
[data-bs-theme="dark"] .news-card__date {
  color: var(--c-primary-light);
}

/* ==================== SIDEBAR CALCULATORS FIX ==================== */
.home .calc-list-link, .page-template-front-page .calc-list-link {
  font-size: 0.875rem;
  line-height: 1.3;
  padding: 0.5em 0.55em;
  word-wrap: break-word;
  hyphens: auto;
}

.home .calc-list-link .calc-ico, .page-template-front-page .calc-list-link .calc-ico {
  min-width: 28px;
  width: 28px;
  height: 28px;
  margin-right: 8px;
}

.home .calc-list-link .chevron, .page-template-front-page .calc-list-link .chevron {
  display: none;
}

/* Dark theme news */
[data-bs-theme="dark"] .news-hero,
[data-bs-theme="dark"] .news-card-small {
  border-color: var(--c-border);
}

/* ==================== CALCULATOR GRID (front-page bottom) ==================== */
.fp-calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.fp-calc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-lg);
  padding: var(--space-5) var(--space-4);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  min-height: 160px;
}

.fp-calc-card:hover {
  border-color: var(--c-primary);
  box-shadow: 0 4px 20px rgba(0, 86, 179, 0.15);
  transform: translateY(-2px);
  text-decoration: none;
}

.fp-calc-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--c-primary) 0%, #2563eb 100%);
  border-radius: var(--r-md);
  margin-bottom: var(--space-3);
  color: #fff;
  flex-shrink: 0;
}

.fp-calc-card__icon svg {
  width: 28px;
  height: 28px;
}

.fp-calc-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.3;
}

.fp-calc-card:hover .fp-calc-card__title {
  color: var(--c-primary);
}

@media (max-width: 991.98px) {
  .fp-calc-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767.98px) {
  .fp-calc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .fp-calc-card {
    padding: var(--space-4) var(--space-3);
    min-height: 140px;
  }
  
  .fp-calc-card__icon {
    width: 40px;
    height: 40px;
  }
  
  .fp-calc-card__icon svg {
    width: 24px;
    height: 24px;
  }
  
  .fp-calc-card__title {
    font-size: 0.875rem;
  }
}

/* Dark theme calc grid */
[data-bs-theme="dark"] .fp-calc-card {
  background: var(--c-surface);
  border-color: var(--c-border);
}

[data-bs-theme="dark"] .fp-calc-card:hover {
  border-color: var(--c-primary-light);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

[data-bs-theme="dark"] .fp-calc-card__title {
  color: var(--c-text);
}

[data-bs-theme="dark"] .fp-calc-card:hover .fp-calc-card__title {
  color: var(--c-primary-light);
}

/* ==================== SECTIONS GRID (front-page) ==================== */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.section-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-md);
  padding: var(--space-3);
  text-decoration: none;
  transition: all 0.2s ease;
}

.section-card:hover {
  border-color: var(--c-primary);
  box-shadow: 0 4px 20px rgba(0, 86, 179, 0.12);
  transform: translateY(-2px);
  text-decoration: none;
}

.section-card__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--c-primary) 0%, #2563eb 100%);
  border-radius: var(--r-sm);
  color: #fff;
}

.section-card__icon svg {
  width: 18px;
  height: 18px;
}

.section-card__content {
  flex: 1;
  min-width: 0;
}

.section-card__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.3;
}

.section-card__desc {
  display: none;
}

.section-card__arrow {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--c-text-light);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s ease;
}

.section-card__arrow svg {
  width: 20px;
  height: 20px;
}

.section-card:hover .section-card__arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--c-primary);
}

.section-card:hover .section-card__title {
  color: var(--c-primary);
}

@media (max-width: 1199.98px) {
  .sections-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575.98px) {
  .sections-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
  
  .section-card {
    padding: var(--space-2);
  }
  
  .section-card__icon {
    width: 32px;
    height: 32px;
  }
  
  .section-card__icon svg {
    width: 16px;
    height: 16px;
  }
  
  .section-card__title {
    font-size: 0.8rem;
  }
  
  .section-card__arrow {
    display: none;
  }
}

/* Dark theme sections */
[data-bs-theme="dark"] .section-card {
  background: var(--c-surface);
  border-color: var(--c-border);
}

[data-bs-theme="dark"] .section-card:hover {
  border-color: var(--c-primary-light);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}

[data-bs-theme="dark"] .section-card__title {
  color: var(--c-text);
}

[data-bs-theme="dark"] .section-card:hover .section-card__title {
  color: var(--c-primary-light);
}