/* widgets/weather/weather.css */

/* Root container fills the widget tile */
.widget-weather {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: var(--widget-padding);
    gap: var(--space-sm);
    font-family: inherit;
    color: var(--color-text-primary);
    box-sizing: border-box;
    --widget-font-scale: 1;
}

/* --------------------------------------
   HEADER
-------------------------------------- */

.weather-header {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    font-size: calc(0.9rem * var(--widget-font-scale));
    font-weight: 600;
}

.weather-summary-short {
    font-size: calc(0.85rem * var(--widget-font-scale));
    color: var(--color-text-secondary);
}

/* --------------------------------------
   MAIN ROW (temp • icon • stacked stats)
-------------------------------------- */

.weather-main-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-md);
    width: 100%;
    flex: 0 0 auto;
}

.weather-main-left,
.weather-main-center,
.weather-main-right {
    min-width: 0;
}

/* Big current temp */
.weather-temp-now-row {
    display: flex;
    align-items: baseline;
}

.weather-temp-now {
    font-size: calc(3.2rem * var(--widget-font-scale));
    font-weight: 700;
    line-height: 1;
}

/* ghosted feels-like directly under temp */
.weather-feels {
    margin-top: 2px;
    font-size: calc(0.9rem * var(--widget-font-scale));
    color: var(--color-text-secondary);
}

/* Center icon */
.weather-main-center {
    display: flex;
    justify-content: center;
}

.weather-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-icon-img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Right cell: stacked hi/lo + rain */
.weather-main-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: calc(0.7rem * var(--widget-font-scale));
}

.weather-hi-lo,
.weather-rain-block {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    width: 100%;
    white-space: nowrap;
}

.weather-mini-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.weather-mini-icon-img {
    width: 100%;
    height: 100%;
}

/* --------------------------------------
   HOURLY STRIP
-------------------------------------- */

.weather-divider {
    margin-top: 4px;
    border-top: 1px solid rgba(0,0,0,0.12);
    width: 100%;
}

.weather-hourly-strip {
    margin-top: 4px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    font-size: calc(0.7rem * var(--widget-font-scale));
}

.weather-hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1px 1px;
    border-radius: 6px;
    background: rgba(255,255,255,0.16);
}

.weather-hourly-time {
    font-weight: 500;
    margin-bottom: 1px;
}

.weather-hourly-icon-img {
    width: 20px;
    height: 20px;
}

.weather-hourly-temp {
    font-weight: 600;
}

/* --------------------------------------
   DAILY LIST (standard/expanded/xl)
-------------------------------------- */

.weather-daily-list {
    margin-top: 4px;
    flex: 1 1 auto;
    display: none;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    font-size: calc(0.75rem * var(--widget-font-scale));
}

.weather-daily-row {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 6px;
    padding: 0 2px;
    border-radius: 6px;
    background: rgba(255,255,255,0.14);
}

.weather-daily-row-day {
    font-weight: 600;
}

.weather-daily-row-icon-img {
    width: 20px;
    height: 20px;
}

.weather-daily-row-temps {
    opacity: 0.9;
}

.weather-daily-row-pop {
    text-align: right;
    opacity: 0.85;
}

/* --------------------------------------
   META LINE
-------------------------------------- */

.weather-meta {
    margin-top: auto;
    font-size: calc(0.7rem * var(--widget-font-scale));
    text-align: right;
    color: var(--color-text-secondary);
}

/* --------------------------------------
   MODE: MINI
-------------------------------------- */

.widget--mode-mini .widget-weather {
    padding: 0 var(--space-sm) var(--space-xs);
    gap: var(--space-xs);
    position: relative;
}

.widget--mode-mini .weather-header,
.widget--mode-mini .weather-sun-times,
.widget--mode-mini .weather-divider,
.widget--mode-mini .weather-hourly-strip,
.widget--mode-mini .weather-daily-list,
.widget--mode-mini .weather-daily-strip,
.widget--mode-mini .weather-meta {
    display: none !important;
}

.widget--mode-mini .weather-feels {
    display: none !important;
}

.widget--mode-mini .weather-temp-now {
    font-size: calc(2.7rem * var(--widget-font-scale));
}

.widget--mode-mini .weather-temp-now-row {
    margin-top: -8px;
}

.widget--mode-mini .weather-main-row {
    grid-template-columns: minmax(0, 1.6fr) auto;
    align-items: flex-start;
}

.widget--mode-mini .weather-icon {
    width: 76px;
    height: 76px;
}

.widget--mode-mini .weather-main-right {
    position: absolute;
    left: var(--space-sm);
    bottom: var(--space-sm);
    align-items: flex-start;
    font-size: calc(0.7rem * var(--widget-font-scale));
}

/* --------------------------------------
   MODE: COMPACT
-------------------------------------- */

.widget--mode-compact .weather-hourly-strip {
    display: grid;
}

.widget--mode-compact .weather-daily-list,
.widget--mode-compact .weather-daily-strip {
    display: none;
}

/* --------------------------------------
   MODE: STANDARD
-------------------------------------- */

.widget--mode-standard .widget-weather {
    padding: var(--space-sm);
    gap: 2px;
    --widget-font-scale: 1.0;
}

.widget--mode-standard .weather-header,
.widget--mode-standard .weather-sun-times,
.widget--mode-standard .weather-meta {
    display: none !important;
}

.widget--mode-standard .weather-feels {
    display: none;
}

.widget--mode-standard .weather-temp-now {
    font-size: calc(3.6rem * var(--widget-font-scale));
}

.widget--mode-standard .weather-hourly-strip {
    display: grid;
}

.widget--mode-standard .weather-daily-list {
    display: flex;
}

.widget--mode-standard .weather-daily-strip {
    display: none;
}

/* --------------------------------------
   MODE: EXPANDED  — EXACT STANDARD LAYOUT, SCALED UP
-------------------------------------- */

.widget--mode-expanded .widget-weather {
    padding: var(--space-sm);
    gap: 2px;
    --widget-font-scale: 1.2;   /* proportional scale up */
}

.widget--mode-expanded .weather-header,
.widget--mode-expanded .weather-sun-times,
.widget--mode-expanded .weather-meta {
    display: none !important;
}

.widget--mode-expanded .weather-feels {
    display: none;
}

.widget--mode-expanded .weather-temp-now {
    font-size: calc(3.6rem * var(--widget-font-scale));
}

.widget--mode-expanded .weather-hourly-strip {
    display: grid;
}

.widget--mode-expanded .weather-daily-list {
    display: flex;
}

.widget--mode-expanded .weather-daily-strip {
    display: none;
}

/* --------------------------------------
   MODE: XL — EXACT STANDARD LAYOUT, SCALED UP MORE
-------------------------------------- */

.widget--mode-xl .widget-weather {
    padding: var(--space-sm);
    gap: 2px;
    --widget-font-scale: 1.35;
}

.widget--mode-xl .weather-header,
.widget--mode-xl .weather-sun-times,
.widget--mode-xl .weather-meta {
    display: none !important;
}

.widget--mode-xl .weather-feels {
    display: none;
}

.widget--mode-xl .weather-temp-now {
    font-size: calc(3.6rem * var(--widget-font-scale));
}

.widget--mode-xl .weather-hourly-strip {
    display: grid;
}

.widget--mode-xl .weather-daily-list {
    display: flex;
}

.widget--mode-xl .weather-daily-strip {
    display: none;
}