/* Scheda luogo: grafica editoriale unica per Luoghi, Cultura e Tradizioni.
   Verde profondo, oro e carta: la stessa identità per ogni comune, con
   contenuti che cambiano luogo per luogo. */

.pg-shell {
  --pg-deep: #10382a;
  --pg-green: #1b5a41;
  --pg-gold: #c39a44;
  --pg-carta: #fbf7ef;
  --pg-surface: #ffffff;
  --pg-ink: #17251e;
  --pg-muted: #5d6b63;
  --pg-line: rgba(16, 56, 42, 0.14);
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--pg-line);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--pg-carta) 0%, #ffffff 55%);
  color: var(--pg-ink);
  box-shadow: 0 16px 40px rgba(16, 56, 42, 0.09);
}

/* Banner -------------------------------------------------------------- */
.pg-banner {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 4vw, 30px);
  border-radius: 18px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(195, 154, 68, 0.34) 0%, rgba(195, 154, 68, 0) 55%),
    linear-gradient(135deg, var(--pg-deep) 0%, var(--pg-green) 100%);
  color: #fdfbf5;
}
.pg-banner::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pg-gold) 0%, rgba(195, 154, 68, 0) 78%);
}
.pg-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: #eccf94;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.pg-shell .pg-banner h3 {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.4rem, 4.2vw, 2rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: 0.005em;
  text-transform: none;
  color: #ffffff !important;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}
.pg-shell .pg-banner .pg-lead {
  margin: 12px 0 0;
  max-width: 68ch;
  color: #f3ecdb !important;
  font-size: clamp(0.94rem, 1.9vw, 1.04rem);
  font-weight: 500;
  line-height: 1.6;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.26);
}
.pg-shell .pg-banner .pg-eyebrow {
  color: #f5d79c !important;
}

/* Dati essenziali ------------------------------------------------------ */
.pg-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pg-facts li {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--pg-line);
  border-radius: 14px;
  background: var(--pg-surface);
}
.pg-shell .pg-fact-label {
  color: var(--pg-muted);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pg-shell .pg-fact-value {
  color: var(--pg-deep);
  font-size: 0.95rem;
  font-weight: 800;
}

/* Mappa ---------------------------------------------------------------- */
.pg-map {
  overflow: hidden;
  border: 1px solid var(--pg-line);
  border-radius: 18px;
  background: var(--pg-surface);
}
.pg-map-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 210px;
  background: linear-gradient(135deg, #e8efe9 0%, #d8e4dc 100%);
}
.pg-map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.pg-map-empty {
  display: grid;
  place-items: center;
  color: var(--pg-green);
  font-size: 1.8rem;
}
.pg-map-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 11px 14px;
  border-top: 1px solid var(--pg-line);
}
.pg-map-label {
  color: var(--pg-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Sezioni numerate ----------------------------------------------------- */
.pg-sections {
  display: grid;
  gap: 14px;
}
.pg-sections:empty {
  display: none;
}
.pg-card {
  padding: clamp(16px, 3vw, 22px);
  border: 1px solid var(--pg-line);
  border-radius: 18px;
  background: var(--pg-surface);
  box-shadow: 0 10px 24px rgba(16, 56, 42, 0.05);
}
.pg-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
}
.pg-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pg-deep) 0%, var(--pg-green) 100%);
  color: #f3dca6;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}
.pg-shell .pg-card-head h4 {
  margin: 0;
  color: var(--pg-deep);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.005em;
}
.pg-shell .pg-card-body p {
  margin: 0 0 10px;
  color: #2c3a33;
  font-size: 0.95rem;
  line-height: 1.66;
}
.pg-card-body p:last-child {
  margin-bottom: 0;
}

