/* ==========================================================================
   ProEContro.com
   Foglio di stile unico. Ordine: variabili, base, componenti, pagine, media.
   ========================================================================== */

:root {
  color-scheme: light;

  --paper:        #fbfaf7;
  --paper-warm:   #f4f1ea;
  --paper-deep:   #14322c;
  --ink:          #1b1d1c;
  --ink-soft:     #5a5f5c;
  --ink-faint:    #868c88;
  --rule:         #e2ded4;
  --rule-strong:  #cdc7b9;

  --pro:          #2c6e49;
  --pro-bg:       #eef5f0;
  --contro:       #a33a29;
  --contro-bg:    #faefec;
  --accent:       #14655a;
  --accent-dark:  #0e4a41;
  --topic-color:  var(--accent);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap:    72rem;
  --gutter:  clamp(1rem, 4vw, 2.5rem);
  --measure: 40rem;

  --radius: 4px;
  --shift:  cubic-bezier(.22, .61, .36, 1);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, .96rem + .18vw, 1.125rem);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.012em;
  margin: 0;
  text-wrap: balance;
}

p, ul, ol { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.25em; }
li { margin-bottom: .35em; }

a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--contro); }

img, svg { max-width: 100%; height: auto; }

mark { background: #fdf0b8; color: inherit; padding: 0 .1em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper-deep);
  color: #fff;
  padding: .75rem 1.25rem;
  z-index: 60;
}
.skip-link:focus { left: 0; color: #fff; }

/* --------------------------------------------------------------------------
   Testata
   -------------------------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  margin-right: auto;
}
.logo:hover { color: var(--ink); }
.logo__pro    { color: var(--pro); }
.logo__contro { color: var(--contro); }
.logo__amp {
  color: var(--ink-faint);
  font-style: italic;
  font-size: .82em;
  margin-inline: .12em;
}
.logo--small { font-size: 1.25rem; margin: 0 0 .6rem; display: inline-block; }

.menu-button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--rule-strong);
  background: transparent;
  border-radius: var(--radius);
  padding: .45rem .7rem;
  font: inherit;
  font-size: .9rem;
  color: var(--ink);
  cursor: pointer;
}
.menu-button__bars,
.menu-button__bars::before,
.menu-button__bars::after {
  display: block;
  width: 1.05rem;
  height: 1.5px;
  background: currentColor;
  transition: transform .2s var(--shift), opacity .2s var(--shift);
}
.menu-button__bars { position: relative; }
.menu-button__bars::before,
.menu-button__bars::after { content: ""; position: absolute; left: 0; }
.menu-button__bars::before { top: -5px; }
.menu-button__bars::after  { top: 5px; }
.menu-button[aria-expanded="true"] .menu-button__bars { background: transparent; }
.menu-button[aria-expanded="true"] .menu-button__bars::before { transform: translateY(5px) rotate(45deg); }
.menu-button[aria-expanded="true"] .menu-button__bars::after  { transform: translateY(-5px) rotate(-45deg); }

/* Senza JavaScript il pannello resta aperto: la navigazione funziona comunque. */
.masthead__panel { display: block; width: 100%; padding-bottom: 1rem; }
.js .masthead__panel { display: none; }
.js .masthead__panel.is-open { display: block; }

.nav__list {
  list-style: none;
  margin: 0 0 .75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.nav__list a {
  display: block;
  padding: .6rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.nav__list a:hover,
.nav__list a[aria-current="page"] { color: var(--accent); }

/* --------------------------------------------------------------------------
   Ricerca
   -------------------------------------------------------------------------- */

.search__label {
  display: block;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .35rem;
}

.search__field {
  display: flex;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.search__field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(20 101 90 / .12); }

.search__field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: .6rem .75rem;
  font: inherit;
  font-size: .95rem;
  background: transparent;
  color: var(--ink);
}
.search__field input:focus { outline: none; }
.search__field input::-webkit-search-cancel-button { cursor: pointer; }

.search__field button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 0;
  border-left: 1px solid var(--rule);
  background: var(--paper-warm);
  color: var(--ink);
  padding: 0 .9rem;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s var(--shift);
}
.search__field button:hover { background: var(--accent); color: #fff; }
.search__field svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search--masthead .search__label { position: absolute; left: -9999px; }
.search--hero { max-width: 32rem; margin-top: 1.75rem; }
.search--hero .search__label { color: rgb(255 255 255 / .7); }
.search--page { margin-bottom: 2rem; max-width: 34rem; }

/* --------------------------------------------------------------------------
   Briciole di pane
   -------------------------------------------------------------------------- */

.breadcrumb {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  font-size: .85rem;
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0;
  padding: .7rem 0;
}
.breadcrumb li { margin: 0; color: var(--ink-soft); }
.breadcrumb li + li::before { content: "›"; margin-right: .4rem; color: var(--ink-faint); }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }

/* --------------------------------------------------------------------------
   Blocchi di pagina
   -------------------------------------------------------------------------- */

.hero {
  background: var(--paper-deep);
  color: #f3f1ea;
  padding-block: clamp(3rem, 8vw, 5.5rem);
  background-image: radial-gradient(120% 130% at 12% 0%, #1b4239 0%, #12302a 55%, #0e2622 100%);
}
.hero__inner { max-width: 46rem; }
.hero__title {
  font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.6rem);
  color: #fff;
  margin-bottom: .8rem;
}
.hero__text {
  font-size: clamp(1.02rem, .98rem + .3vw, 1.2rem);
  color: rgb(243 241 234 / .82);
  max-width: 38rem;
  margin: 0;
}

.section { padding-block: clamp(2.5rem, 6vw, 4rem); }
.section--tinted { background: var(--paper-warm); border-block: 1px solid var(--rule); }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--ink);
}
.section__title { font-size: clamp(1.3rem, 1.1rem + .7vw, 1.7rem); }
.section__more { font-size: .9rem; white-space: nowrap; }

