/* ==========================================================================
   Kings River Watershed Partnership (KRWP) - Modern Responsive Stylesheet
   ========================================================================== */

:root {
    --color-primary: #1B1464;      /* Deep KRWP Navy */
    --color-secondary: #0071BC;    /* River Blue */
    --color-accent: #006837;       /* Forest Green */
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-bg: #edf3f8;
    --color-white: #ffffff;
    --color-border: #e2e8f0;
    --color-link: #0071BC;
    --color-link-hover: #004b7c;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Palatino", "Palatino Linotype", Georgia, "Times New Roman", serif;
    --shadow-sm: 0 2px 6px rgba(27, 20, 100, 0.04);
    --shadow-md: 0 8px 24px -4px rgba(27, 20, 100, 0.08), 0 2px 6px rgba(0,0,0,0.03);
    --shadow-lg: 0 16px 36px -6px rgba(27, 20, 100, 0.14), 0 4px 12px rgba(0,0,0,0.05);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --max-width: 1400px;
    --content-width: 1280px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    color: var(--color-text);
    background-color: var(--color-bg);
    background-image: url("../images/topography.svg");
    background-repeat: repeat;
    background-size: 650px 650px;
    background-attachment: fixed;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    visibility: visible !important;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

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

.top-bar {
    background: linear-gradient(90deg, #1B1464 0%, #0071BC 55%, #006837 100%);
    height: 6px;
    width: 100%;
}

.site-header {
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 113, 188, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px -2px rgba(27, 20, 100, 0.06);
    width: 100%;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-container {
    padding: 0.5rem 0 0.75rem;
    text-align: center;
}

.site-logo {
    max-height: 80px;
    width: auto;
    margin: 0 auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.04));
    transition: transform 0.2s ease;
}

.site-logo:hover {
    transform: scale(1.02);
}

/* Nav Menu (Desktop) */
.nav-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
    margin: 0.5rem 0;
}

.nav-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.6rem;
}

.main-nav > ul > li {
    position: relative;
}

.main-nav > ul > li > a {
    display: block;
    padding: 0.6rem 0.95rem;
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.18s ease;
    white-space: nowrap;
}

.main-nav > ul > li > a:hover,
.main-nav > ul > li.active > a {
    color: var(--color-secondary);
    background-color: #eff6ff;
    box-shadow: inset 0 0 0 1px rgba(0, 113, 188, 0.2);
}

.main-nav > ul > li.has-dropdown > a::after {
    content: " ▾";
    font-size: 0.8rem;
    margin-left: 3px;
    color: #64748b;
}

/* Desktop Dropdown Submenu */
@media (min-width: 901px) {
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(8px);
        min-width: 250px;
        background-color: #ffffff;
        border: 1px solid rgba(0, 113, 188, 0.18);
        box-shadow: var(--shadow-lg);
        border-radius: var(--radius-md);
        z-index: 1100;
        list-style: none;
        padding: 0.5rem;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    }

    /* Invisible hover bridge */
    .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -12px;
        left: 0;
        right: 0;
        height: 12px;
    }

    .main-nav > ul > li:hover > .dropdown-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateX(-50%) translateY(0);
    }

    .dropdown-menu li {
        width: 100%;
    }

    .dropdown-menu a {
        display: block;
        padding: 0.65rem 1rem;
        color: #1e293b !important;
        font-size: 0.92rem;
        font-weight: 600;
        text-decoration: none;
        border-radius: var(--radius-sm);
        transition: background-color 0.15s, color 0.15s;
        white-space: nowrap;
    }

    .dropdown-menu a:hover,
    .dropdown-menu li.active a {
        background-color: #eff6ff;
        color: var(--color-secondary) !important;
    }
}

/* ==========================================================================
   Hero Banners & Homepage Slider (Contained inside Main Content)
   ========================================================================== */

.home-slider,
.page-hero {
    position: relative;
    width: 100%;
    height: 480px;
    overflow: hidden;
    background-color: #000;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px -5px rgba(27, 20, 100, 0.15), 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 113, 188, 0.15);
}

