/* ------------------------------------------------------------------
 * Weekly Weather – Clean, production-ready CSS
 * ------------------------------------------------------------------ */

/* Wrapper */
.weekly-weather {
    padding: 0;
    margin-bottom: 20px;
    max-width: 520px;
}

/* ------------------------------------------------------------------
 * Header (Newsy / Ak style integration)
 * ------------------------------------------------------------------ */

.weather-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.weather-block-header .ak-block-title {
    margin: 0;
}

.weather-city {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .2px;
}

/* Prevent flash of default city */
.weather-city:empty::before {
    content: attr(data-default);
    visibility: hidden;
}

/* Locate button */
.ak-weather-locate {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 6px;
    color: inherit;
}

.ak-weather-locate:hover {
    opacity: .75;
}

/* ------------------------------------------------------------------
 * Weather body & loader
 * ------------------------------------------------------------------ */

.weather-body {
    position: relative;
}

.weather-output {
    margin-top: 8px;
}

/* Fade content while loading */
.weekly-weather.is-loading .weather-output {
    opacity: .35;
    transition: opacity .25s ease;
}

/* Overlay loader */
.weather-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(0,0,0,.15);
    border-top-color: rgba(0,0,0,.55);
    border-radius: 50%;
    animation: wwb-spin .8s linear infinite;
    pointer-events: none;
}

.weekly-weather.is-loading .weather-loader {
    display: block;
}

@keyframes wwb-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ------------------------------------------------------------------
 * LIST VIEW (weekly)
 * ------------------------------------------------------------------ */

.weather-days {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.weather-day {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(0,0,0,.02);
}

.weather-date {
    font-weight: 600;
}

.weather-temp {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    opacity: .9;
}

/* Weather icon */
.wwb-icon svg {
    width: 50px;
    height: 50px;
    display: block;
}

/* ------------------------------------------------------------------
 * COMPACT 3-DAY VIEW
 * ------------------------------------------------------------------ */

.weather-compact {
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    overflow: hidden;
}

.wc-days {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    transition: opacity .25s cubic-bezier(.4,0,.2,1),
                transform .25s cubic-bezier(.4,0,.2,1);
}

.wc-day {
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    background: #f7f7f7;
}

.wc-label {
    font-weight: 700;
    margin-bottom: 4px;
}

.wc-date {
    font-size: 12px;
    opacity: .6;
    margin-bottom: 6px;
    line-height: 1;
}

.wc-temp strong {
    display: block;
    font-size: 18px;
}

.wc-temp span {
    opacity: .7;
}

/* Navigation arrows */
.wc-nav {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

.wc-nav svg {
    width: 18px;
    height: 18px;
    display: block;
}

.wc-nav:hover {
    color: #000;
}

.wc-nav.is-disabled {
    opacity: .25;
    cursor: default;
    pointer-events: none;
}

/* Animation on day change */
.weather-compact.is-animating .wc-days {
    opacity: 0;
    transform: translateX(-12px);
}

.weather-compact.is-animating.reverse .wc-days {
    transform: translateX(12px);
}

/* Instant tooltip */
.has-tooltip {
    position: relative;
}

.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 0;
    white-space: nowrap;
    background: rgba(0,0,0,.85);
    color: #fff;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease;
    z-index: 10;
}

.has-tooltip::before {
    content: '';
    position: absolute;
    bottom: 70%;
    right: 8px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(0,0,0,.85) transparent transparent transparent;
    opacity: 0;
    transition: opacity .15s ease;
}

.has-tooltip:hover::after,
.has-tooltip:hover::before {
    opacity: 1;
    transform: translateY(0);
}

/* ------------------------------------------------------------------
 * Dark mode support
 * Triggered by body.dark
 * ------------------------------------------------------------------ */

body.dark .weekly-weather {
    color: rgba(255,255,255,.9);
}

/* Header */
body.dark .weather-city {
    color: #fff;
}

/* List view cards */
body.dark .weather-day {
    background: rgba(255,255,255,.06);
}

/* Compact cards */
body.dark .wc-day {
    background: rgba(255,255,255,.08);
}

/* Labels & dates */
body.dark .wc-label {
    color: #fff;
}

body.dark .wc-date {
    color: rgba(255,255,255,.65);
}

/* Temperatures */
body.dark .wc-temp strong {
    color: #fff;
}

body.dark .wc-temp span {
    color: rgba(255,255,255,.7);
}

/* Icons */
body.dark .wwb-icon svg {
    color: #fff;
}

/* Navigation arrows */
body.dark .wc-nav {
    color: rgba(255,255,255,.7);
}

body.dark .wc-nav:hover {
    color: #fff;
}

body.dark .wc-nav.is-disabled {
    opacity: .25;
}

/* Loader */
body.dark .weather-loader {
    border-color: rgba(255,255,255,.2);
    border-top-color: rgba(255,255,255,.8);
}

/* Loading fade (less aggressive in dark mode) */
body.dark .weekly-weather.is-loading .weather-output {
    opacity: .55;
}
