/**
 * WeatherAFC - Professional Weather Intelligence Theme
 *
 * Aesthetic: Clean Tech / Data-Driven / Meteorological
 * Dark nav surfaces contrast with bright map content
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Brand Colors */
    --navy: #000067;
    --navy-light: #0a0a7a;
    --cyan: #00A9FF;
    --cyan-bright: #00E9FF;
    --cyan-glow: rgba(0, 169, 255, 0.3);
    --white: #FFFFFF;
    --off-white: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-400: #94A3B8;
    --gray-600: #475569;
    --gray-800: #1E293B;
    --text-dark: #0F172A;
    --text-light: #64748B;

    /* Accent */
    --accent-blue: #0505FF;
    --accent-hover: #0069FF;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Layout */
    --header-height: 64px;
    --footer-height: 56px;
    --admin-bar: 32px;
    --container-max: 1400px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Typography */
    --font-display: 'Outfit', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 30px var(--cyan-glow);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 150ms var(--ease-out);
    --transition-base: 250ms var(--ease-out);
    --transition-slow: 400ms var(--ease-out);
}

/* Admin bar offset */
body.admin-bar {
    --header-top: 32px;
}

body:not(.admin-bar) {
    --header-top: 0px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--off-white);
    padding-top: var(--header-height);
    padding-bottom: 0;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    overflow-x: hidden;
}

/* Map pages: perfect full-viewport fit, no scroll */
body.has-map {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    padding-bottom: 0;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-dark);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--cyan);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn,
button[type="submit"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--white);
    background: linear-gradient(135deg, var(--cyan) 0%, var(--accent-blue) 100%);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm), 0 0 0 0 var(--cyan-glow);
}

.btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    color: var(--white);
}

.btn:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--cyan);
    border: 2px solid var(--cyan);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--cyan);
    color: var(--white);
}

/* ============================================
   LAYOUT
   ============================================ */
.site-content {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    min-height: calc(100dvh - var(--header-height) - var(--footer-height));
}

/* Map pages: fill remaining space exactly */
body.has-map .site-content {
    height: calc(100vh - var(--header-height) - var(--footer-height));
    height: calc(100dvh - var(--header-height) - var(--footer-height));
    min-height: 0;
    overflow: hidden;
}

.site-main {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem;
}

/* Full-width map pages */
body.has-map .site-main {
    max-width: none;
    padding: 0;
    height: 100%;
}

body.has-map .site-main > article,
body.has-map .site-main > .page-content {
    height: 100%;
}

/* ============================================
   MAP CONTAINERS (only on map pages)
   ============================================ */
.map-container {
    width: 100%;
    height: 100%;
}

/* Map pages: all containers fill parent */
body.has-map .entry-content {
    width: 100%;
    height: 100%;
}

body.has-map .xweather-map-container,
body.has-map #map,
body.has-map .leaflet-container,
body.has-map .awxjs-map,
body.has-map .interactive-map {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
}

/* Map attribution styling */
.leaflet-control-attribution {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(8px);
    padding: 4px 8px !important;
    border-radius: var(--radius-sm) 0 0 0 !important;
}

/* Map zoom controls */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow-md) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    color: var(--navy) !important;
    background: var(--white) !important;
    border: none !important;
    font-size: 18px !important;
    font-weight: 600 !important;
}

.leaflet-control-zoom a:hover {
    background: var(--gray-100) !important;
    color: var(--cyan) !important;
}

/* ============================================
   FORMS
   ============================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--text-dark);
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px var(--cyan-glow);
}

input::placeholder {
    color: var(--gray-400);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
}

/* ============================================
   UTILITIES
   ============================================ */

/* Clearfix for floated content (weather plugin uses float) */
.entry-content::after {
    content: '';
    display: table;
    clear: both;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
        --footer-height: 120px;
    }

    body {
        font-size: 14px;
    }

    .site-main {
        padding: 1rem;
    }

    body.has-map .site-main {
        padding: 0;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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