/* ========================================
   South Hanover Volunteer Fire Company
   Modern Responsive Stylesheet
   ======================================== */

/* CSS Variables for easy theming */
:root {
    --primary-red: #9B151C;
    --dark-red: #4E0004;
    --accent-red: #9B151C;
    --light-red: #B31319;
    --bg-light: #E6FFFF;
    --bg-light-alt: #FAAAAA;
    --text-dark: #141414;
    --text-light: #FFFFFF;
    --text-gray: #BFBFBF;
    --border-radius: 18px;
    --shadow: 10px 10px 5px rgba(0, 0, 0, 0.2);
    --max-width: 1200px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
}

body {
    font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Announcement Banner */
.banner {
    display: none;
    min-height: 50px;
    width: 90vw;
    max-width: var(--max-width);
    background: var(--primary-red);
    overflow: hidden;
    position: relative;
    margin: 0 auto 0 auto;
    padding: 10px 20px;
}

.banner:not(.active) {
    height: 0;
    margin: 0;
    padding: 0;
}

.banner.active {
    display: block;
    margin: 0 auto 0 auto;
}

.banner a {
    color: var(--text-light);
    text-decoration: none;
    transition: opacity 0.3s ease;
    padding: 0;
    margin: 0;
}

.banner a:visited {
    color: var(--text-light);
}

.banner a:hover,
.banner a:focus {
    opacity: 0.8;
    text-decoration: underline;
}

.banner h1 {
    font-size: 2em;
    margin: 0;
    line-height: 1.4;
    color: var(--text-light);
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.25);
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    width: 100%;
    position: relative;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    padding: 5px 0;
}