/* Elenco luoghi da vedere ------------------------------------------------- */
.pg-see {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.pg-see li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
}
.pg-see-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(195, 154, 68, 0.6);
  border-radius: 50%;
  background: rgba(195, 154, 68, 0.12);
  color: #8d6a20;
  font-size: 0.7rem;
  font-weight: 900;
}
.pg-see-body {
  display: grid;
  gap: 3px;
}
.pg-shell .pg-see-body strong {
  color: var(--pg-deep);
  font-size: 0.96rem;
  line-height: 1.35;
}
.pg-shell .pg-see-body span {
  color: #33423a;
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Consiglio ------------------------------------------------------------ */
.pg-tip {
  padding: 16px 18px;
  border: 1px solid rgba(195, 154, 68, 0.5);
  border-left: 5px solid var(--pg-gold);
  border-radius: 14px;
  background: #fdf6e6;
}
.pg-shell .pg-tip h4 {
  margin: 0 0 6px;
  color: #7d5c17;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pg-shell .pg-tip p {
  margin: 0;
  color: #4a3a12;
  font-size: 0.93rem;
  line-height: 1.6;
}

/* Galleria ------------------------------------------------------------- */
.pg-gallery-block {
  padding: clamp(16px, 3vw, 20px);
  border: 1px solid var(--pg-line);
  border-radius: 18px;
  background: var(--pg-surface);
}
.pg-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px;
}
.pg-gallery figure {
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #eef3ef;
}
.pg-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef3ef;
}
.pg-gallery figcaption {
  padding: 8px 10px;
  color: var(--pg-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

/* Fonti ---------------------------------------------------------------- */
.pg-credits {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 14px;
  padding-top: 4px;
  border-top: 1px solid var(--pg-line);
}
.pg-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  color: var(--pg-green);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid rgba(27, 90, 65, 0.32);
}
.pg-link:hover,
.pg-link:focus-visible {
  color: var(--pg-deep);
  border-bottom-color: var(--pg-gold);
}
.pg-credit-note {
  flex: 1 1 100%;
  margin: 0;
  color: var(--pg-muted);
  font-size: 0.74rem;
  line-height: 1.45;
}
.pg-credits-title {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 2px;
  color: var(--pg-deep);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pg-credits-title span {
  color: var(--pg-gold);
  font-size: 0.9rem;
}
.pg-credit-links {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 2px;
}
.pg-credit-inline {
  flex: 1 1 auto;
  padding: 10px 12px;
  border: 1px dashed var(--pg-line);
  border-radius: 12px;
  background: rgba(27, 90, 65, 0.04);
}
.pg-credit-inline .pg-link {
  min-height: 0;
  font-size: 0.74rem;
}

/* Caricamento ---------------------------------------------------------- */
.pg-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--pg-muted);
  font-size: 0.8rem;
  font-weight: 700;
}
.pg-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pg-gold);
  animation: pg-pulse 1.4s ease-in-out infinite;
}
@keyframes pg-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.86); }
  50% { opacity: 1; transform: scale(1); }
}

/* Slot riempiti dagli altri moduli ------------------------------------- */
.pg-slot:empty {
  display: none;
}

/* Schermi larghi: due colonne per le sezioni --------------------------- */
@media (min-width: 940px) {
  .pg-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .pg-card[data-guide-key='history'],
  .pg-card[data-guide-key='see'],
  .pg-card[data-guide-key='events'] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .pg-shell {
    gap: 13px;
    padding: 13px;
    border-radius: 18px;
  }
  .pg-banner {
    padding: 18px 16px;
    border-radius: 15px;
  }
  .pg-facts {
    grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
    gap: 8px;
  }
  .pg-map-frame {
    min-height: 180px;
  }
  .pg-gallery {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  }
}

@media (prefers-color-scheme: dark) {
  .pg-shell {
    --pg-carta: #101b16;
    --pg-surface: #16241d;
    --pg-ink: #eaf1ec;
    --pg-muted: #9db0a6;
    --pg-line: rgba(195, 154, 68, 0.22);
    background: linear-gradient(180deg, #101b16 0%, #16241d 60%);
    box-shadow: none;
  }
  .pg-shell .pg-card-body p,
  .pg-shell .pg-see-body span {
    color: #d5e2da;
  }
  .pg-shell .pg-card-head h4,
  .pg-shell .pg-see-body strong,
  .pg-shell .pg-fact-value {
    color: #f0e6cd;
  }
  .pg-tip {
    background: rgba(195, 154, 68, 0.12);
  }
  .pg-shell .pg-tip p {
    color: #f1e2bd;
  }
  .pg-shell .pg-gallery figure,
  .pg-shell .pg-gallery img,
  .pg-shell .pg-map-frame {
    background: #1d2c24;
  }
}
