/*
Theme Name: Trendmast
Description: Magazine-style news aggregation theme for trendmast.com (FreeNews-inspired arrangement). Classic theme, no builders.
Version: 0.2.0
Requires PHP: 8.2
Author: Trendmast
License: Proprietary
Text Domain: trendmast
*/

/* ===== Design tokens (FreeNews-derived) ===== */
:root {
  --tm-accent: #BA1818;
  --tm-nav: #AA1818;
  --tm-dark: #2c2c2c;
  --tm-dark-2: #333;
  --tm-ink: #424242;
  --tm-heading: #222;
  --tm-muted: #999;
  --tm-muted-2: #646770;
  --tm-bg: #f8f8f8;
  --tm-surface: #fff;
  --tm-line: #eee;
  --tm-dashed: #d9d9d9;
  --tm-font-body: 'Arimo', "Helvetica Neue", Helvetica, Arial, sans-serif;
  --tm-font-head: 'Heebo', system-ui, sans-serif;
  /* Category colors: badges + secondary-nav underline */
  --cat-technology: #455A64; --cat-cyber-security: #BA1818; --cat-privacy: #7A5AC2;
  --cat-ai: #8E24AA; --cat-enterprise: #1565C0; --cat-developers: #00695C;
  --cat-gadgets: #E65100; --cat-policy: #4E342E; --cat-business: #2E7D32;
  --cat-money: #B8860B; --cat-careers: #00838F; --cat-world: #37474F;
  --cat-science: #0277BD; --cat-space: #283593; --cat-health: #AD1457;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--tm-bg); color: var(--tm-ink);
  font-family: var(--tm-font-body); font-size: 16px; line-height: 1.7;
}
h1,h2,h3,h4,h5,h6 { font-family: var(--tm-font-head); font-weight: 500; line-height: 1.2;
  color: var(--tm-heading); margin: 0 0 .5em; }
