/* =============================================================
   global.css — Shared variables, header (nav), footer, and
   utility styles used across every page of the site.
   ============================================================= */

/* ---- Reset -------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---- Design tokens ------------------------------------------ */
:root {
    --primary-red: #C61A1A;
    --primary-red-hover: #A01515;
    --primary-red-light: #E53E3E;
    --dark-red: #8F1212;
    --light-red: #FDE8E8;
    --red-gradient: linear-gradient(135deg, #C61A1A 0%, #A01515 50%, #8F1212 100%);
    --red-gradient-subtle: linear-gradient(135deg, rgba(198, 26, 26, 0.1) 0%, rgba(160, 21, 21, 0.05) 100%);

    --white: #FFFFFF;
    --paper: #F8F9FA;
    --off-white: #F1F3F4;
    --cream: #FEFCF8;

    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;

    --ink: #0B0F17;
    --text-primary: #212121;
    --text-secondary: #424242;
    --text-muted: #757575;
    --text-light: #9E9E9E;

    --rule: rgba(33, 33, 33, 0.08);
    --rule-hover: rgba(198, 26, 26, 0.15);
    --rule-strong: rgba(33, 33, 33, 0.12);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(198, 26, 26, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;

    --content-max: 1280px;
    --gutter: 2rem;

    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: ui-serif, Georgia, 'Times New Roman', Times, serif;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Base --------------------------------------------------- */
body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #F8F9FA 0%, #F1F3F4 25%, #FEFCF8 100%);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "liga" 1, "kern" 1, "calt" 1;
    font-variant-ligatures: common-ligatures;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(1000px 420px at 30% 0%, rgba(198, 26, 26, 0.06), transparent 60%),
        radial-gradient(900px 380px at 80% 10%, rgba(11, 15, 23, 0.05), transparent 55%);
    opacity: 0.9;
    z-index: -1;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    letter-spacing: -0.025em;
    line-height: 1.2;
    font-weight: 700;
}

h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

h2 { font-size: clamp(1.875rem, 4vw, 3rem); font-weight: 700; }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 600; }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.875rem); font-weight: 600; }

p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

:focus-visible {
    outline: 3px solid rgba(198, 26, 26, 0.25);
    outline-offset: 2px;
    border-radius: 8px;
}

/* ---- Language Switcher -------------------------------------- */
.lang-switcher {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1001;
    background: var(--white);
    color: var(--ink);
    border: 1px solid var(--rule);
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-switcher:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: rgba(198, 26, 26, 0.35);
}

/* ---- Back Button -------------------------------------------- */
.back-button,
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--white);
    color: var(--text-primary);
    border: 2px solid var(--rule-strong);
    border-radius: var(--radius-xl);
    padding: 0.875rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.back-button::before,
.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--red-gradient-subtle);
    transition: left var(--transition-normal);
}

.back-button:hover,
.back-btn:hover {
    border-color: var(--primary-red);
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
    color: var(--primary-red);
}

.back-button:hover::before,
.back-btn:hover::before {
    left: 0;
}

.back-button i,
.back-btn i {
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.back-button span,
.back-btn span {
    position: relative;
    z-index: 1;
}

/* ====================================================================
   HEADER / NAVIGATION
   ==================================================================== */

nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow-sm);
}

.nav-topbar {
    border-bottom: 1px solid var(--rule);
    background: rgba(255, 255, 255, 0.9);
}

.nav-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.45rem var(--gutter);
    font-size: 0.85rem;
    color: rgba(11, 15, 23, 0.72);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.topbar-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.topbar-sep { opacity: 0.7; }

.topbar-link {
    color: rgba(11, 15, 23, 0.82);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60ch;
}

.topbar-link strong {
    color: var(--primary-red);
    font-weight: 800;
}

.topbar-right {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--white);
    color: rgba(11, 15, 23, 0.8);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.topbar-icon:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.nav-main {
    padding: 1rem var(--gutter);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-image {
    height: 48px;
    width: auto;
    display: block;
    transition: transform var(--transition-fast);
    mix-blend-mode: multiply;
}

.logo:hover .logo-image {
    transform: scale(1.05);
}

.icon-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--text-primary);
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--rule-hover);
    background: var(--gray-50);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a[aria-current="page"] {
    font-weight: 700;
    color: var(--primary-red);
}

