/* MeteoDOC — foglio di stile unico (base). Colori e font saranno rifiniti col logo. */
:root {
    /* palette estratta dal logo: #3058FF (blu elettrico) + #001050 (blu notte) */
    --ink: #0b1430;
    --ink-soft: #5a6480;
    --paper: #ffffff;
    --tint: #f3f6ff;
    --line: #dfe5f5;
    --brand: #3058ff;
    --brand-600: #2346e0;
    --brand-dark: #001050;
    --brand-100: #c0d0ff;
    --brand-50: #eef2ff;
    --radius: 14px;
    --gap: clamp(1rem, .6rem + 1.2vw, 1.6rem);
    --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.55;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.2rem; }

a { color: var(--brand); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .6rem 1rem; z-index: 99; border-radius: 8px; }

/* --- testata --- */
.topbar { background: var(--ink); color: #fff; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 700; }
.brand__mark { font-size: 1.4rem; }
.brand__logo { display: block; height: 30px; width: auto; }
.brand__logo-footer { display: block; height: 26px; width: auto; }
.brand__name span { color: #6fb6f2; }
.topbar__nav { display: flex; gap: 1.2rem; }
.topbar__nav a { color: #cfdce8; text-decoration: none; font-size: .95rem; }
.topbar__nav a:hover { color: #fff; }

/* --- ricerca --- */
.searchbar { background: var(--tint); border-bottom: 1px solid var(--line); padding: .9rem 0; }
.searchbar__label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: .35rem; }
.searchbar__input {
    width: 100%; padding: .75rem .9rem; font-size: 1rem; color: var(--ink);
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.searchbar__input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* --- hero --- */
.hero { padding: clamp(2rem, 1.2rem + 3vw, 3.6rem) 0 clamp(1.6rem, 1rem + 2vw, 2.6rem); }
.hero--luogo { background: linear-gradient(180deg, var(--tint) 0%, #ffffff 100%); }

/* home: hero con i colori del logo */
.hero--home {
    background:
        radial-gradient(1000px 400px at 85% -10%, rgba(192, 208, 255, .55), transparent 60%),
        linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 45%, var(--brand-dark) 100%);
    color: #fff;
    padding: clamp(2.6rem, 1.6rem + 4vw, 4.6rem) 0 clamp(2.2rem, 1.4rem + 3vw, 3.6rem);
}
.hero--home h1 { color: #fff; }
.hero--home .hero__lead { color: #dfe6ff; }
.hero--home .hero__note { color: #b8c8ff; }
.hero--home strong { color: #fff; }

/* immagine di sfondo della hero + griglia testo/pannello */
.hero--home { position: relative; overflow: hidden; }
.hero__bg {
    position: absolute; inset: 0; pointer-events: none;
    background: url('../img/hero.jpg') center/cover no-repeat;
    opacity: .20;
}
.hero__grid { position: relative; }
@media (min-width: 900px) {
    .hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.4rem, 1rem + 2vw, 2.6rem); align-items: start; }
}

/* pannello "Italia oggi" */
.panel {
    background: #fff; color: var(--ink); border-radius: 16px;
    padding: 1rem 1.1rem 1.1rem; border: 1px solid rgba(255, 255, 255, .65);
    box-shadow: 0 18px 44px rgba(0, 16, 80, .30);
}
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; border-bottom: 1px solid var(--line); padding-bottom: .55rem; }
.panel__head h2 { margin: 0; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-dark); }
.panel__head time { font-size: .75rem; color: var(--ink-soft); }

.panel__cities { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .7rem; }
.panel__cities a { display: flex; align-items: center; gap: .4rem; padding: .3rem .35rem; border-radius: 8px; text-decoration: none; color: var(--ink); }
.panel__cities a:hover { background: var(--brand-50); }
.panel__ico { font-size: 1.05rem; width: 1.4rem; text-align: center; }
.panel__nome { flex: 1; font-size: .9rem; }
.panel__temp { font-weight: 700; font-size: .95rem; color: var(--brand-dark); }
.panel__vuoto { margin: .8rem 0 0; font-size: .85rem; color: var(--ink-soft); }

.panel__block { margin-top: .9rem; padding-top: .7rem; border-top: 1px dashed var(--line); }
.panel__block h3 { margin: 0 0 .45rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); display: flex; justify-content: space-between; gap: .5rem; }
.panel__block h3 span { font-weight: 500; text-transform: none; letter-spacing: 0; }

.panel__weekend { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; font-size: .85rem; }
.panel__weekend li { display: flex; justify-content: space-between; gap: .5rem; }
.panel__weekend a { color: var(--ink); text-decoration: none; font-weight: 500; }
.panel__weekend a:hover { color: var(--brand); }
.w-days { display: flex; gap: .7rem; color: var(--ink-soft); font-size: .8rem; }
.w-days b { color: var(--brand-dark); font-weight: 600; }

.panel__feste { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .85rem; }
.panel__feste li { display: flex; align-items: baseline; gap: .5rem; }
.f-data { color: var(--brand); font-weight: 600; min-width: 4.6rem; }
.f-nome { flex: 1; }
.f-giorni { color: var(--ink-soft); font-size: .78rem; }

@media (max-width: 620px) {
    .w-days { flex-direction: column; gap: .05rem; }
    .f-data { min-width: 4rem; }
}
.hero h1 { margin: 0 0 .6rem; font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); line-height: 1.15; }
.hero__lead { margin: 0 0 .5rem; max-width: 62ch; color: var(--ink-soft); font-size: 1.05rem; }
.hero__note { margin: 0; font-size: .85rem; color: var(--brand-dark); }
.crumbs { margin: 0 0 .4rem; font-size: .82rem; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }

/* --- meteo adesso --- */
.now { display: flex; align-items: center; gap: 1rem; margin: 1.4rem 0 0; }
.now__icon { font-size: clamp(2.4rem, 2rem + 2vw, 3.4rem); line-height: 1; }
.now__temp { font-size: clamp(2.6rem, 2rem + 3vw, 4rem); font-weight: 700; line-height: 1; }
.now__label { display: flex; flex-direction: column; font-size: .95rem; color: var(--ink-soft); }
.now__label strong { color: var(--ink); font-size: 1.05rem; }

.now__details {
    list-style: none; margin: 1.4rem 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem;
}
.now__details li {
    background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem;
    display: flex; flex-direction: column; font-size: .8rem; color: var(--ink-soft);
}
.now__details strong { color: var(--ink); font-size: .95rem; }

/* --- sezioni e griglia --- */
.section { padding: clamp(2rem, 1.4rem + 2.4vw, 3.2rem) 0; }
.section--tint { background: var(--tint); }
.section__title { margin: 0 0 1.1rem; font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); }
.section__count { font-size: .8rem; font-weight: 500; color: var(--ink-soft); margin-left: .4rem; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--gap); }
.card {
    display: flex; flex-direction: column; gap: .2rem; height: 100%;
    padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 12px;
    background: #fff; text-decoration: none; color: var(--ink);
    transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--brand); transform: translateY(-2px); }
