/* ===== CSS VARIABLES ===== */
:root {
    /* Colors - Black & White Theme */
    --color-black: #000000;
    --color-white: #FFFFFF;
    --color-gray-100: #F7F7F7;   /* Lightest gray */
    --color-gray-200: #E5E5E5;   /* Light gray borders */
    --color-gray-300: #D4D4D4;   /* Medium light gray */
    --color-gray-400: #A3A3A3;   /* Medium gray */
    --color-gray-500: #737373;   /* Dark medium gray */
    --color-gray-600: #525252;   /* Dark gray */
    --color-gray-700: #404040;   /* Darker gray */
    --color-gray-800: #262626;   /* Very dark gray */
    --color-gray-900: #171717;   /* Near black */
    
    /* Typography */
    --font-primary: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Font Sizes - Responsive */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);    /* 12-14px */
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);      /* 14-16px */
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);      /* 16-18px */
    --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);     /* 18-20px */
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);      /* 20-24px */
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);       /* 24-30px */
    --text-3xl: clamp(1.875rem, 1.6rem + 1.375vw, 2.25rem);  /* 30-36px */
    --text-4xl: clamp(2.25rem, 1.9rem + 1.75vw, 3rem);       /* 36-48px */
    
    /* Spacing - Fluid */
    --space-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.375rem);   /* 4-6px */
    --space-sm: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);      /* 8-12px */
    --space-md: clamp(0.75rem, 0.6rem + 0.75vw, 1.125rem);   /* 12-18px */
    --space-lg: clamp(1rem, 0.8rem + 1vw, 1.5rem);           /* 16-24px */
    --space-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);      /* 24-36px */
    --space-2xl: clamp(2rem, 1.6rem + 2vw, 3rem);            /* 32-48px */
    --space-3xl: clamp(2.5rem, 2rem + 2.5vw, 3.75rem);       /* 40-60px */
    --space-4xl: clamp(3rem, 2.4rem + 3vw, 4.5rem);          /* 48-72px */
    --space-5xl: clamp(4rem, 3.2rem + 4vw, 6rem);            /* 64-96px */
    
    /* Layout */
    --max-width: 1200px;
    --content-width: 900px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-gray-800);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-black);
    margin-bottom: var(--space-lg);
    margin-top: var(--space-2xl);
}

h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child,
h5:first-child,
h6:first-child {
    margin-top: 0;
}

h1 {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-xl);
    font-weight: 900;
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--text-3xl);
    margin-top: var(--space-4xl);
    margin-bottom: var(--space-xl);
    font-weight: 700;
    border-bottom: 2px solid var(--color-black);
    padding-bottom: var(--space-sm);
}

h3 {
    color: var(--color-black);
    margin-bottom: var(--space-lg);
    margin-top: var(--space-2xl);
    font-size: var(--text-2xl);
    margin-top: var(--space-3xl);
    font-weight: 700;
}

h4 {
    font-size: var(--text-xl);
    margin-top: var(--space-2xl);
    font-weight: 700;
}

h5 {
    font-size: var(--text-lg);
    margin-top: var(--space-xl);
    font-weight: 700;
}

h6 {
    font-size: var(--text-base);
    margin-top: var(--space-lg);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-gray-600);
}

p {
    margin-bottom: var(--space-lg);
    /* max-width: 65ch; */
    text-align: justify;
    color: var(--color-gray-700);
}

p:last-child {
    margin-bottom: 0;
}

strong {
    color: var(--color-black);
    font-weight: 700;
}

em {
    font-style: italic;
}

/* ===== HEADER STYLES ===== */
.site-header {
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-gray-200);
    padding: var(--space-lg) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-xl);
}

.site-logo {
    font-family: var(--font-primary);
    font-size: var(--text-2xl);
    font-weight: 900;
    color: var(--color-black);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: opacity 0.2s ease;
}

.site-logo:hover {
    opacity: 0.7;
}

.site-nav {
    display: flex;
    list-style: none;
    gap: var(--space-2xl);
    align-items: center;
}

.site-nav .toplink {
    color: var(--color-gray-600);
    text-decoration: none;
    font-weight: 400;
    font-size: var(--text-base);
    padding: var(--space-md) var(--space-md);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    position: relative;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--color-black);
}

