/*
Theme Name: Herald Express Child
Theme URI: https://herald.express
Description: Herald Express child theme for the Newspaper theme
Author: Herald Express
Author URI: https://herald.express
Template: Newspaper
Version: 2.0.0
Text Domain: herald-express
*/

/* EMERGENCY OVERFLOW GUARD - belt-and-suspenders catch-all in case any
   element (this theme's or TD Composer's) ever forces page width past the
   viewport. The real, targeted fix is the min-width:0 rule on this theme's
   own CSS Grid containers further down - see the comment there for why.
   NOTE: box-sizing:border-box is scoped to this theme's own .he-* elements
   only, NOT applied globally with a `*` selector. A global border-box
   override is a well-known way to subtly break width math across a legacy
   page-builder (TD Composer / Visual Composer) that was written assuming
   the CSS-default content-box model everywhere - that's the likely cause
   of the "Lead Story"/"Top Stories" headings rendering clipped by ~1
   character on the left after the previous deploy, while the homepage hero
   band (built without any box-sizing-sensitive padding+width combination)
   rendered fine. Scoping it down removes that risk while keeping the
   intended effect on this theme's own padded containers. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.he-home-hero,
.he-home-hero *,
.he-home-sections,
.he-home-sections * {
  box-sizing: border-box;
}

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

:root {
    --he-black: #111111;
    --he-red: #c40000;
    --he-grey: #f2f2f2;
    --he-dark-grey: #444444;
    --he-border: #dddddd;
    --he-white: #ffffff;
    --he-light-grey: #f7f7f7;
    --he-dark-red: #c40000;
}

body {
    font-family: Inter, "Source Sans 3", Arial, sans-serif !important;
    background: var(--he-grey) !important;
    color: var(--he-black) !important;
}

h1, h2, h3, h4, .td-module-title, .entry-title, .tdb-title-text {
    font-family: "Source Serif 4", Georgia, serif !important;
}

.he-home-hero {
    background: var(--he-black);
    color: var(--he-white);
    border-bottom: 5px solid var(--he-red);
    padding: 28px 18px 18px;
}

.he-home-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.he-eyebrow {
    color: var(--he-red);
    font-weight: 800;
    letter-spacing: .12em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.he-home-hero h1 {
    color: var(--he-white) !important;
    font-size: clamp(20px, 4vw, 44px);
    line-height: 1.1;
    margin: 0 0 12px;
    white-space: nowrap;
}

@media (max-width: 420px) {
    .he-home-hero h1 { font-size: 18px; }
}

.he-home-kicker {
    max-width: 760px;
    font-size: clamp(13px, 1.3vw, 15px);
    line-height: 1.4;
    color: #e8e8e8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.he-home-sections {
    max-width: 1200px;
    margin: 0 auto 28px;
    padding: 0 14px;
}

.he-section {
    margin-bottom: 28px;
}

.he-section-lead {
    margin-top: 22px;
}

.he-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border-bottom: 3px solid var(--he-black);
    margin-bottom: 16px;
    padding-bottom: 8px;
}

/* CNN-style hero grid: text list / big lead / secondary block */
.he-hero-grid {
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    gap: 20px;
    align-items: start;
    max-width: 100%;
}

/*
 * ROOT-CAUSE FIX for the horizontal-overflow bug. CSS Grid items default to
 * min-width:auto, which resolves to the item's own content's minimum
 * intrinsic width - NOT 0. A long unbroken headline, hyphenated proper
 * noun, or URL inside any grid item (hero columns, density-section
 * columns, the 4-up card grid) can therefore force that column wider than
 * its assigned track, pushing the whole grid - and the page - past the
 * viewport. This is a well-known, common cause of "overflow in specific
 * sections" rather than the whole page uniformly, which matches exactly
 * what was reported. Setting min-width:0 lets grid items shrink to their
 * track size and wrap/truncate their content instead of forcing overflow.
 */
.he-hero-grid > *,
.he-density-grid > *,
.he-card-grid > *,
.he-card-grid-4 > * {
    min-width: 0;
}

.he-card h3 a,
.he-textlist-item a,
.he-card-excerpt,
.he-source-note {
    overflow-wrap: break-word;
    word-break: break-word;
}

.he-hero-col-title {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0 0 10px;
    border-bottom: 2px solid var(--he-black);
    padding-bottom: 6px;
}

@media (max-width: 1024px) {
    .he-hero-grid { grid-template-columns: 1fr; }
}

/* CNN-style density section: featured + secondary + text headlines */
.he-density-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 18px;
    align-items: start;
    max-width: 100%;
}

.he-density-secondary {
    display: grid;
    gap: 14px;
}

@media (max-width: 1024px) {
    .he-density-grid { grid-template-columns: 1fr; }
}

