/* =========================================================
   SAMNET STATIONS DIRECTORY
   /assets/css/stations.css
========================================================= */


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

main {
    background: #f4f7f8;
}


.stations-section {
    padding: 28px 0 56px;
}


/* =========================================================
   SECTION HEADING
========================================================= */

.stations-heading {
    display: flex;

    margin-bottom: 18px;

    align-items: center;
    justify-content: space-between;

    gap: 18px;
}


.stations-heading h2 {
    margin: 0;

    color: #172b43;

    font-size: 1.6rem;
    font-weight: 900;

    letter-spacing: -0.03em;
}


.stations-heading p {
    margin: 4px 0 0;

    color: #7a8991;

    font-size: 0.7rem;
    line-height: 1.45;
}


.stations-network-count {
    display: flex;

    min-width: 105px;

    padding: 9px 12px;

    align-items: center;
    justify-content: center;

    flex-direction: column;

    border: 1px solid #dbe4e7;
    border-radius: 9px;

    background: #ffffff;

    text-align: center;
}


.stations-network-count strong {
    color: #2f8f5b;

    font-size: 3rem;
    font-weight: 900;
}


.stations-network-count span {
    margin-top: 1px;

    color: #7d8c93;

    font-size: 0.48rem;
    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.04em;
}


/* =========================================================
   STATION GRID
========================================================= */

.stations-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 18px;

    align-items: start;
}


/* =========================================================
   STATION CARD
========================================================= */

.station-directory-card {
    min-width: 0;

    overflow: hidden;

    border: 1px solid #dbe3e6;
    border-radius: 14px;

    background: #ffffff;

    box-shadow:
        0 8px 24px
        rgba(10, 31, 43, 0.055);

    text-align: center;
}


/* =========================================================
   CARD TOP / HEADER
========================================================= */

.station-directory-card__top {
    display: flex;

    padding: 15px 16px 11px;

    align-items: center;
    justify-content: center;

    flex-direction: column;

    border-bottom: 1px solid #e4eaec;

    background: #ffffff;

    text-align: center;
}


.station-directory-code {
    display: block;

    color: #2f8f5b;

    font-size: 0.9rem;
    font-weight: 900;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}


.station-directory-card__top h2 {
    margin: 3px 0 0;

    color: #172b43;

    font-size: 1.12rem;
    font-weight: 900;

    line-height: 1.15;
}


.station-directory-location {
    margin: 4px 0 0;

    color: #78878e;

    font-size: 0.83rem;
    font-weight: 600;
}


/* =========================================================
   STATION STATUS
========================================================= */

.station-directory-status {
    display: inline-flex;

    margin-top: 8px;

    min-height: 26px;

    padding: 0 9px;

    align-items: center;
    justify-content: center;

    gap: 5px;

    border-radius: 999px;

    background: #edf1f2;
}


.station-directory-status strong {
    color: #607078;

    font-size: 0.76rem;
    font-weight: 900;

    letter-spacing: 0.03em;

    text-transform: uppercase;
}


.status-dot {
    display: inline-block;

    width: 7px;
    height: 7px;

    flex: 0 0 auto;

    border-radius: 50%;

    background: #a8b0b4;
}


.status-loading {
    background: #a8b0b4;
}


.status-online {
    background: #00a650;
}


.status-stale {
    background: #d49418;
}


.status-offline {
    background: #c85050;
}


/* =========================================================
   SITE INFO
   ELEVATION + STATION ID
========================================================= */

.station-site-info {
    display: grid;

    margin: 0;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    border-bottom: 1px solid #e5ebed;

    background: #f7f9f9;
}


.station-site-info > div {
    padding: 8px 6px;

    text-align: center;
}


.station-site-info > div + div {
    border-left: 1px solid #e2e8ea;
}


.station-site-info span {
    display: block;

    color: #000000;

    font-size: 0.85rem;
    font-weight: 900;

    letter-spacing: 0.04em;

    text-transform: uppercase;
}


.station-site-info strong {
    display: block;

    margin-top: 2px;

    color: #53656d;

    font-size: 0.90rem;
    font-weight: 900;
}


/* =========================================================
   CURRENT CONDITIONS WRAPPER
========================================================= */

.station-directory-current {
    padding: 11px 12px 0;

    background: #eef3f1;

    text-align: center;
}