/* Company Name Banner */
.company-name-banner {
    background: var(--primary-red);
    color: var(--text-light);
    text-align: center;
    padding: 20px 20px;
    font-size: 2em;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    width: 90vw;
    max-width: var(--max-width);
    margin: 0 auto;
    border-bottom: 3px solid var(--dark-red);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.banner-badge-link {
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

.banner-badge-link:hover {
    opacity: 0.8;
}

.banner-badge {
    height: 65px;
    width: 65px;
    display: block;
}

/* Navigation */
.navbar {
    background: var(--dark-red);
    border-top: 1px solid var(--dark-red);
    padding: 0;
    margin: 0 auto;
    width: 90vw;
    max-width: var(--max-width);
    position: relative;
    z-index: 1000;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1em;
    padding: 14px 16px;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.nav-menu {
    list-style: none;
    text-align: center;
    margin: 0;
    padding: 6px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.nav-menu li {
    display: inline-flex;
}

.nav-link {
    display: inline-block;
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.4em;
    padding: 8px 12px;
    transition: background-color 0.3s ease;
    border-left: 1px solid var(--text-light);
}

.nav-menu li:first-child .nav-link {
    border-left: none;
}

.nav-link:hover,
.nav-link:focus {
    background: var(--light-red);
}

/* Header */
.site-header {
    background: var(--primary-red);
    border: 5px solid var(--dark-red);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin: 0 auto 20px auto;
    width: 90vw;
    max-width: var(--max-width);
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Home page header styling */
.site-header.home-header {
    cursor: default;
}

.site-header h1 {
    color: var(--text-light);
    font-size: 2em;
    font-weight: bold;
    margin: 0;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.site-header.home-header h1 {
    font-size: 1.8em;
}

.site-header a {
    color: var(--text-light);
    text-decoration: none;
    transition: opacity 0.3s ease;
    padding: 0;
    margin: 0;
}

.site-header a:visited {
    color: var(--text-light);
}

.site-header a:hover,
.site-header a:focus {
    opacity: 0.8;
    text-decoration: underline;
}

/* Main Content Area */
.main-wrapper {
    width: 90vw;
    max-width: var(--max-width);
    margin: 20px auto;
    flex: 1;
}

.content-area {
    display: flex;
    gap: 20px;
    padding: 0;
    justify-content: space-between;
    align-items: flex-start;
}

.primary-content {
    flex: 1;
    min-width: 0;
}

/* Center primary content when it's the only child (no sidebar) */
.content-area:not(:has(.sidebar)) {
    justify-content: center;
}

.content-area:not(:has(.sidebar)) .primary-content {
    max-width: 900px;
}

.sidebar {
    width: 25%;
    min-width: 250px;
    flex-shrink: 0;
}

/* When sidebar is hidden on smaller screens, center the primary content */
@media (max-width: 900px) {
    .content-area {
        justify-content: center;
    }

    .primary-content {
        max-width: 100%;
        width: 100%;
    }
}

/* Hero Image Section */
.hero-image {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.station-photo {
    width: 100%;
    height: auto;
    display: block;
}

.hero-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);
    color: var(--text-light);
    padding: 30px 20px 20px;
    text-align: center;
}

.hero-caption h2 {
    font-size: 1.5em;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-caption p {
    font-size: 1.1em;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

/* Content Cards */
.content-card {
    background: var(--text-light);
    border: 3px solid var(--accent-red);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.content-card h2 {
    color: var(--accent-red);
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.content-card h3,
.content-card h4 {
    color: var(--accent-red);
    text-align: center;
    padding: 10px 0;
}

.content-card p {
    margin: 15px 0;
    text-align: center;
}

.content-card ul {
    list-style-type: square;
    list-style-position: inside;
    text-align: left;
    margin: 15px 0;
}

.content-card li ul {
    list-style-type: circle;
    margin-left: 20px;
}

.content-card a {
    color: var(--accent-red);
    text-decoration: none;
    transition: color 0.3s ease;
}

.content-card a:visited {
    color: var(--accent-red);
}

.content-card a:hover,
.content-card a:focus {
    color: blue;
    text-decoration: underline;
}

/* Stats Card */
.stats-card {
    background: var(--text-light);
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.stats-table {
    width: 100%;
    text-align: center;
    border: 3px solid var(--accent-red);
    background: var(--bg-light-alt);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--border-radius);
}

.stats-table thead th {
    background: var(--accent-red);
    color: var(--text-light);
    padding: 12px;
    font-size: 1.1em;
    border-top-left-radius: calc(var(--border-radius) - 3px);
    border-top-right-radius: calc(var(--border-radius) - 3px);
}

.stats-table tbody th {
    color: var(--text-dark);
    font-weight: bold;
    padding: 8px;
    font-size: 0.9em;
}

.stats-table tbody td {
    background: var(--text-light);
    color: var(--text-dark);
    padding: 8px;
    min-width: 3em;
}

.stats-table tbody tr:nth-child(even) td {
    background-color: #f9f9f9;
}

.stats-table tbody tr:last-child th:first-child {
    border-bottom-left-radius: calc(var(--border-radius) - 3px);
}

.stats-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: calc(var(--border-radius) - 3px);
}

/* Recent Calls Widget */
.recent-calls-card {
    margin-bottom: 20px;
}

.recent-calls-list {
    background: var(--text-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.recent-call-item {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.recent-call-item:last-child {
    border-bottom: none;
}

.recent-call-item:hover {
    background-color: #f9f9f9;
}

.call-type {
    font-weight: bold;
    color: var(--accent-red);
    font-size: 0.9em;
    margin-bottom: 4px;
}

.call-location {
    font-size: 0.85em;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.call-commonname {
    font-size: 0.8em;
    color: #666;
    font-style: italic;
    margin-bottom: 4px;
}

.call-datetime {
    font-size: 0.75em;
    color: #888;
}

.recent-calls-loading,
.recent-calls-error,
.recent-calls-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    font-style: italic;
}

.recent-calls-error {
    color: var(--accent-red);
}

.recent-calls-disclaimer {
    font-size: 0.7em;
    color: #666;
    font-style: italic;
    padding: 8px 12px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    line-height: 1.3;
}

/* Social Widget */
.social-widget {
    margin-bottom: 20px;
}

.social-widget .fb-page {
    margin-bottom: 20px;
}

/* Facebook Feed Card */
.fb-feed-card {
    width: 100%;
}

.fb-feed-card .fb-page {
    display: block;
    margin: 0 auto;
}

/* Facebook Posts Container */
.fb-posts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fb-posts-loading,
.fb-posts-error {
    padding: 30px 20px;
    text-align: center;
    color: #888;
    font-style: italic;
}

.fb-posts-error {
    color: var(--accent-red);
}

.fb-posts-error a {
    color: var(--accent-red);
    font-weight: bold;
}

/* Individual Facebook Post */
.fb-post-item {
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 20px;
}

.fb-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.fb-post-image {
    width: 100%;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.fb-post-image img {
    width: 100%;
    height: auto;
    display: block;
}

.fb-post-message {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 12px;
    text-align: left;
    white-space: pre-wrap;
}

.fb-post-meta {
    display: flex;
    align-items: center;
    font-size: 0.85em;
    color: #666;
    gap: 8px;
}

.fb-post-date {
    font-style: italic;
}

.fb-post-link {
    color: var(--accent-red);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.fb-post-link:hover {
    color: var(--light-red);
    text-decoration: underline;
}

/* Facebook Footer Link */
.fb-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    text-align: center;
}

.fb-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-red);
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    transition: color 0.3s ease;
}

.fb-link:hover {
    color: var(--light-red);
    text-decoration: underline;
}

.fb-link i {
    font-size: 1.2em;
}

.sidebar-heading {
    color: var(--accent-red);
    font-size: 1.1em;
    margin: 20px 0 10px 0;
    padding: 8px 10px;
    background: var(--text-light);
    border-left: 4px solid var(--accent-red);
    text-align: left;
}

/* Footer */
.site-footer {
    background: var(--primary-red);
    border: 1px solid var(--dark-red);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    padding: 0;
    margin: 40px auto 0;
    max-width: var(--max-width);
    width: 90vw;
    text-align: center;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

/* Footer content section with solid background for readability */
.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: var(--primary-red);
    z-index: 1;
}

/* Footer image displayed at bottom */
.site-footer::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: url('../images/SHVFC_w_Logo.jpg') no-repeat center bottom;
    background-size: cover;
    opacity: 0.2;
    z-index: 0;
}

.site-footer p,
.site-footer a {
    position: relative;
    z-index: 2;
    padding: 0 15px;
}

.site-footer p {
    font-size: 0.75em;
    margin: 4px 0;
    line-height: 1.4;
}

.site-footer p:first-of-type {
    padding-top: 12px;
}

.site-footer p:last-of-type {
    padding-bottom: 12px;
}

.site-footer a {
    color: var(--text-light);
    text-decoration: none;
    transition: opacity 0.3s ease;
    padding: 0;
    margin: 0;
}

.site-footer a:visited {
    color: var(--text-light);
}

.site-footer a:hover,
.site-footer a:focus {
    opacity: 0.8;
    text-decoration: underline;
}

.site-footer p:nth-of-type(1) {
    font-weight: 600;
    margin-bottom: 6px;
}

.footer-stations {
    display: flex;
    justify-content: center;
    gap: 40px;
    position: relative;
    z-index: 2;
    padding: 0 15px;
    margin: 6px 0;
    font-size: 0.75em;
    line-height: 1.4;
}

.footer-station {
    text-align: center;
}

.site-footer p:nth-of-type(2) {
    margin-top: 6px;
    font-size: 0.7em;
}

/* Responsive Design */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .banner {
        display: none !important;
    }

    .company-name-banner {
        width: 100%;
        font-size: 1.4em;
        padding: 15px 15px;
        gap: 15px;
    }

    .banner-badge {
        height: 50px;
        width: 50px;
    }

    .navbar {
        width: 100%;
    }

    .site-header {
        width: 100%;
        height: 70px;
    }

    .site-header h1 {
        font-size: 1.5em;
    }

    .site-header.home-header h1 {
        font-size: 1.3em;
    }

    .hero-caption h2 {
        font-size: 1.2em;
    }

    .hero-caption p {
        font-size: 0.95em;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        text-align: left;
        padding: 0;
    }

    .nav-menu.active {
        display: block;
    }

    .nav-menu li {
        display: block;
        width: 100%;
    }

    .nav-link {
        display: block;
        border-left: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 1em;
        padding: 12px 16px;
    }

    .content-area {
        flex-direction: column;
        padding: 0 10px;
    }

    .primary-content,
    .sidebar {
        max-width: 100%;
        width: 100%;
    }

    .content-card {
        padding: 15px;
    }

    .content-card h2 {
        font-size: 1.3em;
    }

    .fb-feed-card {
        max-width: 100%;
        padding: 15px 8px;
    }

    .fb-feed-card .fb-page > span,
    .fb-feed-card .fb-page iframe {
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .company-name-banner {
        font-size: 1em;
        padding: 12px 10px;
        gap: 10px;
    }

    .banner-badge {
        height: 38px;
        width: 38px;
    }

    .site-header {
        height: 60px;
    }

    .site-header h1 {
        font-size: 1.2em;
    }

    .site-header.home-header h1 {
        font-size: 1.1em;
    }

    .nav-link {
        font-size: 0.9em;
    }

    .content-card {
        padding: 10px;
    }

    .banner h1 {
        font-size: 1.5em;
    }
}

/* Print Styles */
@media print {

    .navbar,
    .site-header,
    .sidebar,
    .site-footer,
    .banner {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .content-card {
        box-shadow: none;
        border: 1px solid black;
    }

    a {
        text-decoration: none;
        color: inherit;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 10px;
}

.mt-2 {
    margin-top: 20px;
}

.mt-3 {
    margin-top: 30px;
}

.mb-1 {
    margin-bottom: 10px;
}

.mb-2 {
    margin-bottom: 20px;
}

.mb-3 {
    margin-bottom: 30px;
}

.lastmod {
    font-size: 0.7em;
    text-align: right;
    color: gray;
    margin-top: 10px;
}