.slider-track,
.hero-image-wrap {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-img,
.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-item.active {
    opacity: 1;
    z-index: 2;
}

.mission-statement,
.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(27, 20, 100, 0.82);
    backdrop-filter: blur(5px);
    color: var(--color-white);
    padding: 1.35rem 2rem;
    text-align: center;
    font-family: var(--font-heading);
    font-style: italic;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.mission-statement {
    font-size: clamp(1.15rem, 2.5vw, 1.55rem);
    line-height: 1.45;
}

.hero-title {
    color: var(--color-white);
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-style: italic;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
}

/* ==========================================================================
   Main Content Layout (Generous & Modern Desktop Width)
   ========================================================================== */

.main-content {
    flex: 1;
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.content-card {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 3rem 3.5rem;
    box-shadow: 0 10px 30px -5px rgba(27, 20, 100, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 113, 188, 0.12);
    margin-bottom: 2.5rem;
}

.page-section {
    margin-bottom: 2.75rem;
}

.page-section:last-child {
    margin-bottom: 0;
}

/* Typography */
h1.section-title, h2.section-title {
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3.2vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.65rem;
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, #0071BC 0%, #006837 35%, rgba(226, 232, 240, 0.6) 100%) 1;
}

h2.sub-title, h3.sub-title {
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: 0.85rem;
}

p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    color: #334155;
    line-height: 1.75;
}

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

ul.styled-list, ol.styled-list {
    margin: 1rem 0 1.5rem 2rem;
    color: #334155;
    font-size: 1.02rem;
}

ul.styled-list li, ol.styled-list li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

ul.styled-list li::marker {
    color: var(--color-secondary);
}

/* Highlights & Callout Boxes */
.callout-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 5px solid var(--color-accent);
    padding: 1.5rem 2rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 1.75rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.callout-box.navy {
    background: linear-gradient(135deg, #f8fafc 0%, #edf4fa 100%);
    border-left-color: var(--color-primary);
    border: 1px solid rgba(27, 20, 100, 0.12);
    border-left-width: 5px;
}

.callout-box.blue {
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    border-left-color: var(--color-secondary);
    border: 1px solid rgba(0, 113, 188, 0.12);
    border-left-width: 5px;
}

.callout-box p {
    color: #1e293b;
    font-size: 1.08rem;
    font-weight: 500;
}

/* Cleanups Banner / Contact Callout */
.contact-banner {
    background: linear-gradient(135deg, #1B1464 0%, #004b7c 100%);
    color: var(--color-white);
    padding: 1.75rem 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    margin: 2.5rem 0;
    box-shadow: 0 8px 24px rgba(27, 20, 100, 0.18);
}

.contact-banner p {
    color: var(--color-white);
    font-size: 1.15rem;
    font-weight: 600;
}

.contact-banner a {
    color: #93c5fd;
    font-weight: 700;
}

.contact-banner a:hover {
    color: #bfdbfe;
    text-decoration: underline;
}

/* PDF Download Cards / Buttons */
.download-card {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    border: 1px solid #bfdbfe;
    padding: 1rem 1.6rem;
    border-radius: var(--radius-md);
    color: var(--color-secondary);
    font-weight: 700;
    font-size: 1.05rem;
    margin: 1rem 0 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 113, 188, 0.08);
    transition: all 0.2s ease;
}

.download-card:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #93c5fd;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 113, 188, 0.15);
    text-decoration: none;
}

.download-card .icon {
    font-size: 1.5rem;
}

/* Responsive Grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    margin: 1.75rem 0;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
    margin: 1.75rem 0;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 1.75rem 0;
}

/* Partner Logo Cards */
.partner-card {
    background: var(--color-white);
    border: 1px solid rgba(0, 113, 188, 0.15);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.partner-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 113, 188, 0.12);
    border-color: var(--color-secondary);
}

.partner-card img {
    max-height: 85px;
    max-width: 100%;
    object-fit: contain;
}