/* =========================================================
   TEMPERATURE
========================================================= */

.station-directory-temperature {
    padding: 10px;

    border: 1px solid #d8e3dd;
    border-radius: 9px;

    background: #ffffff;
}


.station-directory-temperature span {
    display: block;

    color: #d90000;

    font-size: 0.8rem;
    font-weight: 900;

    letter-spacing: 0.04em;

    text-transform: uppercase;
}


.station-directory-temperature strong {
    display: block;

    margin-top: 5px;

    color: #173d2a;

    font-size: 1.65rem;
    font-weight: 900;

    line-height: 1;
}


/* =========================================================
   OTHER CURRENT VARIABLES
========================================================= */

.station-directory-current-grid {
    display: grid;

    margin-top: 7px;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 7px;
}


.station-directory-current-grid > div {
    min-width: 0;

    padding: 9px 6px;

    border: 1px solid #dce5e0;
    border-radius: 8px;

    background: #ffffff;

    text-align: center;
}


.station-directory-current-grid span {
    display: block;

    color: #7f8c86;

    font-size: 0.84rem;
    font-weight: 900;

    letter-spacing: 0.03em;

    text-transform: uppercase;
}


.station-directory-current-grid strong {
    display: block;

    margin-top: 3px;

    color: #3f5a4b;

    font-size: 0.82rem;
    font-weight: 900;

    line-height: 1.15;
}


/* Make Dew Point + Humidity stand out more */
.station-directory-current-grid > div:nth-child(1) strong,
.station-directory-current-grid > div:nth-child(2) strong {
    font-size: 1rem;

    color: #173d2a;
}


/* =========================================================
   INSTALLED SENSORS
========================================================= */

.station-sensors {
    padding: 10px 12px;

    border-bottom: 1px solid #e4eaec;

    background: #ffffff;

    text-align: center;
}


.station-sensors__label {
    display: block;

    margin-bottom: 6px;

    color: #000000;

    font-size: 0.85rem;
    font-weight: 900;

    letter-spacing: 0.04em;

    text-transform: uppercase;
}


.station-sensor-list {
    display: flex;

    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 5px;
}


.station-sensor-list a {
    display: inline-flex;

    min-height: 26px;

    padding: 0 8px;

    align-items: center;
    justify-content: center;

    border: 1px solid #dce4e7;
    border-radius: 999px;

    color: #53656d;

    background: #f8faf9;

    font-size: 0.8rem;
    font-weight: 800;

    text-decoration: none;
}


.station-sensor-list a:hover {
    color: #2f8f5b;

    border-color: #9ec8ae;

    background: #f1f7f3;
}


/* =========================================================
   LAST OBSERVATION
========================================================= */

.station-directory-observation {
    display: flex;

    min-height: 35px;

    padding: 0 10px;

    align-items: center;
    justify-content: center;

    gap: 5px;

    border-bottom: 1px solid #e4eaec;

    color: #89969c;

    background: #f7f9f9;

    font-size: 0.8rem;

    text-align: center;
}


.station-directory-observation span {
    font-weight: 800;

    text-transform: uppercase;
}


.station-directory-observation strong {
    color: #51646d;

    font-weight: 900;
}


/* =========================================================
   CAMERA SECTION
========================================================= */

.station-card-camera {
    margin: 10px 12px 0;

    overflow: hidden;

    border: 1px solid #dce4e7;
    border-radius: 9px;

    background: #ffffff;
}


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

.station-card-camera__header {
    display: flex;

    min-height: 34px;

    padding: 0 9px;

    align-items: center;
    justify-content: center;

    gap: 6px;

    border-bottom: 1px solid #e5eaec;

    background: #f7f9f9;

    text-align: center;
}


.station-card-camera__header span {
    color: #7d8b91;

    font-size: 0.75rem;
    font-weight: 900;

    letter-spacing: 0.04em;

    text-transform: uppercase;
}


.station-card-camera__header strong {
    color: #4d626b;

    font-size: 0.75rem;
    font-weight: 900;
}


/* =========================================================
   CAMERA MODE BUTTONS
========================================================= */

.station-card-camera__mode {
    display: flex;

    padding: 6px;

    justify-content: center;

    gap: 5px;

    border-bottom: 1px solid #e7ecee;

    background: #ffffff;
}