.site-nav .toplink::after {
    content: '';
    position: absolute;
    bottom: calc(-1 * var(--space-xs));
    left: 50%;
    width: 0;
    height: calc(var(--space-xs) / 3);
    background-color: var(--color-black);
    transition: all 0.2s ease;
    transform: translateX(-50%);
}

.site-nav .toplink:hover::after,
.site-nav .toplink.active::after {
    width: 100%;
}
.language-menu {
  position: relative; /* makes child absolute relative to it */
  display: inline-block; /* keeps it nicely contained */
}

.site-nav .menu-item {
    color: var(--color-gray-600);
    text-decoration: none;
    font-weight: 400;
    font-size: var(--text-base);
    border-radius: var(--radius-xl);
    transition: all 0.2s ease;
    position: relative;
}
.site-nav .menu-item:hover {
    color: var(--color-black);
}
.site-nav .language-dropdown {
    position: absolute;
    width: 100%;
    background: var(--color-white);
    border: var(--color-black) calc(var(--space-xs) / 3) solid;
    border-radius: var(--radius-lg);
    margin-top: var(--space-2xl);
}
.site-nav .language-dropdown ul {
    list-style: none;
    padding: 0 var(--space-xs) var(--space-sm) var(--space-xs);
}
.site-nav .language-dropdown li {
    padding-top: var(--space-sm);
    text-align: center;
}

/* ===== MAIN CONTENT STYLES ===== */
.main-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-4xl) var(--space-xl);
    /* Changed from grid to flex column for vertical stacking */
    display: flex;
    flex-direction: column;
    gap: var(--space-5xl); /* Increased gap for clear separation */
    min-height: calc(100vh - 200px);
}

.content-area {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto; /* Center the content area */
}

.article-content {
    background: var(--color-white);
    width: 100%;
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
}
.article-content ul {
    padding-left: var(--space-lg);
}
.article-content li {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
    list-style-type: disc;
}
/* ===== IMAGE STYLES ===== */
.image-container {
    margin: var(--space-3xl) 0;
    text-align: center;
}

.image-single {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.image-double {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    max-width: 100%;
    margin: 0 auto;
}

.image-container img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-gray-200);
    transition: all 0.3s ease;
}

.image-container img:hover {
    border-color: var(--color-gray-400);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.image-caption {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    font-style: italic;
    margin-top: var(--space-md);
    line-height: 1.4;
}

/* ===== SIDEBAR STYLES ===== */
.sidebar {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto; /* Center the sidebar */
    background: var(--color-gray-100);
    padding: var(--space-3xl); /* Increased padding for better presence */
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-gray-300); /* Slightly darker border for definition */
    /* Add a subtle top border to emphasize separation */
    border-top: 3px solid var(--color-black);
    box-shadow: var(--shadow-sm); /* Subtle shadow for depth */
    position: static; /* No longer sticky */
}

.sidebar .sidebar-title {
    color: var(--color-black);
    margin-top: 0;
    margin-bottom: var(--space-xl); /* Increased margin for better spacing */
    font-size: var(--text-2xl); /* Slightly larger for better hierarchy */
    font-weight: 700;
    border-bottom: 2px solid var(--color-gray-400); /* Thicker border */
    padding-bottom: var(--space-md); /* Increased padding */
}

.sidebar ul {
    list-style: none;
    margin-bottom: var(--space-xl); /* Add spacing between sections */
}

.sidebar ul:last-child {
    margin-bottom: 0;
}

.sidebar li {
    margin-bottom: var(--space-md); /* Increased spacing between items */
}

.sidebar a {
    color: var(--color-gray-700); /* Darker for better contrast */
    text-decoration: none;
    font-size: var(--text-base); /* Slightly larger font */
    display: block;
    padding: var(--space-md); /* Increased padding */
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    border-left: 3px solid transparent; /* Add accent border */
}

.sidebar a:hover {
    background: var(--color-white);
    color: var(--color-black);
    border-left-color: var(--color-black); /* Show accent border on hover */
    transform: translateX(4px);
}