/* Publication Download Items */
.pub-item {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(0, 113, 188, 0.15);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.pub-item:hover {
    border-color: var(--color-secondary);
    box-shadow: 0 8px 20px rgba(0, 113, 188, 0.1);
    transform: translateY(-2px);
}

.pub-item h4 {
    color: var(--color-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.pub-item p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.pub-item a.pub-btn {
    align-self: flex-start;
    display: inline-block;
    background: linear-gradient(135deg, #0071BC 0%, #00558f 100%);
    color: var(--color-white);
    padding: 0.5rem 1.15rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 113, 188, 0.25);
    transition: all 0.2s ease;
}

.pub-item a.pub-btn:hover {
    background: linear-gradient(135deg, #005a96 0%, #003e6b 100%);
    box-shadow: 0 4px 10px rgba(0, 113, 188, 0.35);
    transform: translateY(-1px);
}

/* Image Figures */
.image-box {
    margin: 1.75rem 0;
    text-align: center;
}

.image-box img {
    margin: 0 auto;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 113, 188, 0.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.image-caption {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 0.95rem;
    color: #475569;
    margin-top: 0.6rem;
}

/* ==========================================================================
   Tabs Component (River Cleanup)
   ========================================================================== */

.tabs-container {
    margin: 2rem 0;
}

.tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0;
    margin-bottom: 2rem;
}

.tab-btn {
    background-color: #e2e8f0;
    color: #334155;
    border: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 0.75rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background-color: #cbd5e1;
}

.tab-btn.active {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Photo Gallery & Slideshow Component */
.gallery-slideshow {
    position: relative;
    max-width: 860px;
    margin: 2rem auto;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.gallery-track {
    position: relative;
    width: 100%;
    height: 520px;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease-in-out;
}

.gallery-slide.active {
    opacity: 1;
    z-index: 2;
}

.gallery-slide img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 0.75rem 1.5rem;
    color: #fff;
}

.gallery-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0.25rem 1rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.gallery-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gallery-counter {
    font-size: 1.05rem;
    font-weight: 600;
}

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

.site-footer {
    position: relative;
    background: url("../images/krwp footer.jpg") no-repeat center center;
    background-size: cover;
    margin-top: auto;
    border-top: 4px solid var(--color-primary);
}

.footer-overlay {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    padding: 3rem 2rem;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
}

.footer-info {
    font-size: 1rem;
    color: #1e293b;
    line-height: 1.8;
}

.footer-contact {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-primary);
}

.footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.facebook-btn {
    display: inline-block;
    transition: transform 0.2s;
}

.facebook-btn:hover {
    transform: scale(1.1);
}

.facebook-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.footer-copy {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Responsive Media Queries (Mobile & Tablet)
   ========================================================================== */

@media (max-width: 900px) {
    .header-container {
        padding: 0.75rem 1rem;
    }

    .nav-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        width: 100%;
        margin-top: 0.75rem;
        background-color: var(--color-white);
        border-top: 1px solid var(--color-border);
        padding: 0.5rem 0;
    }

    .main-nav.is-open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .main-nav > ul > li {
        width: 100%;
        border-bottom: 1px solid #f1f5f9;
    }

    .main-nav > ul > li > a {
        padding: 0.85rem 1.25rem;
        font-size: 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background-color: #f8fafc;
        border: none;
        border-top: 1px solid var(--color-border);
        padding: 0.25rem 0 0.5rem 1.5rem;
    }

    .dropdown-menu a {
        color: #334155 !important;
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }

    .dropdown-menu a:hover {
        background-color: #e2e8f0;
        color: var(--color-primary) !important;
    }

    .main-nav > ul > li.dropdown-open > .dropdown-menu {
        display: block;
    }

    .home-slider,
    .page-hero {
        height: 340px;
    }

    .gallery-track {
        height: 340px;
    }

    .main-content {
        padding: 1rem 1rem 3rem;
    }

    .content-card {
        padding: 1.75rem 1.25rem;
    }
}

@media (max-width: 600px) {
    .site-logo {
        max-height: 60px;
    }

    .home-slider,
    .page-hero {
        height: 260px;
    }

    .mission-statement,
    .hero-overlay {
        padding: 1rem;
        font-size: 0.98rem;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    .gallery-track {
        height: 240px;
    }

    .tab-btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.9rem;
    }

    .footer-info {
        font-size: 0.9rem;
    }
}
