/* Static-export corrections, kept separate from the exported theme. */
#content .escudosbanderas tr:first-child > td {
  background: #454545 !important;
  color: #fff !important;
}
#content .escudosbanderas { max-width: 100%; }
.ss-coat-variants .wp-block-image figure { margin-bottom: 24px; }
.is-menu-sidebar .builder-item--nav-icon { visibility: hidden; }
.header-menu-sidebar { max-width: 100vw; }

@media (max-width: 767px) {
  #content .escudosbanderas .wptb-container-legacy,
  #content .escudosbanderas table,
  #content .escudosbanderas tbody {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
  }
  #content .escudosbanderas tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100% !important;
  }
  #content .escudosbanderas tr > td {
    display: block;
    width: auto !important;
    min-width: 0 !important;
    padding: 12px !important;
  }
  #content .escudosbanderas tr > td:first-child { grid-column: 1 / -1; }
  #content .escudosbanderas .wptb-image-wrapper a {
    width: 100% !important;
    text-align: center;
  }
  #content .escudosbanderas img {
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
  }
}

.ss-zoomable { cursor: zoom-in; }
.ss-zoomable:focus-visible { outline: 3px solid #2f5aae; outline-offset: 4px; }
html.ss-image-open { overflow: hidden; }
dialog.ss-image-viewer {
  box-sizing: border-box;
  width: min(1100px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 64px 16px 16px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #222;
}
dialog.ss-image-viewer::backdrop { background: rgb(0 0 0 / 80%); }
.ss-image-viewer img {
  display: block;
  margin: 0 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 160px);
  object-fit: contain;
}
.ss-image-viewer button {
  position: absolute;
  top: 10px;
  right: 12px;
  min-height: 44px;
  padding: 8px 16px;
  background: #333;
  color: #fff;
  border: 2px solid #333;
}
.ss-image-viewer button:focus-visible { outline: 3px solid #2f5aae; outline-offset: 2px; }
.ss-image-viewer p { margin: 12px 0 0; text-align: center; }

/* Documented content: keep references readable at every viewport width. */
.ss-record-page { padding-top: 32px; padding-bottom: 32px; }
.ss-record-page h1 { overflow-wrap: anywhere; }
.ss-record-symbols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.ss-record-symbols > section { min-width: 0; padding: 20px; background: #faf8f2; border: 1px solid #bbb; }
.ss-record-symbols figure { margin: 20px 0; text-align: center; }
.ss-record-symbols img { display: inline-block; width: auto; height: auto; max-width: 100%; max-height: 300px; object-fit: contain; }
.ss-record-symbols figcaption { font-size: .9rem; margin-top: 12px; }
.ss-record-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; margin-top: 28px; }
.ss-record-nav a { padding: 10px 0; text-decoration: underline; }
@media (max-width: 767px) {
  .ss-record-symbols { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ss-record-page h1 { font-size: 2rem; }
}
.ss-editorial-notes,
.ss-municipal-record {
  box-sizing: border-box;
  margin-top: 32px;
  margin-bottom: 32px;
  padding: 24px;
  border: 1px solid #bbb;
  background: #faf8f2;
  color: #222;
  overflow-wrap: anywhere;
}
.ss-editorial-notes h2,
.ss-municipal-record h2 { font-size: 1.5rem; }
.ss-municipal-record h3 { font-size: 1.2rem; margin-top: 20px; }
.ss-editorial-notes ul { padding-left: 24px; }
.ss-editorial-notes a,
.ss-municipal-record a { text-decoration: underline; }
.ss-no-data { font-size: .85rem; color: #444; text-align: center; }
@media (max-width: 767px) {
  .ss-editorial-notes, .ss-municipal-record { padding: 16px; }
}
