﻿/* 1. Global & Variables */
:root {
    --usgs-blue: #00264c;
    --border-light: #ddd;
    --bg-light: #f4f4f4;
    --white: #ffffff;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
}

h1 {
    color: var(--usgs-blue);
    text-align: center;
}

/* 2. Layout Structure (Sticky Footer) */
main, .main-content {
    flex: 1 0 auto;
}

.footer {
    flex-shrink: 0;
}

/* 3. Header/Banner */
.banner2 {
    height: 65px;
    background-color: var(--usgs-blue);
    display: flex;
    align-items: center;
    padding: 0 20px;
}

/* 4. Hero Section & Sidebar - FIXED HEIGHT LOCK */
.hero-wrapper {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    /* This forces children (Carousel & Sidebar) to the same height */
    align-items: stretch; 
}

.carousel-container {
    flex: 3;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    /* If you want a specific height, set it here, e.g., height: 450px; */
}

/* Ensures images inside the carousel don't force it to grow past the container */
.carousel-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar-links {
    flex: 1;
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    /* Prevents the sidebar from growing taller than the container height */
    overflow: hidden; 
}

.sidebar-header {
    background-color: var(--usgs-blue);
    color: var(--white);
    padding: 12px 15px;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 3px 3px 0 0;
    flex-shrink: 0;
}

.sidebar-content {
    padding: 0;
    margin: 0;
    list-style: none;
    flex-grow: 1;
    /* If links exceed carousel height, this adds a scrollbar instead of growing the box */
    overflow-y: auto; 
}

.sidebar-content li {
    border-bottom: 1px solid var(--border-light);
}

.sidebar-content a {
    display: block;
    padding: 15px;
    color: var(--usgs-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.sidebar-content a:hover {
    background-color: #e9e9e9;
    text-decoration: underline;
}

/* 5. Agency/Resource Grid */
.resource-section {
    background-color: #ccc;
    padding: 20px 10px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    max-width: 1100px;
    margin: 0 auto;
}

.resource-link {
    text-decoration: none !important;
    color: #000 !important;
    display: block;
}

.logo-container {
    width: 100%;
    height: 65px;
    background: var(--white);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    margin-bottom: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.resource-link:hover .logo-container {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* 6. Project Feature Boxes */
.project-row-wrap {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 10px;
}

.project-box {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.box-header {
    background-color: var(--usgs-blue);
    color: var(--white);
    padding: 10px;
    text-align: center;
}

.box-header h2 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--white) !important;
}

.box-image img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.box-body {
    padding: 12px;
    font-size: 0.85rem;
    flex-grow: 1;
}

/* 7. Responsive Adjustments */
@media (max-width: 1024px) {
    .resource-grid { grid-template-columns: repeat(4, 1fr); }
    .project-row-wrap { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .hero-wrapper { flex-direction: column; }
    .project-row-wrap { grid-template-columns: 1fr; max-width: 400px; }
}

@media (max-width: 600px) {
    .resource-grid { grid-template-columns: repeat(2, 1fr); }
}