/* Gazzetta – Consenso Cookie */
:root { --ggc-colore: #9D2934; }

.ggc, .ggc *, .ggc-riapri, .ggc-segnaposto, .ggc-segnaposto * { box-sizing: border-box; }
.ggc[hidden], .ggc-riapri[hidden], .ggc-google[hidden] { display: none !important; }

.ggc {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; line-height: 1.5; color: #1f1f1f; text-align: left;
}
.ggc a { color: var(--ggc-colore); text-decoration: underline; }
.ggc p { margin: 0 0 10px; padding: 0; font-size: inherit; line-height: inherit; color: inherit; }

/* Banner */
.ggc-banner { position: fixed; z-index: 2147483000; left: 0; right: 0; }
.ggc-banner.ggc-basso { bottom: 0; padding: 0 12px 12px; }
.ggc-banner.ggc-centro { top: 50%; transform: translateY(-50%); padding: 0 12px; }
.ggc-box {
  position: relative; max-width: 1080px; margin: 0 auto; background: #fff;
  border-top: 5px solid var(--ggc-colore); border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .28); padding: 20px 48px 18px 22px;
}
.ggc-banner.ggc-centro .ggc-box { max-width: 620px; }
.ggc-titolo { font-weight: 700; font-size: 18px !important; color: var(--ggc-colore) !important; margin-bottom: 6px !important; }
.ggc-testo { color: #333 !important; }
.ggc-link { display: inline-block; margin-left: 4px; white-space: nowrap; }

.ggc-x {
  position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; border: 0; background: transparent;
  font-size: 28px; line-height: 1; color: #555; cursor: pointer; border-radius: 50%; padding: 0;
}
.ggc-x:hover, .ggc-x:focus-visible { background: #f1f1f1; color: #000; }

.ggc-azioni { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.ggc-btn {
  appearance: none; -webkit-appearance: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 15px;
  min-width: 150px; padding: 11px 20px; border-radius: 6px; border: 2px solid var(--ggc-colore);
  line-height: 1.2; text-transform: none; letter-spacing: 0; margin: 0;
}
/* Accetta e Rifiuta hanno lo stesso peso visivo (niente "dark pattern"). */
.ggc-btn-pieno { background: var(--ggc-colore); color: #fff; }
.ggc-btn-pieno:hover { filter: brightness(1.1); }
.ggc-btn-bordo { background: #fff; color: var(--ggc-colore); }
.ggc-btn-bordo:hover { background: #fbf1f2; }
.ggc-btn:focus-visible, .ggc-switch:focus-visible, .ggc-link-btn:focus-visible, .ggc-riapri:focus-visible {
  outline: 3px solid #1a73e8; outline-offset: 2px;
}
.ggc-link-btn {
  background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--ggc-colore);
  text-decoration: underline; cursor: pointer;
}

/* Pannello preferenze */
.ggc-pannello {
  position: fixed; inset: 0; z-index: 2147483001; background: rgba(20, 8, 10, .55);
  display: flex; align-items: center; justify-content: center; padding: 12px;
}
.ggc-pannello-box {
  position: relative; background: #fff; width: 100%; max-width: 640px; max-height: calc(100vh - 24px);
  overflow-y: auto; border-radius: 10px; border-top: 5px solid var(--ggc-colore);
  padding: 22px 22px 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.ggc-categorie { margin: 12px 0 6px; }
.ggc-cat { border: 1px solid #e6e0e1; border-radius: 8px; padding: 12px 14px 4px; margin-bottom: 10px; }
.ggc-cat p { font-size: 14px; color: #444; }
.ggc-cat-testa { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; cursor: pointer; }
.ggc-cat-nome { font-weight: 700; font-size: 15px; }
.ggc-sempre { font-size: 13px; font-weight: 700; color: #2e7d32; white-space: nowrap; }

.ggc-switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 auto;
  width: 46px; height: 26px; border-radius: 13px; background: #c9c3c4; cursor: pointer; margin: 0; border: 0;
  transition: background .15s;
}
.ggc-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left .15s;
}
.ggc-switch:checked { background: var(--ggc-colore); }
.ggc-switch:checked::after { left: 23px; }

html.ggc-aperto, html.ggc-aperto body { overflow: hidden; }

/* Pulsante per riaprire le preferenze */
.ggc-riapri {
  position: fixed; z-index: 2147482999; bottom: 16px; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid #fff; background: var(--ggc-colore); color: #fff; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
  opacity: .9;
}
.ggc-riapri:hover { opacity: 1; }
.ggc-riapri.ggc-sinistra { left: 16px; }
.ggc-riapri.ggc-destra { right: 16px; }

/* Segnaposto per i contenuti bloccati */
iframe[data-ggc-src] { display: none !important; }
.ggc-segnaposto {
  width: 100%; min-height: 160px; margin: 0 auto 16px; padding: 18px; border-radius: 8px;
  background: #faf6f6; border: 1px dashed var(--ggc-colore); color: #333; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; line-height: 1.45;
}
.ggc-segnaposto p { margin: 0 0 8px; }
.ggc-sp-titolo { font-weight: 700; color: var(--ggc-colore); font-size: 15px; }
.ggc-sp-azioni { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-top: 4px !important; }
.ggc-segnaposto .ggc-btn { min-width: 0; font-size: 14px; padding: 9px 16px; }

/* Tabella per la cookie policy */
.ggc-tabella-wrap { overflow-x: auto; margin: 12px 0; }
.ggc-tabella { width: 100%; border-collapse: collapse; font-size: 14px; }
.ggc-tabella th, .ggc-tabella td { border: 1px solid #ddd; padding: 8px 10px; vertical-align: top; text-align: left; }
.ggc-tabella th { background: var(--ggc-colore); color: #fff; }
.ggc-tabella code { white-space: normal; font-size: 12px; }

@media (max-width: 720px) {
  .ggc-box { padding: 18px 16px 14px; }
  .ggc-titolo { padding-right: 34px; }
  .ggc-azioni { justify-content: stretch; }
  .ggc-azioni .ggc-btn { flex: 1 1 100%; min-width: 0; }
  .ggc-banner .ggc-testo { max-height: 38vh; overflow-y: auto; }
  .ggc-riapri { bottom: 12px; width: 40px; height: 40px; }
  .ggc-riapri.ggc-sinistra { left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ggc-switch, .ggc-switch::after { transition: none; }
}
