/* --- Global Variables & Reset --- */
:root {
    --primary-font: Verdana, sans-serif; 
    --background-color: #ffffff;
    --text-color: #000000;
    --accent-color-dark: #1a1a1a;
    --accent-color-orange: #f7931a;
    --border-color: #e0e0e0;
    --header-height: 60px;
}

body {
    font-family: var(--primary-font);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    transition: background-color .5s; /* For dimming effect */
    line-height: 1.4;
}

* {
    box-sizing: border-box;
}

a {
    color: var(--accent-color-orange);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--text-color);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--accent-color-dark);
}

/* --- Sidebar Navigation Styles --- */
.sidenav {
    height: 100%;
    width: 0; 
    position: fixed;
    z-index: 1001;
    top: 0;
    left: 0;
    background-color: var(--background-color);
    border-right: 1px solid var(--border-color);
    overflow-x: hidden;
    transition: 0.4s;
    padding-top: 60px;
}
.sidenav a {
    padding: 10px 15px 10px 32px;
    text-decoration: none;
    font-size: 1rem; /* Base font size */
    font-weight: bold;
    color: var(--accent-color-dark);
    display: block;
    transition: 0.3s;
}
.sidenav a:hover {
    background-color: #f1f1f1;
    color: var(--accent-color-orange);
}
.sidebar-logo { color: var(--accent-color-orange); font-weight: bold; }
.sidenav .closebtn { position: absolute; top: 0; right: 25px; font-size: 36px; margin-left: 50px; }

/* --- Header Styles --- */
.site-header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}
.header-left, .header-right {
    flex: 1;
}
.header-center {
    flex: 2;
    text-align: center;
}
.header-right {
    display: flex;
    justify-content: flex-end;
}
.header-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.openbtn { font-size: 32px; cursor: pointer; background: none; border: none; color: var(--accent-color-dark); padding: 10px 15px; }
.logo img { 
    max-height: 50px; 
    vertical-align: middle; 
}

.logo-desktop {
    display: none;
}
.logo-mobile {
    display: inline-block;
    margin-left: 0.5rem;
}

