/* ========================================
   TEXAS LEGACIES — THE COUNTY LEDGER
   FLEXIBLE PAGE LAYOUTS
======================================== */

.newsroom-layout-editor,
.newsroom-images-editor {
    margin: 22px 0;
    padding: 20px;
    border: 1px solid rgba(223, 160, 108, .26);
    background: rgba(7, 27, 33, .06);
}

.newsroom-layout-editor-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .7fr);
    gap: 20px;
    align-items: end;
}

.newsroom-layout-editor-heading > div > span,
.newsroom-images-editor > header span,
.newsroom-image-slot-heading span {
    display: block;
    color: #a84622;
    font-family: Arial, sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2.5px;
}

.newsroom-layout-editor-heading h3,
.newsroom-images-editor > header h3 {
    margin: 7px 0 0;
    font-size: 28px;
    font-weight: normal;
}

.newsroom-layout-hint {
    margin-top: 14px;
    padding: 13px 15px;
    border-left: 3px solid #a84622;
    background: rgba(168, 70, 34, .06);
}

.newsroom-layout-hint strong,
.newsroom-layout-hint span {
    display: block;
}

.newsroom-layout-hint strong {
    margin-bottom: 5px;
    font-family: Arial, sans-serif;
    font-size: 8px;
    letter-spacing: 1.5px;
}

.newsroom-layout-hint span {
    font-family: Arial, sans-serif;
    font-size: 10px;
    line-height: 1.6;
}

.newsroom-images-editor > header {
    margin-bottom: 16px;
}

.newsroom-images-editor > header p {
    margin: 8px 0 0;
    font-family: Arial, sans-serif;
    font-size: 10px;
    line-height: 1.6;
    opacity: .65;
}

.newsroom-image-slot {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, .8fr);
    gap: 18px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(16, 42, 51, .13);
    background: rgba(255, 255, 255, .3);
}

.newsroom-image-slot.recommended {
    border-color: rgba(168, 70, 34, .4);
    box-shadow: inset 3px 0 0 rgba(168, 70, 34, .8);
}

.newsroom-image-slot-fields {
    display: grid;
    gap: 12px;
}

.newsroom-image-slot-heading {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: flex-start;
}

.newsroom-image-slot-heading small {
    display: block;
    margin-top: 5px;
    font-family: Arial, sans-serif;
    font-size: 8px;
    opacity: .55;
}

.newsroom-image-remove {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(168, 70, 34, .36);
    background: transparent;
    color: #a84622;
    font-family: Arial, sans-serif;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
}

.newsroom-image-slot .newsroom-image-preview {
    min-height: 210px;
}

.newsroom-image-slot .newsroom-image-preview img {
    width: 100%;
    height: 100%;
    min-height: 210px;
    object-fit: cover;
}

.ledger-template {
    min-height: 100%;
}

.ledger-template .ledger-photo {
    margin: 12px 0;
}

.ledger-template .ledger-photo img {
    display: block;
    width: 100%;
    object-fit: cover;
}

.ledger-template .ledger-photo-caption {
    margin: 5px 0 0;
    font-family: Arial, sans-serif;
    font-size: 7px;
    line-height: 1.4;
}

.ledger-pull-quote {
    margin: 14px 0;
    padding: 13px 15px;
    border-top: 2px solid #17120f;
    border-bottom: 1px solid #17120f;
    font-size: 20px;
    font-style: italic;
    line-height: 1.25;
    text-align: center;
}

.ledger-article-body-single {
    column-count: 1 !important;
}

.ledger-article-body-two-columns {
    column-count: 2;
    column-gap: 18px;
}

.ledger-article-body-editorial {
    column-count: 3;
    column-gap: 16px;
}

.ledger-template-classic .ledger-photo img {
    max-height: 265px;
}

.ledger-template-hero .ledger-hero-photo .ledger-photo {
    margin: 10px -2px 14px;
}

.ledger-template-hero .ledger-hero-photo .ledger-photo img {
    height: 330px;
}

.ledger-side-story {
    display: grid;
    grid-template-columns: .88fr 1.12fr;
    gap: 17px;
    align-items: start;
    margin-top: 12px;
}

.ledger-template-photo-right .ledger-side-photo {
    order: 2;
}

.ledger-template-photo-right .ledger-side-copy {
    order: 1;
}

