
:root {
    --tf-red: #c5102e;
    --tf-ink: #151515;
    --tf-muted: #70706c;
    --tf-line: #dededb;
    --tf-paper: #f5f5f2;
    --tf-white: #fff;
    --tf-serif: Georgia, "Times New Roman", serif;
    --tf-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.tirfax-home-layout-active {
    background: var(--tf-paper);
}

.tirfax-homepage {
    padding: 10px 18px 60px;
    background: var(--tf-paper);
    color: var(--tf-ink);
}

.tirfax-homepage-inner {
    width: min(1220px, 100%);
    margin: auto;
}

.tirfax-homepage a {
    color: inherit;
    text-decoration: none;
}

.tirfax-preview-note {
    padding: 11px 14px;
    margin-bottom: 12px;
    border: 1px solid #dfbf67;
    background: #fff7da;
    font: 700 12px/1.3 var(--tf-sans);
}

.tirfax-home-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tirfax-home-placeholder {
    width: 100%;
    height: 100%;
    min-height: 110px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #ededeb, #d7d7d3);
    color: #777;
    font: 800 18px/1 var(--tf-serif);
}

.tirfax-kicker {
    display: inline-block;
    color: var(--tf-red) !important;
    text-transform: uppercase;
    letter-spacing: .08em;
    font: 800 11px/1 var(--tf-sans);
}

/* TOP */
.tirfax-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(380px, .9fr);
    gap: 20px;
    margin-bottom: 12px;
}

.tirfax-lead-story,
.tirfax-secondary-card,
.tirfax-latest,
.tirfax-category-block,
.tirfax-analysis,
.tirfax-popular {
    background: #fff;
}

.tirfax-lead-story {
    border-bottom: 4px solid var(--tf-red);
}

.tirfax-lead-image {
    display: block;
    aspect-ratio: 16 / 7.9;
    overflow: hidden;
}

.tirfax-lead-text {
    padding: 13px 17px 15px;
}

.tirfax-lead-text h1 {
    margin: 7px 0 10px;
    font: 700 clamp(30px, 3.15vw, 41px)/1.02 var(--tf-serif);
    letter-spacing: -.035em;
}

.tirfax-lead-text p {
    margin: 0 0 12px;
    color: #4c4c48;
    font: 18px/1.42 var(--tf-serif);
}

.tirfax-lead-text small,
.tirfax-secondary-text small {
    color: #888;
    font: 11px/1 var(--tf-sans);
}

.tirfax-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.tirfax-secondary-card {
    border-bottom: 1px solid var(--tf-line);
}

.tirfax-secondary-image {
    display: block;
    aspect-ratio: 16 / 9.2;
    overflow: hidden;
}

.tirfax-secondary-text {
    padding: 10px 11px 11px;
}

.tirfax-secondary-text h2 {
    margin: 6px 0 9px;
    font: 700 18px/1.08 var(--tf-serif);
}

/* HEADINGS */
.tirfax-heading {
    display: flex;
    align-items: end;
    border-bottom: 1px solid var(--tf-line);
    margin-bottom: 14px;
}

.tirfax-heading h2 {
    margin: 0 0 -1px;
    padding: 0 0 9px;
    border-bottom: 3px solid var(--tf-red);
    font: 700 26px/1 var(--tf-serif);
}

.tirfax-heading > a,
.tirfax-heading > span {
    margin-left: auto;
    margin-bottom: 9px;
    color: var(--tf-red);
    font: 800 11px/1 var(--tf-sans);
}

/* LATEST */
.tirfax-latest {
    padding: 16px 18px;
    margin-bottom: 24px;
}

.tirfax-latest-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(155px, 1fr));
    overflow-x: auto;
}

.tirfax-latest-row article {
    padding: 2px 13px;
    border-left: 1px solid var(--tf-line);
}

.tirfax-latest-row article:first-child {
    border-left: 0;
    padding-left: 0;
}

.tirfax-latest-row time,
.tirfax-category-list time {
    display: block;
    color: var(--tf-red);
    margin-bottom: 4px;
    font: 800 10px/1 var(--tf-sans);
}

.tirfax-latest-row a {
    font: 700 15px/1.13 var(--tf-serif);
}

/* MAIN */
.tirfax-home-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    align-items: start;
}

.tirfax-category-block,
.tirfax-analysis {
    padding: 20px;
    margin-bottom: 24px;
}

.tirfax-category-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
    gap: 23px;
}

