/* ========================================
   SAMNET HOME - STATION SELECTOR + MAP
======================================== */

.home-dashboard {
    min-height: 100vh;
    color: #172b43;
    background: #f4f7f8;
}

.home-stations-section {
    padding: 30px 0 54px;
}

.home-section-heading {
    max-width: 760px;
    margin: 0 auto 20px;
    text-align: center;
}

.home-section-kicker {
    display: block;
    margin-bottom: 4px;
    color: #2f8f5b;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-section-heading h1 {
    margin: 0;
    color: #172b43;
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 900;
    letter-spacing: -0.035em;
}

.home-section-heading p {
    margin: 6px 0 0;
    color: #7d8c93;
    font-size: 0.76rem;
    line-height: 1.5;
}

.error-message {
    margin-bottom: 14px;
    padding: 10px 14px;
    border: 1px solid #e0b8b8;
    border-radius: 8px;
    color: #9b3232;
    background: #fff4f4;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.home-network-layout {
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.35fr);
    gap: 20px;
    align-items: start;
}

.home-station-list {
    display: grid;
    gap: 14px;
}

.home-station-card {
    overflow: hidden;
    border: 1px solid #dce4e7;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(7, 26, 38, 0.055);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.home-station-card:hover,
.home-station-card.is-map-active {
    border-color: #9ccbb0;
    box-shadow: 0 10px 28px rgba(7, 26, 38, 0.09);
    transform: translateY(-1px);
}

.home-station-header {
    display: flex;
    padding: 14px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #edf1f2;
}

.home-station-title-wrap {
    min-width: 0;
}

.station-code {
    display: block;
    color: #2f8f5b;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.085em;
    text-transform: uppercase;
}

.home-station-header h2 {
    margin: 2px 0 0;
    color: #172b43;
    font-size: 1.02rem;
    font-weight: 900;
    line-height: 1.15;
}

.station-location {
    margin: 4px 0 0;
    color: #74848c;
    font-size: 0.62rem;
    font-weight: 700;
}

.station-status {
    display: inline-flex;
    min-height: 25px;
    padding: 0 9px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 999px;
    color: #738087;
    background: #edf1f2;
    font-size: 0.50rem;
    font-weight: 900;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.station-status--online {
    color: #167449;
    background: #e5f5ec;
}

.station-status--delayed {
    color: #996500;
    background: #fff2d3;
}

.station-status--offline {
    color: #a63838;
    background: #fbe7e7;
}

.home-compact-data {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: #e7eeea;
    border-bottom: 1px solid #e3e9eb;
}

.home-compact-variable {
    min-width: 0;
    padding: 10px 7px;
    background: #f7faf8;
    text-align: center;
}

.home-compact-variable span {
    display: block;
    color: #7c8a82;
    font-size: 0.45rem;
    font-weight: 900;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.home-compact-variable strong {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: #173d2a;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-camera-button {
    display: block;
    width: 100%;
    padding: 12px 12px 0;
    border: 0;
    background: #ffffff;
    cursor: zoom-in;
}

.home-camera-button:disabled {
    cursor: default;
}

.home-station-camera {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 9px;
    background: #17232b;
}

.home-station-camera__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-station-camera__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    padding: 18px;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.66rem;
    font-weight: 700;
    text-align: center;
}

.home-camera-top-banner {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    min-height: 58px;
    padding: 7px 10px;
    align-items: center;
    color: #ffffff;
    background: rgba(5, 15, 24, 0.66);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: none;
}

.home-camera-site-info {
    min-width: 0;

    justify-self: start;

    color: #ffffff;

    text-align: left;

    line-height: 1.15;
}


.home-camera-site-info strong {
    display: block;

    overflow: hidden;

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

    letter-spacing: 0.01em;

    text-overflow: ellipsis;

    white-space: nowrap;

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


.home-camera-site-info span {
    display: block;

    margin-top: 2px;

    color:
        rgba(255, 255, 255, 0.88);

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

    white-space: nowrap;

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


.home-camera-time {
    color:
        rgba(255, 255, 255, 0.74) !important;

    font-size: 0.53rem !important;
    font-weight: 700 !important;
}


.home-camera-right-info {
    min-width: 0;

    justify-self: end;

    display: flex;

    flex-direction: column;

    align-items: flex-end;

    gap: 4px;

    text-align: right;
}


.home-camera-right-info .home-camera-time {
    margin: 0;

    color: #ffffff !important;

    font-size: 0.60rem !important;
    font-weight: 800 !important;

    line-height: 1.15;

    white-space: nowrap;

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


.home-camera-right-info .home-station-camera__badge {
    justify-self: auto;

    align-self: flex-end;
}

.home-camera-overlay-logo {
    justify-self: center;
    width: 62px;
    max-height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

.home-station-camera__badge {
    justify-self: end;
    padding: 5px 9px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(26, 133, 81, 0.94);
    font-size: 0.56rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.home-camera-current {
    background: rgba(26, 133, 81, 0.94);
}

.home-camera-delayed {
    background: rgba(179, 119, 9, 0.94);
}

.home-camera-older,
.home-camera-unavailable {
    background: rgba(178, 53, 53, 0.94);
}

.home-camera-expand-hint {
    position: absolute;
    right: 8px;
    bottom: 7px;
    z-index: 4;
    padding: 3px 6px;
    border-radius: 5px;
    color: #ffffff;
    background: rgba(7, 26, 38, 0.68);
    font-size: 0.43rem;
    font-weight: 800;
    opacity: 0;
    transition: opacity 150ms ease;
}

.home-camera-button:hover .home-camera-expand-hint,
.home-camera-button:focus-visible .home-camera-expand-hint {
    opacity: 1;
}

.home-card-footer {
    display: flex;
    min-height: 45px;
    padding: 0 13px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.home-updated-line {
    color: #87938d;
    font-size: 0.50rem;
    font-weight: 700;
}

.home-updated-line strong {
    color: #53665b;
}

.home-station-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #2f8f5b;
    font-size: 0.58rem;
    font-weight: 900;
    text-decoration: none;
}

.home-station-link:hover {
    color: #226c44;
}

.home-map-panel {
    position: sticky;
    top: 18px;
    overflow: hidden;
    border: 1px solid #dce4e7;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(7, 26, 38, 0.055);
}

.home-map-heading {
    display: flex;
    min-height: 58px;
    padding: 10px 14px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e3e9eb;
}

.home-map-heading span {
    display: block;
    color: #2f8f5b;
    font-size: 0.50rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-map-heading strong {
    display: block;
    margin-top: 2px;
    color: #172b43;
    font-size: 0.92rem;
    font-weight: 900;
}

.home-map-heading a {
    color: #2f8f5b;
    font-size: 0.56rem;
    font-weight: 900;
    text-decoration: none;
}

.home-station-map {
    width: 100%;
    height: clamp(430px, 58vh, 620px);
    background: #e7ece9;
}

.home-map-message {
    padding: 14px;
    color: #7c8a82;
    font-size: 0.68rem;
    text-align: center;
}

.home-map-popup strong {
    display: block;
    color: #173d2a;
    font-size: 0.82rem;
}

.home-map-popup span {
    display: block;
    margin-top: 2px;
    color: #6f7e76;
    font-size: 0.68rem;
}

.home-map-popup a {
    display: inline-block;
    margin-top: 7px;
    color: #2f8f5b;
    font-size: 0.66rem;
    font-weight: 900;
    text-decoration: none;
}

.home-camera-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    padding: 24px;
    align-items: center;
    justify-content: center;
    background: rgba(3, 10, 15, 0.92);
}

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

.home-camera-lightbox__content {
    position: relative;
    display: flex;
    max-width: min(94vw, 1500px);
    max-height: 92vh;
    flex-direction: column;
}

.home-camera-lightbox__content img {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 55px);
    object-fit: contain;
}

.home-camera-lightbox__caption {
    display: flex;
    min-height: 44px;
    padding: 8px 10px;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    color: #ffffff;
    background: #071a26;
}

.home-camera-lightbox__caption strong {
    font-size: 0.72rem;
}

.home-camera-lightbox__caption span {
    font-size: 0.62rem;
    font-weight: 700;
}

.home-camera-lightbox__close {
    position: fixed;
    top: 14px;
    right: 18px;
    z-index: 10000;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

body.home-camera-lightbox-open {
    overflow: hidden;
}

@media (max-width: 920px) {
    .home-network-layout {
        grid-template-columns: 1fr;
    }

    .home-map-panel {
        position: static;
    }

    .home-station-map {
        height: 420px;
    }
}



@media (max-width: 520px) {

    .home-camera-top-banner {
        min-height: 52px;

        padding:
            6px
            7px;
    }


    .home-camera-site-info strong {
        font-size: 0.61rem;
    }


    .home-camera-site-info span {
        font-size: 0.50rem;
    }


    .home-camera-time {
        font-size: 0.47rem !important;
    }


    .home-camera-overlay-logo {
        width: 52px;

        max-height: 36px;
    }


    .home-station-camera__badge {
        padding:
            4px
            7px;

        font-size: 0.49rem;
    }

}

@media (max-width: 600px) {
    .home-stations-section {
        padding-top: 22px;
    }

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

    .home-station-map {
        height: 350px;
    }

    .home-camera-lightbox {
        padding: 10px;
    }
}


/* ========================================
   HOME MAP STATION MARKERS
======================================== */

.home-map-station-marker {
    width: auto !important;
    height: auto !important;

    border: 0 !important;
    background: transparent !important;
}


.home-map-station-marker__inner {
    display: inline-flex;

    align-items: center;

    gap: 6px;

    white-space: nowrap;

    pointer-events: auto;
}


.home-map-station-marker__dot {
    display: block;

    width: 14px;
    height: 14px;

    flex: 0 0 14px;

    border: 3px solid #ffffff;

    border-radius: 50%;

    background: #d63b3b;

    box-shadow:
        0 1px 5px
        rgba(0, 0, 0, 0.35);
}


.home-map-station-marker__label {
    display: block;

    padding:
        3px
        6px;

    border-radius: 5px;

    color: #172b43;

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

    box-shadow:
        0 1px 5px
        rgba(0, 0, 0, 0.16);

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

    line-height: 1.1;
}


.home-map-station-marker.is-highlighted
.home-map-station-marker__dot {
    transform: scale(1.2);

    background: #b72222;
}


.home-map-station-marker.is-highlighted
.home-map-station-marker__label {
    background: #ffffff;

    box-shadow:
        0 2px 8px
        rgba(0, 0, 0, 0.24);
}


/* ========================================
   HOME MAP HOVER CARD
======================================== */

.home-map-hover-tooltip {
    padding: 0 !important;

    border: 0 !important;

    border-radius: 8px !important;

    background: transparent !important;

    box-shadow:
        0 6px 18px
        rgba(7, 26, 38, 0.20) !important;
}


.home-map-hover-tooltip::before {
    border-top-color:
        #ffffff !important;
}


.home-map-hover-card {
    min-width: 180px;

    padding:
        9px
        10px;

    border-radius: 8px;

    color: #172b43;

    background: #ffffff;
}


.home-map-hover-card__row {
    display: grid;

    grid-template-columns:
        68px
        minmax(0, 1fr);

    gap: 8px;

    align-items: baseline;
}


.home-map-hover-card__row +
.home-map-hover-card__row {
    margin-top: 5px;

    padding-top: 5px;

    border-top:
        1px solid #edf1f2;
}


.home-map-hover-card__row span {
    color: #87938d;

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

    letter-spacing: 0.035em;

    text-transform: uppercase;
}


.home-map-hover-card__row strong {
    color: #173d2a;

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

    line-height: 1.25;
}


/* Camera banner v7 alignment */
.home-camera-top-banner {
    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);
}

.home-camera-site-info {
    align-self: center;
}

.home-camera-overlay-logo {
    align-self: center;
}

.home-camera-right-info {
    align-self: center;
}
