/* ============================================================================
   ATCO — Amateur Television in Central Ohio
   Responsive stylesheet: fixed top nav, dropdowns, hero banner, content,
   image gallery, cards and footer.
   ========================================================================== */

:root {
    --atco-blue:        #1a4f8b;   /* primary brand blue (banner sky) */
    --atco-blue-dark:   #123963;
    --atco-blue-darker: #0e2c4d;
    --atco-accent:      #f6a21e;   /* orange accent from the ATCO logos */
    --atco-accent-dark: #d9851a;
    --ink:              #1f2933;
    --ink-soft:         #4a5560;
    --paper:            #ffffff;
    --paper-tint:       #f4f7fb;
    --line:             #d8e0ea;
    --header-h:         64px;
    --maxw:             1140px;
    --radius:           10px;
    --shadow:           0 6px 20px rgba(14, 44, 77, 0.12);
    --shadow-sm:        0 2px 8px rgba(14, 44, 77, 0.10);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    /* Offset for the fixed header so content is never hidden beneath it. */
    padding-top: var(--header-h);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    color: var(--ink);
    line-height: 1.6;
    background: var(--paper);
}

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

a { color: var(--atco-blue); }

h1, h2, h3 { line-height: 1.2; color: var(--atco-blue-darker); }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* ============================== Fixed top nav ============================== */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;       /* top:0; left:0; right:0 */
    height: var(--header-h);
    background: var(--atco-blue);
    color: #fff;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    height: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    text-decoration: none;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
}
.brand-mark {
    font-weight: 800;
    letter-spacing: 0.06em;
    font-size: 1.35rem;
    color: var(--atco-accent);
}
.brand-full {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.95;
}

/* Nav list (desktop) ------------------------------------------------------- */
.nav-menu { display: flex; }
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.nav-item { position: relative; }

.nav-item > a,
.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    white-space: nowrap;
}
.nav-item > a:hover,
.nav-item > a:focus-visible,
.dropdown-toggle:hover,
.dropdown-toggle:focus-visible { background: rgba(255, 255, 255, 0.15); }

.nav-item > a.is-active { background: rgba(255, 255, 255, 0.22); }

.nav-login {
    background: var(--atco-accent) !important;
    color: var(--atco-blue-darker) !important;
}
.nav-login:hover,
.nav-login:focus-visible { background: var(--atco-accent-dark) !important; }
/* Logout is a CSRF-protected POST button styled to match the .nav-login link. */
.nav-logout-form { margin: 0; display: inline-flex; }
.nav-logout { font: inherit; font-weight: 600; border: 0; cursor: pointer; padding: 0.5rem 0.85rem; border-radius: 6px; white-space: nowrap; display: inline-flex; align-items: center; }

.caret { font-size: 0.7em; }

/* Dropdowns ---------------------------------------------------------------- */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    list-style: none;
    margin: 0;
    padding: 0.4rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 1001;
}
.dropdown-menu li a {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}
.dropdown-menu li a:hover,
.dropdown-menu li a:focus-visible {
    background: var(--paper-tint);
    color: var(--atco-blue-dark);
}

/* Desktop: open dropdown on hover or when toggled open via JS. */
@media (min-width: 821px) {
    .has-dropdown:hover .dropdown-menu,
    .has-dropdown:focus-within .dropdown-menu,
    .has-dropdown.open .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* Hamburger (hidden on desktop) ------------------------------------------- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 40px;
    padding: 8px;
    background: none;
    border: 0;
    cursor: pointer;
}
.nav-toggle-bar {
    display: block;
    height: 3px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ============================== Hero banner ============================== */
.hero {
    background: var(--atco-blue-darker);
}
.hero img {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
}

/* ============================== Sections ============================== */
main { display: block; }

.section { padding-block: 2.5rem; }
.section:nth-of-type(even) { background: var(--paper-tint); }

.section h2 {
    margin-top: 0;
    font-size: 1.6rem;
    border-left: 5px solid var(--atco-accent);
    padding-left: 0.7rem;
}

.lead { font-size: 1.1rem; color: var(--ink-soft); }

.page-title {
    background: linear-gradient(135deg, var(--atco-blue), var(--atco-blue-dark));
    color: #fff;
    padding-block: 2.25rem;
}
.page-title h1 { color: #fff; margin: 0; font-size: 2rem; }
.page-title p { margin: 0.5rem 0 0; opacity: 0.95; }

/* Spec list (repeater) ----------------------------------------------------- */
.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}
.spec-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}
.spec-card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.spec-card ul { margin: 0; padding-left: 1.1rem; }
.spec-card li { margin-bottom: 0.25rem; }

