/*
Theme Name: MobiMag
Theme URI: https://example.com/mobimag
Author: Anonymous
Author URI: https://example.com
Description: A sleek, animated blog theme for mobile phone reviews with a built-in specifications table for every post. Dynamic header & footer, smooth scroll reveals, and a decent, eye-catching midnight-cyan color scheme.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mobimag
Tags: blog, custom-menu, custom-logo, featured-images, threaded-comments
*/

/* ============ Design tokens ============ */
:root {
  --ink: #0b1220;          /* deep navy — header / footer */
  --ink-2: #101a30;        /* raised navy panels */
  --cyan: #22d3ee;         /* electric cyan accent */
  --violet: #7c6cf6;       /* violet accent */
  --grad: linear-gradient(100deg, var(--cyan), var(--violet));
  --bg: #f6f8fc;           /* page background */
  --card: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(11, 18, 32, .08);
  --shadow-lg: 0 24px 60px rgba(11, 18, 32, .16);
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--violet); text-decoration: none; transition: color .25s ease; }
a:hover { color: var(--cyan); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; color: var(--ink); margin: 0 0 .5em; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 18, 32, .85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: box-shadow .35s ease, background .35s ease;
}
.site-header::after {           /* signature: gradient scanline */
  content: ""; display: block; height: 3px;
  background: var(--grad);
  background-size: 200% 100%;
  animation: scan 6s linear infinite;
}
@keyframes scan { to { background-position: 200% 0; } }
.site-header.is-scrolled { box-shadow: 0 12px 30px rgba(11,18,32,.35); background: rgba(11,18,32,.97); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 18px 0; transition: padding .3s ease;
}
.site-header.is-scrolled .header-inner { padding: 10px 0; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand img.custom-logo { max-height: 44px; width: auto; }
.site-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.45rem;
  color: #fff; letter-spacing: .3px; margin: 0;
}
.site-title a { color: #fff; }
.site-title .dot {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.site-tagline { display: none; }
@media (min-width: 900px) {
  .site-tagline { display: block; font-size: .78rem; color: #94a3b8; margin: 2px 0 0; letter-spacing: .4px; }
}

/* Nav */
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.main-nav a {
  display: inline-block; padding: 9px 16px; border-radius: 999px;
  color: #e2e8f0; font-weight: 500; font-size: .95rem; position: relative;
  transition: color .25s ease, background .25s ease, transform .25s ease;
}
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.08); transform: translateY(-2px); }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
  color: var(--ink); background: var(--grad); font-weight: 600;
}

/* Mobile nav */
.nav-toggle {
  display: none; background: none; border: 2px solid rgba(255,255,255,.25);
  border-radius: 12px; padding: 8px 12px; color: #fff; cursor: pointer;
  font-size: 1.1rem; transition: border-color .25s ease;
}
.nav-toggle:hover { border-color: var(--cyan); }
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .main-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--ink);
    max-height: 0; overflow: hidden; transition: max-height .45s cubic-bezier(.4,0,.2,1); }
  .main-nav.open { max-height: 60vh; box-shadow: var(--shadow-lg); }
  .main-nav ul { flex-direction: column; padding: 14px 24px 22px; gap: 4px; }
  .main-nav a { display: block; }
}

/* ============ Hero (home) ============ */
.hero {
  position: relative; overflow: hidden; background: var(--ink);
  color: #cbd5e1; padding: 84px 0 96px; text-align: center;
}
.hero .blob {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  filter: blur(90px); opacity: .5; pointer-events: none;
  animation: float 14s ease-in-out infinite alternate;
}
.hero .blob-a { background: var(--cyan); top: -220px; left: -140px; }
.hero .blob-b { background: var(--violet); bottom: -260px; right: -160px; animation-delay: -7s; }
@keyframes float { from { transform: translate(0,0) scale(1); } to { transform: translate(50px, 30px) scale(1.12); } }
.hero h1 {
  color: #fff; font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700;
  margin-bottom: 14px; position: relative;
}
.hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { max-width: 620px; margin: 0 auto; position: relative; }