.ledger-side-photo .ledger-photo {
    /*
     * HOTFIX 2026-09-14-02 — foto lateral + legenda
     * A foto precisa manter formato vertical, mas a legenda não deve ficar
     * dentro do fundo marrom herdado de .ledger-photo em newspaper.css.
     */
    margin: 0;
    height: auto;
    min-height: 0;
    display: block;
    overflow: visible;
    border: 0;
    background: transparent;
}

.ledger-side-photo .ledger-photo img {
    display: block;
    width: 100%;
    height: 430px;
    min-height: 430px;
    object-fit: cover;
    object-position: center;
    border: 1px solid rgba(24, 19, 15, .30);
}

.ledger-side-photo .ledger-photo-caption {
    margin: 4px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(24, 19, 15, .82);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 6.2px;
    line-height: 1.3;
    font-style: italic;
}

.ledger-photo-gallery {
    display: grid;
    gap: 7px;
    margin: 12px 0 14px;
}

/*
 * HOTFIX 2026-09-14-03 — galeria
 * newspaper.css aplica height: 205px em toda .ledger-photo.
 * Na galeria de 3 fotos, essa altura fixa fazia as fotos da coluna
 * direita ultrapassarem as linhas do grid e invadirem a citação/texto.
 *
 * Aqui o figure deixa de herdar a caixa horizontal genérica e passa a
 * obedecer exclusivamente às dimensões do mosaico da galeria.
 */
.ledger-photo-gallery .ledger-photo {
    margin: 0;
    min-width: 0;
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: visible;
    border: 0;
    background: transparent;
}

.ledger-photo-gallery .ledger-photo img {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: cover;
    object-position: center;
    border: 1px solid rgba(24, 19, 15, .30);
}

.ledger-photo-gallery .ledger-photo-caption {
    flex: 0 0 auto;
    margin: 4px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(24, 19, 15, .82);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 6.2px;
    line-height: 1.25;
    font-style: italic;
}

.ledger-photo-gallery-1 {
    grid-template-columns: 1fr;
}

.ledger-photo-gallery-1 .ledger-photo img {
    height: 320px;
}

.ledger-photo-gallery-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ledger-photo-gallery-2 .ledger-photo img {
    height: 245px;
}

.ledger-photo-gallery-3 {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    height: 320px;
    align-items: stretch;
}

