:root {
    --primary-blue: #007bff;
    --primary-blue-dark: #0056b3;
    --secondary-green: #28a745;
    --secondary-green-dark: #218838;
    --light-grey-bg: #f8f9fa;
    --card-bg: #ffffff;
    --light-border: #e9ecef;
    --text-color: #333;
    --light-text: #6c757d;
    --box-shadow-subtle: 0 2px 8px rgba(0,0,0,0.08);
    --box-shadow-hover: 0 5px 15px rgba(0,0,0,0.12);
}

/* UPDATED: unified system UI stack + smoothing */
body { 
    font-family: system-ui, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
                 "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6; 
    margin: 0; 
    padding: 0; 
    background-color: var(--light-grey-bg); 
    color: var(--text-color); 
}

.main-header {
    background: var(--card-bg);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--box-shadow-subtle);
    margin-bottom: 30px;
}
.header-logo {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--primary-blue-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
}
.header-logo-icon {
    width: 30px;
    height: 30px;
    background: var(--primary-blue);
    border-radius: 4px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2em;
}
.header-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
}
.header-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}
.header-nav a:hover {
    color: var(--primary-blue);
}

/* New Hero Section Style */
/* UPDATED: removed external background image URL to avoid extra request */
.hero-search { 
    background-color: var(--primary-blue-dark);
    background-image: linear-gradient(135deg, #0056b3, #003f88);
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 80px 20px; 
    text-align: center; 
    margin-bottom: 50px;
}
.hero-search h1 {
    color: #fff;
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
    display: block; /* Make sure it's visible */
}
.hero-search .lead-text {
    font-size: 1.4em; 
    color: #fff;
    font-weight: normal;
    margin: 0 auto 30px;
    line-height: 1.4;
}
.search-tabs { 
    display: flex; 
    justify-content: center; 
    margin-bottom: 25px; 
    gap: 10px;
}
.search-tab { 
    background: var(--card-bg);
    color: var(--primary-blue); 
    padding: 12px 20px; 
    border-radius: 50px; 
    border: 1px solid var(--light-border);
    cursor: pointer; 
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; 
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.search-tab:hover { 
    background: var(--light-grey-bg); 
    border-color: var(--primary-blue);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.search-tab.active {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.search-box { 
    display: flex; 
    justify-content: center; 
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}
.search-box input[type="text"] { 
    flex-grow: 1;
    padding: 15px 25px; 
    border: 1px solid var(--light-border); 
    border-right: none;
    border-radius: 50px 0 0 50px; 
    font-size: 1.1em; 
    box-shadow: var(--box-shadow-subtle);
    transition: box-shadow 0.3s ease;
}
.search-box input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: var(--box-shadow-hover);
}
.search-box button { 
    padding: 15px 35px; 
    background: var(--secondary-green); 
    color: #fff; 
    border: none; 
    border-radius: 0 50px 50px 0; 
    cursor: pointer; 
    font-size: 1.1em; 
    font-weight: bold;
    transition: background 0.3s ease, box-shadow 0.3s ease; 
    box-shadow: var(--box-shadow-subtle);
}
.search-box button:hover { 
    background: var(--secondary-green-dark); 
    box-shadow: var(--box-shadow-hover);
}

.container { 
    max-width: 1200px; 
    margin: 20px auto; 
    padding: 0 20px; 
}
        
.section { 
    margin: 60px 0; 
    padding: 20px 0; 
    text-align: center;
}
.section h2 { 
    color: var(--primary-blue-dark); 
    margin-bottom: 15px; 
    font-size: 2.5em; 
    font-weight: 600;
}
.section p {
    max-width: 800px; 
    margin: 0 auto 50px;
    font-size: 1.1em;
    color: var(--light-text);
}

/* --- UPDATED GRID LAYOUTS --- */
.features-grid, .article-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px; 
    text-align: left;
}

.authority-links { 
    display: grid; 
    grid-template-columns: 1fr; /* 1 column by default (mobile-first) */
    gap: 25px; 
    text-align: left;
}
/* ----------------------------- */


/* --- UPDATED AUTHORITY BLOCK --- */
.authority-block, .feature-item { 
    background: var(--card-bg); 
    padding: 30px; 
    border-radius: 12px; 
    border: 1px solid var(--light-border); 
    text-align: left; /* Changed from center */
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    box-shadow: var(--box-shadow-subtle);
}
.article-card { 
    background: var(--card-bg); 
    border-radius: 12px; 
    border: 1px solid var(--light-border); 
    text-align: center; 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    box-shadow: var(--box-shadow-subtle);
    overflow: hidden; /* This is key to containing the image */
    padding: 0; /* Remove padding from the card itself */
}
/* ----------------------------- */

.authority-block:hover, .feature-item:hover, .article-card:hover { 
    transform: translateY(-8px); 
    box-shadow: var(--box-shadow-hover); 
}

/* --- UPDATED TEXT ALIGNMENT --- */
.authority-block h3, .feature-item h3 { 
    color: var(--primary-blue); 
    margin-top: 0; 
    font-size: 1.25em;
    text-align: left; /* Ensure headers are left-aligned */
}
.article-card h3 {
    color: var(--primary-blue); 
    margin-top: 0; 
    font-size: 1.25em;
    text-align: center; /* Keep card headlines centered */
}

.authority-block p, .feature-item p { 
    font-size: 0.95em; 
    color: var(--light-text); 
    line-height: 1.5;
    text-align: left; /* Ensure paragraphs are left-aligned */
}
.article-card p {
    font-size: 0.95em; 
    color: var(--light-text); 
    line-height: 1.5;
    text-align: center; /* Keep card descriptions centered */
}
/* ----------------------------- */

/* UPDATED: make card & authority links clearly link-like (underline) */
.authority-block a, .article-card a { 
    text-decoration: underline; 
    color: var(--primary-blue); 
    font-weight: bold; 
}
.authority-block a:hover, .article-card a:hover { 
    text-decoration: underline; 
}

/* --- STYLES FOR ARTICLE CARD IMAGES --- */
.article-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2; /* Forces a 3:2 aspect ratio, like 450x300 */
    object-fit: cover; /* Ensures image fills the space without distortion */
    border-radius: 0; /* Image has no radius, parent card clips it */
    margin-bottom: 0; /* Remove space */
    border: none;
    border-bottom: 1px solid var(--light-border); /* Separator */
}

/* This new class holds the text and provides the padding */
.article-card-content {
    padding: 20px 25px 25px;
}
/* ------------------------------------------- */


.call-to-action {
    background-color: var(--primary-blue);
    color: #fff;
    padding: 60px 20px;
    text-align: center;
    margin: 60px 0;
}
.call-to-action h2 {
    color: #fff;
    font-size: 2.5em;
    margin-bottom: 20px;
}
.call-to-action .cta-button {
    display: inline-block;
    background-color: var(--secondary-green);
    color: #fff;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
.call-to-action .cta-button:hover {
    background-color: var(--secondary-green-dark);
}

.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-top: 20px;
    text-align: center;
}
.how-it-works-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: var(--box-shadow-subtle);
}
.how-it-works-step .step-number {
    width: 50px;
    height: 50px;
    background: var(--primary-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 20px;
}
.how-it-works-step h3 {
    font-size: 1.5em;
    color: var(--primary-blue-dark);
    margin-bottom: 10px;
}
.how-it-works-step p {
    color: var(--light-text);
    font-size: 1em;
    line-height: 1.5;
}

.faq-section {
    text-align: left;
    margin-bottom: 60px;
}
.faq-item {
    background-color: var(--card-bg);
    border: 1px solid var(--light-border);
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.faq-question {
    padding: 20px;
    cursor: pointer;
    position: relative;
    font-weight: bold;
    font-size: 1.1em;
    color: var(--primary-blue-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question::after {
    content: '+';
    font-size: 1.5em;
    color: var(--primary-blue);
    transition: transform 0.3s ease;
}
.faq-question.active::after {
    content: '−';
    transform: rotate(180deg);
}
.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding-bottom 0.3s ease-out;
    color: var(--light-text);
}
.faq-answer p {
    margin: 0 0 20px 0;
}
.faq-answer.active {
    max-height: 500px;
    padding-bottom: 20px;
}

footer { 
    text-align: center; 
    padding: 30px 20px; 
    margin-top: 50px; 
    font-size: 0.9em; 
    color: var(--light-text); 
    border-top: 1px solid var(--light-border); 
    background-color: var(--card-bg);
}
/* UPDATED: footer links darker + underlined for accessibility */
footer a { 
    color: #0044aa; 
    text-decoration: underline; 
    margin: 0 10px; 
}
footer a:hover { 
    text-decoration: underline; 
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}
.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s ease-in-out;
}

/* --- NEW MEDIA QUERY FOR 2-COLUMN DESKTOP LAYOUT --- */
@media (min-width: 768px) {
    .authority-links {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* -------------------------------------------------- */


@media (max-width: 992px) {
    .features-grid, .article-grid, .how-it-works-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}
@media (max-width: 768px) {
    .main-header { padding: 15px 20px; }
    .header-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 75px;
        left: 0;
        width: 100%;
        background: var(--card-bg);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 10px 0;
    }
    .header-nav.active { display: flex; }
    .header-nav ul { flex-direction: column; gap: 0; width: 100%; }
    .header-nav li { text-align: center; border-bottom: 1px solid var(--light-border); }
    .header-nav li:last-child { border-bottom: none; }
    .header-nav a { display: block; padding: 15px; }
    .menu-toggle { display: flex; }
    
    .hero-search { padding: 60px 20px; }
    .hero-search h1 { font-size: 2.2em; }
    .hero-search .lead-text { font-size: 1.1em; }
    .search-box { flex-direction: column; align-items: stretch; max-width: 90%; }
    .search-box input[type="text"] { border-radius: 50px; margin-bottom: 15px; text-align: center; border-right: 1px solid var(--light-border); }
    .search-box button { border-radius: 50px; }
    .search-tabs { flex-wrap: wrap; }
    .search-tab { padding: 10px 15px; font-size: 0.9em; }
    
    .section h2 { font-size: 2em; }
    .section p { font-size: 1em; }
    .authority-links, .features-grid, .article-grid, .how-it-works-grid { 
        grid-template-columns: 1fr;
        gap: 20px; 
    }
    .authority-block, .feature-item { 
        padding: 25px; 
    }
    
    /* Adjust card padding on mobile to respect image */
    .article-card {
        padding: 0;
    }
    .article-card img {
        border-radius: 12px 12px 0 0;
    }
    .article-card-content {
        padding: 25px 30px 30px;
    }
}


/* ===== Accessibility contrast fixes (homepage) ===== */

/* Darker body text to improve contrast on light backgrounds */
:root {
    --light-text: #4b5563; /* darker grey instead of #6c757d */
}

/* Tabs: darker blue for better contrast */
.search-tab {
    color: #0044aa;
}
.search-tab.active {
    background-color: #0044aa;
    color: #ffffff;
}

/* Search button: darker green for white text */
#search-button {
    background-color: #166534;
}
#search-button:hover {
    background-color: #14532d;
}

