/* ========= PixSqueeze • Final Unified CSS ========= */
/* Tokens */
:root{
  --bg:#0b1018; --panel:#0f1522; --text:#ebf1ff; --muted:#a1aec5;
  --border:#1c2740; --accent:#7cc4ff;
  --radius:16px; --space:18px; --max:1120px;
  --dock-h:clamp(74px,12vw,108px);
}

/* Global Safety */
*,:before,:after{box-sizing:border-box}
html,body{height:100%;max-width:100%;overflow-x:hidden}
body{
  margin:0;
  color:var(--text);
  background:linear-gradient(180deg,#101726 0%,#0b1018 60%,#090d14 100%);
  font:15px/1.55 system-ui,Segoe UI,Roboto,Inter;
  padding-bottom:var(--dock-h);
}
img,video,canvas,iframe,svg{max-width:100%;height:auto;display:block}

/* Prevent Ads forcing horizontal scroll */
[style*="width:100vw"]{
  width:100%!important;
  max-width:100%!important;
}

/* Container */
.wrap{
  width:100%;
  max-width:var(--max);
  margin-inline:auto;
  padding:var(--space) clamp(12px,3vw,24px);
}

/* Header */
header{
  position:sticky; top:0; z-index:50;
  background:rgba(15,21,34,.86);
  -webkit-backdrop-filter:blur(10px) saturate(120%);
  backdrop-filter:blur(10px) saturate(120%);
  border-bottom:1px solid var(--border);
}
.headbar{
  display:flex;justify-content:space-between;align-items:center;
  gap:12px;
}
.brand{display:flex;align-items:center;gap:10px}
.logo{
  width:40px;height:40px;border-radius:10px;display:grid;
  place-items:center;background:#0b1528;border:1px solid #203152;
}
.fx-gradient{
  background:linear-gradient(92deg,#a7d7ff,#d7e8ff);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
.sub{color:var(--muted);font-size:13px}
.chip{
  padding:6px 10px;border:1px solid #2a3450;
  border-radius:999px;background:#11192a;
}
.chip-ok{border-color:#3a4770}
.chip-bad{border-color:#703a3a}

/* Ads */
.adbox{
  display:grid;place-items:center;
  background:linear-gradient(180deg,rgba(12,18,32,.70),rgba(12,18,32,.45));
  -webkit-backdrop-filter:blur(8px) saturate(120%);
  backdrop-filter:blur(8px) saturate(120%);
  border:1px solid var(--border);border-radius:12px;
  width:100%;overflow:hidden;
}
ins.adsbygoogle,
#ad-side-ins,#ad-banner-ins{
  display:block!important;inline-size:100%!important;
  max-inline-size:100%!important;min-inline-size:0!important;
}

/* Main Tool Layout */
#tool{
  display:flex;
  gap:clamp(12px,2vw,18px);
  align-items:flex-start;
  width:100%;
}
#tool > section.card.pad{
  flex:1 1 70%;min-width:0;
}
#tool > aside.card.pad{
  flex:1 1 30%;min-width:260px;
}
@media (max-width:1100px){
  #tool{flex-direction:column}
  #tool > aside.card.pad{min-width:0}
}

/* Cards */
.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
}
.pad{padding:clamp(12px,1.6vw,16px)}
.section-title{margin:0 0 8px;font-weight:600}

/* UI Text */
.muted{color:var(--muted)}
.small{font-size:12px}