.tirfax-category-image {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 12px;
}

.tirfax-category-lead h3 {
    margin: 0 0 7px;
    font: 700 29px/1.02 var(--tf-serif);
    letter-spacing: -.025em;
}

.tirfax-category-lead p {
    margin: 0;
    color: #5c5c57;
    font: 16px/1.4 var(--tf-serif);
}

.tirfax-category-list {
    border-top: 1px solid var(--tf-line);
}

.tirfax-category-list article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 105px;
    gap: 13px;
    padding: 13px 0;
    border-bottom: 1px solid var(--tf-line);
}

.tirfax-category-list h3 {
    margin: 3px 0 0;
    font: 700 18px/1.12 var(--tf-serif);
}

.tirfax-category-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

/* ANALYSIS */
.tirfax-analysis-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.tirfax-analysis-image {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    margin-bottom: 10px;
}

.tirfax-analysis h3 {
    margin: 0 0 7px;
    font: 700 21px/1.06 var(--tf-serif);
}

.tirfax-analysis p {
    margin: 0;
    color: #666;
    font: 14px/1.4 var(--tf-serif);
}

/* SIDEBAR */
.tirfax-home-sidebar {
    position: sticky;
    top: 22px;
}

.tirfax-popular {
    padding: 18px;
    margin-bottom: 18px;
}

.tirfax-popular ol {
    list-style: none;
    counter-reset: tfpopular;
    padding: 0;
    margin: 0;
}

.tirfax-popular li {
    counter-increment: tfpopular;
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--tf-line);
}

.tirfax-popular li:first-child {
    border-top: 0;
    padding-top: 0;
}

.tirfax-popular li::before {
    content: counter(tfpopular);
    color: var(--tf-red);
    font: 700 30px/1 var(--tf-serif);
}

.tirfax-popular a {
    font: 700 16px/1.18 var(--tf-serif);
}

.tirfax-follow {
    padding: 20px;
    margin-bottom: 18px;
    border-top: 4px solid var(--tf-red);
    background: #161616;
    color: #fff;
}

.tirfax-follow small {
    color: #ff4e63;
    font: 800 11px/1 var(--tf-sans);
    letter-spacing: .12em;
}

.tirfax-follow h2 {
    margin: 8px 0;
    font: 700 31px/.98 var(--tf-serif);
}

.tirfax-follow p {
    margin: 0;
    color: #ccc;
    font: 15px/1.4 var(--tf-serif);
}

@media (max-width: 1050px) {
    .tirfax-top-grid {
        grid-template-columns: 1fr;
    }

    .tirfax-secondary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .tirfax-home-main {
        grid-template-columns: 1fr;
    }

    .tirfax-home-sidebar {
        position: static;
    }
}

@media (max-width: 780px) {
    .tirfax-homepage {
        padding: 14px 11px 50px;
    }

    .tirfax-secondary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tirfax-category-grid {
        grid-template-columns: 1fr;
    }

    .tirfax-analysis-grid {
        grid-template-columns: 1fr 1fr;
    }

    .tirfax-latest-row {
        grid-template-columns: repeat(7, 210px);
    }
}

@media (max-width: 520px) {
    .tirfax-lead-text h1 {
        font-size: 38px;
    }

    .tirfax-lead-text {
        padding: 14px;
    }

    .tirfax-secondary-text h2 {
        font-size: 17px;
    }

    .tirfax-category-block,
    .tirfax-analysis {
        padding: 14px;
    }

    .tirfax-analysis-grid {
        grid-template-columns: 1fr;
    }

    .tirfax-category-list article {
        grid-template-columns: minmax(0, 1fr) 88px;
    }
}


/* CentralNews compatibility: remove its page-title/breadcrumb strip on our homepage. */
.tirfax-home-layout-active .breadcrumb,
.tirfax-home-layout-active .breadcrumbs,
.tirfax-home-layout-active .page-header,
.tirfax-home-layout-active .entry-header,
body.tirfax-home-layout-active .inner-banner,
body.tirfax-home-layout-active .site-breadcrumb,
body.tirfax-home-layout-active .breadcrumb-area {
    display: none !important;
}

/* Direct preview is served through admin-post.php, so target common CentralNews wrapper too. */
body .tirfax-homepage {
    margin-top: 0;
}


.tirfax-live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--tf-red);
    vertical-align: 1px;
}

.tirfax-latest-row article {
    min-width: 0;
}

