* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        linear-gradient(
            135deg,
            #d8ecff,
            #f4f9ff
        );
    color: #102b44;
}

.site-header {
    background: #002b4d;
    color: white;
    padding: 28px 20px;
    text-align: center;
    border-bottom: 5px solid #ffbf00;
}

.header-content {
    max-width: 1100px;
    margin: 0 auto;
}

.site-header {
    padding: 10px 20px;
}

.site-header h1 {
    margin: 0;
    font-size: 3rem;
    font-weight: 700;
}

.site-header p {
    display: none;
}

.page-container {
    width: min(1200px, 94%);
    margin: 30px auto;
}

.introduction {
    background: white;
    padding: 22px 26px;
    margin-bottom: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 43, 77, 0.15);
}

.introduction h2 {
    margin-top: 0;
}

.introduction p {
    margin-bottom: 0;
    line-height: 1.7;
}

/*
The map maintains the same dimensions as the original square image.
The percentage-based markers stay in the same relative positions.
*/

.antarctica-map {
    position: relative;
    width: min(600px, 80%);
    aspect-ratio: 527 / 383;
    margin: 0 auto;


    background-image: url("../img/Antarctica-map.jpeg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;

    border: 4px solid #002b4d;
    border-radius: 14px;

    box-shadow: 0 8px 24px rgba(0, 43, 77, 0.25);
}

.station-marker-wrapper {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/*
Make the wrapper rise above nearby markers when hovered
or focused.
*/

.station-marker-wrapper:hover,
.station-marker-wrapper:focus-within {
    z-index: 20;
}

.station-marker {
    display: flex;
    align-items: center;
    gap: 6px;

    padding: 4px 8px;
    border: none;
    border-radius: 18px;

    font: inherit;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;

    cursor: pointer;

    box-shadow:
        0 2px 7px rgba(0, 0, 0, 0.3);
}

.station-marker.available {
    background: #ffffff;
    color: #003d70;
}

.station-marker.unavailable {
    background: #f2f2f2;
    color: #4c4c4c;
}

.marker-dot{
    width:18px;
    height:18px;
    border-radius:50%;
    background:#006bb6;
    border:3px solid white;
}


.available .marker-dot {
    background: #006bb6;
}

.unavailable .marker-dot {
    background: #777777;
}

.station-marker:hover,
.station-marker:focus-visible {
    outline: 4px solid #ffbf00;
    outline-offset: 3px;
}

.station-popup {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);

    width: 250px;
    padding: 14px;

    background: #ffffff;
    color: #102b44;

    border: 2px solid #002b4d;
    border-radius: 10px;

    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.3);

    transform:
        translateX(-50%)
        translateY(8px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
}

.station-popup::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;

    transform: translateX(-50%);

    border-width: 9px;
    border-style: solid;
    border-color:
        #002b4d
        transparent
        transparent
        transparent;
}

.station-popup h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.station-popup p {
    margin: 7px 0;
    line-height: 1.4;
}

.station-popup a {
    display: inline-block;
    margin-top: 7px;
    color: #005c9e;
    font-weight: bold;
}

.station-marker-wrapper:hover .station-popup,
.station-marker-wrapper:focus-within .station-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform:
        translateX(-50%)
        translateY(0);
}

.map-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;

    width: min(900px, 100%);
    margin: 18px auto 35px;
    padding: 14px;

    background: white;
    border-radius: 10px;

    box-shadow:
        0 3px 10px rgba(0, 43, 77, 0.14);
}

.map-legend div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 18px;
    height: 18px;
    border: 3px solid white;
    border-radius: 50%;

    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.25);
}

.available-dot {
    background: #006bb6;
}

.unavailable-dot {
    background: #777777;
}

.station-directory {
    background: white;
    padding: 26px;
    border-radius: 12px;

    box-shadow:
        0 4px 12px rgba(0, 43, 77, 0.15);
}

.station-directory h2 {
    margin-top: 0;
}

.directory-introduction {
    line-height: 1.6;
}

.station-card-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(230px, 1fr));

    gap: 18px;
    margin-top: 20px;
}

.station-card {
    display: flex;
    flex-direction: column;

    padding: 20px;

    background: #eef7ff;
    border: 2px solid #bed8ee;
    border-radius: 10px;
}

.station-card h3 {
    margin-top: 0;
}

.station-card p {
    line-height: 1.55;
}

.station-button {
    display: inline-block;
    margin-top: auto;
    padding: 11px 15px;

    background: #005c9e;
    color: white;

    border-radius: 7px;

    text-align: center;
    text-decoration: none;
    font-weight: bold;
}

.station-button:hover,
.station-button:focus-visible {
    background: #003d70;
    outline: 3px solid #ffbf00;
    outline-offset: 2px;
}

.station-button.disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.site-footer {
    margin-top: 40px;
    padding: 22px;

    background: #002b4d;
    color: white;

    text-align: center;
}

/*
On smaller screens, station names can make the map crowded.
Only the dots remain visible; the complete station names
are still available in the directory below.
*/

@media (max-width: 750px) {

    .station-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .station-marker {
        padding: 5px;
    }

    .marker-dot {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
    }

    .station-popup {
        width: 210px;
    }
}

.trend-page {
    width: min(1500px, 96%);
    margin: 0 auto;
    padding: 28px 0 45px;
}

.trend-header {
    margin-bottom: 22px;
}

.trend-header h1 {
    margin: 0 0 8px;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    color: #ffffff;
}

.trend-header p {
    max-width: 1000px;
    margin: 0;
    color: #dce8f3;
    font-size: 1.05rem;
    line-height: 1.6;
}

.chart-card {
    background: rgba(29, 66, 94, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
    min-width: 0;
}

.chart-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 12px;
}

.chart-heading h2 {
    margin: 2px 0 6px;
    color: #ffffff;
    font-size: 1.35rem;
}

.chart-heading p {
    margin: 0;
    color: #cfdeea;
    font-size: 0.94rem;
    line-height: 1.45;
}

.period-label {
    display: inline-block;
    color: #ffc21c;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.trend-result {
    flex-shrink: 0;
    padding: 9px 12px;
    border-radius: 8px;
    background: rgba(0, 20, 38, 0.65);
    color: #ffffff;
    font-size: 0.88rem;
    line-height: 1.45;
}

/* Top graph: approximately half the current height */
.overview-card {
    margin-bottom: 20px;
}

.overview-chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

/* 74% / 26% proportional layout */
.comparison-section {
    display: grid;
    grid-template-columns: minmax(0, 74fr) minmax(300px, 26fr);
    gap: 20px;
    align-items: stretch;
}

.comparison-chart-container {
    position: relative;
    width: 100%;
    height: 430px;
}

.interpretation-note {
    margin-top: 20px;
    padding: 18px 22px;
    border-left: 5px solid #ffc21c;
    border-radius: 8px;
    background: rgba(0, 31, 57, 0.88);
    color: #dce8f3;
}

.interpretation-note h3 {
    margin: 0 0 6px;
    color: #ffffff;
}

.interpretation-note p {
    margin: 0;
    line-height: 1.55;
}

/* Stack graphs on smaller screens */
@media (max-width: 1000px) {
    .comparison-section {
        grid-template-columns: 1fr;
    }

    .comparison-chart-container {
        height: 370px;
    }

    .chart-heading {
        flex-direction: column;
    }

    .trend-result {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 600px) {
    .trend-page {
        width: 94%;
        padding-top: 18px;
    }

    .overview-chart-container {
        height: 260px;
    }

    .comparison-chart-container {
        height: 320px;
    }

    .chart-card {
        padding: 14px;
    }
}