/* ============================== Image gallery ============================== */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.gallery figure {
    margin: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery figcaption {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
    text-align: center;
}

/* ============================== Teaser cards ============================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}
.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.card p { margin: 0 0 1rem; color: var(--ink-soft); flex: 1; }
.card .card-link {
    align-self: flex-start;
    font-weight: 600;
    text-decoration: none;
    color: var(--atco-blue-dark);
}
.card .card-link::after { content: " \2192"; }
.card .card-link:hover { text-decoration: underline; }

/* ============================== Call-to-action ============================== */
.cta {
    background: var(--atco-blue);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-top: 1.5rem;
    text-align: center;
}
.cta h2 { color: #fff; border: 0; padding: 0; margin-top: 0; }
.btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.7rem 1.4rem;
    background: var(--atco-accent);
    color: var(--atco-blue-darker);
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
}
.btn:hover { background: var(--atco-accent-dark); }

/* ============================== Article (members) ============================== */
.article { max-width: 820px; }
.article p { margin-block: 1rem; }
.article figure {
    margin: 1.5rem 0;
    text-align: center;
}
.article figure img {
    margin-inline: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.article figcaption {
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin-top: 0.5rem;
}

/* Archive list ------------------------------------------------------------- */
.archive-list {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}
.archive-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
}
.archive-list li a:hover { border-color: var(--atco-blue); background: var(--paper-tint); }
.archive-list .badge {
    font-size: 0.8rem;
    background: var(--paper-tint);
    color: var(--ink-soft);
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}
.archive-actions { margin-top: 1.5rem; }
/* Outline variant of .btn for secondary actions (e.g. "Add a newsletter"). */
.btn-outline { background: transparent; color: var(--atco-blue); border: 1px solid var(--atco-blue); }
.btn-outline:hover { background: var(--paper-tint); }
/* Flash / status messages (newsletter upload). */
.flash { border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.flash-success { background: #e6f4ea; color: #1b5e20; border: 1px solid #b8ddb5; }
.flash-error { background: #fdecea; color: #8a1c12; border: 1px solid #f5c2bd; }
.form-field input[type="file"] { width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; }

/* ============================== Login form ============================== */
.auth-card {
    max-width: 420px;
    margin: 2.5rem auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}
.auth-card h1 { margin-top: 0; font-size: 1.5rem; }
.form-field { margin-bottom: 1rem; }
.form-field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.form-field input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}
.form-field input:focus { outline: 2px solid var(--atco-blue); border-color: var(--atco-blue); }
.auth-card .btn { width: 100%; text-align: center; border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.auth-note { font-size: 0.9rem; color: var(--ink-soft); text-align: center; margin-top: 1rem; }

/* ============================== Stub page ============================== */
.stub { text-align: center; padding-block: 3.5rem; }
.stub .pill {
    display: inline-block;
    background: var(--paper-tint);
    color: var(--atco-blue-dark);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* ============================== Footer ============================== */
.site-footer {
    background: var(--atco-blue-darker);
    color: #cdd9e6;
    margin-top: 3rem;
}
.footer-inner {
    max-width: var(--maxw);
    margin-inline: auto;
    padding: 2rem 1.25rem;
}
.footer-tagline { margin-top: 0; color: #fff; }
.footer-info h2 { color: var(--atco-accent); font-size: 1.05rem; margin-bottom: 0.5rem; }
.footer-info ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-info a { color: #cdd9e6; text-decoration: none; }
.footer-info a:hover { color: #fff; text-decoration: underline; }
.footer-credit { margin-bottom: 0; font-size: 0.85rem; opacity: 0.8; }

/* ============================== Mobile ============================== */
@media (max-width: 820px) {
    .brand-full { display: none; }

    .nav-toggle { display: flex; }

    .nav-menu {
        position: fixed;
        top: var(--header-h);
        right: 0;
        width: min(320px, 85vw);
        height: calc(100vh - var(--header-h));
        background: var(--atco-blue-dark);
        padding: 1rem;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        box-shadow: -4px 0 18px rgba(0, 0, 0, 0.25);
    }
    .nav-menu.open { transform: translateX(0); }

    .nav-list { flex-direction: column; align-items: stretch; gap: 0.15rem; }

    .nav-item > a,
    .dropdown-toggle { width: 100%; justify-content: space-between; }

    /* Mobile dropdowns: in-flow, expand when .open is toggled by JS. */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        background: rgba(255, 255, 255, 0.06);
        max-height: 0;
        overflow: hidden;
        padding: 0;
        transition: max-height 0.25s ease;
    }
    .has-dropdown.open .dropdown-menu { max-height: 600px; padding: 0.25rem; }

    .dropdown-menu li a { color: #eef3f9; }
    .dropdown-menu li a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
}
