/* Portale del demanio marittimo: stile piatto del design system Coste360.it
   (niente bordi, gradienti né ombre a riposo; superfici e colore primario #0b2542). */
/* Titillium Web (SIL OFL) servito dal Worker: nessuna richiesta a servizi esterni. */
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/titillium-web-regular.woff2') format('woff2'); }
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/titillium-web-600.woff2') format('woff2'); }
@font-face { font-family: 'Titillium Web'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/titillium-web-700.woff2') format('woff2'); }

:root {
  --primary: #0b2542;
  --primary-light: #12365f;
  --primary-soft: rgba(11, 37, 66, 0.08);
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --text-soft: #64748b;
  --error: #dc2626;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Titillium Web', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface);
}

a { color: var(--primary); }
a:hover { color: var(--primary-light); }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-soft); }

/* Barra in alto */
.topbar { background: var(--surface); }
.topbar__inner { display: flex; align-items: center; gap: 16px; min-height: 80px; flex-wrap: wrap; }
.topbar__brand img { display: block; height: 44px; width: auto; }
.topbar__subtitle { color: var(--text-muted); font-weight: 600; }
.topbar__nav { margin-left: auto; }
.topbar__nav ul, .topbar__menu ul { list-style: none; margin: 0; padding: 0; }
.topbar__nav ul { display: flex; gap: 4px; }
.topbar__nav a, .topbar__menu a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--text); font-weight: 600; text-decoration: none; }
.topbar__nav a:hover, .topbar__menu a:hover { background: var(--primary-soft); color: var(--primary); }
.topbar__menu { display: none; margin-left: auto; position: relative; }
.topbar__menu summary { list-style: none; cursor: pointer; padding: 8px 16px; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 600; }
.topbar__menu summary::-webkit-details-marker { display: none; }
.topbar__menu[open] summary { background: var(--primary-light); }
.topbar__menu nav { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; min-width: 220px; background: var(--surface); border-radius: var(--radius); padding: 8px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16); }
html { scroll-behavior: smooth; }
.section { scroll-margin-top: 16px; }
@media (max-width: 1100px) {
  .topbar__subtitle { display: none; }
}
@media (max-width: 860px) {
  .topbar__nav { display: none; }
  .topbar__menu { display: block; }
}

/* Apertura */
.hero { background: var(--primary); color: #fff; padding: 56px 0 48px; }
/* Con la foto della regione: velatura uniforme del colore primario, niente gradienti. */
.hero--photo { position: relative; background: var(--primary) var(--hero-image) center / cover no-repeat; padding: 88px 0 56px; }
.hero--photo::before { content: ""; position: absolute; inset: 0; background: rgba(11, 37, 66, 0.72); }
.hero--photo > .container { position: relative; }
.hero--photo .kpi { background: rgba(11, 37, 66, 0.6); }
.hero a { color: #fff; }
.hero__eyebrow { margin: 0 0 8px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; opacity: 0.8; }
.hero__title { margin: 0; font-size: clamp(2rem, 4vw, 2.8rem); line-height: 1.15; font-weight: 700; }
.hero__lead { margin: 12px 0 0; max-width: 720px; font-size: 1.1rem; opacity: 0.9; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 32px; }
.kpi { background: rgba(255, 255, 255, 0.08); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; }
.kpi__value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.kpi__label { font-size: 0.9rem; opacity: 0.85; }

/* Sezioni */
.section { padding: 48px 0 8px; }
.section__head { margin-bottom: 20px; }
.section__title { margin: 0; font-size: 1.6rem; line-height: 1.2; color: var(--primary); }
.section__intro { margin: 6px 0 0; color: var(--text-muted); max-width: 760px; }
.section__more { margin: 20px 0 0; }

.btn {
  display: inline-block; padding: 10px 18px; border-radius: 999px;
  background: var(--primary); color: #fff; font-weight: 600; text-decoration: none;
}
.btn:hover { background: var(--primary-light); color: #fff; }

/* Schede */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card { background: var(--surface-subtle); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.card__meta { margin: 0; font-size: 0.88rem; color: var(--text-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.card__title { margin: 0; font-size: 1.08rem; line-height: 1.3; }
.card__title a { text-decoration: none; }
.card__title a:hover { text-decoration: underline; }
.card__text { margin: 0; color: var(--text-muted); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.card__tags { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.card__tags span { background: var(--surface); border-radius: 999px; padding: 2px 10px; font-size: 0.82rem; color: var(--text-muted); }
.card__link { margin: auto 0 0; font-weight: 600; font-size: 0.95rem; }
.card__list { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 0.95rem; }
.card__list li + li { margin-top: 6px; }
.card__list .muted { display: block; font-size: 0.88rem; }

.pill { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 1px 10px; font-size: 0.78rem; font-weight: 600; }
.pill--alta { background: var(--primary); color: #fff; }

/* Tabelle */
.table-wrap { overflow-x: auto; background: var(--surface-subtle); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.table th { text-align: left; font-weight: 600; color: var(--text-muted); padding: 12px 16px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table td { padding: 10px 16px; }
.table tbody tr:nth-child(odd) { background: rgba(255, 255, 255, 0.6); }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .neg { color: var(--error); }

/* Scelta regione */
.regions { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.region { display: flex; flex-direction: column; background: rgba(255, 255, 255, 0.08); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; font-weight: 600; }
.region .muted { color: rgba(255, 255, 255, 0.75); font-weight: 400; font-size: 0.9rem; }

/* Piede */
.footer { margin-top: 56px; background: var(--surface-subtle); padding: 36px 0; color: var(--text-muted); font-size: 0.95rem; }
.footer__title { margin: 0 0 12px; font-size: 1.05rem; color: var(--primary); }
.footer__regions { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer__source, .footer__brand { margin: 8px 0 0; }
.footer__legal { margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .topbar__inner { min-height: 68px; gap: 4px 12px; padding-top: 12px; padding-bottom: 12px; }
  .topbar__brand img { height: 40px; }
  .topbar__subtitle { display: none; }
  .hero { padding: 32px 0 28px; }
  .hero--photo { padding: 56px 0 32px; }
  .hero__lead { font-size: 1rem; }
  .kpis { gap: 10px; margin-top: 24px; }
  .kpi { padding: 12px 14px; }
  .kpi__value { font-size: 1.35rem; }
  .section { padding: 36px 0 0; }
  .section__head { margin-bottom: 16px; }
  .section__title { font-size: 1.4rem; }
  .cards { gap: 12px; }
  .card { padding: 14px 16px; }
  .footer { margin-top: 40px; padding: 28px 0; }
  .cards { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:last-child:nth-child(odd) { grid-column: span 2; }
  .table { font-size: 0.9rem; }
  .table th { padding: 10px 8px; font-size: 0.72rem; letter-spacing: 0.02em; }
  .table td { padding: 9px 8px; }
}