a { color: var(--tm-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.tm-wrap { margin: 0 5%; }

/* ===== Category badges ===== */
.cat-badge { background: var(--tm-dark-2); border-radius: 2px; color: #fff !important;
  display: inline-block; font-size: 12px; line-height: 1.6; padding: 1px 8px;
  margin: 0 2px 4px 0; text-transform: uppercase; letter-spacing: .3px; }
.cat-badge:hover { text-decoration: none; opacity: .85; }
.cat-badge--technology{background:var(--cat-technology)} .cat-badge--cyber-security{background:var(--cat-cyber-security)}
.cat-badge--privacy{background:var(--cat-privacy)} .cat-badge--ai{background:var(--cat-ai)}
.cat-badge--enterprise{background:var(--cat-enterprise)} .cat-badge--developers{background:var(--cat-developers)}
.cat-badge--gadgets{background:var(--cat-gadgets)} .cat-badge--policy{background:var(--cat-policy)}
.cat-badge--business{background:var(--cat-business)} .cat-badge--money{background:var(--cat-money)}
.cat-badge--careers{background:var(--cat-careers)} .cat-badge--world{background:var(--cat-world)}
.cat-badge--science{background:var(--cat-science)} .cat-badge--space{background:var(--cat-space)}
.cat-badge--health{background:var(--cat-health)}

.tm-subcat-chips { margin: -10px 0 20px; }

/* ===== Top bar: ticker + social ===== */
.tm-topbar { background: var(--tm-surface); height: 35px; display: flex; }
.tm-ticker { width: 70%; height: 35px; overflow: hidden; position: relative; display: flex; }
.tm-ticker-label { flex: 0 0 auto; z-index: 3; height: 35px; padding: 0 15px; color: #fff;
  font-size: 14px; font-weight: 700; line-height: 35px; text-transform: uppercase;
  background: linear-gradient(-45deg, #BA1818, #EEEEEE, #BA1818, #333333);
  background-size: 400% 400%; animation: tmGradient 15s ease infinite; }
@keyframes tmGradient { 0%{background-position:0 50%} 50%{background-position:100% 50%} 100%{background-position:0 50%} }
.tm-ticker-track { flex: 1; overflow: hidden; position: relative; height: 35px; }
.tm-ticker-items { display: inline-flex; white-space: nowrap; height: 35px; align-items: center;
  animation: tmTicker 60s linear infinite; will-change: transform; }
.tm-ticker-track:hover .tm-ticker-items { animation-play-state: paused; }
@keyframes tmTicker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tm-ticker-items a { color: var(--tm-heading); font-size: 14px; font-weight: 700;
  letter-spacing: .2px; margin-right: 30px; }
.tm-ticker-items a:before { content: "»"; color: var(--tm-accent); margin-right: 8px; }
.tm-ticker-track:after { content: ""; position: absolute; right: 0; top: 0; height: 35px; width: 80px;
  background: linear-gradient(to left, #fff, transparent); pointer-events: none; }
.tm-topbar-social { width: 30%; background: var(--tm-accent); display: flex; justify-content: flex-end; }
.tm-topbar-social a { width: 35px; height: 35px; line-height: 35px; text-align: center; color: #fff;
  border-left: 1px solid rgba(255,255,255,.4); font-size: 14px; font-weight: 700; }
.tm-topbar-social a:hover { background: var(--tm-dark-2); text-decoration: none; }

/* ===== Brand bar: logo left, ad right ===== */
.tm-brand { background: var(--tm-accent); padding: 10px 0; }
.tm-brand-inner { display: flex; align-items: center; justify-content: space-between; margin: 0 5%; }
.tm-site-title { font-family: var(--tm-font-head); font-size: 36px; font-weight: 400;
  text-transform: uppercase; letter-spacing: .08em; color: #fff; margin: 0; line-height: 1.25; }
.tm-site-title a { color: #fff; }
.tm-site-title a:hover { text-decoration: none; }
.tm-site-desc { color: #eee; font-size: 15px; margin: 0; }
.tm-header-ad { min-height: 90px; width: 100%; max-width: 728px; }

/* ===== Primary nav (sticky) ===== */
.tm-nav { background: var(--tm-nav); border-bottom: 5px solid var(--tm-dark);
  position: sticky; top: 0; z-index: 999; }
.tm-nav-inner { display: flex; align-items: center; justify-content: space-between; margin: 0 5%; }
.tm-nav-menu { display: flex; flex-wrap: wrap; }
.tm-nav-menu a { color: #fff; font-size: 14px; text-transform: uppercase; padding: 0 15px;
  line-height: 45px; display: inline-block; }
.tm-nav-menu a:hover { color: #bdbdbd; text-decoration: none; }
.tm-nav-menu a.current { background: var(--tm-dark); }
.tm-nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.5);
  border-radius: 3px; color: #fff; font-size: 15px; padding: 8px 14px; cursor: pointer;
  margin: 5px 0; min-height: 44px; }
.tm-nav-inner { align-items: flex-start; }
.tm-nav-right { display: flex; align-items: center; height: 45px; }
.tm-clock { color: #fff; font-size: 13px; white-space: nowrap; padding: 0 12px 0 15px; }
.tm-clock #tm-time { background: #fff; color: var(--tm-dark-2); padding: 1px 10px;
  border-radius: 2px; margin-left: 10px; font-weight: 700; }
/* Search: always visible, inline in the nav bar's right cluster. */
.tm-searchform { display: flex; background: #fff; border-radius: 17px; padding: 3px; }
.tm-searchform--nav { margin: 6px 0 6px 12px; width: 230px; }
.tm-search-field { flex: 1; border: 0; outline: none; height: 27px; padding: 0 12px;
  font-size: 14px; border-radius: 14px; min-width: 0; }
.tm-search-field::placeholder { color: #9aa0a6; }
.tm-search-submit { width: 34px; height: 27px; border: 0; border-radius: 14px;
  background: var(--tm-accent); color: #fff; cursor: pointer; display: flex;
  align-items: center; justify-content: center; }
.tm-search-submit:hover { background: #111; }

/* Results-page search bar (search.php main column, wider). */
.tm-searchform--page { max-width: 560px; margin-bottom: 25px; border: 1px solid var(--tm-line); }
.tm-searchform--page .tm-search-field { height: 38px; }
.tm-searchform--page .tm-search-submit { width: 90px; height: 38px; font-weight: 700; font-size: 14px; }

/* ===== Banner strip: 25 / 50 / 25 =====
   The CENTER slider's aspect ratio defines the row height; the side
   columns must never contribute height (the Latest list is absolutely
   positioned, highlight cards flex into the remaining space) — otherwise
   long content stretches the whole strip. */
.tm-banner { background: var(--tm-line); }
.tm-banner-wrap { margin: 30px auto; padding: 0 5%; max-width: 1400px;
  display: flex; gap: 10px; align-items: stretch; }
.tm-banner-left { width: 25%; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.tm-banner-center { width: 50%; position: relative; }
.tm-banner-right { width: 25%; position: relative; overflow: hidden; background: var(--tm-surface); }

.tm-hl-card { position: relative; overflow: hidden; display: block;
  background: var(--tm-dark-2); flex: 1 1 0; min-height: 0; }
.tm-hl-card img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.tm-hl-card .tm-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 15px; z-index: 2;
  /* Fast ramp: the text region is always >= .6 dark, readable over light images
     or a missing thumbnail — never rely on the image for contrast. */
  background: linear-gradient(to bottom, rgba(17,17,17,0), rgba(17,17,17,.6) 22%, rgba(17,17,17,.88)); }
.tm-hl-title { color: #fff; font-size: 18px; line-height: 1.4; font-family: var(--tm-font-head); margin: 0; }
.tm-hl-meta { font-size: 12px; color: #fff; margin-bottom: 5px; }
.tm-hl-meta time { color: #ddd; margin-left: 6px; }
a.tm-hl-card:hover { text-decoration: none; }
a.tm-hl-card:hover .tm-hl-title { text-decoration: underline; }

.tm-slider { position: relative; aspect-ratio: 1000 / 650; overflow: hidden; background: var(--tm-dark-2); }
.tm-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; z-index: 1; }
.tm-slide.active { opacity: 1; z-index: 2; }
.tm-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tm-slide .tm-slide-text { position: absolute; bottom: 0; left: 0; right: 0;
  padding: 30px 50px 20px; background: linear-gradient(to bottom, transparent, rgba(0,0,0,.8)); }
.tm-slide-title { color: #fff; font-family: var(--tm-font-head); font-weight: 700;
  font-size: 26px; line-height: 1.4; letter-spacing: .5px; margin: 0 0 5px; }
.tm-slide-meta { font-size: 12px; color: #fff; margin-bottom: 5px; }
.tm-slide-meta time { color: #ddd; margin-left: 6px; }
.tm-slide-excerpt { color: #eee; font-size: 15px; line-height: 1.6; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tm-slider-dots { position: absolute; top: 10px; left: 20px; z-index: 5; display: flex; gap: 6px; }
.tm-slider-dots button { width: 10px; height: 10px; border-radius: 2px; border: 0;
  background: #fff; opacity: .45; cursor: pointer; padding: 0; }
.tm-slider-dots button.active { opacity: 1; }
a.tm-slide-link:hover { text-decoration: none; }
a.tm-slide-link:hover .tm-slide-title { text-decoration: underline; }

.tm-latest-col-header { background: var(--tm-accent); color: #fff; font-size: 15px; font-weight: 700;
  text-transform: uppercase; padding: 0 15px; height: 30px; line-height: 30px;
  position: relative; z-index: 3; }
/* Absolutely positioned: fills the column without ever growing the row. */
.tm-latest-scroll { position: absolute; top: 30px; left: 0; right: 0; bottom: 0;
  overflow: hidden; }
.tm-latest-items { animation: tmVertical 40s linear infinite; }
.tm-latest-scroll:hover .tm-latest-items { animation-play-state: paused; }
@keyframes tmVertical { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.tm-latest-item { display: block; padding: 10px 15px; border-bottom: 1px dashed var(--tm-dashed); }
.tm-latest-item .tm-hl-meta { color: var(--tm-muted); }
.tm-latest-item h4 { font-size: 14px; margin: 0; line-height: 1.4; }
a.tm-latest-item:hover { text-decoration: none; background: var(--tm-bg); }

/* ===== Ad slots (reserved heights, CLS ~ 0) ===== */
[data-slot] { display: flex; align-items: center; justify-content: center; color: var(--tm-muted-2);
  font-size: 12px; border: 1px dashed var(--tm-line); background: repeating-linear-gradient(45deg,
  transparent, transparent 12px, #f0f1f4 12px, #f0f1f4 24px); }
.tm-slot-leaderboard { min-height: 100px; margin: 20px auto; max-width: 970px; }
@media (min-width: 768px) { .tm-slot-leaderboard { min-height: 250px; } }
.tm-slot-mpu { min-height: 250px; }
.tm-slot-halfpage { min-height: 600px; }
.tm-slot-infeed { min-height: 120px; margin: 30px 0; }

/* ===== Filled ad slots (Ads Manager creatives) ===== */
.tm-ad-host--filled { border: 0; background: none; display: block; }
.tm-ad-frame { position: relative; margin: 0 auto; width: 100%; background: #000;
  overflow: hidden; }
.tm-ad-frame img, .tm-ad-frame video { width: 100%; height: 100%;
  object-fit: contain; display: block; }
.tm-ad-frame a { display: block; height: 100%; }
.tm-ad-badge { position: absolute; top: 4px; right: 4px; z-index: 3;
  background: rgba(0,0,0,.55); color: #fff; font-size: 11px; line-height: 1;
  padding: 3px 6px; border-radius: 2px; text-transform: uppercase; letter-spacing: .5px;
  pointer-events: none; }
.tm-ad-overlay { position: absolute; inset: 0; z-index: 2; }
.tm-ad-mute { position: absolute; bottom: 6px; right: 6px; z-index: 4;
  background: rgba(0,0,0,.55); color: #fff; border: 0; border-radius: 2px;
  width: 30px; height: 24px; cursor: pointer; font-size: 13px; }
.tm-slot-anchor { min-height: 50px; position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 998; max-width: 320px; margin: 0 auto; }
.tm-slot-outstream { aspect-ratio: 16 / 9; max-width: 720px; margin: 30px auto; }

/* Outstream video player chrome (Google-style unit) */
.tm-ad-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: rgba(255,255,255,.25); z-index: 4; }
.tm-ad-progress span { display: block; height: 100%; width: 0; background: var(--tm-accent);
  transition: width .25s linear; }
.tm-ad-time { position: absolute; top: 4px; left: 4px; z-index: 4;
  background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 3px 6px;
  border-radius: 2px; pointer-events: none; }
.tm-ad-cta { position: absolute; left: 10px; bottom: 14px; z-index: 5;
  background: var(--tm-accent); color: #fff !important; font-size: 13px; font-weight: 700;
  padding: 8px 14px; border-radius: 3px; }
.tm-ad-cta:hover { background: #111; text-decoration: none; }
.tm-ad-endcard { position: absolute; inset: 0; z-index: 6; background: rgba(0,0,0,.82);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; }
.tm-ad-endcard[hidden] { display: none; }
.tm-ad-endcard .tm-ad-cta { position: static; font-size: 15px; padding: 10px 22px; }
.tm-ad-endcard-name { color: #fff; font-family: var(--tm-font-head); font-size: 20px;
  font-weight: 700; }
.tm-ad-replay { background: none; border: 1px solid rgba(255,255,255,.6); color: #fff;
  border-radius: 3px; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.tm-ad-replay:hover { background: rgba(255,255,255,.15); }

/* ===== Main layout: 75 / 25 ===== */
.tm-content { margin: 40px 5%; }
.tm-layout { display: flex; gap: 0; align-items: flex-start; }
.tm-main { width: 75%; padding-right: 25px; }
.tm-sidebar { width: 25%; }

/* ===== Section titles ===== */
.tm-section-title { font-size: 22px; font-family: var(--tm-font-head); position: relative;
  margin: 0 0 25px; padding-bottom: 10px; }
.tm-section-title:after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: linear-gradient(to right, var(--tm-accent), transparent); }
.tm-section-title a { color: var(--tm-heading); }
.tm-section { margin-bottom: 40px; }

/* ===== Magazine: two halves (hero + compact rows) ===== */
.tm-halves { display: flex; gap: 1.25em; }
.tm-half { width: calc(50% - .625em); }
.tm-hero { display: block; margin-bottom: 15px; }
.tm-hero .tm-media { margin-bottom: 12px; }
.tm-hero-title { font-size: 18px; font-weight: 600; line-height: 1.5; margin: 4px 0; }
.tm-row { display: flex; gap: 15px; padding: 10px 0; border-top: 1px solid var(--tm-line); }
.tm-row .tm-media { flex: 0 0 30%; }
.tm-row-title { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 0 0 4px; }
a.tm-hero:hover, a.tm-row:hover { text-decoration: none; }
a.tm-hero:hover .tm-hero-title, a.tm-row:hover .tm-row-title { text-decoration: underline; }

/* ===== Magazine: wide rows ===== */
.tm-wide-row { display: flex; gap: 20px; margin-bottom: 25px; }
.tm-wide-row .tm-media { flex: 0 0 40%; }
.tm-wide-title { font-size: 24px; font-family: var(--tm-font-head); font-weight: 700;
  line-height: 1.35; margin: 6px 0 8px; }
.tm-wide-title a { color: var(--tm-heading); }
.tm-wide-excerpt { color: var(--tm-ink); font-size: 15px; margin: 6px 0 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== Media frames (fixed ratio; fallback tint blocks) ===== */
.tm-media { aspect-ratio: 765 / 500; background: var(--tm-line); overflow: hidden; position: relative; }
.tm-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tm-media--fallback { display: flex; align-items: center; justify-content: center; }
.tm-media--fallback span { font-size: 42px; font-weight: 700; color: #fff; font-family: var(--tm-font-head); }
.tint-0{background:#4c6ef5}.tint-1{background:#12856d}.tint-2{background:#b04ca3}
.tint-3{background:#b3541e}.tint-4{background:#5a7a4c}.tint-5{background:#7a5ac2}

/* ===== Meta lines ===== */
.tm-meta { font-size: 13px; color: var(--tm-muted); }
.tm-meta .sep:before { content: ""; display: inline-block; background: var(--tm-accent);
  height: 1px; width: 8px; margin: 4px 7px; }
.tm-meta time { color: #a4a4a4; font-style: italic; }
.tm-src-count { font-weight: 700; color: var(--tm-muted-2); }
.tm-via { color: #8a6d00; font-weight: 700; white-space: nowrap; }

/* ===== Archive grid cards ===== */
.tm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tm-card { display: block; }
.tm-card-content { background: var(--tm-surface); border: 1px solid var(--tm-line);
  padding: 20px; margin-top: -1px; }
.tm-card-title { font-size: 19px; font-weight: 600; line-height: 1.45; margin: 6px 0 8px; }
.tm-card-sources { font-size: 13px; color: var(--tm-muted-2); }
.tm-card-sources .tm-src { font-weight: 700; color: var(--tm-heading); }
a.tm-card:hover { text-decoration: none; }
a.tm-card:hover .tm-card-title { text-decoration: underline; }

/* ===== Sidebar widgets ===== */
.tm-widget { background: var(--tm-surface); border: 1px solid var(--tm-line);
  padding: 25px; margin-bottom: 3em; }
.tm-widget-title { background: var(--tm-accent); color: #fff; text-align: center;
  font-size: 16px; font-family: var(--tm-font-head); padding: 8px; margin: 0 0 25px; }
.tm-mini { display: flex; gap: 15px; padding: 10px 0; border-bottom: 1px dashed var(--tm-dashed); }
.tm-mini:last-child { border-bottom: 0; }
.tm-mini .tm-mini-thumb { flex: 0 0 70px; width: 70px; height: 70px; overflow: hidden; background: var(--tm-line); }
.tm-mini .tm-mini-thumb img { width: 70px; height: 70px; object-fit: cover; display: block; }
.tm-mini-meta { font-size: 11px; text-transform: uppercase; color: var(--tm-muted); }
.tm-mini-title { font-family: var(--tm-font-head); font-size: 13px; text-transform: uppercase;
  line-height: 1.5; margin: 2px 0 0; }
a.tm-mini:hover { text-decoration: none; }
a.tm-mini:hover .tm-mini-title { text-decoration: underline; }
.tm-cat-list { list-style: none; margin: 0; padding: 0; }
.tm-cat-list li { border-bottom: 1px dashed var(--tm-dashed); padding: 6px 0; }
.tm-cat-list a { color: #838383; font-size: 14px; transition: color .3s ease; }
.tm-cat-list a:hover { color: var(--tm-muted); text-decoration: none; }

/* ===== Story page ===== */
.tm-article { background: var(--tm-surface); border: 1px solid var(--tm-line); padding: 30px; }
.tm-story-title { font-size: 30px; font-family: var(--tm-font-head); font-weight: 700;
  line-height: 1.25; margin: 6px 0 10px; }
.tm-story-meta { color: var(--tm-muted); font-size: 14px; margin-bottom: 20px; }
.tm-story-thumb { margin: 0 0 8px; }
.tm-story-thumb img { width: 100%; display: block; }
.tm-image-credit { font-size: 12px; color: var(--tm-muted-2); margin-bottom: 20px; }
.tm-summary { font-size: 17px; margin-bottom: 20px; }
.tm-coverage-title { font-size: 22px; font-family: var(--tm-font-head); margin: 25px 0 5px; }
.tm-tier-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--tm-muted-2); margin-top: 20px; font-weight: 700; }
.tm-source-list { list-style: none; margin: 0; padding: 0; }
.tm-source-list li { padding: 12px 0; border-top: 1px solid var(--tm-line); }
.tm-src-headline { font-weight: 600; font-size: 16px; }
.tm-src-meta { color: var(--tm-muted); font-size: 12px; margin-top: 2px; }
.tm-src-excerpt { color: var(--tm-muted-2); font-size: 14px; margin-top: 4px; }
.tm-related h3 { margin: 0 0 12px; font-size: 16px; font-family: var(--tm-font-head); }
.tm-related li { margin-bottom: 8px; }

/* ===== Original article ===== */
.tm-byline { color: var(--tm-muted); font-size: 14px; }
.tm-article .entry-content a { text-decoration: underline; }

/* ===== Pagination ===== */
.tm-pagination { display: flex; justify-content: center; align-items: center;
  gap: 10px; margin: 40px 0; }
.tm-pagination a { background: var(--tm-surface); border: 1px solid var(--tm-line);
  padding: 5px 15px; text-transform: uppercase; font-size: 12px; color: var(--tm-accent); }
.tm-pagination a:hover { background: var(--tm-bg); text-decoration: none; }
.tm-page-now { background: var(--tm-accent); color: #fff; padding: 5px 15px;
  font-size: 12px; text-transform: uppercase; font-weight: 700; }

/* Collapsed source lists */
.tm-show-more-sources { background: none; border: 0; color: var(--tm-accent);
  font-weight: 700; font-size: 14px; cursor: pointer; padding: 10px 0;
  border-top: 1px solid var(--tm-line); width: 100%; text-align: left; }
.tm-show-more-sources:hover { color: #111; }

/* ===== Footer ===== */
.tm-footer { background: var(--tm-dark); color: #cfcfcf; font-size: 14px; margin-top: 40px; }
.tm-footer a { color: #cfcfcf; text-decoration: none; }
.tm-footer a:hover { color: #fff; text-decoration: underline; }
.tm-footer-cols { display: flex; gap: 40px; padding: 40px 0 30px; }
.tm-footer-col { flex: 1 1 0; min-width: 0; }
.tm-footer-col h4 { color: #fff; font-family: var(--tm-font-head); font-size: 18px; font-weight: 400;
  text-transform: uppercase; letter-spacing: .5px; margin: 0 0 6px; padding-bottom: 8px; }
.tm-footer-col h4::after { content: ""; display: block; width: 44px; height: 3px;
  background: var(--tm-accent); margin-top: 8px; }
.tm-footer-col p { line-height: 1.7; margin: 12px 0; }
.tm-footer-links { list-style: none; margin: 12px 0 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.tm-footer-links a { display: inline-block; padding: 2px 0; }
.tm-footer-links a::before { content: "» "; color: var(--tm-accent); }
.tm-nl-form { display: flex; margin-top: 14px; }
.tm-nl-form input[type=email] { flex: 1 1 auto; min-width: 0; border: 1px solid #4a4a4a;
  background: #1f1f1f; color: #fff; padding: 10px 12px; border-radius: 3px 0 0 3px; font-size: 14px; }
.tm-nl-form input[type=email]:focus { outline: none; border-color: var(--tm-accent); }
.tm-nl-form button { background: var(--tm-accent); color: #fff; border: 0; padding: 10px 18px;
  border-radius: 0 3px 3px 0; font-weight: 700; cursor: pointer; }
.tm-nl-form button:hover { background: #8f1212; }
.tm-nl-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.tm-nl-note { font-size: 13px; color: #9a9a9a; margin-top: 10px; }
.tm-nl-msg { margin-top: 12px; padding: 8px 12px; border-radius: 3px; font-size: 13px; }
.tm-nl-msg--ok { background: #1d3a1d; color: #a9e5a9; }
.tm-nl-msg--err { background: #421919; color: #f0b3b3; }
.tm-footer-bottom { border-top: 1px solid #3d3d3d; padding: 16px 0; text-align: center;
  color: #9a9a9a; font-size: 13px; }
.tm-footer-bottom a { color: #9a9a9a; text-decoration: underline; }
.tm-back-top { background: var(--tm-accent); border: 0; border-radius: 25px; color: #fff;
  width: 45px; height: 45px; position: fixed; bottom: 30px; right: 30px; z-index: 100;
  cursor: pointer; display: none; font-size: 18px; transition: all .3s ease; }
.tm-back-top:hover { opacity: .7; transform: translateY(-3px); }
.tm-back-top.visible { display: block; }


/* =====================================================================
   RESPONSIVE — single consolidated block, deliberately LAST in the file
   so no later base rule (e.g. [data-slot]) can override these.
   ===================================================================== */
@media (max-width: 1200px) {
  .tm-clock { display: none; }
  .tm-banner-wrap { flex-wrap: wrap; }
  .tm-banner-left { width: 100%; flex-direction: row; }
  .tm-banner-left .tm-hl-card { aspect-ratio: 765 / 500; }
  .tm-banner-center { width: calc(60% - 10px); }
  .tm-banner-right { width: 40%; }
  .tm-slide-excerpt { display: none; }
}

@media (max-width: 960px) {
  .tm-header-ad { display: none; }          /* ad never renders on small screens */
  .tm-layout { flex-wrap: wrap; }
  .tm-main, .tm-sidebar { width: 100%; padding-right: 0; }
  .tm-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  /* Compact brand bar: title only, no clipping. */
  .tm-brand { padding: 6px 0; }
  .tm-brand-inner { margin: 0 12px; }
  .tm-site-title { font-size: 22px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 100%; }
  .tm-site-desc { display: none; }

  /* Hamburger nav: menu collapses behind a toggle; search stays visible. */
  .tm-nav-inner { margin: 0 12px; min-height: 54px; align-items: center; }
  .tm-nav-right { flex: 1; justify-content: flex-end; }
  .tm-searchform--nav { flex: 1; max-width: 260px; width: auto; margin: 0 0 0 10px; }
  .tm-nav-toggle { display: inline-block; }
  .tm-nav { position: sticky; top: 0; }
  .tm-nav-menu { display: none; }
  .tm-nav-menu.open { display: block; position: absolute; left: 0; right: 0;
    top: 100%; background: var(--tm-nav); border-top: 1px solid rgba(255,255,255,.25);
    border-bottom: 5px solid var(--tm-dark); max-height: 70vh; overflow-y: auto;
    z-index: 999; box-shadow: 0 12px 20px rgba(0,0,0,.25); }
  .tm-nav-menu.open a { display: block; line-height: 44px; padding: 0 18px;
    border-bottom: 1px solid rgba(255,255,255,.15); }
}

@media (max-width: 700px) {
  .tm-banner-wrap { margin: 12px auto; padding: 0 12px; }
  .tm-banner-center, .tm-banner-right { width: 100%; }
  .tm-banner-left { flex-direction: column; }
  .tm-banner-left .tm-hl-card { flex: none; }
  .tm-slide .tm-slide-text { padding: 15px 20px 12px; }
  .tm-slide-title { font-size: 20px; }
  .tm-topbar-social { display: none; }
  .tm-ticker { width: 100%; }
  .tm-banner-right { height: 280px; }
  .tm-halves { flex-wrap: wrap; }
  .tm-half { width: 100%; }
  .tm-wide-row { flex-wrap: wrap; }
  .tm-wide-row .tm-media { flex: 0 0 100%; }
  .tm-footer-cols { flex-direction: column; gap: 28px; padding: 28px 0 20px; }
}

@media (max-width: 600px) {
  .tm-grid { grid-template-columns: 1fr; }
  .tm-content { margin: 20px 12px; }
  .tm-wrap { margin: 0 12px; }
  .tm-section-title { font-size: 18px; }
  .tm-ticker-label { padding: 0 9px; font-size: 12px; }
  .tm-article { padding: 16px; }
  .tm-story-title { font-size: 24px; }
}