.tirfax-latest-row a {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Section layout variants */
.tirfax-category-split .tirfax-category-grid {
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
}

.tirfax-category-split .tirfax-category-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
    border-top: 0;
}

.tirfax-category-split .tirfax-category-list article {
    grid-template-columns: 1fr;
    border-top: 1px solid var(--tf-line);
}

.tirfax-category-split .tirfax-category-thumb {
    order: -1;
    aspect-ratio: 16 / 9;
    margin-bottom: 7px;
}

.tirfax-category-compact .tirfax-category-grid {
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
}

.tirfax-category-compact .tirfax-category-main h3 {
    font-size: 25px;
}

.tirfax-category-compact .tirfax-category-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
    border-top: 0;
}

.tirfax-category-compact .tirfax-category-list article {
    grid-template-columns: 1fr 92px;
    border-top: 1px solid var(--tf-line);
}

@media (max-width: 780px) {
    .tirfax-category-split .tirfax-category-list,
    .tirfax-category-compact .tirfax-category-list {
        grid-template-columns: 1fr;
    }

    .tirfax-category-split .tirfax-category-grid,
    .tirfax-category-compact .tirfax-category-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 520px) {
    .tirfax-homepage {
        padding-top: 10px;
    }

    .tirfax-top-grid {
        gap: 12px;
    }

    .tirfax-secondary-grid {
        gap: 8px;
    }

    .tirfax-secondary-text {
        padding: 8px 9px 9px;
    }

    .tirfax-secondary-text h2 {
        font-size: 16px;
        line-height: 1.08;
    }

    .tirfax-latest {
        padding: 13px 14px;
    }

    .tirfax-latest-row {
        grid-template-columns: repeat(7, 190px);
    }
}


/* v1.7 final polish */
.tirfax-secondary-text h2 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.32em;
}

.tirfax-latest {
    margin-top: 0;
    margin-bottom: 20px;
    padding-top: 13px;
    padding-bottom: 13px;
}

.tirfax-preview-note {
    padding-top: 8px;
    padding-bottom: 8px;
}

@media (min-width: 1051px) {
    .tirfax-top-grid {
        align-items: stretch;
    }

    .tirfax-secondary-card {
        display: flex;
        flex-direction: column;
    }

    .tirfax-secondary-text {
        flex: 1;
    }
}

@media (max-width: 520px) {
    .tirfax-homepage {
        padding-top: 6px;
    }

    .tirfax-lead-text h1 {
        font-size: 34px;
        line-height: 1.02;
    }

    .tirfax-secondary-text h2 {
        -webkit-line-clamp: 3;
        min-height: 3.24em;
    }
}


/* =========================================================
   v1.8 — lower-page polish + CentralNews cleanup
   ========================================================= */