/* ============ Post grid ============ */
.section-pad { padding: 70px 0; }
.post-grid {
  display: grid; gap: 30px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.post-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .35s cubic-bezier(.4,0,.2,1), box-shadow .35s ease;
}
.post-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.post-card .thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--ink-2); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.post-card:hover .thumb img { transform: scale(1.06); }
.post-card .card-body { padding: 24px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.post-card h2 { font-size: 1.25rem; margin-bottom: 8px; }
.post-card h2 a { color: var(--ink); }
.post-card h2 a:hover { color: var(--violet); }
.post-meta { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; }
.post-meta .cat { color: var(--violet); font-weight: 600; }
.post-card .excerpt { color: var(--muted); font-size: .95rem; flex: 1; }
.read-more {
  margin-top: 18px; align-self: flex-start; font-weight: 600; font-size: .9rem;
  color: var(--ink); position: relative; padding-bottom: 3px;
}
.read-more::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--grad); transform: scaleX(.35); transform-origin: left;
  transition: transform .3s ease;
}
.read-more:hover::after { transform: scaleX(1); }

/* Scroll-reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.4,0,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ============ Single post ============ */
.single-hero { background: var(--ink); color: #cbd5e1; padding: 70px 0 60px; position: relative; overflow: hidden; }
.single-hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.7rem); max-width: 820px; }
.single-hero .post-meta { color: #94a3b8; }
.single-hero .post-meta .cat { color: var(--cyan); }
.entry-wrap { max-width: 780px; margin: 0 auto; }
.entry-thumb { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); margin: -46px auto 44px; max-width: 820px; }
.entry-content { font-size: 1.05rem; }
.entry-content h2, .entry-content h3 { margin-top: 1.8em; }
.entry-content blockquote {
  margin: 1.6em 0; padding: 6px 24px; border-left: 4px solid; border-image: var(--grad) 1;
  background: #eef2ff; border-radius: 0 12px 12px 0; color: #334155;
}
.entry-content a { border-bottom: 1px solid var(--cyan); }

/* ============ Spec table (signature element) ============ */
.spec-box { margin: 46px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.spec-box .spec-head {
  background: var(--ink); color: #fff; padding: 18px 26px;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
}
.spec-box .spec-head::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--grad); box-shadow: 0 0 14px var(--cyan);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.35); opacity: .7; } }
.spec-table { width: 100%; border-collapse: collapse; background: var(--card); }
.spec-table th, .spec-table td { padding: 14px 26px; text-align: left; font-size: .96rem; }
.spec-table tr { border-bottom: 1px solid var(--line); transition: background .25s ease; }
.spec-table tr:last-child { border-bottom: none; }
.spec-table tr:hover { background: #f0f7ff; }
.spec-table th {
  width: 38%; color: var(--ink); font-weight: 600; font-family: var(--font-display);
  font-size: .86rem; letter-spacing: .3px; position: relative;
}
.spec-table th::before {
  content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px;
  background: var(--grad); border-radius: 3px; opacity: 0;
  transition: opacity .25s ease;
}
.spec-table tr:hover th::before { opacity: 1; }
.spec-table td { color: #334155; font-variant-numeric: tabular-nums; }

/* Author box */
.author-box {
  margin: 50px 0 0; padding: 26px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
  display: flex; gap: 20px; align-items: center;
}
.author-box img { border-radius: 50%; width: 72px; height: 72px; }
.author-box .who { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.author-box p { margin: 4px 0 0; color: var(--muted); font-size: .93rem; }

/* Post navigation */
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 44px; }
.post-nav a {
  flex: 1; background: var(--card); border-radius: 14px; padding: 16px 20px;
  box-shadow: var(--shadow); color: var(--ink); font-weight: 600; font-size: .92rem;
  transition: transform .3s ease, box-shadow .3s ease;
}
.post-nav a:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--violet); }
.post-nav .next { text-align: right; }

