/* ============================================================
   POLITICANDO — Institutional navy theme.
   Overrides the warm PrismaNews tokens with a sober, parliamentary
   blue/navy system. Keeps the same type families and kit components.
   Load order: colors_and_type.css → ui_kits/app/kit.css → politicando.css
   ============================================================ */

:root {
  /* ── Surfaces ──────────────────────────────────────────── */
  --page:          #E7ECF4; /* cool institutional page background */
  --cream:         #FFFFFF; /* cards / primary surfaces           */
  --cream-raised:  #F1F4FA; /* subtle raised bars / insets        */
  --paper:         #FFFFFF;

  /* ── Ink / text (deep navy) ────────────────────────────── */
  --ink:           #0F2038; /* primary text, headlines            */
  --ink-2:         #2A3C56; /* secondary text, body               */
  --ink-3:         #5C6C85; /* muted text, meta, labels           */
  --muted:         #8C99AD; /* faint text, captions               */
  --muted-2:       #BAC5D4; /* inactive bars / dots               */

  /* ── Lines ─────────────────────────────────────────────── */
  --border:        #D6DEEC; /* hairline dividers, card borders    */
  --border-strong: #C2CCDD;

  /* ── Accents ───────────────────────────────────────────── */
  --accent:        #1C4E8F; /* parliamentary blue — CTAs, links   */
  --accent-deep:   #15396B; /* pressed / deep navy                */
  --gold:          #9A7B2E; /* prestige accent — rules, eyebrows  */
  --gold-soft:     #B89A4E;

  /* ── App / status signal colors ────────────────────────── */
  --vote-yes:      #2E7D52; /* favorevole                         */
  --vote-no:       #B23A3A; /* contrario                          */
  --vote-abst:     #9A7B2E; /* astensione                         */
  --info:          #1C4E8F;

  /* re-point legacy signal tokens so kit components stay sane */
  --div-low:       #2E7D52;
  --div-mid:       #9A7B2E;
  --div-high:      #B23A3A;
  --div-agree:     #2E7D52;

  /* ── Elevation ─────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px rgba(15,32,56,.06), 0 2px 8px -2px rgba(15,32,56,.08);
  --shadow-md: 0 4px 12px -2px rgba(15,32,56,.10), 0 12px 28px -10px rgba(15,32,56,.16);
  --shadow-lg: 0 18px 48px -16px rgba(15,32,56,.28);
}

html[data-theme="dark"] {
  --page:          #08111F;
  --cream:         #122339;
  --cream-raised:  #0E1B2D;
  --paper:         #122339;
  --ink:           #EAF0F8;
  --ink-2:         #C2CFE0;
  --ink-3:         #8A9BB4;
  --muted:         #6E7E96;
  --muted-2:       #3A4860;
  --border:        #243650;
  --border-strong: #2E435F;
  --accent:        #5C92D6;
  --accent-deep:   #7AABEA;
  --gold:          #C6A65A;
  --gold-soft:     #D8BE78;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px -2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 12px -2px rgba(0,0,0,.4), 0 12px 28px -10px rgba(0,0,0,.5);
  --shadow-lg: 0 18px 48px -16px rgba(0,0,0,.6);
}

html, body { margin: 0; background: var(--page); }
body.kit { background: var(--page); }

/* Cards get a soft institutional shadow + lift */
.kit .card { box-shadow: var(--shadow-sm); }
.kit .card--hover:hover { box-shadow: var(--shadow-md); background: var(--cream); border-color: var(--border-strong); }
.kit .panel { box-shadow: var(--shadow-sm); }

/* Primary button → confident navy; accent → parliamentary blue */
.kit .btn--primary { background: var(--accent); color: #fff; }
.kit .btn--primary:hover { background: var(--accent-deep); }
.kit .btn--accent { background: var(--accent); color: #fff; }
.kit .btn--accent:hover { background: var(--accent-deep); }

/* ============================================================
   TOP BAR
   ============================================================ */
.pn-top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(12px) saturate(1.3); -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
.pn-top__in { max-width: 1240px; margin: 0 auto; height: 66px; padding: 0 28px; display: flex; align-items: center; gap: 22px; }
/* Marchio Politicando bicolore (prisma navy + barra blu) usato come <img>,
   con swap automatico chiaro/scuro al cambio tema. NON usare come CSS mask. */
.brandmark { display: inline-block; }
.brandmark--light { display: none; }
html[data-theme="dark"] .brandmark--dark { display: none; }
html[data-theme="dark"] .brandmark--light { display: inline-block; }

.pn-brand { display: flex; align-items: center; gap: 11px; flex: none; }
/* Marchio bicolore Politicando come <img>, swap chiaro/scuro per tema. */
.pn-brand__mark { width: 31px; height: 31px; display: block; flex: none; }
.pn-brand__mark--light { display: none; }
html[data-theme="dark"] .pn-brand__mark--dark { display: none; }
html[data-theme="dark"] .pn-brand__mark--light { display: block; }
.pn-brand__name { font-family: var(--font-display); font-weight: 600; font-size: 23px; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.pn-nav { display: flex; align-items: center; gap: 2px; }
.pn-navlink { font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: 9px 14px; border-radius: 8px; cursor: pointer; transition: color .14s, background .14s; white-space: nowrap; }
.pn-navlink:hover { color: var(--ink); background: var(--cream-raised); }
.pn-navlink[aria-current="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.pn-top__sp { flex: 1; }
.pn-search { width: 250px; }
.pn-iconbtn { width: 40px; height: 40px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--cream); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; transition: border-color .14s, background .14s; }
.pn-iconbtn:hover { border-color: var(--border-strong); background: var(--cream-raised); }
.pn-iconbtn svg { width: 18px; height: 18px; stroke-width: 2; }
.pn-iconbtn__dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); border: 1.5px solid var(--cream); }
.pn-user { display: flex; align-items: center; gap: 10px; padding-left: 6px; cursor: pointer; }
.pn-user__id { text-align: right; line-height: 1.2; }
.pn-user__name { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink); }
.pn-user__grp { font-family: var(--font-mono); font-weight: 500; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.pn-user .avatar { background: var(--accent); border-radius: 9px; }

/* ============================================================
   LAYOUT
   ============================================================ */
.pn-wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.pn-section-h { display: flex; align-items: baseline; gap: 14px; margin: 0 0 18px; }
.pn-section-h h2 { font-family: var(--font-display); font-weight: 500; font-size: 30px; letter-spacing: -.018em; color: var(--ink); margin: 0; }
.pn-section-h .sub { font-family: var(--font-body); font-size: 15px; color: var(--ink-3); }
.pn-section-h .rule { flex: 1; height: 1px; background: var(--border); align-self: center; }
.pn-eyebrow { font-family: var(--font-mono); font-weight: 600; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.pn-eyebrow::before { content: ""; width: 20px; height: 1.5px; background: var(--gold); }

/* ============================================================
   APP CAROUSEL
   ============================================================ */
.appc { margin: 30px 0 8px; }
.appc__frame { position: relative; }
.appc__viewport { overflow: hidden; border-radius: 18px; }
.appc__track { display: flex; transition: transform .5s cubic-bezier(.4,.05,.15,1); }
.appc__anim.no-anim .appc__track { transition: none; }
.appc__slide { min-width: 100%; }

.appslide { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 360px; background: var(--cream); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-md); }
.appslide__body { padding: 46px 44px; display: flex; flex-direction: column; }
.appslide__icon { width: 54px; height: 54px; border-radius: 13px; background: color-mix(in srgb, var(--accent) 12%, var(--cream)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 22px; }
.appslide__icon svg { width: 26px; height: 26px; color: var(--accent); stroke-width: 1.9; }
.appslide__title { font-family: var(--font-display); font-weight: 500; font-size: 38px; line-height: 1.02; letter-spacing: -.022em; color: var(--ink); margin: 12px 0 0; }
.appslide__desc { font-family: var(--font-body); font-size: 17.5px; line-height: 1.5; color: var(--ink-2); margin: 16px 0 0; max-width: 46ch; }
.appslide__meta { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 26px; font-family: var(--font-num); font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.appslide__meta .sep { color: var(--muted-2); }
.appslide__cta { display: flex; align-items: center; gap: 12px; margin-top: 22px; }

/* coming-soon variant */
.appslide--soon { background: var(--cream-raised); }
.appslide--soon .appslide__icon { background: color-mix(in srgb, var(--gold) 12%, var(--cream)); border-color: color-mix(in srgb, var(--gold) 26%, var(--border)); }
.appslide--soon .appslide__icon svg { color: var(--gold); }

/* right-hand mini preview */
.appslide__preview { position: relative; background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--cream-raised)) 0%, var(--cream-raised) 100%);
  border-left: 1px solid var(--border); padding: 34px; display: flex; align-items: center; justify-content: center; }
.appslide__preview::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 0); background-size: 22px 22px; opacity: .5; }

