/* Special Bulletin — flyer MCB (proporción PSD, cuerpo alto) */
.doc-sheet.bulletin-flyer {
  width: 615px;
  max-width: 615px;
  min-height: 980px;
  height: auto;
  padding: 0;
  margin: 0 auto;
  background: #eee;
  color: #111;
  box-shadow: 0 0 0 1px #888;
  overflow: hidden;
}
/* Al abrir o descargar, la hoja A4 de los demás documentos (210mm) no estira el flyer: sin franja vacía al costado */
.doc-stack.view-doc-stack .doc-sheet.bulletin-flyer {
  width: 615px;
  max-width: 615px;
}
/* Sin el borde gris de las hojas A4: en la descarga dejaba una línea al costado y abajo */
.doc-sheet.bulletin-flyer {
  border: 0;
}
@media print {
  .doc-sheet.bulletin-flyer {
    width: 615px !important;
    max-width: 615px !important;
    margin: 0 auto !important;
  }
}

.sb-root {
  display: flex;
  flex-direction: column;
  width: 615px;
  min-height: 980px;
  font-family: Arial, Helvetica, sans-serif;
  color: #111;
  background: #eeeeee;
}

/* Cabecera cielo (sin WANTED en el PNG) + franjas CSS */
.sb-top {
  position: relative;
  flex: 0 0 120px;
  width: 615px;
  height: 120px;
  background: #0a1628 url("/static/assets/bulletin/sb-top.png?v=17") left top / 615px 120px no-repeat;
}