.he-density-textlist,
ul.he-density-textlist {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Fill the columns that would otherwise sit empty when a section has no
   real-image stories to show as featured/secondary - grid-column spans the
   unused tracks, and a multi-column text layout uses the reclaimed width
   usefully instead of leaving one narrow list beside blank space. */
.he-density-textlist-full {
    grid-column: 1 / -1;
    column-count: 3;
    column-gap: 24px;
}

.he-density-textlist-wide {
    grid-column: 2 / -1;
    column-count: 2;
    column-gap: 24px;
}

.he-density-textlist-full .he-textlist-item,
.he-density-textlist-wide .he-textlist-item {
    break-inside: avoid;
}

.he-textlist-item {
    padding: 9px 0;
    border-bottom: 1px solid var(--he-border);
    font-size: 15px;
    line-height: 1.35;
}

.he-textlist-item:last-child { border-bottom: none; }

.he-textlist-cat {
    display: block;
    color: var(--he-red);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.he-textlist-item a {
    color: var(--he-black);
    font-weight: 600;
    text-decoration: none;
}

.he-textlist-item a:hover { text-decoration: underline; }

.he-badge-breaking {
    background: #c40000;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

.he-section-head span {
    color: var(--he-black);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 28px;
    font-weight: 800;
}

.he-section-head a {
    color: var(--he-red) !important;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 12px;
}

.he-card-grid {
    display: grid;
    gap: 16px;
}

.he-card-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.he-card {
    background: var(--he-white);
    border: 1px solid var(--he-border);
}

.he-card-lead {
    border-bottom: none;
}

.he-card-secondary .he-card-image {
    aspect-ratio: 16 / 10;
}

.he-card-secondary .he-card-body {
    padding: 10px 12px;
}

.he-card-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-color: #d9d9d9;
}

.he-card-body {
    padding: 14px;
}

.he-card-category {
    color: var(--he-red);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.he-card h3,
.he-card h3 a {
    color: var(--he-black) !important;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 24px;
    line-height: 1.15;
    margin: 0 0 8px;
}

.he-card-compact h3,
.he-card-compact h3 a {
    font-size: 20px;
}

.he-card-date {
    color: var(--he-dark-grey);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.he-card-excerpt {
    color: var(--he-dark-grey);
    font-size: 15px;
    line-height: 1.55;
}

.he-global-bar {
    background: var(--he-red);
    color: var(--he-white);
    padding: 10px 16px;
}

.he-global-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 700;
}

.he-desk-grid {
    max-width: 1200px;
    margin: 0 auto 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 0 14px;
}

.he-desk-card {
    display: block;
    background: var(--he-white);
    border: 1px solid var(--he-border);
    border-top: 4px solid var(--he-black);
    padding: 18px;
}

.he-desk-card span {
    display: block;
    color: var(--he-red);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.he-desk-card strong {
    font-size: 18px;
    line-height: 1.35;
}

.he-desk-card-opinion {
    border-top-color: var(--he-red);
    background: #fbfbfb;
}

.he-page-shell {
    max-width: 860px;
    margin: 32px auto;
    padding: 0 18px 36px;
}

.he-page-shell h1 {
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1;
    margin: 0 0 18px;
}

.he-page-shell p,
.he-page-shell li {
    font-size: 18px;
    line-height: 1.7;
}

.he-page-kicker {
    color: var(--he-red);
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.he-principles {
    border-left: 4px solid var(--he-red);
    background: var(--he-light-grey);
    padding: 18px 18px 18px 28px;
}

.he-contributor-form {
    margin-top: 24px;
    display: grid;
    gap: 14px;
}

.he-contributor-form input[type="text"],
.he-contributor-form input[type="email"],
.he-contributor-form textarea {
    width: 100%;
    border: 1px solid var(--he-border);
    background: var(--he-white);
    padding: 12px;
    font: inherit;
}

.he-contributor-form textarea {
    min-height: 110px;
}

.he-contributor-form label {
    font-weight: 600;
    display: block;
}

.he-ai-disclosure, .he-article-sources, .he-corrections-note {
    border: 1px solid var(--he-border);
    border-left: 5px solid var(--he-red);
    background: var(--he-light-grey);
    padding: 14px 16px;
    margin: 18px 0;
}

.he-article-type { color: var(--he-red); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }

.he-footer-identity {
    background: var(--he-black);
    color: var(--he-white);
    padding: 28px 18px;
    border-top: 5px solid var(--he-red);
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    align-items: center;
    justify-content: center;
}

.he-footer-identity strong { font-size: 22px; }
.he-footer-identity span { color: #ddd; }
.he-footer-identity nav { display:flex; gap:14px; flex-wrap:wrap; justify-content:center; }
.he-footer-identity a { color: var(--he-white) !important; font-weight:700; }

/* Headlines - bold newspaper style */
.td-module-title a,
.block-title a,
.tdb-block-title-text {
    font-weight: 700 !important;
    letter-spacing: -0.5px !important;
}

/* Category labels */
.td-post-category {
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    background: var(--he-grey) !important;
    color: var(--he-black) !important;
    border: 1px solid var(--he-border) !important;
}

.td-post-category:hover,
.td-post-category a,
.td-post-category a:hover,
.td-module-meta-info .td-post-category,
.td_module_wrap .td-post-category {
    color: var(--he-black) !important;
    background: var(--he-grey) !important;
}

/* Headline separator */
.block-title span {
    background-color: var(--he-dark-red) !important;
}

/* Menu styling */
.td-header-main-menu {
    border-top: 3px solid var(--he-dark-red) !important;
}

.sf-menu > li > a {
    font-family: Inter, "Source Sans 3", Arial, sans-serif !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 13px !important;
}

.tdb-menu-item-text,
.tdb-block-title-text,
.td_module_wrap,
.td-module-meta-info,
.td-post-content,
.td-post-content p,
.td-post-content li,
.td-post-content div,
.td-excerpt,
.widget,
.td_block_wrap,
.td-footer-wrapper {
    font-family: Inter, "Source Sans 3", Arial, sans-serif !important;
}

/* Remove gimmicky styling */
.td-module-image .td-post-category {
    border-radius: 0 !important;
}

.td_module_wrap {
    border-bottom: 1px solid var(--he-border) !important;
}

/* Serious newsroom feel - clean lines */
.td_block_template_1 .td-block-title {
    border-bottom: 3px solid var(--he-dark-red) !important;
}

.td_block_template_1 .td-block-title span {
    padding: 8px 16px !important;
}

/* Footer */
.td-footer-wrapper {
    border-top: 4px solid var(--he-dark-red) !important;
}

/* Links */
a {
    color: var(--he-black) !important;
}

a:hover {
    color: var(--he-dark-red) !important;
}

/* Read more button */
.td-read-more a {
    border: 2px solid var(--he-black) !important;
    color: var(--he-black) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-size: 11px !important;
    padding: 8px 16px !important;
    transition: all 0.3s ease !important;
}

.td-read-more a:hover {
    background-color: var(--he-black) !important;
    color: var(--he-white) !important;
    border-color: var(--he-black) !important;
}

/* Responsive headings */
@media (max-width: 767px) {
    .tdb-block-title-text {
        font-size: 20px !important;
    }
    .he-promo-grid { grid-template-columns: 1fr; margin: 12px; }
    .he-promise-strip { grid-template-columns: 1fr; margin: 12px; }
    .he-home-hero { padding: 32px 16px 16px; }
    .he-desk-grid { grid-template-columns: 1fr; padding: 0 12px; }
    .he-global-bar-inner { font-size: 13px; }
    .he-page-shell p, .he-page-shell li { font-size: 16px; }
    .he-card-grid-4 { grid-template-columns: 1fr; }
    .he-section-head { align-items: flex-start; flex-direction: column; }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .he-promo-grid { grid-template-columns: repeat(2, 1fr); margin-left: 14px; margin-right: 14px; }
    .he-promise-strip { grid-template-columns: repeat(2, 1fr); margin-left: 14px; margin-right: 14px; }
    .he-desk-grid { grid-template-columns: repeat(2, 1fr); }
    .he-card-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.he-ai-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #888;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 4px;
    vertical-align: middle;
}

.he-meme-section { margin: 30px 12px; }
.he-meme-subcat { margin-top: 16px; }
.he-meme-subcat h3 { font-size: 16px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .03em; }
.he-meme-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.he-meme-item { flex: 0 0 160px; text-decoration: none; color: inherit; }
.he-meme-item img { width: 100%; height: 120px; object-fit: cover; border-radius: 4px; display: block; }
.he-meme-item span { display: block; font-size: 12px; margin-top: 6px; line-height: 1.3; }
.he-conspiracy-note { color: #666; font-size: 13px; margin: 4px 0 14px; }
.he-tah-section, .he-conspiracy-section { margin-top: 26px; }

@media (max-width: 767px) {
    .he-meme-item { flex: 0 0 130px; }
    .he-meme-item img { height: 100px; }
}

.he-ad-slot {
    margin: 22px auto;
    max-width: 728px;
    min-height: 90px;
    background: #f5f5f5;
    border: 1px solid #e2e2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.he-ad-label {
    color: #999;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
}
@media (max-width: 767px) {
    .he-ad-mobile-conservative { display: none; }
}

/*
 * Site-wide width consistency fix. TD Composer's own category/article
 * templates (stored in the DB, not editable theme files) use several
 * different "stretch row" presets - stretch_row_1400, stretch_row_1200, etc -
 * for different blocks, even within the same page. That produced visibly
 * inconsistent content widths between the homepage (this child theme's own
 * 1200px sections) and TD Composer's native category/article layout.
 *
 * The outer .tdc-row.stretch_row_XXXX element carries the row's background
 * and is left full-width on purpose - "background may remain full width."
 * Its direct child .vc_row is the actual content row, so that's what gets
 * constrained to the same 1200px used everywhere else on the site.
 */
.tdc-row.stretch_row_1100 > .vc_row,
.tdc-row.stretch_row_1200 > .vc_row,
.tdc-row.stretch_row_1300 > .vc_row,
.tdc-row.stretch_row_1400 > .vc_row,
.tdc-row.stretch_row_1600 > .vc_row,
.tdc-row.stretch_row_1800 > .vc_row {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none !important;
}