/* Button */
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;width:100%}
.btn{
  background:#0f1d36;border:1px solid #223153;color:var(--text);
  padding:12px 16px;border-radius:12px;cursor:pointer;min-height:44px;
  transition:transform .15s ease,box-shadow .2s ease,border-color .2s ease;
}
.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 0 24px rgba(124,196,255,.22);
}
.btn-primary{background:linear-gradient(180deg,#152847,#0f1d36)}
.btn-ghost{background:transparent;border-color:#2a3857}
.pulse-cta::after{
  content:"";position:absolute;inset:-2px;border-radius:14px;
  box-shadow:0 0 20px rgba(124,196,255,.25);
  opacity:.6;animation:pulse 2.1s ease-in-out infinite;
}
@keyframes pulse{0%{opacity:.2}50%{opacity:.6}100%{opacity:.2}}

/* File Picker Fix */
#filePick{display:none!important}
.filepick{
  display:block;width:100%;margin-bottom:10px;
}
.filepick .btn{width:100%}

/* Drop */
.drop{
  border:2px dashed #2a3450;border-radius:14px;
  padding:clamp(18px,2.2vw,22px);
  text-align:center;background:linear-gradient(180deg,#0e1524,#0c1220);
  width:100%;
}
.drag{border-color:#3a8bff!important}

/* List */
.list{
  display:flex;flex-direction:column;
  gap:clamp(8px,1vw,10px);
}

/* KPI */
.kpi{
  display:flex;flex-wrap:wrap;
  gap:clamp(8px,1.2vw,12px);
  margin-top:clamp(10px,1.2vw,14px);
}
.kpi .box{
  flex:1 1 22%;min-width:160px;
  background:linear-gradient(180deg,#0c1220,#0d1422);
  border:1px solid var(--border);
  border-radius:12px;padding:clamp(10px,1vw,12px);
}

/* Fixed Action Dock */
.wrap.sticky{
  position:fixed;left:0;right:0;bottom:0;z-index:60;
  background:transparent;isolation:isolate;
  max-width:none;margin:0;
  padding:0 clamp(12px,3vw,24px);
}
.wrap.sticky .card.pad.actions{
  width:100%;
  max-width:var(--max);
  margin-inline:auto;
  border-radius:14px 14px 0 0;
  background:linear-gradient(180deg,rgba(12,18,32,.72),rgba(12,18,32,.48));
  -webkit-backdrop-filter:blur(10px) saturate(120%);
  backdrop-filter:blur(10px) saturate(120%);
  border-top:1px solid var(--border);
  box-shadow:0 -8px 24px rgba(0,0,0,.35);
  padding:clamp(12px,3vw,18px);
}
.wrap.sticky .actions .row{
  flex-wrap:nowrap;width:100%;gap:10px;
}
.wrap.sticky .actions .btn{
  flex:1 1 50%;min-width:0;
}

/* Hide helper text on phones */
@media (max-width:768px){
  .wrap.sticky .muted.small{display:none}
}

/* Thumbnails */
.thumb{display:flex;gap:clamp(8px,1vw,12px);align-items:center}
.thumb img{
  width:18%;max-width:80px;
  border-radius:10px;border:1px solid #242c40;background:#0a0f1c;
}

/* Footer */
.foot{
  display:flex;justify-content:space-between;
  align-items:center;border-top:1px solid var(--border);
  padding-top:12px;gap:12px;flex-wrap:wrap;
}

/* Mobile fixes */
@media (max-width:900px){
  #tool{
    flex-direction:column;
    gap:18px;
  }
  #tool > aside.card.pad,
  #tool > section.card.pad{
    width:100%;max-width:100%;margin:0;
  }
}

@media (max-width:480px){
  .wrap{padding-inline:12px}
  .kpi .box{min-width:130px}
  .thumb img{width:22%;max-width:64px}
}

/* ===== Mobile & low-power performance helpers (append at end) ===== */

/* 1) Avoid costly blur/composite on mobile: swap glass for a flat tint */
@media (max-width: 640px) {
  header,
  .wrap.sticky .card.pad.actions,
  .adbox {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(12,18,32,.92) !important; /* close to current look */
    box-shadow: 0 -4px 14px rgba(0,0,0,.25) !important; /* lighter shadow */
  }
}

/* 2) Kill non-essential animations on touch devices (saves CPU/GPU) */
@media (hover: none) and (pointer: coarse) {
  .btn:hover { transform: none; box-shadow: none; }
  .pulse-cta::after { content: none !important; animation: none !important; }
}

/* Respect user preference, too */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 3) Prevent layout thrash from hover transforms on desktop GPUs */
.btn { will-change: transform; }
@media (hover: none) { .btn { will-change: auto; } }

/* 4) Offscreen sections don’t need layout/paint until scrolled into view */
#benefits, #faq, #tool > aside.card.pad {
  content-visibility: auto;
  contain-intrinsic-size: 600px; /* avoids CLS while collapsed */
}

/* 5) Ads: keep them from forcing wide layout and reserve space (CLS-safe) */
#ad-banner-ins, #ad-side-ins, ins.adsbygoogle {
  min-height: 90px; /* top banner */
}
@media (max-width: 900px) {
  #ad-side-ins { min-height: 250px; } /* side ad when stacked */
}

/* 6) Sticky dock: keep it lightweight on phones */
@media (max-width: 640px) {
  .wrap.sticky .card.pad.actions {
    box-shadow: 0 -6px 16px rgba(0,0,0,.28);
    border-top-color: #1b2540;
  }
}

/* 7) Avoid accidental horizontal scroll from wide inner elements */
.wrap, .card, .adbox, .row, .kpi, .list { overflow-x: clip; }

/* 8) Images/thumbs: hint sizing to avoid reflow */
.thumb img { aspect-ratio: 4 / 3; object-fit: cover; }

/* 9) Tap targets: ensure minimum size on mobile */
@media (max-width: 640px) {
  .btn { min-height: 48px; padding: 12px 14px; }
}

/* 10) Header: reduce blur cost even on larger screens (cheaper shader) */
header { backdrop-filter: blur(6px) saturate(120%); -webkit-backdrop-filter: blur(6px) saturate(120%); }

/* Cap banner size on small screens */
@media (max-width: 640px) {
  #ad-banner-ins { min-height: 90px; max-height: 160px; aspect-ratio: 6 / 1; }
  .adbox { max-height: 180px; }
}

/* Collapse truly empty ad slots immediately */
.adbox:has(> ins.adsbygoogle:empty) { display: none !important; }
ins.adsbygoogle:empty { display: none !important; min-height: 0 !important; height: 0 !important; }

/* --- Header compaction for small screens --- */

/* 1) Let header items wrap when space is tight */
.headbar { flex-wrap: wrap; }

/* 2) Shrink the logo + title/subtitle responsively */
.logo { width: clamp(28px, 6vw, 40px); height: clamp(28px, 6vw, 40px); }
.brand h1 { font-size: clamp(18px, 4.5vw, 24px); margin: 0; }
.sub { font-size: clamp(11px, 2.8vw, 13px); }

/* 3) Codec badge: scale down as viewport shrinks */
#codecBadge {
  font-size: clamp(10px, 1.8vw, 13px);
  padding: clamp(4px, 0.9vw, 6px) clamp(6px, 1.4vw, 10px);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(40vw, 220px); /* prevent it from taking over */
}

