@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
    --color-primary: #003F87;
    --color-navy-dark: #001F3F;
    --color-accent: #CE1126;
    --color-text: #444444;
    --color-border: #dddddd;
    --color-background: #ffffff;
    --content-width: 1100px;
    --section-padding: 48px 24px;
    --card-radius: 4px;
}

/* =========================================================
   BASIC RESET
   ========================================================= */
* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: "Work Sans", Arial, sans-serif;
    line-height: 1.5;
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
h1,
h2,
h3,
h4 {
    margin-top: 0;
    color: var(--color-primary);
}

h1 {
    font-size: 40px;
    font-weight: 500;
}

h2 {
    font-size: 30px;
    font-weight: 600;
}

h3 {
    font-size: 20px;
    font-weight: 600;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* =========================================================
   STANDARD LAYOUT
   ========================================================= */
.site-container {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.site-section {
    padding: 48px 0;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
    display: inline-block;
    padding: 14px 24px;
    border: 0;
    border-radius: var(--card-radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* =========================================================
   SITE HEADER
   ========================================================= */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
}

.site-header .site-container {
    max-width: 1200px;
}

.site-header-inner {
    min-height: 96px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.site-branding {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sa-logo-link {
    display: block;
}

.sa-logo {
    display: block;
    width: 140px;
    height: auto;
}

.brand-divider {
    width: 1px;
    height: 62px;
    margin: 0 16px;
    background: var(--color-primary);
}

.site-brand {
    display: flex;
    flex-direction: column;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.site-brand-name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
}

.site-brand-location {
    margin-top: 3px;
    font-size: 10px;
    font-weight: 500;
}

.site-nav {
    margin-left: auto;
}

.site-nav-list {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav-list > li {
    flex: 0 0 auto;
}

.site-nav-list a,
.nav-more summary {
    color: #111111;
    font-size: 16px;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav-list a:hover,
.nav-more summary:hover {
    color: var(--color-primary);
}

.site-nav-list a.active {
    color: var(--color-primary);
    font-weight: 700;
}

/* =========================================================
   MORE NAVIGATION DROPDOWN
   ========================================================= */
.nav-more {
    position: relative;
}

.nav-more summary {
    cursor: pointer;
    list-style: none;
}

.nav-more summary::-webkit-details-marker {
    display: none;
}

.nav-more summary::after {
    content: " ▼";
    margin-left: 4px;
    font-size: 10px;
}

.nav-more-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 1000;
    min-width: 220px;
    padding: 8px 0;
    background: #ffffff;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.nav-more-menu a {
    display: block;
    padding: 9px 16px;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
}

.nav-more-menu a:hover {
    background: #f5f5f5;
    text-decoration: none;
}

/* =========================================================
   SITE FOOTER
   ========================================================= */
.site-footer {
    background: var(--color-primary);
    color: #ffffff;
    padding: 34px 0;
}

.site-footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 36px;
}

.site-footer h2,
.site-footer h3 {
    margin-top: 0;
    color: #ffffff;
}

.site-footer h2 {
    margin-bottom: 6px;
    font-size: 24px;
}

.site-footer h3 {
    margin-bottom: 12px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.site-footer p {
    margin: 0;
    color: #e6e6e6;
    line-height: 1.5;
}

.site-footer a {
    display: block;
    margin: 8px 0;
    color: #ffffff;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* =========================================================
   QUICK LINKS
   ========================================================= */
.quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.quick-link-card {
    display: block;
    padding: 18px 20px;
    border: 1px solid var(--color-border);
    border-top: 4px solid var(--color-accent);
    border-radius: var(--card-radius);
    background: #ffffff;
    color: var(--color-primary);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quick-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.quick-link-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 18px;
}

.quick-link-card span {
    display: block;
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.35;
}

/* =========================================================
   HOME PAGE
   ========================================================= */
.home-hero {
    width: 100%;
    overflow: hidden;
}

.home-hero-image {
    display: block;
    width: 100%;
    height: auto;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.value-card {
    padding: 24px 12px;
    text-align: center;
}

.value-icon {
    display: block;
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin: 0 auto 16px;
}

.value-card h2 {
    margin-bottom: 14px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

/* Home Upcoming Events list */
#upcoming-events-list {
    margin-top: 18px;
}

.upcoming-event {
    padding: 16px 0;
    border-top: 1px solid #d9d9d9;
}

.upcoming-event:first-child {
    padding-top: 0;
    border-top: 0;
}

.upcoming-event-date {
    margin-bottom: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.upcoming-event-title {
    margin: 0 0 4px;
    font-size: 1.05rem;
    line-height: 1.35;
}

.upcoming-event-location {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #555;
}

.upcoming-events-message {
    margin: 0;
}

/* Home About + Upcoming Events */
.home-overview {
    background: #ffffff;
}

.home-overview-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 28px;
    align-items: stretch;
}

.home-about,
.home-events {
    padding: 32px;
    border-radius: var(--card-radius);
}

.home-about {
    background: #ffffff;
    border: 1px solid #ddd;
}

.home-events {
    background: #f5f5f5;
}

.home-about p,
.home-events p {
    line-height: 1.7;
}

.home-quick-links {
    background: #ffffff;
}

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

    .home-about,
        .home-events {
        padding: 24px;
    }
}

/* =========================================================
   TABLET
   ========================================================= */
@media (max-width: 1050px) {
    .site-header-inner {
        flex-wrap: wrap;
        gap: 8px 20px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .site-nav {
        width: 100%;
        margin-left: 0;
    }

    .site-nav-list {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 10px 20px;
    }
}

@media (max-width: 900px) {
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 700px) {
    .site-container {
        padding-left: 18px;
        padding-right: 18px;
    }

    .site-section {
        padding: 32px 0;
    }

    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 26px;
    }

    /* Header */
    .site-header-inner {
        min-height: auto;
    }

    .sa-logo {
        width: 110px;
    }

    .brand-divider {
        height: 50px;
        margin: 0 12px;
    }

    .site-brand-name {
        font-size: 16px;
    }

    .site-brand-location {
        font-size: 9px;
    }

    .site-nav {
        width: 100%;
        margin-left: 0;
    }

    .site-nav-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px 16px;
    }

    .site-nav-list a,
        .nav-more summary {
        font-size: 14px;
    }

    /* Home */
    .values-grid {
        grid-template-columns: 1fr;
    }

    .value-card h2 {
        white-space: normal;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .site-footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* About page */
.about-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: start;
}

.about-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--card-radius);
}

@media (max-width: 700px) {
    .about-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Join page */
.join-content {
    max-width: 760px;
}

.join-content p {
    font-size: 18px;
    line-height: 1.7;
    margin-bottom: 28px;
}

/* Payments page */
.payment-content {
    max-width: 700px;
}

.payment-content h2 {
    margin-top: 24px;
}

.payment-note {
    margin-top: 20px;
    font-size: 14px;
}

/* Resource catalog */
.resource-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin: 24px 0 0;
}

.resource-section-nav a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.resource-section-nav a:hover {
    text-decoration: underline;
}

.resource-group {
    margin-top: 24px;
}

.resource-group h3 {
    margin-bottom: 12px;
}

.resource-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.resource-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.resource-list a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.resource-list a:hover {
    text-decoration: underline;
}

.resource-list p {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--color-text);
}

.resource-empty {
    margin-top: 16px;
    font-style: italic;
}

/* Troop calendar */
.calendar-content {
    max-width: 1000px;
}

.calendar-embed {
    width: 100%;
    margin-top: 24px;
}

.calendar-embed iframe {
    display: block;
    width: 100%;
    height: 600px;
    border: 0;
}

@media (max-width: 700px) {
    .calendar-embed iframe {
        height: 500px;
    }
}

/* Contact page */
.contact-layout {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 48px;
    align-items: start;
}

.contact-form-section {
    max-width: 700px;
}

.contact-form-section > p {
    font-size: 18px;
    line-height: 1.7;
}

#contact-form {
    margin-top: 28px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--color-primary);
}

.form-field input,
.form-field select,
.form-field textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #b8b8b8;
    border-radius: 4px;
    font: inherit;
    color: var(--color-text);
    background: #ffffff;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

.form-field textarea {
    resize: vertical;
}

.form-status {
    min-height: 24px;
    margin-top: 14px;
}

.contact-visit-section {
    padding: 24px;
    border-top: 4px solid var(--color-accent);
    background: #f5f5f5;
}

.contact-visit-section h2 {
    margin-top: 0;
}

.contact-visit-section address {
    margin-top: 20px;
    font-style: normal;
    line-height: 1.6;
}

@media (max-width: 700px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .contact-form-section {
        max-width: none;
    }
}

/* Eagle Scout Central */
.eagle-intro-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 36px;
    align-items: start;
    margin-bottom: 32px;
}

.eagle-badge img {
    display: block;
    width: 100%;
    max-width: 260px;
    height: auto;
    margin: 0 auto;
}

.eagle-resource-list {
    padding-left: 20px;
}

.eagle-resource-list li {
    margin-bottom: 12px;
}

.eagle-resource-list a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.eagle-resource-list a:hover {
    text-decoration: underline;
}

@media (max-width: 700px) {
    .eagle-intro-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .eagle-badge img {
        max-width: 220px;
    }
}

/* Neighborhood Flags */
.flags-hero {
    position: relative;
    min-height: 520px;
    background-image: url("../images/flags-hero.png");
    background-size: cover;
    background-position: center;
    color: #ffffff;
    overflow: hidden;
    border-bottom: 6px solid var(--color-accent);
}

.flags-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      90deg,
      rgba(0, 31, 63, 0.98) 0%,
      rgba(0, 31, 63, 0.92) 38%,
      rgba(0, 31, 63, 0.48) 62%,
      rgba(0, 31, 63, 0.05) 100%
    );
}