.search-container { display: flex; }
.search-input { border: 1px solid #ccc; background-color: #f9f9f9; color: var(--text-color); padding: 0.5rem; border-radius: 4px 0 0 4px; font-family: var(--primary-font);}
.search-button { background: #eee; border: 1px solid #ccc; border-left: none; color: #333; padding: 0.5rem 0.75rem; cursor: pointer; border-radius: 0 4px 4px 0; }

/* --- Main Content Area --- */
#main-content-wrapper { padding-top: var(--header-height); transition: margin-left .4s; }
.container { max-width: 1400px; margin: 0 auto; padding: 2rem; }

/* --- Universal Article Image Cropping Style --- */
.article-image-container {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 0.2rem; /* FIX: Restored original margin */
}

.article-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Generic Article Styles (FIX: RESTORED ORIGINAL MARGINS) --- */
.article-item { margin-bottom: 0.2rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--border-color); }
.article-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.article-item h1, .article-item h1 a { font-size: 2rem; color: var(--accent-color-dark); text-decoration: none; margin-bottom: 0.2rem; margin-top: 0rem;}
.article-item h2 { margin: 0 0 0.2rem; font-size: 1.3rem; }
.article-item h2 a { color: var(--accent-color-dark); }
.article-item h2 a:hover { color: var(--accent-color-orange); }
.article-item .article-meta, .article-full .article-meta {
    font-size: 1rem;
    color: #666;
    margin-top: 0rem;
    margin-bottom: 0.2rem;
}
.article-item p { margin: 0; color: #333; line-height: 1.4; }

/* --- Article Detail Page --- */
.article-full h1 { 
    font-size: 2.2rem; 
    line-height: 1.2; 
    margin-bottom: 0.5rem;
    text-align: left;
}
.article-full h2.article-abstract {
    font-size: 1.5rem;
    font-weight: normal;
    color: #666;
    margin: 1.5rem 0 1rem 0;
    max-width: none;
    text-align: left;
}
.article-top-content {
    margin-bottom: 1.5rem;
}
.article-full .article-meta {
    font-style: italic;
    color: #666;
    margin-top: 1rem; 
    margin-bottom: 1.2rem; 
    font-size: 1rem;
    text-align: left;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.article-content { 
    font-size: 1.1rem; 
    white-space: pre-wrap;
    padding-top: 0;
}
.article-content > p:first-child {
    margin-top: 0;
}

.article-header-centered {
    text-align: center;
    margin-bottom: 2rem;
}
.title-with-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.title-with-icon h1 {
    margin: 0; /* Remove default h1 margin */
    text-align: center; /* Ensure title remains centered */
}
.article-source-icon {
    display: inline-block;
    flex-shrink: 0;
    margin-top: 0; /* Changed from 0.5rem */
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
}


/* FIX: RE-ADDED ARTICLE DETAIL TWO-COLUMN LAYOUT */
.article-layout-container {
    display: flex;
    flex-direction: row;
    gap: 2.5rem;
    padding-top: 0; 
    border-top: none;
}
.related-articles-column {
    flex: 1 1 25%;
    max-width: 25%;
    border-top: 2px solid black;
    padding-top: 1rem;
}
.main-article-column {
    flex: 1 1 75%;
    max-width: 75%;
    border-top: 2px solid black;
    padding-top: 0rem;
}

/* Related Articles Styles */
.related-articles-column h3 {
    font-size: 1.1rem;
    border-bottom: none;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.related-articles-list {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}
.related-article-item {
    display: block;
    text-decoration: none;
    color: var(--text-color);
}
.related-article-item .article-image-container {
    margin-bottom: 0.1rem;
}
.related-article-item:hover strong {
    color: var(--accent-color-orange);
}
.related-article-item strong {
    display: block;
    margin-top: 0.1rem;
    font-size: 1.1rem;
    line-height: 1.2;
}

/* Keywords Section Styles */
.keywords-container {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.keyword-tag {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: #f0f0f0;
    border-radius: 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: all 0.2s ease-in-out;
}
.keyword-tag:hover {
    background-color: var(--accent-color-orange);
    color: #fff;
}


/* --- Homepage Layout Styles --- */
.homepage-desktop { display: none; }
.homepage-mobile { display: block; }
.opinion-section-container { display: none; }
.section-heading-container {
    border-left: 5px solid var(--accent-color-orange);
    padding-left: 1.5rem;
    margin-bottom: 2rem;
    margin-top: 1rem;
}
.newsroom-list { list-style-type: none; padding-left: 0; margin: 0; }
.newsroom-list li { margin-bottom: 0.75rem; padding-bottom: 0.75rem; border-bottom: 1px solid #f0f0f0; }
.newsroom-list li strong a { color: var(--text-color); font-weight: 600; }
.newsroom-list li strong a:hover { color: var(--accent-color-orange); }
.newsroom-list li .time { font-size: 0.9rem; color: #777; margin-right: 0.75em; font-weight: normal; }


/* --- Newsroom Page Styles --- */
.newsroom-article-item { display: flex; gap: 1.5rem; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border-color); align-items: flex-start; }
.newsroom-article-item:last-child { border-bottom: none; }
.newsroom-article-item .article-image-container { flex-shrink: 0; width: 250px; height: 160px; }
.newsroom-article-item .article-image-container img {
    height: 100%;
    object-fit: cover;
}
.newsroom-text-content { display: flex; flex-direction: column; }
.newsroom-text-content .meta-time { color: #888; font-size: 0.9rem; margin: 0 0 0.5rem 0; }
.newsroom-text-content .title { font-size: 1.15rem; font-weight: bold; color: var(--accent-color-dark); margin: 0 0 0.75rem 0; }
.newsroom-text-content .abstract { font-size: 1rem; line-height: 1.6; color: #333; margin: 0; }


/* --- Featured Article List Page Styles --- */
.featured-main-article { margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 2px solid var(--border-color); }
.featured-main-article .article-image-container { width: 100%; height: auto; max-height: 500px; }
.featured-main-article .main-title { font-size: 1.4rem; margin-top:0.1rem;margin-bottom: 0.2rem; }
.featured-main-article .main-title a { color: var(--accent-color-dark); text-decoration: none; }
.featured-main-article .main-abstract { font-size: 1rem; line-height: 1.2; margin-top: 0.1rem; margin-bottom: 0.5rem; color: #333; }
.article-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }


/* --- START OF CORRECTED STYLES --- */
/* --- Opinion List Page (Order 22) --- */
.opinion-page-grid {
    display: grid;
    /* This creates the two-column layout */
    grid-template-columns: repeat(2, 1fr); 
    gap: 2rem;
}

.opinion-grid-item a {
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* Aligns image and text to the top */
    gap: 1rem;
    text-decoration: none;
    color: var(--text-color);
    background-color: #fafafa;
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.2s ease-in-out;
    height: 100%;
}

.opinion-grid-item a:hover {
    background-color: #f0f0f0;
}

/* FIX: Image container is now strictly sized */
.opinion-grid-item .article-image-container {
    width: 125px;
    height: 80px;
    flex-shrink: 0; /* Prevents the container from shrinking */
    margin-bottom: 0;
    border-radius: 4px; /* Softer edges for the image */
}

/* FIX: Image inside the container will fill it completely */
.opinion-grid-item .article-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image covers the area without distortion */
}

.opinion-item-content {
    display: flex;
    flex-direction: column;
}

/* FIX: Title style is now explicitly set */
.opinion-grid-item .opinion-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    color: var(--accent-color-dark);
}

.opinion-grid-item a:hover .opinion-title {
    color: var(--accent-color-orange);
}

.opinion-grid-item .opinion-abstract {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
    margin: 0;
}
/* --- END OF CORRECTED STYLES --- */


/* --- Responsive Design --- */
@media (min-width: 993px) {
    .homepage-desktop { display: grid; grid-template-columns: 1fr 2.5fr; gap: 2.5rem; }
    .homepage-mobile { display: none; }
    .opinion-section-container { display: block; }
    .desktop-secondary-column { border-right: 1px solid var(--border-color); padding-right: 2.5rem; }
    .logo-desktop { display: inline-block; }
    .logo-desktop img { max-height: 48px; }
    .logo-mobile { display: none; }
}

@media (max-width: 992px) {
    .container { padding: 1rem; }
    .article-grid { grid-template-columns: 1fr; }
    .opinion-grid { grid-template-columns: repeat(2, 1fr); }
    /* FIX: The two-column grid now becomes one column ONLY on smaller tablet/mobile sizes */
    /* .opinion-page-grid { grid-template-columns: 1fr; }  <-- This rule was moved down */

    .article-layout-container { flex-direction: column; border-top: 1px solid var(--border-color); }
    .related-articles-column {
        order: 2;
        max-width: 100%;
        flex-basis: 100%;
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 1px solid var(--border-color);
    }
    .main-article-column {
        order: 1;
        max-width: 100%;
        flex-basis: 100%;
        border-top: none;
        padding-top: 0;
    }
}

@media (max-width: 768px) {
    .search-container { display: none; }
    .featured-main-article .main-title { font-size: 2rem; }
    .opinion-grid { grid-template-columns: 1fr; }
    /* FIX: The grid becomes a single column on mobile */
    .opinion-page-grid { grid-template-columns: 1fr; } 

    .section-heading-container { padding-left: 0; border-left: none; margin-bottom: 1rem; }
    .section-heading { font-size: 1.6rem; text-align: center; }
    .article-full h1 { font-size: 1.6rem; }
    .article-full h2.article-abstract { font-size: 1.1rem; }
    .newsroom-article-item { flex-direction: column; }
    .newsroom-article-item .article-image-container { width: 100%; height: auto; }
    
    /* On mobile, the opinion item layout stacks vertically */
    .opinion-grid-item a { flex-direction: column; } 
    .opinion-grid-item .article-image-container { width: 100%; height: 120px; margin-bottom: 1rem;}
    .logo-mobile img {
        max-height: 30px; /* Make the logo smaller on mobile */
    }

    .header-center {
        flex: 1.5; /* Reduce the space the logo area takes up */
        text-align: left; /* Shift the logo within its container */
        padding-left: 1px; /* Add a small gap from the hamburger menu */
    }
}

/* --- Planner Tool Styles --- */
.planner-container { display: flex; flex-direction: column; gap: 2rem; }
@media (min-width: 768px) { .planner-container { flex-direction: row; } }
.input-panel { flex: 1; }
.results-panel { flex: 3; }
.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; }
label { margin-bottom: 0.5rem; font-weight: bold; color: #333; }
input, select { padding: 0.75rem; border-radius: 4px; border: 1px solid #ccc; background-color: #f9f9f9; font-size: 1rem; font-family: var(--primary-font); }
button[type="submit"] { padding: 0.75rem 1.5rem; border-radius: 4px; border: none; background-color: var(--accent-color-orange); color: var(--accent-color-dark); font-size: 1.1rem; font-weight: bold; cursor: pointer; transition: background-color 0.2s; }
button[type="submit"]:hover { background-color: #e08010; }
button[type="submit"]:disabled { background-color: #ccc; cursor: not-allowed;}
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem; text-align: right; border-bottom: 1px solid var(--border-color); }
th { font-weight: bold; }
tbody tr:hover { background-color: #fff8e1; }
#status-message.error { color: #d32f2f; font-weight: bold; margin-bottom: 1rem;}
.unsustainable-row { background-color: #ffcdd2 !important; font-weight: bold; }

/* --- Newsletter Styles --- */
.newsletter-section {
    text-align: center;
    padding: 2.5rem 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    background-color: #f9f9f9;
}
.newsletter-section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}
.newsletter-form-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}
.newsletter-email-input {
    flex: 1 1 40%;
    padding: 1rem; /* Double height */
    font-size: 1.1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.newsletter-submit-button {
    padding: 1rem 2rem;
    background-color: var(--accent-color-orange);
    color: white !important; /* FIX: Use !important to force white text color */
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: filter 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
.newsletter-submit-button:hover {
    background-color: var(--accent-color-orange); /* FIX: Re-assert background to override generic hover */
    filter: brightness(1.15); 
    color: white !important; 
}
.newsletter-description {
    flex: 1 1 40%;
    margin: 0;
    text-align: left;
    color: #555;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .newsletter-form-inner {
        flex-direction: column;
    }
    .newsletter-email-input, .newsletter-submit-button {
        width: 100%;
    }
    .newsletter-description {
        text-align: center;
        margin-top: 1rem;
    }
}

/* --- Footer --- */
.site-footer {
    text-align: center; /* Fallback for older browsers */
    margin-top: 3rem;
    padding: 2rem 1rem; /* Added horizontal padding */
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #666;
}

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

.footer-copyright {
    flex: 1;
    text-align: left;
    margin: 0;
}

.footer-nav {
    flex: 2;
    text-align: center;
}

.footer-nav a {
    color: #555;
    margin: 0 0.5rem;
    font-weight: bold;
}
.footer-nav a:hover {
    color: var(--accent-color-orange);
}

.footer-nav-separator {
    color: #ccc;
}

.footer-placeholder {
    flex: 1; /* Balances the copyright text */
}

@media (max-width: 768px) {
    .site-footer-content {
        flex-direction: column;
        gap: 1rem;
    }
    .footer-copyright, .footer-nav, .footer-placeholder {
        flex: none;
        text-align: center;
        width: 100%;
    }
    .footer-nav-separator {
        display: none;
    }
    .footer-nav a {
        display: block;
        padding: 0.5rem 0;
    }
}
/* --- Image Caption Style --- */
.image-caption {
    font-size: 0.9rem;      /* Makes it slightly smaller than body text */
    color: #666;           /* A softer gray color */
    text-align: right;      /* Aligns it to the right, common for credits */
    margin-top: -0.8rem;    /* Pulls it closer to the image */
    margin-bottom: 1.5rem;  /* Adds space before the article text starts */
    padding-right: 0.5rem;  /* Adds a little space from the edge */
    font-style: italic;
}

/* --- START: Header Language Switcher Styles --- */
.header-lang-switcher {
    display: inline-block; /* Now visible on all screen sizes */
    margin-right: 0.5rem;
    padding: 0.5rem;
    vertical-align: middle;
    line-height: 0; 
}

.header-lang-switcher img {
    height: 20px;
    width: 30px;
    display: block;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: opacity 0.2s ease-in-out;
}

.header-lang-switcher:hover img {
    opacity: 0.8;
}

/* --- Misc. Enhancements --- */
.youtube-embed-container { position: relative; overflow: hidden; width: 100%; padding-top: 56.25%; margin-bottom: 1.5rem; }
.youtube-embed-container iframe { position: absolute; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100%; border: none; }
.search-page-container { max-width: 800px; margin: 0 auto; text-align: center; }
.search-page-container h1 { font-size: 1.8rem; color: #444; margin-bottom: 2rem; }
.search-page-form { display: flex; margin-bottom: 3rem; border: 1px solid #ccc; border-radius: 4px; overflow: hidden; }
.search-page-form .search-input { flex-grow: 1; border: none; padding: 0.8rem 1rem; font-size: 1.1rem; }
.search-page-form .search-button { border: none; background-color: var(--accent-color-orange); color: white; font-size: 1.5rem; padding: 0 1.2rem; cursor: pointer; transition: background-color 0.2s; }
.search-page-form .search-button:hover { background-color: #e08010; }
.search-results-page { text-align: left; }
.newsroom-date-header { font-size: 1.1rem; font-weight: bold; color: #666; margin: 2.5rem 0 1.5rem 0; padding-bottom: 0.25rem; border-bottom: 1px solid var(--border-color); }
.newsroom-article-list > .newsroom-date-header:first-child { margin-top: 0; }
.article-source-icon img { height: 34px; width: 34px; display: block; }
.article-source-icon:hover { background-color: #f0f0f0; }
.ticker-wrap { width: 100%; overflow: hidden; background-color: var(--accent-color-dark); padding: 0.75rem 0; margin-bottom: 2rem; border-radius: 4px; white-space: nowrap; }
.ticker { display: inline-block; padding-left: 100%; animation: ticker-scroll 45s linear infinite; }
.ticker-wrap:hover .ticker { animation-play-state: paused; }
.ticker-item { display: inline-block; padding: 0 2rem; font-size: 1rem; color: #ffffff; }
.ticker-item::after { content: "◈"; color: var(--accent-color-orange); margin-left: 2rem; }
@keyframes ticker-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
.opinion-section-container { margin-top: 4rem; padding-top: 2rem; border-top: 2px solid var(--border-color); }
.opinion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.opinion-article-item { text-align: left; }
.opinion-article-item a { text-decoration: none; }
.opinion-article-item .opinion-title { font-size: 1.2rem; margin: 0 0 0.5rem 0; color: var(--accent-color-dark); line-height: 1.4; }
.opinion-article-item a:hover .opinion-title { color: var(--accent-color-orange); }
.opinion-abstract { font-size: 0.95rem; line-height: 1.6; color: #333; margin-top: 0.5rem; }