/* 4) On narrow phones, move badge to next line and make it subtler */
@media (max-width: 520px) {
  #codecBadge {
    order: 3;                 /* wrap under the brand row */
    margin-top: 6px;
    opacity: .85;
    max-width: 100%;
  }
}

/* 5) On very small screens, hide the badge entirely */
@media (max-width: 360px) {
  #codecBadge { display: none; }
}

/* 6) Language pills shrink a bit too to save space */
.lang-switch a { font-size: clamp(11px, 2.8vw, 12.5px); padding: 5px 8px; }

/* --- Header wrap/shrink fix --- */
.headbar { flex-wrap: wrap; }
.headbar > * { min-width: 0; }          /* lets items shrink instead of overflowing */

/* Make the brand block take the available space; badge can shrink */
.brand { flex: 1 1 auto; min-width: 0; }
#codecBadge { flex: 0 1 auto; min-width: 0; }

/* Tighter sizing on small screens (re-assert with !important just in case) */
.logo { width: clamp(28px, 6vw, 40px) !important; height: clamp(28px, 6vw, 40px) !important; }
.brand h1 { font-size: clamp(18px, 4.5vw, 24px) !important; margin: 0; }
.sub { font-size: clamp(11px, 2.8vw, 13px) !important; }

/* Codec badge scales and can wrap to next line */
#codecBadge {
  font-size: clamp(10px, 1.8vw, 13px);
  padding: clamp(4px, 0.9vw, 6px) clamp(6px, 1.4vw, 10px);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(40vw, 220px);
}
@media (max-width: 520px) {
  #codecBadge { order: 3; margin-top: 6px; max-width: 100%; opacity: .85; }
}
@media (max-width: 360px) {
  #codecBadge { display: none; }
}