.flags-hero-content {
    position: relative;
    z-index: 1;
    min-height: 520px;
    display: flex;
    align-items: center;
}

.flags-hero-text {
    width: 56%;
    padding: 52px 0;
}

.flags-eyebrow {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.flags-hero h1 {
    margin: 0 0 20px;
    color: #ffffff;
    font-size: clamp(42px, 5vw, 64px);
    line-height: 1;
}

.flags-intro {
    max-width: 560px;
    margin: 0;
    font-size: 19px;
    line-height: 1.6;
}

.flags-benefits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 34px;
}

.flags-benefit {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.flags-benefit-icon {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-accent);
    font-size: 24px;
    line-height: 1;
}

.flags-benefit h2 {
    margin: 2px 0 5px;
    color: #ffffff;
    font-size: 16px;
}

.flags-benefit p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

@media (max-width: 700px) {
    .flags-hero {
        min-height: auto;
        background-position: 64% center;
    }

    .flags-hero-overlay {
        background: rgba(0, 31, 63, 0.84);
    }

    .flags-hero-content {
        min-height: auto;
    }

    .flags-hero-text {
        width: 100%;
        padding: 42px 0;
    }

    .flags-benefits {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .flags-intro {
        font-size: 17px;
    }
}

/* Flags service-area banner */
.flags-service-banner {
    background: #f5f5f5;
    border-bottom: 1px solid #d8d8d8;
}

.flags-service-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    padding-top: 26px;
    padding-bottom: 26px;
}

