/* ------------------------------------------------------------------------
   Blog Pro layer — modern, fully responsive blog layout + feature images.
   Loaded AFTER every other stylesheet so it wins without !important hacks.
   Content, posts and SEO markup are untouched; this file is presentation only.
------------------------------------------------------------------------- */

/* Global safety: nothing may push the page sideways at any width or zoom. */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, video, canvas, iframe { max-width: 100%; }

/* ---------------------------------------------------------- containers */
.wrap-wide,
.wrap-blog {
  width: 100%;
  max-width: min(1280px, 100% - 2rem);
  margin-inline: auto;
  padding-inline: 0;
}
@media (max-width: 640px) {
  .wrap-wide,
  .wrap-blog { max-width: min(1280px, 100% - 1.5rem); }
}

.page-head.wrap-wide,
.page-head.wrap-blog { padding-block: clamp(32px, 6vw, 64px) 4px; }

/* --------------------------------------------------------- blog grid */
.blog-grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 28px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  align-items: stretch;
}
@media (min-width: 1200px) {
  .blog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .blog-grid { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------- post cards */
.post-card {
  min-width: 0;
  overflow: hidden;
  border-radius: clamp(12px, 1.4vw, 18px);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--acc) 40%, transparent);
  box-shadow: 0 22px 50px -34px rgba(0, 0, 0, .9);
}
/* Card thumbnails: uniform 16:9 frame, centred crop, never squeezed. */
.post-card > a:first-child { display: block; overflow: hidden; }
.post-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  background: var(--panel2);
  transition: transform .35s ease;
}
.post-card:hover img { transform: scale(1.03); }
.post-card .pc-body { min-width: 0; }
.post-card h3 a { overflow-wrap: anywhere; }
.post-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------------------------- article + feature */
.article {
  width: 100%;
  max-width: min(820px, 100% - 2rem);
  margin-inline: auto;
  padding: clamp(24px, 5vw, 48px) 0 clamp(48px, 8vw, 80px);
}
@media (min-width: 1200px) { .article { max-width: 860px; } }

/* Feature image: intended aspect ratio preserved, no crop, no overflow. */
.article-feature {
  margin: 0 0 clamp(20px, 3vw, 32px);
  width: 100%;
  border-radius: clamp(12px, 1.4vw, 18px);
  overflow: hidden;
  background: var(--panel2);
  border: 1px solid var(--line);
}
.article .feature,
.article-feature img {
  display: block;
  width: 100%;
  height: auto;          /* keeps the file's own aspect ratio */
  max-height: min(70vh, 620px);
  object-fit: contain;   /* landscape composition stays intact */
  object-position: center;
  margin: 0;
  border-radius: inherit;
  image-rendering: auto;
}
.article-feature figcaption {
  padding: 8px 14px 12px;
  font-size: 13px;
  color: var(--mut);
}

/* Body media never overflows the column. */
.cms-body { min-width: 0; overflow-wrap: break-word; }
.cms-body img { width: auto; max-width: 100%; height: auto; }
.cms-body pre { overflow-x: auto; max-width: 100%; }
.cms-body table { width: 100%; display: block; overflow-x: auto; }

/* ------------------------------------------------------------- pager */
.pager { flex-wrap: wrap; }
.pager a, .pager span { min-height: 40px; display: inline-flex; align-items: center; }

/* ------------------------------------------- sound preference toggle */
.snd-toggle {
  display: none;                 /* desktop-only, enabled by JS */
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mut);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  width: auto;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.snd-toggle.is-available { display: inline-flex; }
.snd-toggle:hover { color: var(--txt); background: rgba(255, 255, 255, .05); }
.snd-toggle svg { flex: 0 0 auto; }
.snd-toggle .snd-label { white-space: nowrap; }
.snd-toggle[aria-pressed="true"] {
  color: var(--txt);
  border-color: color-mix(in srgb, var(--acc) 34%, transparent);
  background: var(--ui-tint);
}

/* ------------------------------------------------ mobile menu polish */
@media (max-width: 820px) {
  .topbar { max-width: 100vw; }
  .topbar nav#siteNav { max-width: 100vw; }
  .ui-burger { display: inline-flex; margin-left: auto; }
  .topbar .brand { max-width: calc(100% - 72px); }
  .snd-toggle { display: none !important; }   /* sound stays off on touch */
}
@media (max-width: 380px) {
  .topbar { padding: 8px 10px; gap: 10px; }
  .topbar .brand { font-size: 15px; }
  .brand-logo { max-height: 28px; }
  .page-head h1 { font-size: clamp(24px, 7vw, 32px); }
}

/* Modern blog header: left aligned, clean measure. */
.page-head.wrap-blog { text-align: left; }
.page-head.wrap-blog h1 { margin: 0 0 10px; }
.page-head.wrap-blog p { margin: 0; max-width: 62ch; }