/* mini mock cards inside preview */
.mock { position: relative; width: 100%; max-width: 360px; background: var(--cream); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-md); padding: 18px; }
.mock__bar { display: flex; align-items: center; gap: 7px; padding-bottom: 13px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.mock__dot { width: 9px; height: 9px; border-radius: 50%; }
.mock__label { font-family: var(--font-mono); font-weight: 600; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-left: auto; }
.mock__line { height: 9px; border-radius: 4px; background: var(--cream-raised); }
.mock__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mock__col h5 { font-family: var(--font-mono); font-weight: 600; font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 9px; }
.mock__para { font-family: var(--font-body); font-size: 11.5px; line-height: 1.5; color: var(--ink-2); }
.mock__strike { color: var(--muted); text-decoration: line-through; }

/* vote-indication mock */
.votecard__opt { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 9px; border: 1.5px solid var(--border); margin-top: 9px; }
.votecard__opt.sel { border-color: var(--vote-yes); background: color-mix(in srgb, var(--vote-yes) 8%, var(--cream)); }
.votecard__radio { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--muted-2); flex: none; display: inline-flex; align-items: center; justify-content: center; }
.votecard__opt.sel .votecard__radio { border-color: var(--vote-yes); }
.votecard__opt.sel .votecard__radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--vote-yes); }
.votecard__txt { font-family: var(--font-body); font-size: 13px; color: var(--ink); }
.votecard__txt b { font-weight: 600; }
.votecard__tag { margin-left: auto; font-family: var(--font-mono); font-weight: 700; font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; }

