/*
Theme Name: Raymond Video Archives
Theme URI: https://raymondmaine.org
Author: Town of Raymond, Maine
Description: Custom theme for Raymond Maine video archives, live streaming, and promotional videos
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: raymond-video
*/

/* ============================================
   CSS VARIABLES & ROOT SETTINGS
   ============================================ */
:root {
    /* Town of Raymond Colors - inspired by Maine landscapes */
    --raymond-sky: #4a90b8;
    --raymond-sky-light: #7eb3d1;
    --raymond-sky-dark: #2d6a8f;
    --raymond-lake: #1a5276;
    --raymond-forest: #2e7d32;
    --raymond-forest-light: #4caf50;
    --raymond-sand: #f5f1e8;
    --raymond-cream: #fdfcf9;
    --raymond-stone: #5d6d7e;
    --raymond-slate: #34495e;
    
    /* UI Colors */
    --link-color: #1565c0;
    --link-hover: #0d47a1;
    --header-bg: linear-gradient(180deg, var(--raymond-sky) 0%, var(--raymond-sky-light) 100%);
    --nav-bg: var(--raymond-lake);
    --table-header: #5a7a9a;
    --table-alt-row: #f8fafc;
    --border-color: #d1d9e0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.18);
    
    /* Typography */
    --font-heading: 'Crimson Text', Georgia, 'Times New Roman', serif;
    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Layout */
    --max-width: 1200px;
    --header-height: 120px;
    --nav-height: 44px;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--raymond-slate);
    background: var(--raymond-cream);
    min-height: 100vh;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--raymond-lake);
    margin-top: 0;
}

/* ============================================
   SITE HEADER
   ============================================ */
.site-header {
    background: var(--header-bg);
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('images/header-clouds.png') no-repeat center center;
    background-size: cover;
    opacity: 0.3;
    pointer-events: none;
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-xl);
    position: relative;
    z-index: 1;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 400;
    color: #1a3a5c;
    margin: 0 0 var(--space-xs);
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
}

.site-tagline {
    font-size: 0.95rem;
    color: var(--raymond-slate);
    margin: 0;
}

/* ============================================
   MAIN NAVIGATION
   ============================================ */
.main-navigation {
    background: var(--nav-bg);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: var(--space-md) var(--space-lg);
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
    background: rgba(255,255,255,0.1);
    border-bottom-color: var(--raymond-forest-light);
    text-decoration: none;
}

/* Dropdown menus */
.nav-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: var(--shadow-md);
    list-style: none;
    padding: var(--space-sm) 0;
    z-index: 1000;
}

.nav-menu li:hover .sub-menu {
    display: block;
}

.nav-menu .sub-menu a {
    color: var(--raymond-slate);
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.85rem;
    text-transform: none;
    border-bottom: none;
}

.nav-menu .sub-menu a:hover {
    background: var(--raymond-sand);
    color: var(--raymond-lake);
}

/* ============================================
   PAGE CONTENT
   ============================================ */
.site-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-xl);
}

.page-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--raymond-sky-light);
}

.page-title {
    font-size: 1.75rem;
    color: var(--raymond-lake);
    margin: 0;
}

/* ============================================
   VIDEO ARCHIVE TABLE
   ============================================ */
.video-archive-filters {
    background: var(--raymond-sand);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.filter-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--raymond-slate);
}

.filter-group select,
.filter-group input[type="text"] {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    min-width: 200px;
    background: white;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--raymond-sky);
    box-shadow: 0 0 0 3px rgba(74, 144, 184, 0.2);
}

.filter-group select[multiple] {
    min-height: 120px;
}

.btn-filter {
    padding: var(--space-sm) var(--space-xl);
    background: var(--raymond-lake);
    color: white;
    border: none;
    border-radius: 4px;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-filter:hover {
    background: var(--raymond-sky-dark);
    color: white;
    text-decoration: none;
}

.btn-filter.btn-clear {
    background: #6c757d;
}

.btn-filter.btn-clear:hover {
    background: #5a6268;
}

.filter-buttons {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
}

/* Archive Table */
.video-archive-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    overflow: hidden;
}

.video-archive-table thead {
    background: var(--table-header);
}

.video-archive-table th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.video-archive-table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.video-archive-table tbody tr:nth-child(even) {
    background: var(--table-alt-row);
}

.video-archive-table tbody tr:hover {
    background: #e8f4f8;
}

