/* ========================================
   Global Styles & Reset
   ======================================== */

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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-gray: #ecf0f1;
    --border-color: #bdc3c7;
    --white: #ffffff;
    --max-width: 1200px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ========================================
   Header & Navigation
   ======================================== */

header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

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

.nav-links button,
.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

/* .nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
} */

/* ========================================
   Main Content & Sections
   ======================================== */

main {
    min-height: calc(100vh - 200px);
    flex: 1;
    overflow-y: auto;
}

section {
    padding: 1rem 2rem;
    margin: 0 auto;
}

.featured-reports {
    max-width: 100%;
    position: relative;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.categories {
    padding: 0 2rem 3rem;
}

.categories h2 {
    max-width: var(--max-width);
    margin: 0 auto 1.5rem;
    padding: 0 2rem;
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
    background: linear-gradient(rgba(44, 62, 80, 0.8), rgba(52, 152, 219, 0.8)),
        url('../images/background.jpg') center/cover;
    color: var(--white);
    text-align: center;
    padding: 5rem 2rem;
    margin: 0;
    max-width: 100%;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
    border: none;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

/* ========================================
   Reports Grid
   ======================================== */

/* Featured Reports Section */
.featured-reports {
    padding: 0 2rem 3rem;
}

.featured-reports h2 {
    max-width: var(--max-width);
    margin: 0 auto 1.5rem;
    padding: 0 2rem;
}

.reports-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 50px;
    /* Space for arrows */
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    overflow: hidden; /* Prevent horizontal scroll on desktop */
}

.reports-grid.is-carousel {
    display: flex;
    gap: 1.25rem;
    align-items: stretch;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.reports-grid.is-carousel .report-card {
    flex: 0 0 calc(25% - 0.9375rem);
    min-width: 0;
}

.report-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    break-inside: avoid; /* Prevent break in print */
}

.carousel-btn {
     position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.carousel-btn.prev {
    left: -27px;
}

.carousel-btn.next {
    right: -27px;
}

.reports-container.is-carousel .carousel-btn {
    display: grid;
}

.report-card:hover {
    transform: translateY(-3px);
}

.report-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.report-card .date {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.report-card .excerpt {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.read-more {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: color 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    font-family: inherit;
}

.read-more:hover {
    color: var(--accent-color);
}

/* ========================================
   Categories Grid
   ======================================== */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.category-card {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    transition: background-color 0.3s ease;
}

.category-card:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

.category-card h3 {
    margin-bottom: 0.5rem;
}

/* ========================================
   Content Pages (About, Contact)
   ======================================== */

.content-page {
    background-color: var(--white);
}

.about-content,
.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.about-content ul,
.about-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.about-content li {
    margin-bottom: 0.5rem;
}

/* ========================================
   Contact Section
   ======================================== */

.contact-content {
    max-width: 1000px;
}

.contact-methods {
    margin-top: 2rem;
}

.contact-item {
    background: var(--light-gray);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

.contact-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.contact-form {
    margin-top: 3rem;
    background: var(--light-gray);
    padding: 2rem;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.submit-btn {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: var(--primary-color);
}

/* ========================================
   Article Styles
   ======================================== */
article header {
    position: static;
}

.article-content {
    /* max-width: 900px; */
    margin: 0 auto;
}

.article-header {
    margin-bottom: 1rem;
    /* padding-bottom: 2rem; */
    border-bottom: 2px solid var(--light-gray);
}

.article-header h1 {
    font-size: 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-color);
    /*margin-bottom: 1rem;*/
    line-height: 1.2;
}

.article-header p.subtitle {
    font-style: italic;
    color: #7f8c8d;
    text-wrap: balance;
    font-size: clamp(0.6rem, 1vw, 1.2rem);
}

.article-header-extras {
    display: flex;
    justify-content:
        space-between;
    align-items: center;
    width: 100%;
}

.article-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    color: #7f8c8d;
    font-size: 0.95rem;
}

.article-body h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.article-body h3 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--white);
}

.article-body p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.article-body ul,
.article-body ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.article-footer {
    /* margin-top: 4rem;
    padding-top: 2rem; */
    border-top: 2px solid var(--light-gray);
}

.article-footer h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.article-footer strong {
    color: var(--text-color);
}

.sources {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.sources li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: var(--text-color);
    text-align: left;
}

.article-tags {
    margin: 2rem 0;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
}

.tag {
    display: inline-block;
    background: var(--secondary-color);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    margin: 0.3rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

button.lang-toggle {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

.language-toggle {
    margin: 2rem 0;
    padding: 0.5rem;
    background: var(--light-gray);
    border-radius: 8px;
}

.language-toggle a {
    color: var(--secondary-color);
    font-weight: 600;
}

.back-link {
    margin-top: 2rem;
}

.back-link a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.back-link a:hover {
    color: var(--primary-color);
}

/* ========================================
   Footer
   ======================================== */

/* ========================================
   Content Render Section
   ======================================== */

.content-render {
    display: none;
    width: 100%;
    height: 100%;
    background-color: var(--white);
    z-index: 2000;
    padding: 1rem;
}

.content-render.active {
    display: block;
}

.content-close-btn {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 2001;
    transition: background-color 0.3s ease;
}

.content-listen-btn {
    position: fixed;
    left: 60%;
    transform: translateX(-40%);
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 2001;
    transition: background-color 0.3s ease;
}

.content-stop-btn {
    position: fixed;
    left: 70%;
    transform: translateX(-30%);
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 2001;
    transition: background-color 0.3s ease;
}

.content-close-btn:hover {
    background-color: #c0392b;
}

.content-frame {
    width: 100%;
    border: none;
    padding: 2rem;
    overflow-y: auto;
    box-sizing: border-box;
}

/* ========================================
   Maintenance Banner
   ======================================== */

.maintenance-banner {
    background-color: #e74c3c;
    color: var(--white);
    /* padding: 0.75rem 0; */
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.maintenance-text {
    display: inline-block;
    animation: scroll-text 25s linear infinite;
    padding-left: 100%;
}

@keyframes scroll-text {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* ========================================
   Footer
   ======================================== */

footer {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    position: st;
    bottom: 0;
    z-index: 999;
    flex-shrink: 0;
}

.footer-content p {
    margin: 0.5rem 0;
}