/* ===== FOOTER STYLES ===== */
.site-footer {
    background: var(--color-gray-900);
    color: var(--color-gray-300);
    padding: var(--space-4xl) 0 var(--space-2xl);
    margin-top: var(--space-5xl); /* Increased margin for better separation */
    border-top: 1px solid var(--color-gray-200);
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-3xl);
}

.footer-about .footer-title,
.footer-links .footer-title,
.footer-contact .footer-title {
    color: var(--color-white);
    margin-top: 0;
    margin-bottom: var(--space-lg);
    font-size: var(--text-lg);
    font-weight: 700;
}

.footer-about p {
    color: var(--color-gray-400);
    font-size: var(--text-sm);
    line-height: 1.6;
}

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

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: var(--color-gray-400);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--color-white);
}

.footer-contact p {
    color: var(--color-gray-400);
    font-size: var(--text-sm);
    margin-bottom: var(--space-sm);
}

.footer-bottom {
    border-top: 1px solid var(--color-gray-700);
    margin-top: var(--space-3xl);
    padding-top: var(--space-xl);
    display: flex;
    justify-content: center;
    text-align: center;
    color: var(--color-gray-500);
    font-size: var(--text-sm);
}

/* ===== INDEX AND BLOG HOME PAGES ===== */
.articles-list {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-4xl);
    max-width: var(--content-width);
    margin: 0 auto;
}
.article-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}
.article-item a {
    text-decoration: none;
    color: var(--color-black);
}
.article-item a:hover {
    opacity: 0.7;
}

.article-item a:visited {
    text-decoration: none;
}



/* ===== RESPONSIVE DESIGN - Using Aspect Ratios ===== */

/* Tablet Landscape - roughly 4:3 aspect ratio and below */
@media (max-aspect-ratio: 4/3) and (max-width: 1024px) {
    .main-container {
        padding: var(--space-3xl) var(--space-lg);
        gap: var(--space-4xl); /* Maintain good spacing on tablets */
    }
    
    .header-container {
        padding: 0 var(--space-lg);
    }
    
    .sidebar {
        padding: var(--space-2xl); /* Reduce padding on smaller screens */
    }
}

/* Mobile Portrait - roughly 9:16 aspect ratio */
@media (max-aspect-ratio: 9/16), (max-width: 768px) {
    .header-container {
        flex-direction: row;
        gap: var(--space-lg);
        text-align: center;
    }

    .site-nav {
        gap: var(--space-xl);
    }
    
    .main-container {
        padding: var(--space-2xl) var(--space-lg);
        gap: var(--space-3xl); /* Reduce gap on mobile for better flow */
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }
    
    .image-double {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .site-header {
        position: static;
    }

}

/* Small Mobile - very narrow screens */
@media (max-width: 480px) {
    .header-container,
    .main-container,
    .footer-container {
        padding-left: var(--space-md);
        padding-right: var(--space-md);
    }
    
    .sidebar {
        padding: var(--space-lg);
    }
    
    .site-nav {
        gap: var(--space-lg);
    }
    .articles-list {
        grid-template-columns: 1fr; /* Single column on small mobile */
        gap: var(--space-3xl);
    }
}

/* Large Desktop - ultra-wide screens */
@media (min-aspect-ratio: 21/9) and (min-width: 1400px) {
    .content-area,
    .sidebar {
        max-width: calc(1.1 * var(--content-width)); /* Slightly wider on ultra-wide screens */
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-black { color: var(--color-black); }
.text-gray { color: var(--color-gray-600); }
.bg-light { background-color: var(--color-gray-100); }
.rounded { border-radius: var(--radius-md); }
.shadow { box-shadow: var(--shadow-md); }

/* ===== SEO & ACCESSIBILITY ===== */
.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;
}

/* Focus styles for accessibility */
/*
a:focus,
button:focus {
    outline: 2px solid var(--color-black);
    outline-offset: 2px;
}
*/

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-gray-600: var(--color-gray-800);
        --color-gray-500: var(--color-gray-700);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-nav,
    .sidebar,
    .site-footer {
        display: none;
    }
    
    .main-container {
        display: block;
        max-width: none;
        padding: 0;
    }
    
    body {
        color: var(--color-black);
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
}