.meteogram-wrapper {
    text-align: center;
    margin-bottom: 40px;
}

.meteogram-title {
    font-size: 26px;
    margin-bottom: 10px;
}

/* =========================
   Meteograms base layout
   ========================= */

#meteogram-wrapper {
    position: relative;
    width: 100%;
}

#container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* =========================
   Overlay rows (weather / wind / beaufort)
   ========================= */

.mg-overlay-layer {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 10;
}

.mg-overlay-item {
    position: absolute;
    text-align: center;
    transform: translateX(-50%);
    white-space: nowrap;
}

.mg-overlay-item img {
    display: block;
    margin: 0 auto;
}

/* =========================
   Navigation arrows (match NYT slider / Swiper)
   ========================= */

.mg-nav-btn {
    color: #000;
    /* Default appearance for nav buttons (used in scroller) */
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    z-index: 20;
}

/*
 * Use Swiper's icon font (same as NYT slider arrows).
 * We set it explicitly so the arrows render even if theme CSS overrides Swiper defaults.
 */
.mg-nav-btn.swiper-button-prev,
.mg-nav-btn.swiper-button-next {
    position: static !important;
    inset: auto !important;
    margin: 0 !important;
}

.mg-nav-btn.swiper-button-prev::after,
.mg-nav-btn.swiper-button-next::after {
    font-family: swiper-icons !important;
    font-size: 18px;
    line-height: 1;
    color: currentColor;
}

/* Ensure the correct glyph is used even if Swiper's CSS isn't applied */
.mg-nav-btn.swiper-button-prev::after { content: 'prev'; }
.mg-nav-btn.swiper-button-next::after { content: 'next'; }

/* =========================
   Time scroller (3-hour points)
   ========================= */

.mg-scroller-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 8px 0 10px 0;
}

.mg-scroller {
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    border-radius: 9999px;
    background: rgba(0,0,0,0.04);
    padding: 6px 8px;
}

.mg-scroller:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.mg-scroller-track {
    display: flex;
    align-items: center;
    gap: 0;
}

/* One-line tick */
.mg-scroll-tick {
    scroll-snap-align: center;
    flex: 0 0 auto;
    width: 42px; /* must match JS MIN_PX_PER_POINT */
    text-align: center;
    font-size: 11px;
    line-height: 1;
    color: rgba(0,0,0,0.75);
    user-select: none;

    /* Reserve border space so active state doesn't shift layout */
    box-sizing: border-box;
    border: 4px solid transparent;
    border-radius: 6px;
    padding: 6px 0;
}

/* Selected tick */
.mg-scroll-tick.is-center {
    border-color: #000;
}

/* Selected (last user click) can differ from center when clamped */
.mg-scroll-tick.is-selected:not(.is-center) {
    border-color: rgba(0,0,0,0.45);
}

/* Single label (hour OR day code at midnight) */
.mg-scroll-tick .mg-tick-label {
    display: block;
    font-weight: 700;
    font-size: 11px;
}

/* Hide scroller completely when not needed */
.mg-scroller-wrap.is-hidden {
    display: none;
}

/* =========================
   Pagination dots (if any)
   ========================= */

.mg-pagination {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

/* =========================
   Responsive tweaks
   ========================= */

@media (max-width: 768px) {
    .mg-nav-btn {
        width: 32px;
        height: 32px;
    }

    .mg-nav-btn.swiper-button-prev::after,
    .mg-nav-btn.swiper-button-next::after {
        font-size: 16px;
    }
    .mg-scroll-tick {
        width: 38px; /* a bit tighter on mobile */
    }
}


/* === One-line scroller ticks (label only) === */
.mg-scroll-tick{
    padding: 6px 0;
    line-height: 1;
}
.mg-scroll-tick .mg-tick-day,
.mg-scroll-tick .mg-tick-hour,
.mg-scroll-tick .mg-tick-bar{ display:none !important; }
.mg-scroll-tick .mg-tick-label{
    display:block;
    font-weight: 600;
    font-size: 11px;
    color: rgba(0,0,0,0.85);
}