.station-card-camera__mode-button {
    min-height: 28px;

    padding: 0 9px;

    border: 1px solid #d9e1e4;
    border-radius: 6px;

    color: #687980;

    background: #ffffff;

    font-size: 0.7rem;
    font-weight: 900;

    cursor: pointer;
}


.station-card-camera__mode-button:hover {
    border-color: #98bca7;

    color: #2f8f5b;
}


.station-card-camera__mode-button.active {
    color: #ffffff;

    border-color: #2f8f5b;

    background: #2f8f5b;
}


/* =========================================================
   CAMERA FRAME
========================================================= */

.station-card-camera__frame {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #14212a;
}


.station-card-camera__image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* =========================================================
   CAMERA LOADING
========================================================= */

.station-card-camera__loading {
    position: absolute;

    inset: 0;

    z-index: 5;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #ffffff;

    background:
        rgba(
            10,
            23,
            31,
            0.55
        );

    font-size: 0.6rem;
    font-weight: 700;
}


.station-card-camera__loading[hidden] {
    display: none;
}


/* =========================================================
   CAMERA POPOUT BUTTON
========================================================= */

.station-card-camera__popout-button {
    position: absolute;

    right: 7px;
    bottom: 7px;

    z-index: 9;

    display: flex;

    width: 29px;
    height: 29px;

    padding: 0;

    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;

    color: #ffffff;

    background:
        rgba(
            12,
            29,
            39,
            0.72
        );

    font-size: 0.8rem;

    cursor: pointer;
}


/* =========================================================
   CAMERA STATUS BADGE
========================================================= */

.station-card-camera__badge {
    position: absolute;

    left: 7px;
    bottom: 7px;

    z-index: 8;

    padding: 4px 6px;

    border-radius: 5px;

    color: #ffffff;

    background:
        rgba(
            31,
            128,
            78,
            0.93
        );

    font-size: 0.43rem;
    font-weight: 900;
}


.station-card-camera__badge[hidden] {
    display: none;
}


/* =========================================================
   CAMERA TOP OVERLAY
========================================================= */

.station-card-camera__frame::after {
    position: absolute;

    top: 0;
    right: 0;
    left: 0;

    z-index: 2;

    height: 78px;

    content: "";

    pointer-events: none;

    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.60),
            rgba(0, 0, 0, 0)
        );
}


.station-card-camera__overlay-info {
    position: absolute;

    top: 8px;
    left: 9px;

    z-index: 7;

    display: flex;

    max-width: 68%;

    flex-direction: column;

    align-items: flex-start;

    color: #ffffff;

    text-align: left;

    text-shadow:
        0 1px 4px
        rgba(
            0,
            0,
            0,
            0.9
        );
}


.station-card-camera__overlay-info strong {
    font-size: 0.86rem;
    font-weight: 900;
}


.station-card-camera__overlay-info span {
    margin-top: 1px;

    font-size: 0.75rem;
    font-weight: 700;
}


/* =========================================================
   CAMERA LOGO
========================================================= */

.station-card-camera__frame
img.station-card-camera__overlay-logo {
    position: absolute;

    top: 8px;
    right: 8px;

    z-index: 7;

    width: 45px;
    max-width: 45px;

    height: auto;
    max-height: 45px;

    object-fit: contain;
}


/* =========================================================
   TIMELAPSE CONTROLS
========================================================= */

.station-card-camera__timelapse-controls {
    padding: 8px;

    border-top: 1px solid #e4eaec;

    background: #f7f9f9;
}


.station-card-camera__timelapse-controls[hidden] {
    display: none;
}


.station-card-camera__play-button {
    min-height: 28px;

    padding: 0 9px;

    border: 0;
    border-radius: 6px;

    color: #ffffff;

    background: #2f8f5b;

    font-size: 0.5rem;
    font-weight: 900;

    cursor: pointer;
}


.station-card-camera__timelapse-controls input[type="range"] {
    width: 100%;

    margin: 8px 0 5px;
}


.station-card-camera__speed {
    min-height: 28px;

    padding: 0 6px;

    border: 1px solid #d8e1e4;
    border-radius: 6px;

    color: #53656d;

    background: #ffffff;

    font-size: 0.5rem;
    font-weight: 800;
}


