
/* =========================================
   ROOT VARIABLES
========================================= */

:root {
    --red: #d92538;
    --ink: #172638;
    --muted: #718092;
    --bg: #f3f5f8;
    --line: #e3e8ee;
}


/* =========================================
   GLOBAL STYLES
========================================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px system-ui, -apple-system, Segoe UI, sans-serif;
}


/* =========================================
   HEADER
========================================= */

header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 18px max(24px, calc((100vw - 1380px) / 2));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

header strong {
    font-size: 22px;
    letter-spacing: -0.7px;
}

header strong span {
    color: var(--red);
}


/* =========================================
   TYPOGRAPHY
========================================= */

.eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--red);
    font-weight: 800;
}

h1 {
    font-size: clamp(26px, 3.5vw, 42px);
    letter-spacing: -1.5px;
    margin: 4px 0;
}

p {
    color: var(--muted);
    margin: 4px 0;
}


/* =========================================
   MAIN CONTAINER
========================================= */

.container {
    max-width: 1380px;
    margin: auto;
    padding: 26px 24px 55px;
}


/* =========================================
   PAGE HEADING
========================================= */

.heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 20px;
}


/* =========================================
   LIVE STATUS INDICATOR
========================================= */

.live {
    font-size: 14px;
    background: #e7f7ed;
    color: #167743;
    padding: 9px 13px;
    border-radius: 30px;
    font-weight: 700;
}

.live::before {
    content: "● ";
    color: #20b365;
}


/* =========================================
   MAIN LAYOUT
========================================= */

.layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}


/* =========================================
   TOP CONTROLS
========================================= */

.topcontrols {
    display: grid;
    grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
    gap: 0;
    margin-bottom: 30px;
}

.topcontrols .feature {
    min-height: 200px;
}

.topcontrols .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
}

.topcontrols .controls > p {
    grid-column: 1 / -1;
}


/* =========================================
   PANELS
========================================= */

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 19px;
    overflow: hidden;
    box-shadow: 0 8px 26px #24324908;
}