/* Nombre del Sheriff en HTML nítido */
.sb-sheriff {
  position: absolute;
  right: 14px;
  top: 93px;
  z-index: 3;
  margin: 0;
  padding: 0;
  color: #ffffff;
  font-family: "Times New Roman", Times, "Liberation Serif", Georgia, serif;
  font-style: italic;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  text-shadow: none;
  filter: none;
  white-space: nowrap;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sb-banner {
  flex: 0 0 72px;
  width: 100%;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  box-sizing: border-box;
  background: #ffdb00;
  color: #0a0a0a;
}
.sb-banner-text {
  display: block;
  max-width: 100%;
  font-family: "Arial Black", "Helvetica Neue", Arial, Helvetica, sans-serif;
  font-weight: 900;
  font-size: 42px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
  line-height: 1.05;
  text-align: center;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  overflow-wrap: anywhere;
  word-break: normal;
}
.sb-banner.mid .sb-banner-text {
  font-size: 32px;
  letter-spacing: 0.03em;
}
.sb-banner.compact .sb-banner-text {
  font-size: 24px;
  letter-spacing: 0.02em;
  line-height: 1.08;
}
.sb-banner.tight .sb-banner-text {
  font-size: 18px;
  letter-spacing: 0.015em;
  line-height: 1.12;
}
.sb-banner.red,
.sb-banner.blue,
.sb-banner.green { color: #fff; }
.sb-banner.red { background: #b00000; }
.sb-banner.blue { background: #1a4f8c; }
.sb-banner.green { background: #1b4d2e; }
.sb-banner.yellow {
  background: #ffdb00;
  color: #0a0a0a;
}

/* Franja marrón bajo el banner (como el PSD) */
.sb-banner-rule {
  flex: 0 0 20px;
  width: 100%;
  height: 20px;
  background: #6d593d;
}

.sb-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  background: #eeeeee;
  padding: 18px 0 14px;
  min-height: 560px;
}

.sb-subject-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 14px;
  padding: 0 20px;
  margin-bottom: 16px;
  align-items: stretch;
}

.sb-photo-col {
  display: flex;
  flex-direction: column;
  border: 2px solid #111;
  background: #ddd;
  min-height: 240px;
}

.sb-photo-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #d5d5d5;
}
.sb-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.sb-photo-frame .photo-zoom {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
/* Foto como fondo "contain": html2canvas no respeta object-fit y la descarga salía con zoom */
.sb-photo-frame .sb-photo-bg {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: #d5d5d5 center / contain no-repeat;
  cursor: zoom-in;
}
.sb-photo-frame span {
  color: #777;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.sb-stamp {
  position: absolute;
  inset: 16% 8%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: rotate(-28deg);
  border: 5px solid #c00;
  color: #c00;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.88;
  z-index: 3;
}
.sb-photo-date {
  flex: 0 0 auto;
  border-top: 2px solid #111;
  background: #eee;
  font-size: 10px;
  font-weight: 700;
  color: #111;
  text-align: center;
  padding: 4px 4px;
  line-height: 1.2;
}

.sb-subj-box {
  border: 2px solid #111;
  background: #f4f4f4;
  padding: 10px 12px;
  overflow: hidden;
  min-height: 240px;
  box-sizing: border-box;
}
.sb-subj-name {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  line-height: 1.2;
}
.sb-subj-info {
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.sb-subj-charges {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
}

/* Texto de borde a borde, justificado */
.sb-narrative {
  flex: 1 1 auto;
  padding: 2px 18px 10px;
  font-size: 12.5px;
  line-height: 1.55;
  text-align: justify;
  text-justify: inter-word;
  /* sin guionado automático: al descargar (html2canvas) partía palabras como "inf ormación" */
  hyphens: manual;
  -webkit-hyphens: manual;
  overflow: visible;
}
.sb-narrative p {
  margin: 0 0 0.75em;
}
.sb-narrative p:last-child {
  margin-bottom: 0;
}

/* Pie: colores PSD, sin imagen estirada */
.sb-bot {
  flex: 0 0 auto;
  width: 100%;
  background: #3f562f;
  display: flex;
  flex-direction: column;
}

.sb-contact {
  text-align: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.25;
  padding: 12px 14px 10px;
}
.sb-contact-label {
  color: #ffd200;
  font-size: 13px;
  font-weight: 700;
}
.sb-contact-unit {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.sb-contact-det {
  font-size: 12px;
  font-weight: 700;
}
.sb-contact-det .attn {
  color: #ffd200;
}

.sb-bottom {
  /* alto con aire: html2canvas baja un poco el texto y en la descarga la fecha salía cortada */
  min-height: 22px;
  line-height: 22px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 10px 2px;
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  background: #000;
  white-space: nowrap;
}
.sb-bottom-date {
  justify-self: start;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-bottom-num { justify-self: center; letter-spacing: 0.1em; }
.sb-bottom-code { justify-self: end; }

.composer-preview .doc-sheet.bulletin-flyer {
  transform-origin: top center;
}

.sb-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.sb-template-preview {
  appearance: none;
  border: 1px solid var(--card-border, #3a3f48);
  background: var(--panel, #12151a);
  border-radius: 8px;
  padding: 0.55rem;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.sb-template-preview:hover {
  border-color: color-mix(in srgb, #c9a227 55%, var(--card-border));
  transform: translateY(-2px);
}
.sb-mini-frame {
  height: 230px;
  overflow: hidden;
  border-radius: 4px;
  background: #ddd;
  border: 1px solid #999;
  pointer-events: none;
}
.sb-mini-scale {
  width: 615px;
  transform: scale(0.28);
  transform-origin: top left;
}
.sb-template-caption {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.72;
}
.sb-template-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
  font-size: 0.88rem;
  line-height: 1.25;
  color: inherit;
}
.sb-template-name strong {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.sb-template-tag {
  flex: 0 0 auto;
  background: #c9a227;
  color: #111;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

/* —— Preview PSD precargada (sb-chrome.png ×1 en caché) —— */
.sb-template-preview.is-principal {
  border-color: #c9a227;
  box-shadow: 0 0 0 1px color-mix(in srgb, #c9a227 45%, transparent);
}
.sb-mini-shot {
  position: relative;
  height: 240px;
  overflow: hidden;
  border-radius: 4px;
  background: #1a1a1a;
  border: 1px solid #999;
  pointer-events: none;
}
.sb-mini-shot.is-principal {
  outline: 2px solid #c9a227;
  outline-offset: -2px;
}
.sb-mini-shot img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
  user-select: none;
  -webkit-user-drag: none;
}
.sb-mini-shot-banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 15%;
  height: 7%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-sizing: border-box;
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.05;
  color: #0a0a0a;
  background: #ffdb00;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-mini-shot-banner.long {
  font-size: 8.5px;
  letter-spacing: 0.02em;
  white-space: normal;
  line-height: 1.05;
  padding: 1px 3px;
}
.sb-mini-shot.banner-red .sb-mini-shot-banner {
  background: #b00000;
  color: #fff;
}
.sb-mini-shot.banner-blue .sb-mini-shot-banner {
  background: #1a4f8c;
  color: #fff;
}
.sb-mini-shot.banner-green .sb-mini-shot-banner {
  background: #1b4d2e;
  color: #fff;
}
.sb-mini-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  background: #c9a227;
  color: #111;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 2px;
}

/* Selector OSSB / MCB del pie */
.sb-bureau-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.15rem;
}
.sb-bureau-btn {
  border: 1px solid var(--line, #444);
  background: transparent;
  color: var(--ink, #ddd);
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: var(--radius, 4px);
  cursor: pointer;
}
.sb-bureau-btn:hover {
  border-color: var(--gold, #c9a227);
  color: #fff;
}
.sb-bureau-btn.active {
  background: color-mix(in srgb, var(--gold, #c9a227) 28%, transparent);
  border-color: var(--gold, #c9a227);
  color: var(--ink, #fff);
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