/* =========================================================
   CAMERA DETAILS
========================================================= */

.station-card-camera__details {
    display: flex;

    margin-top: 7px;

    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 7px;

    color: #849198;

    font-size: 0.46rem;

    text-align: center;
}


.station-card-camera__details strong {
    color: #52646d;

    font-weight: 900;
}


/* =========================================================
   CAMERA UNAVAILABLE
========================================================= */

.station-card-camera--unavailable {
    background: #f8faf9;
}


.station-card-camera__placeholder {
    display: flex;

    min-height: 150px;

    padding: 16px;

    align-items: center;
    justify-content: center;

    color: #7d8c93;

    background: #f7f9f9;

    font-size: 0.62rem;
    line-height: 1.45;

    text-align: center;
}


/* =========================================================
   ACTION BUTTONS
========================================================= */

.station-directory-actions {
    display: grid;

    margin: 10px 12px 12px;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 6px;
}


.station-primary-button,
.station-secondary-button {
    display: flex;

    min-height: 34px;

    padding: 0 7px;

    align-items: center;
    justify-content: center;

    border-radius: 7px;

    font-size: 0.76rem;
    font-weight: 900;

    text-align: center;

    text-decoration: none;
}


.station-primary-button {
    color: #ffffff;

    background: #2f8f5b;
}


.station-primary-button:hover {
    background: #247348;
}


.station-secondary-button {
    border: 1px solid #dce4e7;

    color: #53656d;

    background: #ffffff;
}


.station-secondary-button:hover {
    color: #2f8f5b;

    border-color: #8ebba0;

    background: #f5f9f7;
}


/* =========================================================
   CAMERA POPOUT
========================================================= */

.camera-popout[hidden] {
    display: none;
}


.camera-popout {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: flex;

    align-items: center;
    justify-content: center;
}


.camera-popout__backdrop {
    position: absolute;

    inset: 0;

    background:
        rgba(
            0,
            0,
            0,
            0.82
        );
}


.camera-popout__dialog {
    position: relative;

    z-index: 2;

    width: min(94vw, 1200px);

    max-height: 92vh;
}


.camera-popout__close {
    position: absolute;

    top: -38px;
    right: 0;

    z-index: 5;

    width: 32px;
    height: 32px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    color: #ffffff;

    background:
        rgba(
            255,
            255,
            255,
            0.14
        );

    font-size: 1.25rem;

    cursor: pointer;
}


.camera-popout__image-frame {
    position: relative;

    width: 100%;

    overflow: hidden;

    border-radius: 10px;

    background: #10191f;
}


.camera-popout__image {
    display: block;

    width: 100%;
    height: auto;

    max-height: 88vh;

    object-fit: contain;
}


.camera-popout__info {
    position: absolute;

    top: 14px;
    left: 15px;

    z-index: 4;

    display: flex;

    flex-direction: column;

    align-items: flex-start;

    color: #ffffff;

    text-align: left;

    text-shadow:
        0 1px 5px
        rgba(
            0,
            0,
            0,
            0.9
        );
}


.camera-popout__info strong {
    font-size: 1rem;
}


.camera-popout__info span {
    margin-top: 2px;

    font-size: 0.72rem;
}


.camera-popout__logo {
    position: absolute;

    top: 14px;
    right: 15px;

    z-index: 4;

    width: 75px;
    height: auto;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

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


    .station-directory-card {
        max-width: 650px;

        margin: 0 auto;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .stations-section {
        padding-top: 20px;
    }


    .stations-heading {
        align-items: flex-start;

        flex-direction: column;
    }


    .stations-network-count {
        align-self: center;
    }


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


    .station-directory-actions {
        grid-template-columns: 1fr;
    }


    .station-card-camera__frame
    img.station-card-camera__overlay-logo {
        width: 40px;
        max-width: 40px;

        max-height: 40px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .station-directory-current-grid {
        grid-template-columns: 1fr;
    }


    .station-site-info {
        grid-template-columns: 1fr;
    }


    .station-site-info > div + div {
        border-top: 1px solid #e2e8ea;
        border-left: 0;
    }


    .station-card-camera__frame
    img.station-card-camera__overlay-logo {
        width: 34px;
        max-width: 34px;

        max-height: 34px;
    }

}