.page-head {
  padding-block: clamp(2rem, 5vw, 3.25rem) clamp(1.25rem, 3vw, 2rem);
  border-bottom: 1px solid var(--rule);
}
.page-head__kicker {
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--topic-color);
  font-weight: 600;
  margin-bottom: .5rem;
}
.page-head__title { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); }
.page-head__lead {
  margin-top: .9rem;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   Griglie e schede
   -------------------------------------------------------------------------- */

.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }

.card { position: relative; display: flex; flex-direction: column; }

.card__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper-warm);
  margin-bottom: .9rem;
}
.card__media .media { width: 100%; height: 100%; object-fit: cover; display: block; }
.card:hover .card__media img { transform: scale(1.03); }
.card__media img { transition: transform .4s var(--shift); }

.media--empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(-45deg, transparent 0 10px, rgb(0 0 0 / .015) 10px 20px),
    var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: inherit;
}
.media--empty svg {
  width: 2.25rem;
  height: 2.25rem;
  fill: none;
  stroke: var(--rule-strong);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.card__title {
  font-size: 1.18rem;
  margin-bottom: .4rem;
}
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card:hover .card__title a { color: var(--accent); text-decoration: underline; }

.card__summary { color: var(--ink-soft); font-size: .95rem; margin-bottom: .6rem; }
.card__meta { font-size: .82rem; color: var(--ink-faint); margin: auto 0 0; }

.kicker {
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: .4rem;
}
.kicker a { color: var(--topic-color); text-decoration: none; position: relative; z-index: 1; }
.kicker a:hover { text-decoration: underline; }

/* Sezioni in evidenza sulla home */

.topics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.topic { margin: 0; background: var(--paper); }
.topic a {
  display: block;
  height: 100%;
  padding: 1.4rem 1.35rem;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: background .18s var(--shift), border-color .18s var(--shift);
}
.topic a:hover { background: #fff; border-left-color: var(--topic-color); }
.topic__name { font-size: 1.15rem; margin-bottom: .35rem; }
.topic__text { font-size: .92rem; color: var(--ink-soft); margin-bottom: .6rem; }
.topic__count { font-size: .8rem; color: var(--topic-color); font-weight: 600; }

/* --------------------------------------------------------------------------
   Impaginazione con colonna laterale
   -------------------------------------------------------------------------- */

.layout {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  padding-block: clamp(2rem, 5vw, 3rem) clamp(3rem, 7vw, 4.5rem);
  align-items: start;
}
.layout--single .layout__main { max-width: 52rem; }
.layout__main { min-width: 0; }

.sidebar { min-width: 0; }

.panel { margin-bottom: 2rem; }
.panel__title {
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: .85rem;
}

.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li { margin: 0; border-bottom: 1px solid var(--rule); }
.linklist a {
  display: block;
  padding: .55rem 0;
  color: var(--ink);
  text-decoration: none;
  font-size: .95rem;
}
.linklist a:hover { color: var(--accent); text-decoration: underline; }
.linklist--counted li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.linklist--counted span { font-size: .8rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.linklist--columns { columns: 2; column-gap: 2rem; }
.linklist--columns li { break-inside: avoid; }

/* --------------------------------------------------------------------------
   Scheda pro e contro
   -------------------------------------------------------------------------- */

.article__head { padding-top: clamp(1.75rem, 4vw, 2.75rem); }
.article__title {
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.1rem);
  max-width: 22ch;
  margin-bottom: .9rem;
}
.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.1rem;
  font-size: .85rem;
  color: var(--ink-faint);
  margin: 0;
}
.article__meta span:first-child { color: var(--pro); font-weight: 600; }
.article__meta span:nth-child(2) { color: var(--contro); font-weight: 600; }

.article__hero { margin: clamp(1.5rem, 4vw, 2.25rem) auto 0; }
.article__hero .media {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.article__block { margin-bottom: clamp(2.25rem, 5vw, 3.25rem); }
.article__block > h2 {
  font-size: clamp(1.45rem, 1.2rem + .9vw, 1.9rem);
  margin-bottom: 1rem;
}

.block-title {
  display: inline-block;
  font-size: clamp(1.45rem, 1.2rem + .9vw, 1.9rem);
  padding-bottom: .35rem;
  border-bottom: 3px solid currentColor;
  margin-bottom: 1.4rem;
}
.article__block--pro    .block-title { color: var(--pro); }
.article__block--contro .block-title { color: var(--contro); }

.point { margin-bottom: 1.9rem; padding-left: 1.1rem; border-left: 2px solid var(--rule); }
.point--pro    { border-left-color: color-mix(in srgb, var(--pro) 35%, var(--rule)); }
.point--contro { border-left-color: color-mix(in srgb, var(--contro) 35%, var(--rule)); }
.point__title { font-size: 1.2rem; margin-bottom: .5rem; }
.point:target { background: #fffdf2; }

.article__block--closing {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--paper-warm);
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}
.article__block--closing > h2 { margin-bottom: .75rem; }

.jump-back { padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .95rem; }

/* Riepilogo pro/contro */

.verdict {
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  margin-bottom: clamp(2.25rem, 5vw, 3rem);
  background: #fff;
}
.verdict__title {
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-weight: 700;
  margin-bottom: 1rem;
}
.verdict__grid { display: grid; gap: 1.25rem; }
.verdict__col h3 {
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: .6rem;
  display: flex;
  align-items: center;
  gap: .45rem;
}
.verdict__col h3 span {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  font-size: .95rem;
  line-height: 1;
  color: #fff;
}
.verdict__col--pro    h3 { color: var(--pro); }
.verdict__col--pro    h3 span { background: var(--pro); }
.verdict__col--contro h3 { color: var(--contro); }
.verdict__col--contro h3 span { background: var(--contro); }

.verdict__col ul { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.verdict__col li { margin-bottom: .45rem; padding-left: .95rem; position: relative; }
.verdict__col li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: .35rem;
  height: .35rem;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
}
.verdict__col--pro    li { color: var(--pro); }
.verdict__col--contro li { color: var(--contro); }
.verdict__col a { color: var(--ink); text-decoration: none; }
.verdict__col a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Testo lungo
   -------------------------------------------------------------------------- */

.prose { max-width: var(--measure); }
.prose > *:last-child { margin-bottom: 0; }
.prose h2 { font-size: 1.5rem; margin: 2rem 0 .8rem; }
.prose h3 { font-size: 1.2rem; margin: 1.6rem 0 .6rem; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin-bottom: .5em; }
.prose strong { font-weight: 650; }
.prose a { text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }

.prose--lead { font-size: 1.08em; color: #2a2e2c; }
.prose--lead > p:first-child::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 3.1em;
  line-height: .84;
  padding: .06em .1em 0 0;
  color: var(--topic-color);
}
.prose--intro { margin-bottom: 2rem; }

/* --------------------------------------------------------------------------
   Indice degli argomenti
   -------------------------------------------------------------------------- */

.index-block {
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}
.index-block:last-child { border-bottom: 0; }
.index-block__title { font-size: 1.4rem; margin-bottom: .3rem; }
.index-block__title a { color: var(--ink); text-decoration: none; border-bottom: 3px solid var(--topic-color); }
.index-block__title a:hover { color: var(--topic-color); }
.index-block__text { color: var(--ink-soft); font-size: .95rem; margin-bottom: .9rem; }

/* --------------------------------------------------------------------------
   Stati e utilità
   -------------------------------------------------------------------------- */

.empty {
  padding: 1.25rem;
  background: var(--paper-warm);
  border-left: 3px solid var(--rule-strong);
  color: var(--ink-soft);
}
.result-count {
  font-size: .85rem;
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
}
.error-page { max-width: 38rem; }
.error-page__subtitle { font-size: 1.15rem; margin: 2rem 0 .5rem; }
.error-page__back { margin-top: 2rem; }

/* --------------------------------------------------------------------------
   Piede di pagina
   -------------------------------------------------------------------------- */

.colophon {
  margin-top: auto;
  background: var(--paper-deep);
  color: rgb(243 241 234 / .78);
  padding-top: clamp(2.5rem, 6vw, 3.5rem);
  font-size: .93rem;
}
.colophon__inner { display: grid; gap: 2rem; padding-bottom: 2.5rem; }
.colophon .logo { color: #fff; }
.colophon .logo__amp { color: rgb(255 255 255 / .5); }
.colophon__intro p { max-width: 28rem; margin: 0; }
.colophon__nav h2 {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgb(255 255 255 / .55);
  margin-bottom: .75rem;
}
.colophon__nav ul { list-style: none; margin: 0; padding: 0; }
.colophon__nav li { margin-bottom: .4rem; }
.colophon a { color: rgb(243 241 234 / .85); text-decoration: none; }
.colophon a:hover { color: #fff; text-decoration: underline; }

.colophon__legal {
  border-top: 1px solid rgb(255 255 255 / .12);
  padding-block: 1.25rem;
  font-size: .82rem;
  color: rgb(243 241 234 / .55);
}
.colophon__legal p { margin: 0; }

/* --------------------------------------------------------------------------
   Adattamenti per schermi più larghi
   -------------------------------------------------------------------------- */

@media (min-width: 34rem) {
  .verdict__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .colophon__inner { grid-template-columns: 2fr 1fr 1fr; }
}

@media (min-width: 48rem) {
  .grid--two { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
  .topics { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 62rem) {
  .menu-button { display: none; }

  .masthead__inner { flex-wrap: nowrap; gap: 1.5rem; }
  .masthead__panel,
  .js .masthead__panel {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: auto;
    padding-bottom: 0;
  }
  .nav__list { flex-direction: row; gap: 1.25rem; margin: 0; }
  .nav__list a { border: 0; padding: .35rem 0; font-size: .95rem; }
  .nav__list a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .search--masthead .search__field { border-radius: 999px; }
  .search--masthead input { width: 11rem; font-size: .88rem; }
  .search--masthead button span { position: absolute; left: -9999px; }
  .search--masthead button { padding-inline: .75rem; }

  .topics { grid-template-columns: repeat(5, 1fr); }
  .layout { grid-template-columns: minmax(0, 1fr) 17rem; }
  .layout--single { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 5.5rem; }
}

@media (min-width: 90rem) {
  :root { --wrap: 78rem; --measure: 42rem; }
  .layout { grid-template-columns: minmax(0, 1fr) 19rem; }
}

@media (min-width: 120rem) {
  :root { --wrap: 86rem; }
  body { font-size: 1.16rem; }
}

/* --------------------------------------------------------------------------
   Stampa
   -------------------------------------------------------------------------- */

@media print {
  .masthead, .colophon, .sidebar, .breadcrumb, .search, .jump-back { display: none; }
  body { background: #fff; font-size: 11pt; }
  .layout { display: block; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}
