/* Aroostook Right to Read - Main Stylesheet */

:root {
    --primary-green: #2a7f3f;
    --dark-green: #1e5c2f;
    --accent-orange: #ff9d00;
    --dark-blue: #1a2f4a;
    --light-blue: #2a4a7f;
    --text-gray: #333;
    --light-gray: #f5f5f5;
    --border-gray: #ddd;
}

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

html, body {
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-gray);
    background-color: #fff;
}

/* Header */
.top-bar {
    background-color: var(--primary-green);
    padding: 12px clamp(15px, 10vw, 210px);
    display: flex;
    justify-content: flex-end;
    gap: 40px;
    align-items: center;
    font-size: 16px;
}

.top-bar a {
    color: white;
    text-decoration: none;
}

.top-bar a:hover {
    opacity: 0.8;
}

.top-bar .donate-btn {
    background-color: var(--accent-orange);
    color: white;
    padding: 8px 24px;
    border-radius: 4px;
    font-weight: bold;
}

header {
    background-color: #f8f9fa;
    padding: 20px clamp(15px, 10vw, 210px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--primary-green);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo img {
    height: 50px;
}

.logo-text {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary-green);
    text-decoration: none;
}

nav {
    display: flex;
    gap: 20px;
    margin-right: 0;
    position: relative;
}

nav::after {
    content: '';
    position: absolute;
    bottom: -34px;
    left: var(--slider-left, 0);
    height: 12px;
    background-color: var(--primary-green);
    transition: left 0.3s ease, width 0.3s ease;
    width: var(--slider-width, 80px);
}

nav a {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
    font-size: 16px;
    white-space: nowrap;
}

nav a:hover,
nav a.active {
    color: var(--accent-orange);
}

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    gap: 6px;
}

.hamburger-menu span {
    width: 25px;
    height: 3px;
    background-color: var(--text-gray);
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-dropdown {
    position: relative;
    display: inline-block;
    margin: 0;
    padding-bottom: 8px;
}


/* Invisible hover area to keep dropdown visible when moving mouse into it */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 400px;
    pointer-events: auto;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 30px);
    left: 0;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    min-width: 250px;
    padding: 0;
    display: none;
    z-index: 1000;
}


/* Align last dropdown to the right so it doesn't go off-screen */
.nav-dropdown:last-of-type .dropdown-menu {
    left: auto;
    right: 0;
}

.nav-dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
}

.nav-dropdown:hover,
.dropdown-menu:hover {
    z-index: 1001;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #ddd;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background-color: #ddd;
}

/* Hero Banner */
.hero-banner {
    height: 300px;
    display: flex;
    align-items: center;
    color: white;
    position: relative;
    background-color: var(--dark-blue);
    background-size: cover;
    background-position: center;
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(10, 20, 40, 0.55), rgba(10, 20, 40, 0.55));
}

.hero-banner h1 {
    position: relative;
    font-size: 52px;
    font-weight: 700;
    color: white;
    margin-left: calc(33% - 200px);
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Image Carousel */
.image-carousel {
    position: relative;
    width: 100%;
    height: clamp(220px, 45vw, 600px);
    overflow: hidden;
    background-color: var(--dark-blue);
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    background-size: cover;
    background-position: center;
}

.carousel-slide.active {
    opacity: 1;
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
}

.content {
    background-color: white;
    padding: 40px;
}

/* Typography */
h1 {
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--text-gray);
}

h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--text-gray);
}

h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text-gray);
}

p {
    margin-bottom: 15px;
    line-height: 1.8;
}

/* Director Cards */
.directors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.director-card {
    text-align: center;
    padding: 20px;
}

.director-photo {
    width: 150px;
    height: 150px;
    margin: 0 auto 15px;
    border-radius: 8px;
    overflow: hidden;
    object-fit: cover;
    display: block;
}

.director-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.director-position {
    color: #666;
    font-size: 14px;
    margin-bottom: 3px;
}

.director-school {
    color: #999;
    font-size: 13px;
}

/* Resource Cards */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.resource-card {
    background-color: var(--primary-green);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    cursor: pointer;
}

.resource-card:hover {
    background-color: var(--dark-green);
    transform: translateY(-2px);
}

.resource-card a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

/* PDF Viewer */
.pdf-viewer {
    width: 100%;
    height: 1200px;
    margin: 20px 0;
    border: 1px solid var(--border-gray);
}

/* Guest Author Section */
.guest-author {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-top: 40px;
    align-items: start;
}

.guest-author-image {
    width: 100%;
    max-width: 300px;
}

.guest-author-image img {
    width: 100%;
    border-radius: 8px;
}

.guest-author-bio {
    line-height: 1.8;
}

/* Two-column layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: start;
}

/* Section Headers */
.section-header {
    background-color: var(--light-gray);
    padding: 30px;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-green);
}

.section-header h2 {
    margin: 0;
}

/* Footer */
footer {
    background-color: var(--text-gray);
    color: white;
    padding: 40px;
    text-align: center;
    margin-top: 60px;
}

