/* ==========================================================================
   АПК-ЮГ — Custom Styles
   Built on Bootstrap 5.3
   ========================================================================== */

/* --- CSS Custom Properties (Brand Colors) --- */
:root {
    --apk-green: #2d6a4f;
    --apk-green-light: #40916c;
    --apk-green-dark: #1b4332;
    --apk-yellow: #e9c46a;
    --apk-yellow-light: #f4d35e;
    --apk-orange: #e76f51;
    --apk-cream: #fefae0;
    --apk-earth: #6b705c;
    --apk-earth-light: #a7a99b;

    /* Bootstrap overrides */
    --bs-primary: var(--apk-green);
    --bs-primary-rgb: 45, 106, 79;
    --bs-link-color: var(--apk-green);
    --bs-link-hover-color: var(--apk-green-dark);
}

/* --- Global --- */
html,
body {
    height: 100%;
}

body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    color: #333;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

/* --- Navbar --- */
.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--apk-green-dark) !important;
}

.navbar .nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

.navbar .nav-link:hover {
    color: var(--apk-green) !important;
}

.navbar .nav-link.active {
    color: var(--apk-green) !important;
    border-bottom: 2px solid var(--apk-green);
}

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(135deg, var(--apk-green-dark) 0%, var(--apk-green) 50%, var(--apk-green-light) 100%);
    color: white;
    padding: 5rem 0;
    min-height: clamp(480px, 70vh, 760px);
    display: flex;
    align-items: center;
}

.hero-section h1 {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
}

.hero-section .lead {
    font-size: 1.25rem;
    opacity: 0.9;
}

.hero-actions {
    margin-bottom: 1rem;
}

.hero-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.hero-link-list a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-weight: 500;
}

.hero-link-list a:hover {
    color: var(--apk-yellow-light);
}

.fallback-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
}

.info-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.9rem;
    height: 100%;
}

.info-card .icon-wrap {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    background: rgba(45, 106, 79, 0.12);
    color: var(--apk-green-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.trust-stat {
    background: #fff;
    border-radius: 0.9rem;
    padding: 1.25rem 1rem;
    text-align: center;
    border: 1px solid rgba(45, 106, 79, 0.12);
    height: 100%;
}

/* --- Cards --- */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-img-top {
    border-radius: 0.75rem 0.75rem 0 0;
    object-fit: cover;
    aspect-ratio: 16 / 10;
}

/* --- Buttons --- */
.btn-primary {
    background-color: var(--apk-green);
    border-color: var(--apk-green);
}

.btn-primary:hover {
    background-color: var(--apk-green-dark);
    border-color: var(--apk-green-dark);
}

.btn-outline-primary {
    color: var(--apk-green);
    border-color: var(--apk-green);
}

.btn-outline-primary:hover {
    background-color: var(--apk-green);
    border-color: var(--apk-green);
}

.btn-accent {
    background-color: var(--apk-yellow);
    border-color: var(--apk-yellow);
    color: var(--apk-green-dark);
    font-weight: 600;
}

.btn-accent:hover {
    background-color: var(--apk-yellow-light);
    border-color: var(--apk-yellow-light);
    color: var(--apk-green-dark);
}

/* --- Section Headers --- */
.section-title {
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--apk-green-dark);
    margin-bottom: 1.5rem;
}

.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--apk-yellow);
    margin-top: 0.5rem;
}

/* --- Footer --- */
.footer {
    background-color: var(--apk-green-dark);
    color: rgba(255, 255, 255, 0.85);
    padding: 3rem 0 1.5rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--apk-yellow);
}

.footer .footer-title {
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
}

.footer hr {
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- HTMX Loading Indicator --- */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* --- Breadcrumbs --- */
.breadcrumb {
    background: none;
    padding: 0.75rem 0;
    font-size: 0.875rem;
}

/* --- Pagination --- */
.page-link {
    color: var(--apk-green);
}

.page-item.active .page-link {
    background-color: var(--apk-green);
    border-color: var(--apk-green);
}

/* --- Search --- */
.search-box {
    position: relative;
}

.search-box .form-control:focus {
    border-color: var(--apk-green-light);
    box-shadow: 0 0 0 0.2rem rgba(45, 106, 79, 0.15);
}

/* --- Tag badges --- */
.badge-tag {
    background-color: var(--apk-cream);
    color: var(--apk-earth);
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 50rem;
}

/* --- Counters / Stats --- */
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--apk-green);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--apk-earth);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Testimonials --- */
.testimonial-card {
    background: var(--apk-cream);
    border-radius: 1rem;
    padding: 2rem;
}

.testimonial-card .quote-icon {
    font-size: 2rem;
    color: var(--apk-yellow);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section {
        padding: 3rem 0;
        min-height: clamp(420px, 62vh, 620px);
    }

    .section-title {
        font-size: 1.5rem;
    }

    .hero-section .lead {
        font-size: 1.05rem;
    }
}

@media (max-width: 375px) {
    .hero-section {
        padding: 2.25rem 0;
        min-height: auto;
    }

    .hero-section h1 {
        font-size: 1.7rem;
        line-height: 1.25;
    }

    .hero-actions .btn {
        width: 100%;
        font-size: 0.95rem;
        padding: 0.6rem 0.8rem;
    }

    .hero-link-list {
        gap: 0.35rem 0.75rem;
        font-size: 0.92rem;
    }

    .fallback-card {
        padding: 1rem !important;
    }
}