.nav-links a[aria-current="page"]::after {
    width: 100%;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--red-gradient);
    border-radius: 2px;
    transition: width var(--transition-normal);
}

.nav-links a:hover {
    color: var(--primary-red);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu {
    display: none;
    color: var(--ink);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ====================================================================
   FOOTER
   ==================================================================== */

/* -- Unified site footer (.site-footer) ----------------------- */
.site-footer {
    background: var(--white);
    color: var(--text-primary);
    border-top: 2px solid var(--rule-strong);
}

.footer-top {
    padding: 3.25rem 2rem;
}

.footer-top-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 2fr;
    gap: 3rem;
    align-items: start;
}

/* -- Brand: logo + tagline (left column) ---------------------- */
.footer-brand {
    min-width: 0;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.footer-logo img {
    height: 114px;
    width: auto;
    display: block;
}

.footer-tagline {
    margin-top: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
    max-width: 34ch;
}

/* -- Links grid (right column) -------------------------------- */
.footer-links {
    background: transparent;
    border: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

/* Legacy wrapper used on some pages — ignored in new structure */
.footer-links-container {
    display: contents;
}

.footer-column h4 {
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--red-gradient);
    border-radius: 1px;
}

.footer-column h4 i {
    color: var(--primary-red);
    margin-right: 0.35rem;
}

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

.footer-column ul li {
    margin-bottom: 0.55rem;
}

.footer-column a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer-column a:hover {
    color: var(--primary-red);
}

/* -- Bottom bar: copyright + social --------------------------- */
.footer-bottom {
    border-top: 1px solid var(--rule-strong);
    padding: 1.1rem 2rem;
    background: var(--gray-50);
}

.footer-bottom-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-copy {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.footer-credit i {
    color: var(--primary-red);
}

/* -- Social link icon buttons --------------------------------- */
.footer-social {
    display: none;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rule-strong);
    background: var(--white);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: transform 0.15s ease, border-color 0.15s ease,
                background 0.15s ease, color 0.15s ease;
}

.social-link:hover {
    transform: translateY(-2px);
    border-color: var(--primary-red);
    background: var(--light-red);
    color: var(--primary-red);
}

/* -- Legacy plain footer (fallback, kept for safety) ---------- */
footer:not(.site-footer) {
    background: var(--white);
    border-top: 1px solid var(--rule-strong);
    padding: 1.5rem 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-left {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ====================================================================
   MOBILE NAVIGATION
   ==================================================================== */

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--gray-900);
    z-index: 1002;
    padding: 2rem;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-header h3 {
    color: var(--white);
    font-size: 1.5rem;
}

.close-menu {
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem 0;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.3s ease;
}

.mobile-nav-links a:hover {
    color: var(--primary-red);
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.overlay.active {
    display: block;
}

/* ====================================================================
   SCROLL-TO-TOP BUTTON
   ==================================================================== */

a.scroll-top,
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    z-index: 999;
    border: 1px solid var(--rule);
}

.scroll-top.visible {
    opacity: 1;
}

.scroll-top:hover {
    transform: translateY(-5px);
    border-color: rgba(198, 26, 26, 0.3);
}

/* ====================================================================
   RESPONSIVE
   ==================================================================== */

@media (max-width: 1024px) {
    .lang-switcher {
        top: 80px;
        right: 10px;
        padding: 10px 18px;
        font-size: 12px;
    }

    .footer-top-inner {
        grid-template-columns: 1fr;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu {
        display: block;
    }

    .nav-topbar {
        display: none;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-bottom-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    .mobile-nav {
        display: block;
    }
}

@media (max-width: 480px) {
    .footer-links {
        grid-template-columns: 1fr 1fr;
    }
}

/* No-JS fallback */
@media (max-width: 768px) {
    .nav-links {
        display: flex !important;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .mobile-menu,
    .mobile-nav,
    .overlay,
    .scroll-top {
        display: none !important;
    }
}