footer a {
    color: var(--accent-orange);
    text-decoration: none;
}

footer .admin-btn {
    display: inline-block;
    margin-top: 14px;
    padding: 6px 16px;
    background-color: var(--primary-green);
    color: white;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: background-color 0.2s;
}

footer .admin-btn:hover {
    background-color: var(--dark-green);
}

/* History List (literacy awards, guest presenters) */
.history-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.history-item {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 10px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid var(--primary-green);
}

.history-item .h-year {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-green);
    white-space: nowrap;
    min-width: 38px;
    flex-shrink: 0;
}

.history-item .h-name {
    font-size: 15px;
    color: var(--text-gray);
    line-height: 1.4;
}

.history-item .h-sub {
    font-size: 13px;
    color: #777;
    margin-top: 2px;
}

@media (max-width: 700px) {
    .history-list {
        grid-template-columns: 1fr;
    }
}

/* News/Updates Section */
.news-section {
    margin-top: 60px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.news-item {
    border-left: 4px solid var(--primary-green);
    padding-left: 20px;
}

.news-date {
    color: #999;
    font-size: 13px;
    margin-bottom: 10px;
}

.news-title {
    font-weight: bold;
    font-size: 16px;
    color: var(--text-gray);
}

.news-title a {
    color: var(--text-gray);
    text-decoration: none;
}

.news-title a:hover {
    color: var(--accent-orange);
}

/* Quick Links */
.quick-links {
    background-color: var(--light-gray);
    padding: 30px;
    margin-top: 40px;
    border-radius: 8px;
}

.quick-links h3 {
    margin-bottom: 20px;
    color: var(--primary-green);
}

.quick-links ul {
    list-style: none;
}

.quick-links li {
    margin-bottom: 10px;
}

.quick-links a {
    color: var(--primary-green);
    text-decoration: none;
}

.quick-links a:hover {
    color: var(--accent-orange);
}

/* Responsive Design - Desktop and up */
@media (max-width: 1024px) {
    nav {
        margin-right: 0;
    }
}

/* Responsive Design - Hamburger Menu & Below */
@media (max-width: 1280px) {
    header {
        flex-direction: row;
        padding: 20px clamp(15px, 7vw, 180px);
        gap: 20px;
        justify-content: space-between;
        align-items: center;
    }

    .hamburger-menu {
        display: flex;
    }

    .top-bar {
        padding: 12px clamp(15px, 7vw, 180px);
    }

    nav {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100%;
        flex-direction: column;
        gap: 0;
        margin-right: 0;
        background-color: white;
        padding: 80px 20px 30px 20px;
        transition: left 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    nav.active {
        left: 0;
    }

    nav a {
        padding: 12px 0;
        font-size: 15px;
        display: block;
    }

    nav > a {
        border-bottom: 1px solid #f0f0f0;
    }

    nav .nav-dropdown {
        margin: 0;
        padding-bottom: 0;
    }

    nav .nav-dropdown > a {
        border-bottom: 1px solid #f0f0f0;
    }

    nav .dropdown-menu {
        position: static;
        display: block;
        background-color: transparent;
        border: none;
        min-width: auto;
        padding: 0;
        top: auto;
    }

    nav .dropdown-menu a {
        padding: 8px 0 8px 15px;
        font-size: 15px;
        color: #666;
        border-bottom: none;
    }

    nav .dropdown-menu a:last-child {
        border-bottom: none;
    }

    nav::after {
        display: none;
    }

    .logo img {
        height: 50px;
    }

    .logo-text {
        font-size: 20px;
    }
}

/* Stack multi-column page sections on tablet/mobile */
@media (max-width: 900px) {
    .home-scholarship-grid,
    .home-about-grid,
    .home-three-col,
    .guest-author-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .home-about-grid {
        padding: 50px 25px !important;
        gap: 30px !important;
    }

    .home-about-grid h2 {
        white-space: normal !important;
        font-size: clamp(20px, 5vw, 28px) !important;
    }

    .home-three-col > div {
        border-right: none !important;
        border-bottom: 1px solid #e5e7eb;
    }

    .home-three-col > div:last-child {
        border-bottom: none;
        min-height: 250px !important;
    }

    .guest-author-grid {
        padding: 0 !important;
        gap: 30px !important;
    }
}

/* Responsive Design - Small Mobile */
@media (max-width: 600px) {
    header {
        flex-direction: row;
        padding: 20px clamp(15px, 10vw, 210px);
        gap: 15px;
    }

    .top-bar {
        flex-direction: column;
        gap: 10px;
        padding: 12px clamp(15px, 10vw, 210px);
    }

    nav {
        gap: 10px;
        font-size: 14px;
    }

    .logo img {
        height: 40px;
    }

    .logo-text {
        font-size: 16px;
    }

    .hero-banner h1 {
        font-size: 32px;
        margin-left: 20px;
    }

    .container {
        padding: 20px;
    }

    .two-column,
    .guest-author {
        grid-template-columns: 1fr;
    }

    .directors-grid,
    .resources-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}
