/* Generic content page (views/page.js): legacy markup stored in the database */
.page-content {
  overflow-x: auto;
}

/* Long links, e-mails and paths wrap instead of widening the page on phones (normal words stay whole) */
.page-content {
  overflow-wrap: break-word;
}

.page-content img {
  max-width: 100%;
  height: auto;
}

.page-content table {
  width: 100%;
  margin-bottom: var(--spacing-md);
}

/* PageContent puts each table in this box: a table wider than the page scrolls sideways by itself */
.page-content .page-table-scroll {
  overflow-x: auto;
  margin-bottom: var(--spacing-md);
}

.page-content .page-table-scroll > table {
  margin-bottom: 0;
}

.page-content th {
  background-color: var(--news-header-bg);
  padding: var(--spacing-sm);
  text-align: left;
}

.page-content td {
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

/* Hidden answers (C.O. per tutti solutions): closed by default */
.page-content summary {
  color: var(--gold-blue);
  cursor: pointer;
  font-weight: 600;
}

.page-content details[open] summary {
  margin-bottom: var(--spacing-xs);
}

/* The content's own headings are subtitles under the blue page title, never larger than it */
.page-content :is(h1, h2, h3) {
  font-size: 1.15rem;
}

/* Group title between section panels (PageContent `sections`, e.g. "Pagamenti GOLD") */
.page-section-heading {
  color: var(--gold-blue);
  font-size: 1.25rem;
  font-weight: 700;
  margin: var(--spacing-sm) 0 0;
}

/* Sections side by side in the legacy layout (PageContent `sections` cards, e.g. the contacts) */
.page-section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: var(--spacing-md);
}

/* One layout cell: its titles, tables and panels one under the other, spaced by the column gap */
.page-section-column {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  min-width: 0;
}

.page-section-column .table-box-section,
.page-section-column .page-section-heading {
  margin: 0;
}

.page-section-column .content-panel-body {
  padding: var(--spacing-md);
}

/* A titled panel alone in its cell is stretched to the tallest cell of the row (the contacts) */
.page-section-column > .content-panel:only-child:has(> .content-panel-header) {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page-section-column > .content-panel:only-child:has(> .content-panel-header) > .content-panel-body {
  flex: 1;
}