.panelhead {
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.panelhead b {
    font-size: 18px;
}

.panelhead small {
    color: var(--muted);
}


/* =========================================
   CANADA MAP
========================================= */

.mapwrap {
    overflow: hidden;
    padding: 14px;
    background: linear-gradient(140deg, #f7fbff, #eef4f9);
}

svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 510px;
}


/* =========================================
   MAP PROVINCES
========================================= */

.province {
    fill: #e6edf3;
    stroke: #fff;
    stroke-width: 3;
    stroke-linejoin: round;
    cursor: pointer;
    transition: fill 0.18s, filter 0.18s;
}

.province:hover {
    fill: #f5b9bf;
}

.province.active {
    fill: #d92538;
    filter: drop-shadow(0 3px 4px #c4253650);
}


/* =========================================
   MAP LABELS
========================================= */

.maplabel {
    pointer-events: none;
    font-size: 15px;
    font-weight: 800;
    fill: #435366;
    text-anchor: middle;
}

.maplabel.active {
    fill: white;
}


/* =========================================
   CITY MARKERS
========================================= */

.citydot {
    fill: #fff;
    stroke: #d92538;
    stroke-width: 3;
    cursor: pointer;
}

.citydot.active {
    fill: #172638;
    stroke: white;
    stroke-width: 3;
}


/* =========================================
   WATER AND MAP BACKGROUND
========================================= */

.water {
    fill: #dceef5;
}

.mapwrap {
    background: #e6f2f7;
}

.province {
    stroke: #f7fcff;
    stroke-width: 2.2;
}


/* =========================================
   MAP NOTE
========================================= */

.mapnote {
    font-size: 12px;
    color: var(--muted);
    padding: 10px 18px 18px;
}


/* =========================================
   FEATURED CLOCK
========================================= */

.feature {
    padding: 24px;
    background: linear-gradient(125deg, #b81c30, #ec3e51);
    color: #fff;
    min-height: 218px;
}

.feature .eyebrow {
    color: #ffd6db;
}

.feature h2 {
    margin: 7px 0 4px;
    font-size: 27px;
}

.feature .clock {
    font-size: clamp(44px, 5vw, 66px);
    font-weight: 750;
    letter-spacing: -3px;
    font-variant-numeric: tabular-nums;
    margin: 13px 0 3px;
}

.feature p,
.feature small {
    color: #ffe6e9;
}


/* =========================================
   SEARCH AND DROPDOWN CONTROLS
========================================= */

.controls {
    padding: 20px 22px;
    display: grid;
    gap: 13px;
}

label {
    font-size: 12px;
    font-weight: 750;
    color: #48566a;
}

select,
input {
    width: 100%;
    border: 1px solid #d8dfe7;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    font: inherit;
    color: var(--ink);
}

.controlrow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}


/* =========================================
   CLOCK GRID HEADING
========================================= */

.gridhead {
    margin: 28px 0 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gridhead h2 {
    margin: 0;
    font-size: 22px;
}


/* =========================================
   CLOCK GRID
========================================= */

.clockgrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}


/* =========================================
   INDIVIDUAL CLOCK CARDS
========================================= */

.clockcard {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 18px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s, border 0.15s;
}

.clockcard:hover {
    transform: translateY(-2px);
}

.clockcard.active {
    border: 2px solid var(--red);
    padding: 17px;
    background: #fff9fa;
}

.clockcard .abbr {
    color: var(--red);
    font-size: 12px;
    font-weight: 800;
}

.clockcard h3 {
    font-size: 15px;
    margin: 6px 0 2px;
}

.clockcard .city {
    color: var(--muted);
    font-size: 12px;
}

.clockcard .time {
    font-size: 26px;
    letter-spacing: -0.8px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    margin-top: 13px;
}

.clockcard .zone {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}


/* =========================================
   FOOTER
========================================= */

.foot {
    margin-top: 24px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

/* Footer description - left side */
.footer-info {
    max-width: 650px;
}

/* Copyright - right side */
.footer-copyright {
    white-space: nowrap;
    text-align: right;
}


/* =========================================
   RESPONSIVE - TABLET (1000px)
========================================= */

@media (max-width: 1000px) {

    .topcontrols {
        grid-template-columns: 1fr;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .clockgrid {
        grid-template-columns: repeat(3, 1fr);
    }

}


/* =========================================
   RESPONSIVE - MOBILE (650px)
========================================= */

@media (max-width: 650px) {

    .container {
        padding: 18px 12px;
    }

    .clockgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .clockcard {
        padding: 13px;
    }

    .clockcard.active {
        padding: 12px;
    }

    .clockcard .time {
        font-size: 21px;
    }

    .panelhead {
        padding: 15px;
    }

    .controlrow {
        grid-template-columns: 1fr;
    }

    header {
        padding: 14px;
    }

    .feature .clock {
        font-size: 43px;
    }

    .foot {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .footer-copyright {
        text-align: left;
    }

}


/* =========================================
   RESPONSIVE - SMALL MOBILE (360px)
========================================= */

@media (max-width: 360px) {

    .clockgrid {
        grid-template-columns: 1fr;
    }

}


/* =========================================
   SEARCH CONTROLS + FEATURED CLOCK
   FINAL LAYOUT OVERRIDES
========================================= */

/* Search controls and featured time share the top row. */

.topcontrols {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.85fr);
    gap: 0;
}

.topcontrols .controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-content: center;
}

.topcontrols .controls > p {
    grid-column: 1 / -1;
}

.topcontrols .feature {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 245px;
}

.topcontrols .feature .clock {
    font-size: clamp(35px, 4vw, 62px);
    overflow-wrap: anywhere;
}

.layout {
    display: block;
}


/* =========================================
   FINAL RESPONSIVE OVERRIDES (900px)
========================================= */

@media (max-width: 900px) {

    .topcontrols {
        grid-template-columns: 1fr;
    }

    .topcontrols .feature {
        min-height: 205px;
    }

}


/* =========================================
   FINAL RESPONSIVE OVERRIDES (650px)
========================================= */

@media (max-width: 650px) {

    .topcontrols .controls {
        grid-template-columns: 1fr;
    }

}
