/* WEB-03 only: complete page fragment inside the query container;
   footer is a sibling after the editorial wrapper. Page CSS loads first. */
/* Shared geometry also works without container queries. Navigation display,
   grid placement and the frozen 820px breakpoint remain in institutional CSS. */
.web03-page .institutional-header {
  background: rgba(11, 15, 20, .94);
}

.web03-page .institutional-header-inner,
.web03-page .hero-banner--maker-faire,
.web03-page .maker-faire-cta,
.web03-page .web03-editorial {
  box-sizing: border-box;
  width: calc(100% - 36px);
  max-width: 1120px;
  margin-inline: auto;
}

.web03-page .institutional-header-inner {
  padding-inline: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.web03-page .maker-faire-cta__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

@media (min-width: 80rem) {
  .web03-page .institutional-header-inner,
  .web03-page .hero-banner--maker-faire,
  .web03-page .maker-faire-cta,
  .web03-page .web03-editorial {
    max-width: 1432px;
  }
}

.web03-editorial {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 32px;
  padding-top: clamp(28px, 4vw, 46px);
  width: calc(100% - 36px);
  max-width: 1120px;
  margin-inline: auto;
}

.web03-editorial__content {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 1120px;
}

.web03-editorial > .web03-collaborazioni {
  width: 100%;
  min-width: 0;
}

/* Conservative internal grids also apply without container query support. */
.web03-editorial__content .cards,
.web03-editorial__content .project-card-grid,
.web03-editorial__content .news-grid,
.web03-editorial__content .hero-grid,
.web03-editorial__content .project-hero,
.web03-editorial__content .project-split,
.web03-editorial__content .contacts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

@supports (container-type: inline-size) {
  .web03-editorial__content {
    container-type: inline-size;
    container-name: web03-content;
  }

  @media (min-width: 80rem) {
    .web03-editorial {
      max-width: 1432px;
      grid-template-columns: minmax(0, 1fr) clamp(240px, 20vw, 280px);
    }
  }

  @container web03-content (min-width: 600px) {
    .web03-editorial__content .cards,
.web03-editorial__content .project-card-grid,
    .web03-editorial__content .news-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @container web03-content (min-width: 900px) {
    .web03-editorial__content .cards,
.web03-editorial__content .project-card-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .web03-editorial__content .hero-grid,
.web03-editorial__content .project-hero,
.web03-editorial__content .project-split,
.web03-editorial__content .contacts-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @container web03-content (min-width: 980px) {
    .web03-editorial__content .news-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
}

/* The wrapper alone supplies horizontal margins; retain reading limits. */
.web03-editorial__content .container,
.web03-editorial__content .project-page,
.web03-editorial__content .news-page {
  width: 100%;
}

.web03-editorial__content .privacy-content { max-width: 980px; }
.web03-editorial__content .privacy-hero-inner { max-width: 960px; }
.web03-editorial__content .contacts-hero-inner { max-width: 920px; }

.web03-editorial__content {
  overflow-wrap: anywhere;
}

.web03-editorial__content .hero-grid > *,
.web03-editorial__content .cards > *,
.web03-editorial__content .news-grid > *,
.web03-editorial__content .project-hero > *,
.web03-editorial__content .project-split > *,
.web03-editorial__content .project-card-grid > *,
.web03-editorial__content .contacts-grid > *,
.web03-editorial__content .form-grid > * {
  min-width: 0;
}

.web03-editorial__content .form-grid,
.web03-editorial__content .contact-row {
  grid-template-columns: minmax(0, 1fr);
}

.web03-editorial__content .contact-form input,
.web03-editorial__content .contact-form textarea {
  min-width: 0;
  max-width: 100%;
}

/* Titles follow available space rather than the full desktop viewport. */
.web03-editorial__content .hero h1 { font-size: clamp(2rem, 5vw, 3.75rem); }
.web03-editorial__content .project-title { font-size: clamp(2rem, 4vw, 3.5rem); }
.web03-editorial__content .news-page h1 { font-size: clamp(2rem, 4vw, 3.375rem); }

@supports (container-type: inline-size) {
  .web03-editorial__content .hero h1 { font-size: clamp(2rem, 6cqi, 3.75rem); }
  .web03-editorial__content .project-title { font-size: clamp(2rem, 5.5cqi, 3.5rem); }
  .web03-editorial__content .news-page h1 { font-size: clamp(2rem, 5.5cqi, 3.375rem); }

  @container web03-content (min-width: 600px) {
    .web03-editorial__content .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .web03-editorial__content .contact-row { grid-template-columns: 150px minmax(0, 1fr); }
  }
}

/* The outer grid supplies the space above the first content block. */
.web03-editorial__content > main,
.web03-editorial__content > .news-page {
  display: flow-root;
  padding-block: 0;
}

.web03-editorial__content > main > :first-child {
  margin-top: 0;
  padding-top: 0;
}

.web03-editorial__content > main > :nth-last-child(1 of :not(script)) {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Keep the closing intro margin inside the final section. */
.web03-editorial__content .project-partner-section {
  display: flow-root;
}

.web03-editorial__content .region-page {
  width: 100%;
}

.web03-editorial__content .rete-page {
  padding-inline: 0;
}

.web03-editorial__content .home-banner + .hero {
  padding-top: clamp(24px, 4vw, 48px);
}

@container web03-content (max-width: 980px) {
  .web03-editorial__content .rete-map-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
