/* Motivi e marchi del modello regionale, su bianco e sul blu della fascia. */
.puglia-base,
.office-footer {
  --puglia-blue: #0076bf;
}
.puglia-base {
  display: grid;
  justify-items: center;
  background: var(--puglia-blue);
}
.puglia-base::before {
  content: "";
  width: 100%;
  height: clamp(24px, 3.2vw, 46px);
  background: #fff url("assets/puglia-fascia-onde.svg") repeat-x center bottom / auto 100%;
}
.puglia-base > img {
  width: clamp(160px, 17vw, 230px);
  margin: clamp(12px, 1.1vw, 17px) auto;
}

.regional-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: center / contain no-repeat url("assets/puglia-fascia-cornice.svg");
}
.regional-photo > img,
.photo-band .regional-photo img,
.city-head .regional-photo img,
.dialog__figure .regional-photo img {
  position: absolute;
  inset: 16%;
  width: 68%;
  height: 68%;
  border-radius: 50%;
  object-fit: cover;
}
.regional-photo img[src$="torre-testa.jpg"] { object-position: 70% center; }
.photo-band {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: center;
  gap: clamp(.85rem, 3vw, 2.5rem);
}
.photo-band figure,
.city-head figure {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}
.photo-band figure { width: min(100%, 265px); }
.photo-band figcaption,
.city-head figcaption,
.dialog__figure figcaption {
  text-align: center;
  color: var(--muted);
  background: transparent;
}
.city-head figure { width: min(100%, 285px); margin-inline: auto; }
.dialog__figure .regional-photo { width: min(100%, 245px); margin-inline: auto; }
.office-footer { background: #fff; border-top: 1px solid #c9d6d8; }
.office-footer__office {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1.3rem, 3.5vw, 3.25rem);
  padding-block: clamp(2rem, 5vw, 4.5rem);
}
.office-footer__badge { width: clamp(75px, 8vw, 116px); }
.office-footer h2 {
  margin: 0 0 .45rem;
  font: 800 clamp(2.15rem, 3vw, 3.2rem)/1 BarlowCondensed, system-ui, sans-serif;
  color: var(--navy);
}
.office-footer address { font-style: normal; color: var(--ink); }
.office-footer__contacts { display: grid; justify-items: start; }
.office-footer__contacts span {
  color: var(--muted);
  font-size: .79rem;
  font-weight: 650;
}
.office-footer__contacts a {
  font-size: clamp(1rem, 1.4vw, 1.14rem);
  font-weight: 650;
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
}
.office-footer__contacts a + span { margin-top: .55rem; }
.hero__comune {
  position: absolute;
  z-index: 1;
  top: clamp(10px, 1.15vw, 20px);
  right: clamp(12px, 1.65vw, 32px);
  width: clamp(56px, 6vw, 94px);
  height: auto;
  filter: drop-shadow(0 1px 2px rgb(6 39 61 / 70%));
}
.office-footer__marks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3.5vw, 48px);
  padding: clamp(21px, 3vw, 38px) 16px;
  background: var(--puglia-blue);
}
.office-footer__regione { width: min(72%, 480px); height: auto; }
.office-footer__comune { width: clamp(49px, 8vw, 78px); height: auto; }
@media (max-width: 720px) {
  .hero__comune { top: 8px; right: 12px; }
}
@media (max-width: 440px) {
  .hero__comune { top: 5px; width: 54px; }
  .office-footer__marks { flex-direction: column; gap: 18px; }
  .office-footer__regione { width: min(100%, 340px); }
  .office-footer__comune { width: 60px; }
}
.office-footer__bar { background: var(--navy-deep); color: #e7f2f7; }
.office-footer__bar .wrap,
.office-footer__bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; }
.office-footer__bar .wrap { justify-content: space-between; padding-block: 1.15rem; font-size: .9rem; }
.office-footer__bar a { color: #fff; }
@media (max-width: 720px) {
  .photo-band { gap: .4rem; }
  .photo-band figure:first-child { grid-column: auto; }
  .photo-band figcaption { font-size: .82rem; padding: .5rem 0 0; }
  .city-head figure { width: min(70%, 215px); }
  .office-footer__office {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.4rem 1.15rem;
    padding-inline: .5rem;
  }
  .office-footer__contacts { grid-column: 1 / -1; border-top: 1px solid #c9d6d8; padding-top: 1rem; }
}

.topic-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
.topic-card { min-height: 0; }
.topic-card h3 { margin: 0 0 .45rem; }
.topic-card--active {
  display: grid;
  grid-template-columns: minmax(96px, 30%) 1fr;
  align-items: center;
  gap: clamp(.85rem, 2vw, 1.65rem);
  background: #fff;
}
.topic-card--active h3 { font-size: clamp(1.7rem, 2.5vw, 2.2rem); }
.topic-card__action { display: inline-block; line-height: 1.3; }
.topic-grid article { border-top-width: 1px; }
.topic-grid article h3 { font-size: 1.35rem; }
.city-archive-link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  margin-top: .55rem;
  color: #155979;
  font-weight: 700;
}
.event-card:has(> .regional-photo) {
  display: grid;
  grid-template-columns: clamp(72px, 7vw, 88px) minmax(0, 1fr);
  grid-template-areas: "picture date" "picture detail";
  align-content: center;
  align-items: start;
  gap: .3rem .85rem;
}
.event-card > .regional-photo { grid-area: picture; align-self: center; }
.event-card:has(> .regional-photo) .event-card__date {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  grid-area: date;
  font-size: 1.65rem;
}
.event-card:has(> .regional-photo) .event-card__body { grid-area: detail; }
@media (max-width: 790px) {
  .topic-card--active { grid-template-columns: minmax(76px, 27%) 1fr; gap: .8rem; }
}
@media (max-width: 640px) {
  .topic-grid { grid-template-columns: 1fr; gap: .65rem; }
  .topic-card--active { grid-template-columns: minmax(80px, 24%) 1fr; }
  .topic-card { padding: 1rem; }
}

.program-direct {
  display: inline-flex; gap: .55rem; align-items: center; min-height: 44px;
  margin-top: .5rem; font-weight: 700;
}
.city-head .program-direct { margin-inline-start: .9rem; }
.natura-head .program-direct { color: inherit; }
.program-downloads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.program-file {
  display: grid; grid-template-columns: minmax(6.5rem, 30%) 1fr;
  align-items: start; gap: clamp(.85rem,2.4vw,2rem); padding: clamp(1rem,2vw,1.8rem);
  border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: 12px; background: white;
}
.program-file:last-child { border-top-color: var(--rust); }
.program-file__preview { min-height: 3rem; }
.program-file__preview img { width: 100%; height: auto; box-shadow: 0 2px 6px #163a4e26; }
.program-file h3 { margin: 0 0 .4rem; font: 800 clamp(1.7rem,2.6vw,2.15rem)/1.07 BarlowCondensed,sans-serif; }
.program-file p { margin: 0 0 .75rem; color: var(--muted); font-size: .9rem; }
.program-file ul, .visit-files ul { margin: 0; padding: 0; list-style: none; }
.program-file li + li, .visit-files li + li { border-top: 1px solid var(--line); }
.program-file li a, .visit-files li a {
  display: flex; justify-content: space-between; align-items: baseline; gap: .65rem;
  padding: .6rem 0; text-decoration: none; font-weight: 700; line-height: 1.32;
}
.program-file a:hover, .visit-files a:hover { text-decoration: underline; }
.visit-files li small, .program-file li small { flex: 0 0 auto; color: var(--muted); font-size: .77rem; font-weight: 550; }
.visit-files { margin: 1.35rem 0; padding-top: 1.1rem; border-top: 2px solid #0076bf; }
.visit-files h4 { margin: 0 0 .35rem; font: 800 1.5rem/1.12 BarlowCondensed,sans-serif; }
.visit-files a > span > small { display: block; margin-top: .12rem; }
.event-source-photo { margin: .8rem 0; }
.event-source-photo .regional-photo { width: min(45%, 145px); }
.event-source-photo figcaption { font-size: .78rem; }
.photo-credit { display: block; margin-top: .2rem; }
.photo-credit a { color: inherit; }
.other-materials { margin-top: 1.8rem; }
.other-materials summary { cursor: pointer; font-weight: 750; padding: .7rem 0; color: var(--navy); }
.other-materials[open] .download-grid { margin-top: 1rem; }
@media (max-width: 800px) { .program-downloads { grid-template-columns: 1fr; } }
@media (max-width: 440px) {
  .program-file { grid-template-columns: minmax(62px, 22%) minmax(0,1fr); gap: .8rem; }
  .program-file li a { flex-wrap: wrap; gap: .1rem .5rem; }
  .city-head .program-direct { margin-inline-start: 0; margin-inline-end: .9rem; }
  .city-archive-link { margin-inline-end: .9rem; }
}

#city-archive-document { margin-top: 1.15rem; }
#city-archive-document h3 { margin: 0; font: 800 1.35rem/1.15 BarlowCondensed,sans-serif; }
#city-archive-document .dialog__note { margin-block: .35rem 0 !important; }
.visit-text { display: inline-flex; align-items: center; min-height: 44px; margin-top: .5rem; font-size: .9rem; }
.photo-enlarge { display: inline-block; padding: .3rem .1rem; text-decoration-thickness: 1px; }

/* Le schede condividono lo stesso elenco nel calendario e nella pagina HTML. */
.visit-files li .visit-file__single {
  display: inline-block; padding: .2rem 0 .7rem; font-size: .85rem;
  font-weight: 500; text-decoration: underline; text-underline-offset: .15em;
}
.visit-files li .visit-file__download { align-items: flex-start; }
.visit-file__download > span, .visit-files li { min-width: 0; }
.fallback-list .visit-files li { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 0; }
.visit-copy { margin-top: .75rem; }
.visit-copy summary {
  cursor: pointer; color: var(--navy); font-weight: 700;
  padding: .65rem 0; text-decoration: underline; text-underline-offset: .15em;
}
.visit-copy__text {
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; line-height: 1.55;
  padding: .85rem 1rem; border-inline-start: 3px solid #0076bf; background: #f3f7fa;
}
.visit-participation { line-height: 1.5; }
.visit-participation a { white-space: nowrap; }

.visit-video {
  margin: .75rem 0 1rem; border: 1px solid var(--line); border-radius: .55rem;
  background: #f3f7fa; overflow: hidden;
}
.visit-video summary {
  padding: .8rem 1rem; cursor: pointer; color: var(--navy);
  font-weight: 700; line-height: 1.4;
}
.visit-video summary:focus-visible { outline-offset: -3px; }
.visit-video video {
  display: block; width: min(100% - 1.5rem, 17rem); height: auto; margin: 0 auto .8rem;
  width: min(100% - 1.5rem, 17rem, 35svh);
  aspect-ratio: 9 / 16; background: #102b3c;
}