/* arrows + dots */
.appc__arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; background: var(--cream); border: 1.5px solid var(--border); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; z-index: 5; box-shadow: var(--shadow-md); transition: border-color .14s, color .14s, transform .1s; }
.appc__arrow:hover { border-color: var(--accent); color: var(--accent); }
.appc__arrow:active { transform: translateY(-50%) scale(.94); }
.appc__arrow svg { width: 20px; height: 20px; stroke-width: 2.2; }
.appc__arrow--prev { left: -16px; }
.appc__arrow--next { right: -16px; }
.appc__nav { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }
.appc__dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: var(--muted-2); cursor: pointer; padding: 0; transition: background .15s, width .2s, border-radius .2s; }
.appc__dot[aria-current="true"] { background: var(--accent); width: 26px; border-radius: 5px; }

/* ============================================================
   FINESTRA SUL MONDO (news)
   ============================================================ */
.fw { margin: 56px 0 8px; }
.fw__badge { font-family: var(--font-mono); font-weight: 700; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 4px 9px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: none; }
.fw__badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.fw__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ncard { display: flex; flex-direction: column; background: var(--cream); border: 1px solid var(--border); border-radius: 12px; padding: 20px; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .16s, transform .16s, box-shadow .16s; }
.ncard:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ncard__top { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; flex-wrap: wrap; }
.ncard__src { font-family: var(--font-mono); font-weight: 700; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 7px; }
.ncard__brand { width: 13px; height: 13px; border-radius: 3px; flex: none; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%); position: relative; }
.ncard__brand::after { content: ""; position: absolute; inset: 3px; border-radius: 1px; background: linear-gradient(135deg, transparent 45%, rgba(255,255,255,.7) 46%, rgba(255,255,255,.7) 54%, transparent 55%); }
.ncard__srcmeta { font-family: var(--font-num); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.ncard__srcmeta b { color: var(--ink-2); font-weight: 600; }
.ncard__srcmeta .sep { color: var(--muted-2); margin: 0 1px; }
.ncard__time { margin-left: auto; font-family: var(--font-num); font-size: 11px; color: var(--ink-3); }
.ncard__sec { font-family: var(--font-mono); font-weight: 600; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 7px; }
.ncard__title { font-family: var(--font-display); font-weight: 500; font-size: 19px; line-height: 1.16; letter-spacing: -.012em; color: var(--ink); margin: 0; text-wrap: pretty; }
.ncard:hover .ncard__title { color: var(--accent); }
.ncard__dek { font-family: var(--font-body); font-size: 14px; line-height: 1.45; color: var(--ink-3); margin: 10px 0 0; }

/* "ne parlano" — outlets that cover this PrismaNews briefing (links) */
.ncard__fonti { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: auto; padding-top: 15px; }
.ncard:not(.ncard--lead) .ncard__fonti { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border); }
.ncard__fonti > svg { width: 13px; height: 13px; color: var(--ink-3); stroke-width: 2; flex: none; }
.ncard__fonti-lbl { font-family: var(--font-mono); font-weight: 500; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.ncard__chip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-family: var(--font-body); font-size: 12px; color: var(--ink-2); background: var(--cream-raised); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; transition: border-color .14s, color .14s; }
.ncard__chip:hover { border-color: var(--accent); color: var(--accent); }
.ncard__chip-dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.ncard__chip--more { color: var(--ink-3); font-family: var(--font-num); font-size: 11px; }