.flags-service-banner h2 {
    margin: 0 0 5px;
    color: var(--color-primary);
    font-size: 25px;
}

.flags-service-banner p {
    margin-bottom: 0;
}

.flags-service-status {
    flex: 0 0 auto;
    padding: 12px 18px;
    border: 2px solid var(--color-accent);
    border-radius: 4px;
    color: var(--color-accent);
    font-weight: 700;
    text-align: center;
}

@media (max-width: 700px) {
    .flags-service-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .flags-service-status {
        width: auto;
    }
}

/* Flags - How It Works */
.flags-how-it-works {
    padding: 46px 0 52px;
    background: #ffffff;
}

.flags-section-heading {
    margin: 0 0 30px;
    color: var(--color-primary);
    font-size: 26px;
}

.flags-section-heading::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 3px;
    margin-right: 12px;
    vertical-align: middle;
    background: var(--color-accent);
}

.flags-how-layout {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 56px;
    align-items: start;
}

.flags-steps {
    display: grid;
    gap: 24px;
}

.flags-step {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 18px;
    align-items: start;
}

.flags-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 700;
}

.flags-step p {
    margin: 5px 0 0;
    line-height: 1.6;
}

.flags-display-days {
    padding: 26px 28px;
    border: 1px solid #cfcfcf;
    background: #ffffff;
}

.flags-display-days h3 {
    margin: 0 0 18px;
    color: var(--color-primary);
    font-size: 17px;
}

.flags-display-days ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.flags-display-days li {
    position: relative;
    padding: 7px 0 7px 22px;
}

.flags-display-days li::before {
    content: "★";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-size: 12px;
}

@media (max-width: 700px) {
    .flags-how-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .flags-how-it-works {
        padding: 36px 0 42px;
    }
}

/* Flags enrollment panel */
.flags-enrollment-section {
    padding: 0 0 56px;
    background: #ffffff;
}

.flags-enrollment-card {
    max-width: 720px;
    margin: 0 auto;
    border: 1px solid #cfcfcf;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.flags-enrollment-header {
    padding: 16px 24px;
    background: var(--color-primary);
    text-align: center;
}

.flags-enrollment-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 24px;
}

.flags-enrollment-body {
    padding: 30px 32px 34px;
}

.flags-enrollment-body h3 {
    margin-top: 0;
    color: var(--color-primary);
}

.flags-enrollment-body p {
    line-height: 1.6;
}

.flags-enrollment-body button:disabled {
    background: #b8b8b8;
    border-color: #b8b8b8;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 1;
}

@media (max-width: 700px) {
    .flags-enrollment-section {
        padding-bottom: 42px;
    }

    .flags-enrollment-body {
        padding: 24px 20px 28px;
    }

    .flags-enrollment-header h2 {
        font-size: 21px;
    }
}

/* Flags address validation */
.flags-address-eligible {
    color: #217a3c;
    font-weight: 600;
}

.flags-address-ineligible {
    color: var(--color-accent);
    font-weight: 600;
}

#flags-checkout-area {
    margin-top: 20px;
}

#flags-checkout-link[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

/* Neighborhood Flags Thank You */
.flags-thank-you {
    max-width: 900px;
    padding-top: 20px;
    padding-bottom: 30px;
}

.flags-thank-you-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #ffffff;
    font-size: 30px;
    font-weight: 700;
}

.flags-thank-you h1 {
    margin-bottom: 24px;
}

.flags-thank-you-lead {
    max-width: 780px;
    font-size: 18px;
    line-height: 1.6;
}

.flags-thank-you h2 {
    margin-top: 34px;
    margin-bottom: 14px;
}

.flags-thank-you p {
    line-height: 1.6;
}

@media (max-width: 700px) {
    .flags-thank-you {
        padding-top: 10px;
    }

    .flags-thank-you-lead {
        font-size: 17px;
    }
}