/* ============ Pagination ============ */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 56px; }
.pagination .page-numbers {
  min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 14px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow);
  color: var(--ink); font-weight: 600; transition: transform .25s ease;
}
.pagination .page-numbers:hover { transform: translateY(-3px); color: var(--violet); }
.pagination .current { background: var(--grad); color: var(--ink); }

/* ============ Footer ============ */
.site-footer { background: var(--ink); color: #94a3b8; margin-top: 80px; position: relative; }
.site-footer::before { content: ""; display: block; height: 3px; background: var(--grad); background-size: 200% 100%; animation: scan 6s linear infinite; }
.footer-widgets {
  display: grid; gap: 40px; padding: 60px 0 40px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.footer-widgets .widget-title {
  color: #fff; font-family: var(--font-display); font-size: 1rem; margin-bottom: 16px;
  position: relative; padding-bottom: 10px;
}
.footer-widgets .widget-title::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 3px;
  border-radius: 3px; background: var(--grad);
}
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: var(--cyan); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { padding: 5px 0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); padding: 22px 0;
  display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between;
  font-size: .86rem;
}
.footer-bottom .heart { color: var(--cyan); }
.to-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 90;
  width: 46px; height: 46px; border: none; border-radius: 14px; cursor: pointer;
  background: var(--grad); color: var(--ink); font-size: 1.15rem; font-weight: 700;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-4px); }

/* ============ Comments & forms ============ */
.comments-area { max-width: 780px; margin: 60px auto 0; }
.comment-list { list-style: none; padding: 0; }
.comment-body { background: var(--card); border-radius: 14px; padding: 20px 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
input[type=text], input[type=email], input[type=url], input[type=search], textarea {
  width: 100%; padding: 13px 16px; border: 2px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: .96rem; background: #fff; color: var(--text);
  transition: border-color .25s ease, box-shadow .25s ease;
}
input:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(34,211,238,.15); outline: none; }
button, input[type=submit], .btn {
  display: inline-block; border: none; cursor: pointer; border-radius: 999px;
  background: var(--grad); color: var(--ink); font-weight: 700; font-family: var(--font-display);
  padding: 13px 30px; font-size: .95rem;
  transition: transform .25s ease, box-shadow .25s ease;
}
button:hover, input[type=submit]:hover, .btn:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(124,108,246,.35); }