/* lead (wide) news card */
.ncard--lead { grid-column: span 2; }
.ncard--lead .ncard__media { width: calc(100% + 40px); margin: -20px -20px 16px; flex: none; height: 220px; }
.ncard--lead image-slot { width: 100%; height: 100%; display: block; }
.ncard--lead .ncard__title { font-size: 28px; line-height: 1.06; }
.ncard--lead .ncard__dek { font-size: 16px; }

.fw__more { display: flex; justify-content: center; margin-top: 26px; }

/* ============================================================
   FOOTER
   ============================================================ */
.pn-foot { border-top: 1px solid var(--border); margin-top: 60px; background: var(--cream); }
.pn-foot__in { max-width: 1240px; margin: 0 auto; padding: 30px 28px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pn-foot__note { font-family: var(--font-num); font-size: 11.5px; color: var(--ink-3); }
.pn-foot__sp { flex: 1; }
.pn-foot a { font-family: var(--font-mono); font-weight: 500; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); cursor: pointer; }
.pn-foot a:hover { color: var(--accent); }

/* ============================================================
   MOBILE APP SHELL — bottom tab bar + install banner (PWA)
   ============================================================ */
.pn-tabbar { display: none; }

.pn-install { display: none; }
.pn-install__mark { width: 38px; height: 38px; border-radius: 10px; flex: none; background: color-mix(in srgb, var(--accent) 12%, var(--cream)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); display: inline-flex; align-items: center; justify-content: center; }
.pn-install__mark svg { width: 18px; height: 18px; color: var(--accent); stroke-width: 2; }
.pn-install__txt { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.pn-install__txt b { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); }
.pn-install__txt span { font-family: var(--font-body); font-size: 13px; color: var(--ink-3); }
.pn-install__x { width: 30px; height: 30px; border: none; background: none; color: var(--ink-3); cursor: pointer; border-radius: 7px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.pn-install__x:hover { background: var(--cream-raised); }
.pn-install__x svg { width: 16px; height: 16px; stroke-width: 2.2; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .pn-nav, .pn-search, .pn-user__id { display: none; }
  .appslide { grid-template-columns: 1fr; min-height: 0; }
  .appslide__preview { display: none; }
  .appslide__body { padding: 32px 24px; }
  .appslide__title { font-size: 30px; }
  .appslide__cta .btn { flex: 1; }
  .fw__grid { grid-template-columns: 1fr; }
  .ncard--lead { grid-column: span 1; grid-row: auto; }
  .ncard--lead .ncard__media { height: 160px; }
  .ncard--lead .ncard__title { font-size: 22px; }
  .pn-wrap, .pn-top__in, .pn-foot__in { padding-left: 16px; padding-right: 16px; }
  .appc__arrow--prev { left: 6px; }
  .appc__arrow--next { right: 6px; }

  /* show the install banner + bottom tab bar */
  .pn-install { display: flex; align-items: center; gap: 12px; margin: 14px 16px 0; padding: 12px 14px; background: var(--cream); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); }

  .pn-tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    background: color-mix(in srgb, var(--cream) 92%, transparent);
    backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .pn-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 0 8px; border: none; background: none; cursor: pointer; color: var(--ink-3); font-family: var(--font-mono); font-weight: 600; font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; transition: color .14s; }
  .pn-tab svg { width: 21px; height: 21px; stroke-width: 2; }
  .pn-tab[aria-current="true"] { color: var(--accent); }
  .pn-tab:active { transform: scale(.94); }

  /* clear the fixed bar */
  body.kit { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .pn-foot { margin-bottom: 8px; }
}
@media (max-width: 560px) {
  .appc__arrow { display: none; }
  .pn-top__in { height: 58px; gap: 12px; }
  .pn-brand__name { font-size: 20px; }
  .pn-section-h h2 { font-size: 25px; }
  .pn-section-h .sub { display: none; }
}

/* News chip: favicon della fonte + link del titolo (feed PrismaNews) */
.ncard__chip-logo { width: 14px; height: 14px; border-radius: 3px; object-fit: cover; flex: none; background: var(--cream-raised); }
.ncard__title a { color: inherit; text-decoration: none; }
.ncard__title a:hover { color: var(--accent); }
