#home-folhao[hidden],.folhao-reader[hidden]{display:none!important}
.home-feature-layout{--fh-columns:5;display:grid;grid-template-columns:repeat(var(--fh-columns),minmax(0,1fr));gap:16px 20px;align-items:start;margin-bottom:24px}
.home-feature-layout>.featured-grid{grid-column:1 / -1;grid-row:1;grid-template-columns:repeat(var(--fh-columns),minmax(0,1fr))}
.folhao-cover{display:block;position:relative;width:min(100%,180px);margin-inline:auto;padding:0;border:0;overflow:hidden;aspect-ratio:2/3;background:antiquewhite;cursor:zoom-in;box-sizing:border-box}
.folhao-cover img{display:block;position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:contain;object-position:center}
.folhao-cover img[hidden]{display:none}
#home-folhao .folhao-cover{background:transparent;mask-image:linear-gradient(to bottom,#000,transparent)}
@media (width > 650px) {
    #home-agenda-column {
        --folhao-side-bleed:clamp(8px,1.05vw,16px);
        display:flex;
        flex-direction:column;
        align-self:stretch;
        min-width:0;
        isolation:isolate;
    }
    #home-agenda-column > #home-folhao { position:relative; z-index:0; flex:none; }
    #home-agenda-column > #home-agenda { position:relative; z-index:1; flex:1; min-height:180px; }
    /* Keep the lead photo visible behind the upper edge of the calendar. */
    #home-agenda-column .folhao-cover {
        width:calc(100% + 2 * var(--folhao-side-bleed));
        margin-inline:calc(-1 * var(--folhao-side-bleed));
        aspect-ratio:100 / 57;
    }
    #home-agenda-column .folhao-cover img { height:auto; }
    #home-agenda-column > #home-folhao:not([hidden]) + #home-agenda {
        margin-top:calc(-14.6% - var(--folhao-side-bleed) * .292 - 50px);
        background:linear-gradient(to bottom,rgb(0 0 0 / 72%),transparent);
    }
    .light-mode #home-agenda-column > #home-folhao:not([hidden]) + #home-agenda {
        background:linear-gradient(to bottom,rgb(255 250 240 / 80%),transparent);
    }
    #home-agenda-column > #home-folhao:has(>.folhao-cover:focus-visible) {
        outline:2px solid var(--site-accent,#AF8058);
        outline-offset:3px;
    }
}
.folhao-cover:disabled{cursor:default}
.folhao-reader{width:max-content;max-width:calc(100vw - 32px);height:fit-content;max-height:calc(100dvh - 32px);margin:auto;padding:30px 0 0;border:0;box-sizing:border-box;background:transparent;color:#fff;overflow:hidden}
.folhao-reader::backdrop{background:#0009}
.folhao-reader-body{position:relative;max-width:calc(100vw - 34px);max-height:calc(100dvh - 64px);padding:0;overflow:auto;overscroll-behavior:contain;touch-action:none;box-sizing:border-box}
.folhao-reader-bar{position:absolute;top:0;right:0;z-index:2;display:flex;align-items:start;color:#fff;font:14px/1.3 Arial,sans-serif}
.folhao-reader-title{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.folhao-reader-actions{display:flex;gap:4px}
.folhao-reader button.folhao-reader-close{display:grid;place-items:center;padding:0;width:26px;height:26px;background:#0008;color:#fff;border:0;cursor:pointer;transition:background .15s,color .15s}
.folhao-reader-close svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round}
.folhao-reader button.folhao-reader-close:hover{background:#000c;color:#fff}
.folhao-reader-close:focus-visible,.folhao-reader-image:focus-visible{outline:1px solid #aaa;outline-offset:-2px}
.folhao-reader-spread{display:flex;align-items:center;justify-content:center;gap:12px;min-width:100%;width:max-content;min-height:100%}
.folhao-reader-paper{position:relative;flex:0 0 auto;min-width:0}
.folhao-reader-image{display:block;max-width:none;object-fit:contain;margin:0;background:antiquewhite;cursor:grab;user-select:none;-webkit-user-drag:none}
.folhao-reader-image.is-dragging{cursor:grabbing}
.folhao-reader-links{text-align:left;font:16px/1.5 Arial,sans-serif;max-width:800px;margin:16px auto;color:#fff;padding:0 12px}
.folhao-reader-links[hidden]{display:none}
.folhao-reader-links a{color:#fff}
.folhao-reader-links ul{padding-left:24px}
@media(max-width:1250px){.home-feature-layout{--fh-columns:4}}
@media(max-width:1050px){.home-feature-layout{--fh-columns:3}}
@media(max-width:780px){.home-feature-layout{--fh-columns:2}}
@media(max-width:650px){
    .home-feature-layout{display:none}
    #home-folhao{display:block;min-width:0}
    #home-folhao .folhao-cover{width:100%;aspect-ratio:800/240}
    #home-folhao .folhao-cover img{inset:auto;left:0;top:0;width:100%;height:auto;object-fit:initial;object-position:top}
    #home-folhao:has(>.folhao-cover:focus-visible){outline:2px solid var(--site-accent,#AF8058);outline-offset:3px}
    .folhao-reader{max-width:calc(100vw - 24px)}
    .folhao-reader-body{max-width:calc(100vw - 26px)}
    .folhao-reader-spread{flex-direction:row;width:max-content;min-width:100%;gap:0;padding:0;min-height:0}
}


.folhao-reader-links>summary{display:list-item;list-style-position:inside;padding:6px 0;cursor:pointer;user-select:none;pointer-events:auto}
.folhao-reader-links>summary:focus-visible{outline:1px solid #aaa;outline-offset:3px}

/* Reader advertising stays outside the paper's independent zoom/pan viewport. */
.folhao-reader {
    width:min(1400px,calc(100vw - 24px));
    max-width:calc(100vw - 24px);
    height:calc(100dvh - 16px);
    max-height:calc(100dvh - 16px);
    margin:8px auto;
    padding:0;
    grid-template-columns:clamp(110px,12vw,180px) minmax(0,1fr) clamp(110px,12vw,180px);
    grid-template-rows:minmax(0,1fr);
    gap:12px;
}
.folhao-reader[open] { display:grid; }
.folhao-reader .folhao-reader-body { min-width:0; min-height:0; width:100%; height:100%; max-width:none; max-height:none; overflow-anchor:none; }
.folhao-reader .folhao-reader-ad,
.folhao-reader .folhao-reader-ad.campaign-slot {
    display:block;
    position:relative;
    width:100%;
    height:100%;
    min-width:0;
    min-height:0;
    margin:0;
    padding:0;
    border:0;
    overflow:hidden;
}
.folhao-reader .folhao-reader-ad > span { box-sizing:border-box; display:grid; place-items:center; width:100%; height:100%; margin:0; border:1px solid gray; color:gray; }
@media(max-width:600px) {
    .folhao-reader {
        width:calc(100vw - 16px);
        max-width:calc(100vw - 16px);
        grid-template-columns:minmax(0,1fr);
        grid-template-rows:60px minmax(0,1fr) 60px;
        gap:8px;
    }
}

/* Ads overlay the reader viewport, so the enlarged paper passes behind them. */
.folhao-reader .folhao-reader-body { grid-column:1 / -1; grid-row:1; }
.folhao-reader .folhao-reader-ad { z-index:1; grid-row:1; }
.folhao-reader .folhao-reader-ad-start { grid-column:1; }
.folhao-reader .folhao-reader-ad-end { grid-column:3; }
@media(max-width:600px) {
    .folhao-reader .folhao-reader-body { grid-row:1 / -1; padding-block:68px; }
    .folhao-reader .folhao-reader-ad { grid-column:1; }
    .folhao-reader .folhao-reader-ad-start { grid-row:1; }
    .folhao-reader .folhao-reader-ad-end { grid-row:3; }
}

.folhao-reader .folhao-reader-spread { padding:var(--fh-pan-y,0px) var(--fh-pan-x,0px);box-sizing:border-box; }
.folhao-reader-body.is-zoomed { cursor:grab; }
.folhao-reader-body.is-dragging { cursor:grabbing;user-select:none; }
.folhao-reader-failure { position:absolute; inset:40% 15% auto; margin:0; padding:16px; background:#111; color:#fff; text-align:center; font:16px/1.5 Arial,sans-serif; }

.folhao-reader-zoom-hint{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:3;pointer-events:none;opacity:0;padding:12px 20px;border-radius:4px;background:#000b;color:#fff;font:18px/1.3 Arial,sans-serif;white-space:nowrap}
@media(max-width:600px),(hover:none),(pointer:coarse){.folhao-reader-zoom-hint{display:none}}


[data-internal-campaigns-paused] .folhao-reader {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
}
[data-internal-campaigns-paused] .folhao-reader .folhao-reader-body {
    grid-row: 1;
    padding-block: 0;
}

.folhao-reader-archive { align-self:center; padding:4px 6px; background:#111; color:#fff; text-decoration:underline; }
.folhao-reader-archive[hidden] { display:none; }