/* Archive / page titles */
.page-header-band { background: var(--ink); padding: 56px 0; }
.page-header-band h1 { color: #fff; margin: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.page-header-band .sub { color: #94a3b8; margin: 8px 0 0; }

/* WordPress core classes */
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { margin: 24px auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: .85rem; color: var(--muted); text-align: center; padding-top: 8px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sticky .post-card, .post-card.sticky-post { border-top: 4px solid; border-image: var(--grad) 1; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ============ Homepage: hero extras ============ */
.hero-eyebrow {
  display: inline-block; margin: 0 0 16px; padding: 7px 18px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--cyan); border: 1px solid rgba(34,211,238,.35); background: rgba(34,211,238,.08);
  position: relative;
}
.hero-search {
  position: relative; max-width: 560px; margin: 32px auto 0;
  display: flex; gap: 10px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 8px;
  backdrop-filter: blur(8px);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.hero-search:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 5px rgba(34,211,238,.12); }
.hero-search input[type=search] {
  flex: 1; border: none; background: transparent; color: #fff;
  padding: 10px 18px; font-size: 1rem; box-shadow: none;
}
.hero-search input::placeholder { color: #94a3b8; }
.hero-search input:focus { box-shadow: none; border: none; }
.hero-search button { padding: 12px 28px; }

/* Section heads */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; margin-bottom: 34px;
}
.section-head h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0; position: relative; padding-left: 18px;
}
.section-head h2::before {
  content: ""; position: absolute; left: 0; top: 12%; bottom: 12%;
  width: 5px; border-radius: 5px; background: var(--grad);
}
.see-all { font-weight: 600; font-size: .92rem; color: var(--ink); }
.see-all:hover { color: var(--violet); }

/* Featured split */
.featured-split { display: grid; gap: 30px; grid-template-columns: 1.6fr 1fr; align-items: start; }
@media (max-width: 900px) { .featured-split { grid-template-columns: 1fr; } }
.featured-lead {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.featured-lead:hover { transform: translateY(-6px); }
.featured-lead .thumb { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--ink-2); }
.featured-lead .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.featured-lead:hover .thumb img { transform: scale(1.05); }
.featured-lead .badge {
  position: absolute; top: 18px; left: 18px; padding: 6px 16px; border-radius: 999px;
  background: var(--grad); color: var(--ink); font-weight: 700; font-size: .78rem;
  font-family: var(--font-display); letter-spacing: .5px; text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(34,211,238,.4);
}
.featured-lead .card-body { padding: 28px 32px 34px; }
.featured-lead h3 { font-size: 1.5rem; margin-bottom: 10px; }
.featured-lead h3 a { color: var(--ink); }
.featured-lead h3 a:hover { color: var(--violet); }
.featured-lead .btn { margin-top: 18px; }

.featured-side { display: flex; flex-direction: column; gap: 16px; }
.mini-card {
  display: flex; gap: 16px; align-items: center; background: var(--card);
  border-radius: 16px; padding: 14px 18px 14px 14px; box-shadow: var(--shadow);
  transition: transform .3s ease, box-shadow .3s ease;
}
.mini-card:hover { transform: translateX(6px); box-shadow: var(--shadow-lg); }
.mini-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.mini-card .mini-date { display: block; font-size: .76rem; color: var(--muted); margin-bottom: 3px; }
.mini-card .mini-title { font-family: var(--font-display); font-weight: 600; font-size: .95rem; color: var(--ink); line-height: 1.35; }
.mini-card:hover .mini-title { color: var(--violet); }

/* Category band on homepage */
.cat-band { background: var(--ink); padding: 70px 0; position: relative; overflow: hidden; }
.cat-band .section-head h2 { color: #fff; }
.cat-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cat-card {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 24px 26px; border-radius: 16px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  transition: transform .3s ease, border-color .3s ease, background .3s ease;
}
.cat-card:hover { transform: translateY(-5px); border-color: var(--cyan); background: rgba(34,211,238,.07); }
.cat-card .cat-name { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; color: #fff; }
.cat-card .cat-count { font-size: .84rem; color: #94a3b8; }
.cat-card .cat-arrow {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  color: var(--cyan); font-size: 1.2rem; opacity: 0; transition: opacity .3s ease, transform .3s ease;
}
.cat-card:hover .cat-arrow { opacity: 1; transform: translate(4px, -50%); }

/* CTA band */
.cta-band { background: var(--ink); position: relative; overflow: hidden; padding: 70px 0; margin-top: 10px; }
.cta-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
  position: relative;
}
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { color: #94a3b8; margin: 0; max-width: 520px; }
.btn-light { background: #fff; }

/* Category page extras */
.cat-header { position: relative; overflow: hidden; padding: 64px 0; }
.cat-chips, .tag-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.tag-row { margin: 40px 0 0; }
.chip {
  padding: 8px 18px; border-radius: 999px; background: var(--card);
  box-shadow: var(--shadow); color: var(--ink); font-weight: 600; font-size: .86rem;
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
.chip:hover { transform: translateY(-3px); color: var(--violet); }
.chip.active { background: var(--grad); color: var(--ink); }

/* Related reviews */
.related-wrap { max-width: 1140px; margin: 70px auto 0; }

/* ============ Fancy homepage cards ============ */
.fancy-card { position: relative; }
.fancy-card::after {                 /* gradient frame that lights up on hover */
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  padding: 2px; background: var(--grad);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s ease; pointer-events: none;
}
.fancy-card:hover::after { opacity: 1; }
.fancy-card .thumb { position: relative; display: block; }
.cat-badge {
  position: absolute; bottom: 14px; left: 14px; padding: 6px 15px;
  border-radius: 999px; background: rgba(11,18,32,.82); color: var(--cyan);
  font-family: var(--font-display); font-weight: 600; font-size: .74rem;
  letter-spacing: .6px; text-transform: uppercase;
  border: 1px solid rgba(34,211,238,.4); backdrop-filter: blur(6px);
  transition: background .3s ease, color .3s ease;
}
.fancy-card:hover .cat-badge { background: var(--grad); color: var(--ink); border-color: transparent; }
.thumb-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 3rem;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 60%, #1a2a4a 100%);
}

/* =========================================================
   v1.1 — layout hardening + refined cards
   ========================================================= */

/* Hard-lock every thumbnail so tall images can never blow up the layout */
.post-card .thumb,
.featured-lead .thumb {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #0b1220, #16243f);
}
.post-card .thumb { padding-top: 62%; }        /* ~16:10 ratio box */
.featured-lead .thumb { padding-top: 56.25%; } /* 16:9 ratio box */
.post-card .thumb img,
.featured-lead .thumb img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.post-card .thumb .thumb-fallback,
.featured-lead .thumb .thumb-fallback {
  position: absolute; inset: 0;
}
.entry-thumb img { width: 100%; max-height: 520px; object-fit: cover; }

/* Section head must stay on one line, wrapping only when truly needed */
.section-head {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 12px 20px; margin-bottom: 34px;
}
.section-head h2 { flex: 1 1 auto; }
.see-all { flex: 0 0 auto; white-space: nowrap; }
.section-pad.pt-0 { padding-top: 0; }

/* --- Refined post cards --- */
.post-card {
  border: 1px solid var(--line);
  background: var(--card);
}
.post-card .card-body { padding: 22px 24px 26px; }
.post-card h2 { font-size: 1.18rem; line-height: 1.35; }
.post-card .post-meta {
  font-size: .78rem; letter-spacing: .3px; text-transform: uppercase;
  font-weight: 600; color: #94a3b8; gap: 8px; align-items: center;
}
.post-card .excerpt { font-size: .93rem; }
.read-more { cursor: pointer; }

/* Category badge sits on the image */
.cat-badge {
  position: absolute; bottom: 14px; left: 14px; z-index: 2;
  padding: 6px 15px; border-radius: 999px;
  background: rgba(11,18,32,.82); color: var(--cyan);
  font-family: var(--font-display); font-weight: 600; font-size: .72rem;
  letter-spacing: .7px; text-transform: uppercase;
  border: 1px solid rgba(34,211,238,.4); backdrop-filter: blur(6px);
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.fancy-card:hover .cat-badge,
.featured-lead:hover .cat-badge { background: var(--grad); color: var(--ink); border-color: transparent; }

.thumb-fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; opacity: .55;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-2) 55%, #1c2f52 100%);
}
.thumb-fallback.small { font-size: 1.4rem; border-radius: 12px; }

/* Mini cards in the featured column */
.mini-card { align-items: stretch; }
.mini-thumb {
  position: relative; flex: 0 0 84px; width: 84px; height: 84px;
  border-radius: 12px; overflow: hidden; display: block;
  background: var(--ink-2);
}
.mini-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini-thumb .thumb-fallback { position: absolute; inset: 0; }
.mini-text { display: flex; flex-direction: column; justify-content: center; }

/* Featured lead balance */
.featured-lead .card-body { padding: 26px 30px 32px; }
.featured-lead h3 { font-size: 1.4rem; }

/* Hero polish */
.hero-sub { font-size: 1.05rem; }
.home-hero { padding: 92px 0 100px; }

/* Category band tightening */
.cat-band { padding: 64px 0; }