.card__name { font-weight: 600; }
.card__meta { font-size: .8rem; color: var(--ink-soft); }

/* --- 10 giorni --- */
.days { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.day {
    display: grid; grid-template-columns: 90px 60px 40px 1fr 80px; align-items: center; gap: .6rem;
    padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.day__nome { font-weight: 600; }
.day__data { color: var(--ink-soft); font-size: .85rem; }
.day__icon { font-size: 1.3rem; }
.day__temp strong { font-size: 1.05rem; }
.day__mm { text-align: right; font-size: .85rem; color: var(--brand-dark); }

/* --- 24 ore --- */
.hours {
    list-style: none; margin: 0; padding: .4rem 0 1rem; display: flex; gap: .5rem;
    overflow-x: auto; scroll-snap-type: x mandatory;
}
.hour {
    flex: 0 0 auto; scroll-snap-align: start;
    display: flex; flex-direction: column; align-items: center; gap: .25rem;
    min-width: 74px; padding: .6rem .5rem; background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.hour__ora { font-size: .78rem; color: var(--ink-soft); }
.hour__icon { font-size: 1.25rem; }
.hour__temp { font-weight: 600; }
.hour__mm { font-size: .72rem; color: var(--brand-dark); min-height: 1rem; }

/* --- avvisi, bottoni, footer --- */
.alert { margin: 1rem 0 0; padding: .8rem 1rem; border-radius: 10px; background: #fdecec; border: 1px solid #f3c4c4; color: #8a2222; }
.alert--soft { background: #fff7e6; border-color: #f0d8a8; color: #6b4b0b; }
.btn { display: inline-block; padding: .7rem 1.2rem; border-radius: 10px; background: var(--brand); color: #fff; text-decoration: none; font-weight: 600; }
.btn:hover { background: var(--brand-dark); }
.muted { color: var(--ink-soft); font-size: .85rem; }

.footer { background: var(--ink); color: #c9d6e2; padding: 2rem 0; font-size: .85rem; }
.footer__inner { display: grid; gap: .6rem; }
.footer a { color: #9fcdf3; }
.footer__brand { margin: 0; font-weight: 600; color: #fff; }
.footer__attr, .footer__note { margin: 0; max-width: 90ch; }

.embed {
    width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 10px;
    font: .8rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #fff; color: var(--ink); resize: vertical;
}

/* --- selettore lingua --- */
.langs { display: flex; gap: .35rem; }
.langs a {
    color: #cfdce8; text-decoration: none; font-size: .72rem; font-weight: 600;
    padding: .22rem .45rem; border: 1px solid rgba(255, 255, 255, .28); border-radius: 6px;
}
.langs a:hover { color: #fff; border-color: #fff; }
.langs a.is-active { background: #fff; color: var(--ink); border-color: #fff; }

@media (max-width: 700px) {
    .topbar__inner { flex-wrap: wrap; justify-content: center; padding: .6rem 0; gap: .5rem; }
    .topbar__nav { order: 3; }
}

@media (max-width: 620px) {
    .day { grid-template-columns: 70px 36px 1fr auto; }
    .day__data { display: none; }
}