/* Remove CentralNews' residual empty bar above the custom homepage. */
.tirfax-home-layout-active .site-content > .container:empty,
.tirfax-home-layout-active .container > .row:empty,
.tirfax-home-layout-active .main-banner-section:empty,
.tirfax-home-layout-active .page-title-area:empty,
.tirfax-home-layout-active .page-header:empty,
.tirfax-home-layout-active .breadcrumb-area:empty,
.tirfax-home-guaranteed-preview .site-content > .container:empty,
.tirfax-home-guaranteed-preview .container > .row:empty {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

/* Pull our page close to the navigation without crowding it. */
.tirfax-homepage {
    margin-top: 0 !important;
}

/* Category blocks: stronger newsroom rhythm. */
.tirfax-category-block {
    border-top: 4px solid var(--tf-ink);
}

.tirfax-category-block .tirfax-heading {
    margin-top: -4px;
}

.tirfax-category-block .tirfax-heading h2 {
    padding-top: 14px;
}

.tirfax-category-block:nth-of-type(even) {
    background: #fbfbf9;
}

.tirfax-category-lead h3 a:hover,
.tirfax-category-list h3 a:hover,
.tirfax-analysis h3 a:hover,
.tirfax-popular a:hover,
.tirfax-latest-row a:hover,
.tirfax-secondary-text h2 a:hover,
.tirfax-lead-text h1 a:hover {
    color: var(--tf-red);
}

/* Slightly calmer body copy in category blocks. */
.tirfax-category-lead p,
.tirfax-analysis p {
    max-width: 58ch;
}

/* Analysis/opinion feels intentionally different from hard news. */
.tirfax-analysis {
    border-top: 4px solid var(--tf-red);
    background: #faf7f3;
}

.tirfax-analysis .tirfax-heading h2 {
    font-style: italic;
}

.tirfax-analysis-grid article {
    min-width: 0;
}

.tirfax-analysis-grid article + article {
    border-left: 1px solid var(--tf-line);
    padding-left: 16px;
}

/* Most-read sidebar gets clearer hierarchy. */
.tirfax-popular {
    border-top: 4px solid var(--tf-red);
}

.tirfax-popular .tirfax-heading > span {
    color: #999;
    font-size: 9px;
    letter-spacing: .08em;
}

.tirfax-popular li {
    align-items: start;
}

.tirfax-popular li::before {
    font-size: 34px;
    line-height: .9;
}

.tirfax-popular li:nth-child(1)::before {
    color: var(--tf-red);
}

/* Make sidebar modules feel attached to the editorial grid. */
.tirfax-home-sidebar > * {
    box-shadow: 0 1px 0 rgba(0,0,0,.03);
}

/* Category thumbnails remain visually consistent. */
.tirfax-category-thumb,
.tirfax-category-image,
.tirfax-analysis-image {
    background: #e8e8e5;
}

/* Mobile: clearer stacked hierarchy and less card fatigue. */
@media (max-width: 780px) {
    .tirfax-category-block,
    .tirfax-analysis {
        margin-bottom: 16px;
    }

    .tirfax-category-block {
        border-top-width: 3px;
    }

    .tirfax-category-list article {
        padding: 11px 0;
    }

    .tirfax-category-list h3 {
        font-size: 17px;
    }

    .tirfax-analysis-grid article + article {
        border-left: 0;
        border-top: 1px solid var(--tf-line);
        padding-left: 0;
        padding-top: 14px;
    }

    .tirfax-home-sidebar {
        display: block;
    }

    .tirfax-popular,
    .tirfax-follow {
        margin-bottom: 14px;
    }
}

@media (max-width: 520px) {
    .tirfax-heading h2 {
        font-size: 22px;
    }

    .tirfax-category-lead h3 {
        font-size: 23px;
    }

    .tirfax-category-lead p {
        font-size: 15px;
    }

    .tirfax-category-list article {
        grid-template-columns: minmax(0, 1fr) 82px;
        gap: 10px;
    }

    .tirfax-category-split .tirfax-category-list article {
        grid-template-columns: 1fr;
    }

    .tirfax-popular li {
        grid-template-columns: 34px 1fr;
        gap: 7px;
    }
}


/* =========================================================
   v1.9 — clean newsroom sidebar
   ========================================================= */

.tirfax-sidebar-latest {
    background: #fff;
    padding: 18px;
    margin-bottom: 18px;
    border-top: 4px solid var(--tf-ink);
}

.tirfax-sidebar-latest-list article {
    padding: 12px 0;
    border-top: 1px solid var(--tf-line);
}

.tirfax-sidebar-latest-list article:first-child {
    padding-top: 0;
    border-top: 0;
}

.tirfax-sidebar-latest-list time {
    display: block;
    margin-bottom: 4px;
    color: var(--tf-red);
    font: 800 10px/1 var(--tf-sans);
}

.tirfax-sidebar-latest-list a {
    display: block;
    font: 700 16px/1.18 var(--tf-serif);
}

.tirfax-sidebar-latest-list a:hover {
    color: var(--tf-red);
}

/* Keep the custom editorial sidebar compact and intentional. */
.tirfax-home-sidebar {
    align-self: start;
}

.tirfax-home-sidebar > section:last-child {
    margin-bottom: 0;
}

/* Prevent long archive-like lists from appearing if a theme injects them anyway. */
.tirfax-home-layout-active .tirfax-home-sidebar .widget_archive,
.tirfax-home-layout-active .tirfax-home-sidebar .widget_calendar,
.tirfax-home-layout-active .tirfax-home-sidebar .widget_pages,
.tirfax-home-guaranteed-preview .tirfax-home-sidebar .widget_archive,
.tirfax-home-guaranteed-preview .tirfax-home-sidebar .widget_calendar,
.tirfax-home-guaranteed-preview .tirfax-home-sidebar .widget_pages {
    display: none !important;
}

@media (max-width: 780px) {
    .tirfax-sidebar-latest {
        padding: 15px;
    }

    .tirfax-sidebar-latest-list a {
        font-size: 15px;
    }
}
