/*
 * Global stylesheet for the redesigned Snow Day Calculator site
 *
 * The design blends a minimalist aesthetic with playful pastel accents. It
 * is mobile‑first and fully responsive. Colors are defined using CSS
 * variables for easy maintenance. Avoid heavy drop shadows or large
 * animations to keep the pages lightweight and fast to load.
 */

:root {
    --primary-color: #0A263D;
    --secondary-color: #38BDF8;
    --background-color: #F8FBFD;
    --card-background: #FFFFFF;
    --text-color: #0A263D;
    --muted-color: #497899;
    --light-blue: #E0F2FE;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background: var(--background-color);
    color: var(--text-color);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    background: var(--card-background);
    border-bottom: 1px solid #e5eef5;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
}
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}
.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}
.nav a {
    margin-left: 1rem;
    color: var(--muted-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
.nav a:hover,
.nav a.active {
    color: var(--primary-color);
}

/* Hero section */
.hero {
    position: relative;
    background-size: cover;
    background-position: center;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-align: center;
}
.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 38, 61, 0.55);
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 650px;
    padding: 2rem;
}
.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}
.hero-content p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    color: #f5fafc;
}

/* Form */
.calc-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}
.form-row {
    display: flex;
    flex-direction: column;
}
select,
input {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    min-width: 200px;
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

select:focus,
input:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--secondary-color);
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    background: var(--secondary-color);
    color: var(--primary-color);
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 0.5rem;
}
.btn-primary:hover {
    background: #0ea5e9;
}

.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;
}

/* Progress bar */
.result-area {
    margin-top: 2rem;
    text-align: center;
    color: var(--primary-color);
}
.percentage {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--light-blue);
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar .progress {
    height: 100%;
    width: 0;
    background: var(--secondary-color);
    transition: width 0.5s ease-in-out;
}
.result-message {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted-color);
}

/* Sections */
section {
    padding: 4rem 0;
}
.info-section {
    background: var(--background-color);
}

/* Contact page specific styles */
.contact-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
}

.contact-form-container,
.contact-map-container {
    flex: 1 1 300px;
    min-width: 280px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: 4px;
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 1rem;
}

.contact-form textarea {
    resize: vertical;
}
.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

/* Cards */
.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}
.card {
    flex: 1 1 300px;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    padding: 1.5rem;
    transition: transform 0.2s ease;
}
.card:hover {
    transform: translateY(-4px);
}
.card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}
.card p {
    font-size: 0.95rem;
    color: var(--muted-color);
    margin-bottom: 0;
}

/* FAQ */
.faq details {
    margin-bottom: 1rem;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.03);
    padding: 1rem;
}
.faq summary {
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    position: relative;
}
.faq summary::marker {
    display: none;
}
.faq summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 0;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--secondary-color);
    transition: transform 0.2s ease;
}
.faq details[open] summary::after {
    transform: rotate(45deg);
}
.faq details p {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted-color);
}

/* Blog cards */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.blog-card {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.2s ease;
}
.blog-card:hover {
    transform: translateY(-4px);
}
.blog-card img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.blog-card .card-body {
    padding: 1rem;
}
.blog-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--primary-color);
}
.blog-card p {
    font-size: 0.9rem;
    color: var(--muted-color);
    margin-bottom: 0;
}
.blog-card a {
    text-decoration: none;
    color: inherit;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: #ffffff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}
.footer a {
    color: #bbdcf6;
    margin: 0 0.5rem;
    text-decoration: none;
}
.footer a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    .nav {
        display: none;
    }
    .header-content {
        justify-content: space-between;
    }
    .calc-form {
        flex-direction: column;
        align-items: stretch;
    }
    select,
    input {
        min-width: 100%;
    }
}

/* ------------------------------------------------------------------ */
/*  Additional styles for improved branding and weather results         */
/*
 * The new logo consists of a snowflake icon (SVG/WebP) accompanied by
 * the site name. The .logo a wrapper aligns the icon and text
 * horizontally and preserves our color palette. We also expose classes
 * for weather info returned by the calculator, ensuring a consistent
 * look across devices.
 */
.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-color);
}
.logo-text {
    margin-left: 0.4rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}
.logo-img {
    height: 40px;
    width: auto;
}
.weather-info {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    font-size: 1.1rem;
    color: var(--muted-color);
}
.weather-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* ------------------------------------------------------------------ */
/* Gauge visualisation styles
 *
 * The interactive and custom calculators feature a semicircular gauge to
 * display the predicted snow day chance in a way that feels playful and
 * engaging. We build the gauge using an inline SVG comprised of two
 * half‑circle paths – a background track and a progress arc. The
 * `stroke‑dashoffset` of the progress arc is manipulated via JavaScript
 * to reflect the current probability. The accompanying percentage
 * number, description and supporting text are positioned on top of the
 * gauge using absolute positioning.
 */
.gauge-section {
    margin-top: 2rem;
    text-align: center;
}

.gauge-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
}

/* SVG wrapper for the semicircle gauge. The viewBox and dimensions
   ensure a consistent aspect ratio across devices. */
.svg-gauge {
    width: 300px;
    height: 150px;
}

/* Base track behind the progress arc */
.svg-gauge path.bg {
    stroke: var(--light-blue);
    stroke-width: 10;
    fill: none;
}

/* Progress arc. It starts hidden (stroke‑dashoffset equal to the
   circumference of the path) and animates towards the full length
   depending on the probability. A round linecap gives a smooth
   endpoint. */
.svg-gauge path.progress {
    stroke: var(--secondary-color);
    stroke-width: 10;
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease-in-out;
}

/* Percentage text displayed above the gauge */
.gauge-percentage {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Message below the gauge summarising the results */
.gauge-message {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--muted-color);
    max-width: 400px;
    text-align: center;
}

/* Auxiliary text showing how many others are checking the calculator */
.others-count {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--muted-color);
}

/* Hero section styling for the interactive and custom calculators. We
   reuse the minimal structure of the default hero but switch to a
   darker background and white text to improve contrast with the
   colourful gauge. */
.interactive-hero {
    background: var(--primary-color);
    color: #ffffff;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.interactive-hero::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.4);
}

.interactive-content {
    position: relative;
    z-index: 1;
    max-width: 650px;
    padding: 2rem;
}

/* Adjust input and button colours for dark hero */
.interactive-hero select,
.interactive-hero input {
    background: #ffffff;
    color: var(--primary-color);
}

.interactive-hero .btn-primary {
    color: var(--primary-color);
}