/* Language pills can shrink too */
.lang-switch a { font-size: clamp(11px, 2.8vw, 12.5px); padding: 5px 8px; }

/* === Anti-collapse hardening (append at END of stylesheet) === */
html { min-height: 100%; }
body {
  min-height: 100vh !important;      /* body always at least viewport height */
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure main content creates flow height even if other pieces are fixed */
main, main.wrap, #tool {
  min-height: calc(100vh - var(--dock-h, 0px) - 60px); /* header + dock allowance */
  display: block;
}

/* If the action dock is fixed, reserve space to avoid 0-height body */
body:has(.wrap.sticky) { padding-bottom: var(--dock-h, 96px) !important; }

/* Safety: never let the root container vanish horizontally or vertically */
.wrap, .card { min-height: 1px; overflow-x: clip; }

/* --- Language dropdown (pill aesthetic) --- */
.lang-dd { position: relative; align-self: center; }
.lang-dd__btn{
  display:flex; align-items:center; gap:8px;
  padding:6px 10px; line-height:1;
  border:1px solid var(--border); border-radius:9999px;
  background:#0f1d36; color:var(--text); cursor:pointer;
  font-size:12.5px; opacity:.95;
}
.lang-dd__btn:hover{ opacity:1; }
.lang-dd__list{
  position:absolute; top:calc(100% + 8px); right:0;
  min-width:170px; padding:6px; margin:0; list-style:none;
  background:#0f1522; border:1px solid var(--border);
  border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,.35);
  display:none; z-index:80;
}
.lang-dd[aria-expanded="true"] .lang-dd__list,
.lang-dd.open .lang-dd__list{ display:block; }