.video-archive-table .view-link {
    color: var(--link-color);
    font-weight: 500;
}

.video-archive-table .video-title {
    color: var(--link-color);
}

.video-archive-table .video-title:hover {
    color: var(--link-hover);
}

/* ============================================
   LIVE STREAMING SECTION
   ============================================ */
.live-streaming-section {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: var(--space-2xl);
}

.live-streaming-header {
    background: var(--raymond-lake);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.live-dot {
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.video-embed-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
}

.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.streaming-info {
    padding: var(--space-lg);
    background: var(--raymond-sand);
    font-size: 0.9rem;
    color: var(--raymond-stone);
}

/* ============================================
   PROMOTIONAL VIDEOS GRID
   ============================================ */
.promo-videos-filters {
    background: var(--raymond-sand);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    border-radius: 8px;
}

.promo-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.promo-video-card {
    overflow: visible;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.promo-video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.promo-video-thumbnail {
    max-height: 180px;
    position: relative;
    height: 180px;
    background: #1a1a1a;
    overflow: hidden;
}

.promo-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.promo-video-card:hover .promo-video-thumbnail img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.promo-video-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay svg {
    width: 24px;
    height: 24px;
    fill: white;
    margin-left: 4px;
}

.promo-video-content {
    
    
    
    
    padding: var(--space-lg);
}

.promo-video-title {
    font-size: 1rem;
    margin: 0;
    color: var(--link-color);
}

.promo-video-title a {
    color: inherit;
}

.promo-video-title a:hover {
    color: var(--link-hover);
}

.promo-video-category {
    font-size: 0.8rem;
    color: var(--raymond-stone);
    margin-top: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   COMBINED VIDEO PAGE LAYOUT
   ============================================ */
.video-section {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-2xl);
    border-bottom: 2px solid var(--border-color);
}

.video-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: 1.5rem;
    color: var(--raymond-lake);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.section-title .icon {
    width: 32px;
    height: 32px;
    fill: var(--raymond-sky);
}

.section-toggle {
    background: var(--raymond-sand);
    border: 1px solid var(--border-color);
    padding: var(--space-sm) var(--space-md);
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--raymond-slate);
    transition: all 0.2s ease;
}

.section-toggle:hover {
    background: var(--raymond-sky-light);
    color: white;
}

/* ============================================
   TABS NAVIGATION
   ============================================ */
.video-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-xl);
    border-bottom: 2px solid var(--border-color);
}

.video-tab {
    padding: var(--space-md) var(--space-xl);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--raymond-stone);
    transition: all 0.2s ease;
}

.video-tab:hover {
    color: var(--raymond-lake);
}

.video-tab.active {
    color: var(--raymond-lake);
    border-bottom-color: var(--raymond-lake);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ============================================
   DISCLAIMER NOTICE
   ============================================ */
.video-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xl);
    border-radius: 4px;
    font-size: 0.9rem;
    color: #856404;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-xl);
}

.pagination a,
.pagination span {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--raymond-slate);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--raymond-sky-light);
    color: white;
    border-color: var(--raymond-sky-light);
    text-decoration: none;
}

.pagination .current {
    background: var(--raymond-lake);
    color: white;
    border-color: var(--raymond-lake);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--raymond-slate);
    color: white;
    padding: var(--space-2xl) 0;
    margin-top: var(--space-2xl);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-2xl);
}

.footer-section h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
}

.footer-section p,
.footer-section a {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    max-width: var(--max-width);
    margin: var(--space-xl) auto 0;
    padding: var(--space-lg) var(--space-xl) 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .site-title {
        font-size: 2rem;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-menu a {
        padding: var(--space-md);
    }
    
    .video-archive-filters {
        flex-direction: column;
    }
    
    .filter-group select,
    .filter-group input[type="text"] {
        width: 100%;
        min-width: auto;
    }
    
    .video-tabs {
        flex-direction: column;
    }
    
    .video-tab {
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .video-tab.active {
        border-bottom: none;
        border-left-color: var(--raymond-lake);
        background: var(--raymond-sand);
    }
    
    .video-archive-table {
        display: block;
        overflow-x: auto;
    }
    
    .promo-videos-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .main-navigation,
    .video-archive-filters,
    .promo-videos-filters,
    .video-tabs,
    .play-overlay,
    .site-footer {
        display: none !important;
    }
    
    .site-header {
        background: none;
        border-bottom: 2px solid #000;
    }
    
    .site-title {
        color: #000;
    }
}
