/* ==========================================================================
   Layout: header/navigation, banner, hero, sections, footer
   ========================================================================== */

/* ---------- Header / Navigation ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: var(--container-width);
    height: var(--header-h);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}

.logo i {
    font-size: 26px;
}

.nav-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
}

.nav-menu a {
    display: block;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 10px;
    border-radius: 5px;
    white-space: nowrap;
    transition: background var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255, 255, 255, 0.2);
}

.lang-switcher {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-btn[aria-pressed="true"] {
    background: #fff;
    color: var(--primary-color);
}

.mobile-toggle {
    display: none;
    background: none;
    border: 0;
    color: #fff;
    font-size: 24px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    border-radius: 5px;
}

/*
 * Collapsed (hamburger) navigation. assets/js/nav.js adds .is-compact whenever the
 * links + language switcher do not fit on one row, so it adapts to any locale length.
 */
.site-header.is-compact .mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.site-header.is-compact .nav-panel {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px var(--gutter) 20px;
    background: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
}

.site-header.is-compact .nav-panel.is-open {
    display: flex;
}

.site-header.is-compact .nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.site-header.is-compact .nav-menu a {
    text-align: center;
    font-size: 16px;
    padding: 10px 12px;
    white-space: normal;
}

.site-header.is-compact .lang-switcher {
    justify-content: center;
}

.site-header.is-compact .lang-btn {
    padding: 8px 14px;
}

@media (max-width: 400px) {
    .logo {
        font-size: 18px;
    }

    .logo i {
        font-size: 22px;
    }
}

/* ---------- Emergency banner ---------- */
.emergency-banner {
    background: var(--accent-color);
    color: #fff;
    padding: 12px var(--gutter);
    text-align: center;
    font-weight: 600;
    font-size: clamp(13px, 3.2vw, 16px);
}

.emergency-banner i {
    margin-right: 8px;
}

/* ---------- Hero ---------- */
.hero {
    background:
        linear-gradient(135deg, rgba(26, 84, 144, 0.95), rgba(41, 128, 185, 0.95)),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%231a5490" width="1200" height="600"/><path fill="%232980b9" opacity="0.3" d="M0,300 Q300,200 600,300 T1200,300 L1200,600 L0,600 Z"/></svg>');
    background-size: cover;
    background-position: center;
    padding: clamp(60px, 10vw, 120px) var(--gutter) clamp(50px, 8vw, 100px);
    text-align: center;
    color: #fff;
}

.hero h1 {
    font-size: clamp(26px, 5.5vw, 48px);
    line-height: 1.25;
    margin-bottom: 20px;
    overflow-wrap: break-word;
    animation: fadeInDown 0.8s ease both;
}

.hero p {
    font-size: clamp(15px, 2.4vw, 20px);
    max-width: 800px;
    margin: 0 auto 30px;
    animation: fadeInUp 0.8s ease both;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease both;
}

@media (max-width: 560px) {
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
        max-width: 360px;
        margin: 0 auto;
    }
}

/* ---------- Sections ---------- */
.section {
    padding: clamp(50px, 8vw, 80px) 0;
}

.section--alt {
    background: var(--light-bg);
}

.section-header {
    text-align: center;
    margin-bottom: clamp(36px, 6vw, 60px);
}

.section-header h2 {
    font-size: clamp(22px, 4.2vw, 38px);
    line-height: 1.3;
    color: var(--primary-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-color);
}

.section-header p {
    color: var(--text-light);
    font-size: clamp(15px, 2vw, 18px);
    max-width: 700px;
    margin: 20px auto 0;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--dark-bg);
    color: #fff;
    padding: 60px var(--gutter) 20px;
}

.footer-content {
    max-width: var(--container-width);
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 40px;
}

.footer-section h2 {
    font-size: 19px;
    margin-bottom: 20px;
    color: #fff;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #c8ced3;
    text-decoration: none;
    transition: color var(--transition);
}

.footer-section a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #c8ced3;
    font-size: 14px;
}

@media (max-width: 768px) {
    .footer-content {
        gap: 30px;
        text-align: center;
    }
}

/* ---------- Back to top ---------- */
.back-to-top {
    position: fixed;
    bottom: clamp(16px, 4vw, 30px);
    right: clamp(16px, 4vw, 30px);
    z-index: 999;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition), background var(--transition);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.back-to-top:hover {
    background: var(--secondary-color);
}

/* ---------- Standalone error page ---------- */
.error-page {
    padding-top: 0;
}

.error-page .hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
}