.lang-dd__list a{
  display:flex; justify-content:space-between; align-items:center;
  gap:10px; padding:8px 10px; border-radius:10px; text-decoration:none;
  color:var(--text); font-size:13px; background:transparent;
}
.lang-dd__list a:hover{ background:#111c33; }
.lang-dd__list a[aria-current="true"]{
  border:1px solid #4a86ff; box-shadow:0 0 0 1px rgba(74,134,255,.25) inset;
}

/* Small screens */
@media (max-width:480px){
  .lang-dd__btn{ padding:5px 8px; font-size:12px; }
}

/* Ensure the header can anchor absolutely positioned children */
header { position: relative; }

/* === Hamburger (pinned right) === */
.hamburger{
  position:absolute; right:12px; top:50%; transform:translateY(-50%);
  display:flex; flex-direction:column; gap:5px;
  width:42px; height:38px; padding:8px;
  border:1px solid var(--border, #1c2740);
  background:#0f1522; border-radius:12px; cursor:pointer; z-index: 5;
  touch-action:manipulation;
}
.hamburger .bar{ height:2px; width:100%; background:var(--text, #ebf1ff); display:block; }
.hamburger:focus-visible, .hamburger:hover{ outline:0; box-shadow:0 0 0 2px rgba(255,255,255,.06) }

/* Hide the hamburger when the menu is open (your JS sets aria-expanded="true") */
.hamburger[aria-expanded="true"]{ display:none; }

/* === Backdrop behind the sidebar === */
.backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:999;
  backdrop-filter:blur(1px) saturate(.9);
}

/* === Sidebar (slides from right) === */
.sidebar{
  position:fixed; top:0; right:0; height:100vh; width:min(360px,92vw);
  background:#0f1522; border-left:1px solid var(--border, #1c2740);
  transform:translateX(100%); transition:transform .25s ease; z-index:1000;
  padding:16px; display:flex; flex-direction:column; gap:10px;
  box-shadow:-8px 0 24px rgba(0,0,0,.35);
}
.sidebar.open{ transform:translateX(0); }

/* Full-screen takeover on phones */
@media (max-width: 640px){
  .sidebar{ width:100vw; }
}

/* Sidebar content */
.side-close{
  align-self:flex-end; background:transparent; border:0; color:var(--muted, #a1aec5);
  font-size:18px; cursor:pointer; padding:6px; border-radius:8px;
}
.side-close:hover, .side-close:focus-visible{ color:var(--text, #ebf1ff) }

.side-nav{ display:flex; flex-direction:column; gap:12px; margin-top:6px }
.side-link{ color:var(--text, #ebf1ff); text-decoration:none; opacity:.9 }
.side-link:hover, .side-link:focus-visible{ opacity:1; text-decoration:underline }

body.noscroll { overflow: hidden; }

/* ==== Glassy Sidebar + Backdrop (non-breaking upgrade) ==== */

/* Backdrop: darker + subtle blur behind the glass */
.backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999;
  /* blur the page behind the overlay */
  backdrop-filter: blur(4px) saturate(0.9);
  -webkit-backdrop-filter: blur(4px) saturate(0.9);
}

/* Sidebar: glassmorphism */
.sidebar{
  position: fixed; top: 0; right: 0; height: 100vh; width: min(360px, 92vw);
  z-index: 1000;
  /* translucent pane so blur shows through */
  background: rgba(15, 21, 34, 0.55);
  /* frosted glass effect */
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);

  /* glassy border + soft glow */
  border-left: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    -10px 0 30px rgba(0,0,0,0.38),
    inset 0 1px 0 rgba(255,255,255,0.04);

  transform: translateX(100%);
  transition: transform .25s ease, background-color .25s ease, backdrop-filter .25s ease;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;

  /* perf hints for smoothness */
  will-change: transform;
  contain: paint;
}

.sidebar.open{ transform: translateX(0); }

/* Full-screen takeover on phones (preserves the glass look) */
@media (max-width: 640px){
  .sidebar{ width: 100vw; }
}

/* Close button + links stay readable on glass */
.side-close{
  align-self: flex-end;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text, #ebf1ff);
  font-size: 18px; cursor: pointer; padding: 6px 8px; border-radius: 10px;
}
.side-close:hover, .side-close:focus-visible{
  background: rgba(255,255,255,0.12);
}

.side-nav{ display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.side-link{
  color: var(--text, #ebf1ff);
  text-decoration: none;
  opacity: 0.95;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background-color .15s ease, opacity .15s ease;
}
.side-link:hover, .side-link:focus-visible{
  background: rgba(255,255,255,0.08);
  opacity: 1;
}

/* Keep hamburger pinned right; hide when expanded (unchanged behavior) */
.hamburger{
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 5px;
  width: 42px; height: 38px; padding: 8px;
  border: 1px solid var(--border, #1c2740);
  background: rgba(15, 21, 34, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 12px; cursor: pointer; z-index: 5;
  touch-action: manipulation;
}
.hamburger .bar{ height: 2px; width: 100%; background: var(--text, #ebf1ff); display: block; }
.hamburger:focus-visible, .hamburger:hover{ outline: 0; box-shadow: 0 0 0 2px rgba(255,255,255,.06) }
.hamburger[aria-expanded="true"]{ display: none; }

/* Optional: slight edge highlight for the glass pane */
.sidebar::before{
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  border-left: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 0 40px rgba(255,255,255,0.03);
  border-radius: 0; /* pane is rectangular; keep edges crisp */
}

/* Respect users who prefer less transparency/blur */
@media (prefers-reduced-transparency: reduce){
  .backdrop{ backdrop-filter: none; -webkit-backdrop-filter: none; }
  .sidebar{
    backdrop-filter: none; -webkit-backdrop-filter: none;
    background: rgba(15, 21, 34, 0.92);
  }
}

/* === Spacing & Rhythm Fixes (non-breaking, end of file) === */

/* Scale: reuse your token but add finer steps */
:root{
  --space-xxs: clamp(6px, 0.6vw, 8px);
  --space-xs:  clamp(8px, 0.8vw, 10px);
  --space-sm:  clamp(12px,1.2vw,14px);
  --space-md:  clamp(16px,1.6vw,20px);
  --space-lg:  clamp(20px,2.2vw,26px);
}

/* 1) Make every .card.pad manage its own inner spacing */
.card.pad{
  display: grid;
  gap: var(--space-md);              /* creates clean spacing between children */
}

/* 2) Section titles need a bit more air */
.section-title{
  margin: 0 0 var(--space-sm);
}

/* 3) Batch Conversion card specifics (keeps your classes) */
#tool > section.card.pad > .filepick{           /* “Select images” button block */
  margin: var(--space-sm) 0 var(--space-sm);    /* was tight; add top/bottom space */
}
#tool > section.card.pad > .drop{
  margin-top: var(--space-sm);                  /* breathing room below button */
}
#tool > section.card.pad > .kpi{
  margin-top: var(--space-sm);                  /* consistent gap above KPIs */
}
#tool > section.card.pad > #list{
  margin-top: var(--space-sm);
}

/* 4) “How it works” card: ensure inner elements don’t stick together */
#tool > aside.card.pad > h3{ margin: 0; }
#tool > aside.card.pad > ol{ margin: 0; }
#tool > aside.card.pad > ol + .adbox{           /* space before the side ad card */
  margin-top: var(--space-md);
}

/* 5) Global: avoid cramped buttons/rows inside any card */
.card.pad .row{ gap: var(--space-sm); }
.card.pad .btn + .btn{ margin-left: 0; }        /* gap already handled by .row */

/* 6) File picker: ensure the button itself isn’t glued to edges */
.filepick .btn{
  width: 100%;
  padding: 14px 18px;                           /* slight bump for touch comfort */
}

/* 7) Stacking sections: cards that follow other cards get air */
.wrap > .card + .card{
  margin-top: var(--space-lg);
}

/* 8) Mobile stack: when #tool stacks, keep the same vertical rhythm */
@media (max-width:1100px){
  #tool{ gap: var(--space-md); }
}

/* 9) Ad containers inside cards shouldn’t touch content above */
.card.pad .adbox{
  margin-top: var(--space-sm);
}

/* 10) Last-child tidy: prevent extra bottom cramp in any card */
.card.pad > *:last-child{
  margin-bottom: 0;
}

/* === Modern Blog Card Redesign === */

/* Remove inner padding at the top so the image hugs the card */
.blogcard {
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18,24,36,0.96), rgba(12,18,32,0.92));
  border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .25s ease;
}

/* Hover motion */
.blogcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(124,196,255,.18);
}

/* Image now spans full width/height of the card top */
.blogcard__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: none !important;
  border-radius: 0 !important;
  margin: 0;
}

/* Text zone – clean padding inside */
.blogcard__title,
.blogcard__date,
.blogcard__sum {
  padding-inline: clamp(12px, 1.5vw, 18px);
}
.blogcard__title {
  margin-top: clamp(10px, 1vw, 12px);
  font-weight: 600;
  line-height: 1.4;
}
.blogcard__date {
  margin-top: 4px;
  color: var(--muted);
}
.blogcard__sum {
  margin-top: 8px;
  margin-bottom: clamp(14px, 1.8vw, 20px);
  color: var(--muted);
}

/* Link styling inside title */
.blogcard__title a {
  text-decoration: none;
  color: var(--text);
  transition: color .15s ease;
}
.blogcard__title a:hover {
  color: var(--accent);
}

/* Grid refinement */
.blog-grid3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(18px, 2vw, 24px);
  align-items: stretch;
}

/* Responsive smoothing */
@media (max-width: 640px) {
  .blogcard {
    border-radius: 12px;
  }
}

/* === Blog Card Spacing Enhancement === */

/* Add space below each card (between rows) */
.blogcard {
  margin-bottom: clamp(18px, 2.5vw, 26px);
}

/* Add space above the title inside each card */
.blogcard__title {
  margin-top: clamp(16px, 2vw, 22px) !important;
}

/* === Blogcard date/summary spacing fix === */

/* Bring date and summary closer together */
.blogcard__date {
  margin-bottom: 4px !important;     /* reduce excess gap below the date */
  line-height: 1.3;                  /* keeps it compact but legible */
}

/* Optional: tighten the top of the summary a bit */
.blogcard__sum {
  margin-top: 2px !important;
}

/* === Blog Card Specificity Fix (kills unwanted grid gap) === */

/* Beat .card.pad specificity by matching all three classes */
.card.pad.blogcard{
  /* kill the global grid layout + gap */
  display: flex !important;
  flex-direction: column;
  gap: 0 !important;

  /* keep the “modern” card chrome from earlier */
  padding: 0 !important;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18,24,36,0.96), rgba(12,18,32,0.92));
  border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .25s ease;
}