.ledger-photo-gallery-3 .ledger-photo {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.ledger-photo-gallery-3 .ledger-photo:first-child {
    grid-row: 1 / span 2;
}

.ledger-photo-gallery-3 .ledger-photo img {
    flex: 1 1 auto;
    height: 0;
    min-height: 0;
}

.ledger-template-text-focus .ledger-pull-quote {
    margin: 18px 5% 20px;
    padding: 16px 20px;
    font-size: 23px;
}

.ledger-text-focus-inset {
    width: 42%;
    float: right;
    margin: 0 0 12px 16px;
}

.ledger-text-focus-inset .ledger-photo {
    margin: 0;
}

.ledger-text-focus-inset .ledger-photo img {
    max-height: 220px;
}

.ledger-template-continuation .ledger-article-title small {
    display: block;
    margin-top: 5px;
    font-family: Arial, sans-serif;
    font-size: 8px;
    letter-spacing: 2px;
}

@media print {
    /* Mantém a foto vertical no PDF sem transformar a legenda em uma caixa. */
    .ledger-print-area .ledger-template-photo-side .ledger-side-photo .ledger-photo {
        height: auto !important;
        min-height: 0 !important;
        border: 0 !important;
        background: transparent !important;
        overflow: visible !important;
    }

    .ledger-print-area .ledger-template-photo-side .ledger-side-photo .ledger-photo img {
        width: 100% !important;
        height: 115mm !important;
        min-height: 115mm !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    .ledger-print-area .ledger-template-photo-side .ledger-side-photo .ledger-photo-caption {
        margin-top: 1.5mm !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    /*
     * newspaper.css força height: 70mm em toda .ledger-photo no PDF.
     * A galeria precisa neutralizar essa regra para que cada figure respeite
     * a própria célula do mosaico e nenhuma foto invada o conteúdo abaixo.
     */
    .ledger-print-area .ledger-template-gallery .ledger-photo-gallery {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .ledger-print-area .ledger-template-gallery .ledger-photo-gallery .ledger-photo {
        height: auto !important;
        min-height: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    .ledger-print-area .ledger-template-gallery .ledger-photo-gallery-1 .ledger-photo img {
        height: 80mm !important;
        min-height: 0 !important;
    }

    .ledger-print-area .ledger-template-gallery .ledger-photo-gallery-2 .ledger-photo img {
        height: 62mm !important;
        min-height: 0 !important;
    }

    .ledger-print-area .ledger-template-gallery .ledger-photo-gallery-3 {
        height: 78mm;
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }

    .ledger-print-area .ledger-template-gallery .ledger-photo-gallery-3 .ledger-photo {
        height: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .ledger-print-area .ledger-template-gallery .ledger-photo-gallery-3 .ledger-photo img {
        flex: 1 1 auto !important;
        height: 0 !important;
        min-height: 0 !important;
    }
}

@media (max-width: 900px) {
    .newsroom-layout-editor-heading,
    .newsroom-image-slot {
        grid-template-columns: 1fr;
    }

    .newsroom-image-slot .newsroom-image-preview {
        min-height: 260px;
    }
}

@media (max-width: 600px) {
    .newsroom-layout-editor,
    .newsroom-images-editor {
        padding: 14px;
    }

    .newsroom-image-slot {
        padding: 12px;
    }

    .newsroom-image-slot-heading {
        flex-direction: column;
    }
}

/* ========================================
   PER-ARTICLE IMAGE SCALE
   BUILD 2026-09-18-04
======================================== */

.ledger-image-size-compact .ledger-side-photo .ledger-photo img {
    height: 355px;
    min-height: 355px;
}

.ledger-image-size-normal .ledger-side-photo .ledger-photo img {
    height: 430px;
    min-height: 430px;
}

.ledger-image-size-large .ledger-side-photo .ledger-photo img {
    height: 495px;
    min-height: 495px;
}

.ledger-image-size-compact .ledger-photo-gallery-1 .ledger-photo img {
    height: 255px;
}

.ledger-image-size-normal .ledger-photo-gallery-1 .ledger-photo img {
    height: 320px;
}

.ledger-image-size-large .ledger-photo-gallery-1 .ledger-photo img {
    height: 360px;
}

.ledger-image-size-compact .ledger-photo-gallery-2 .ledger-photo img {
    height: 200px;
}

.ledger-image-size-normal .ledger-photo-gallery-2 .ledger-photo img {
    height: 245px;
}

.ledger-image-size-large .ledger-photo-gallery-2 .ledger-photo img {
    height: 280px;
}

.ledger-image-size-compact .ledger-photo-gallery-3 {
    height: 260px;
}

.ledger-image-size-normal .ledger-photo-gallery-3 {
    height: 320px;
}

.ledger-image-size-large .ledger-photo-gallery-3 {
    height: 360px;
}

.ledger-image-size-compact .ledger-hero-photo .ledger-photo img {
    height: 270px;
}

.ledger-image-size-normal .ledger-hero-photo .ledger-photo img {
    height: 330px;
}

.ledger-image-size-large .ledger-hero-photo .ledger-photo img {
    height: 385px;
}

@media print {
    .ledger-print-area .ledger-image-size-compact .ledger-side-photo .ledger-photo img {
        height: 94mm !important;
        min-height: 94mm !important;
    }

    .ledger-print-area .ledger-image-size-normal .ledger-side-photo .ledger-photo img {
        height: 115mm !important;
        min-height: 115mm !important;
    }

    .ledger-print-area .ledger-image-size-large .ledger-side-photo .ledger-photo img {
        height: 130mm !important;
        min-height: 130mm !important;
    }

    .ledger-print-area .ledger-image-size-compact .ledger-template-gallery .ledger-photo-gallery-1 .ledger-photo img {
        height: 64mm !important;
    }

    .ledger-print-area .ledger-image-size-normal .ledger-template-gallery .ledger-photo-gallery-1 .ledger-photo img {
        height: 80mm !important;
    }

    .ledger-print-area .ledger-image-size-large .ledger-template-gallery .ledger-photo-gallery-1 .ledger-photo img {
        height: 92mm !important;
    }

    .ledger-print-area .ledger-image-size-compact .ledger-template-gallery .ledger-photo-gallery-2 .ledger-photo img {
        height: 52mm !important;
    }

    .ledger-print-area .ledger-image-size-normal .ledger-template-gallery .ledger-photo-gallery-2 .ledger-photo img {
        height: 62mm !important;
    }

    .ledger-print-area .ledger-image-size-large .ledger-template-gallery .ledger-photo-gallery-2 .ledger-photo img {
        height: 70mm !important;
    }
}
