/* TopBoss migrated content */

.entry {
    width: 100%;
    min-width: 0;
}

.entry img,
.entry video,
.entry iframe {
    max-width: 100%;
}

.tb-content-image {
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.tb-responsive-table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
}

.tb-content-table {
    border-collapse: collapse;
    max-width: none;
}

.tb-content-table td,
.tb-content-table th {
    padding: 0.65rem;
    vertical-align: top;
}

.tb-responsive-embed {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
}

.tb-responsive-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.tb-text-center {
    text-align: center;
}

@media (max-width: 767px) {
    .entry {
        overflow-wrap: anywhere;
    }

    .tb-responsive-table {
        margin: 1rem 0;
    }

    .tb-content-table td,
    .tb-content-table th {
        padding: 0.4rem;
    }
}

/* TopBoss Stage 15.10: migrated-content responsive enhancements.
   Append after existing responsive-content.css; do not replace base rules. */
.entry,
.entry-content,
.site-main { min-width: 0; }
.entry :where(img, video, svg) { max-width: 100%; height: auto; }
.entry :where(pre, code) { overflow-wrap: anywhere; }
.entry :where(iframe, embed, object) { max-width: 100%; }
.entry :where(.tb-content-grid, .tb-content-row, .tb-content-cell) { min-width: 0; }
.entry .tb-content-cell img { max-width: 100%; height: auto; }

/* A-Z indexes have 10+ letter cells in a single row.
   Ordinary two-column promotions and previous/next links remain unchanged. */
.entry .tb-content-grid:has(> .tb-content-row > .tb-content-cell:nth-child(10)) {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.25rem 0;
}
.entry .tb-content-grid:has(> .tb-content-row > .tb-content-cell:nth-child(10)) > .tb-content-row {
  display: contents;
}
.entry .tb-content-grid:has(> .tb-content-row > .tb-content-cell:nth-child(10)) > .tb-content-row > .tb-content-cell {
  display: block;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
}
.entry .tb-content-grid:has(> .tb-content-row > .tb-content-cell:nth-child(10)) > .tb-content-row > .tb-content-cell { /* > a {*/
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  min-height: 2.6rem;
  padding: .4rem .65rem;
  border: 1px solid #e0d7d5;
  border-radius: .4rem;
  background: #fff;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}
.entry .tb-content-grid:has(> .tb-content-row > .tb-content-cell:nth-child(10)) > .tb-content-row > .tb-content-cell > a:is(:hover,:focus-visible) {
  border-color: #7d1e27;
  background: #fff7f3;
  text-decoration: underline;
}

/* Consistent presentation of existing editorial cards and placeholders. */
.tb-content-card { min-width: 0; overflow: hidden; }
.tb-content-card-link { min-width: 0; }
.tb-content-card-image { overflow: hidden; }
.tb-content-card-image > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tb-content-card-placeholder { min-height: 100%; }
.tb-content-card-body { min-width: 0; overflow-wrap: break-word; }
.tb-related-pages ul { padding-inline-start: 1.25rem; }

@media (max-width: 600px) {
  .entry { overflow-wrap: break-word; }
  .entry .tb-content-grid:has(> .tb-content-row > .tb-content-cell:nth-child(10)) { gap: .35rem; }
  .entry .tb-content-grid:has(> .tb-content-row > .tb-content-cell:nth-child(10)) > .tb-content-row > .tb-content-cell > a {
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: .4rem .55rem;
  }
  .tb-content-card-body { padding-inline: clamp(.75rem, 3vw, 1.25rem); }
}


/* Stage 19.5E — Explicit TopBoss gallery grids */

.entry .tb-content-grid.tb-gallery-grid {
  margin: 1.5rem 0;
}

.entry .tb-content-grid.tb-gallery-grid > .tb-content-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.entry .tb-content-grid.tb-gallery-grid > .tb-content-row > .tb-content-cell {
  min-width: 0;
  padding: 12px;
  border: 1px solid #eee3e0;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.entry .tb-content-grid.tb-gallery-grid > .tb-content-row > .tb-content-cell img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto 10px;
}

.entry .tb-content-grid.tb-gallery-grid > .tb-content-row > .tb-content-cell a {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .entry .tb-content-grid.tb-gallery-grid > .tb-content-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .entry .tb-content-grid.tb-gallery-grid > .tb-content-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}


/* Stage 19.8 — Clean gallery title styling */

/* Reset promotional-style formatting inside gallery cards only. */
.entry .tb-content-grid.tb-gallery-grid
> .tb-content-row > .tb-content-cell :is(h2, h3, h4) {
    display: block;
    margin: 10px 0 4px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #650900;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-transform: none;
}

/* Captions created by the gallery editor use paragraphs. */
.entry .tb-content-grid.tb-gallery-grid
> .tb-content-row > .tb-content-cell p {
    margin: 10px 0 4px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
}

/* Make title links consistent across legacy and new galleries. */
.entry .tb-content-grid.tb-gallery-grid
> .tb-content-row > .tb-content-cell :is(h2, h3, h4, p) a {
    display: inline;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #650900;
    font: inherit;
    text-decoration: none;
    overflow-wrap: break-word;
}

.entry .tb-content-grid.tb-gallery-grid
> .tb-content-row > .tb-content-cell :is(h2, h3, h4, p) a:is(:hover, :focus-visible) {
    color: #a51b0b;
    text-decoration: underline;
}

/* Prevent inherited promotional accent bars on title wrappers. */
.entry .tb-content-grid.tb-gallery-grid
> .tb-content-row > .tb-content-cell :is(h2, h3, h4, p)::before,
.entry .tb-content-grid.tb-gallery-grid
> .tb-content-row > .tb-content-cell :is(h2, h3, h4, p)::after {
    border: 0;
    box-shadow: none;
}

/* Compact titles on smaller screens. */
@media (max-width: 600px) {
    .entry .tb-content-grid.tb-gallery-grid
    > .tb-content-row > .tb-content-cell :is(h2, h3, h4, p) {
        font-size: .95rem;
    }
}