/* Ensure inner elements don't inherit any grid/flex gap from parents */
.card.pad.blogcard > *{
  margin: 0; /* we’ll control rhythm explicitly below */
}

/* Full-bleed image stays tight */
.card.pad.blogcard .blogcard__img{
  display:block;
  width:100%;
  aspect-ratio:16/9;
  object-fit:cover;
  border:0 !important;
  border-radius:0 !important;
}

/* Title/date/summary spacing ONLY (keeps your typography/colors) */
.card.pad.blogcard .blogcard__title,
.card.pad.blogcard .blogcard__date,
.card.pad.blogcard .blogcard__sum{
  padding-inline: clamp(12px, 1.5vw, 18px);
}

.card.pad.blogcard .blogcard__title{
  margin-top: clamp(16px, 2vw, 22px) !important; /* space above title */
}

.card.pad.blogcard .blogcard__date{
  margin-top: 4px;
  margin-bottom: 2px !important; /* tighten under date */
  line-height: 1.3;
}

.card.pad.blogcard .blogcard__sum{
  margin-top: 2px !important;
  margin-bottom: clamp(14px, 1.8vw, 20px);
}

/* Space between cards (rows) */
.card.pad.blogcard{
  margin-bottom: clamp(18px, 2.5vw, 26px);
}


/* === Slow, smooth dropdown base for home accordions === */

#learn details > summary,
#faq  details > summary {
  cursor: pointer;
}

/* Hide default marker only here */
#learn details > summary::-webkit-details-marker,
#faq  details > summary::-webkit-details-marker {
  display: none;
}

/* Animate the content (anything after summary) */
#learn details > *:not(summary),
#faq  details > *:not(summary) {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  margin-top: 6px;
  transition:
    max-height 0.6s cubic-bezier(.25,.1,.25,1),
    opacity    0.45s cubic-bezier(.25,.1,.25,1),
    transform  0.45s cubic-bezier(.25,.1,.25,1);
}
