/* =====================================================================
   AH STUDIO — BLOG MODULE STYLES
   Built entirely on top of the tokens/utilities defined in base.css
   (--red, --glass-bg, --ink, --gray, .glass, .wrap, .btn, .eyebrow, etc).
   No design tokens are redefined here.
   ===================================================================== */

/* ---------- Blog Card (shared: home slider, blog grid, related) ---------- */
.blog-card{
  border-radius:26px; overflow:hidden; display:flex; flex-direction:column;
  transition:transform .45s var(--ease), box-shadow .45s var(--ease), border-color .35s var(--ease);
  height:100%;
}
.blog-card:hover{ transform:translateY(-6px); box-shadow:0 24px 50px var(--shadow-color-strong); border-color:rgba(var(--red-rgb),0.30); }
.blog-card-thumb-link{ display:block; }
.blog-card-thumb{
  height:180px; position:relative; overflow:hidden;
  background:linear-gradient(135deg,var(--surface),var(--surface-2));
}
.blog-card-thumb img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transition:transform .5s var(--ease); }
.blog-card:hover .blog-card-thumb img{ transform:scale(1.08); }
.blog-card-ph{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; opacity:.35; }
.blog-card-ph svg{ width:36px; height:36px; stroke:var(--thumb-icon); }
.blog-card-thumb img ~ .blog-card-ph{ display:none; }
.blog-card-body{ padding:22px 22px 24px; display:flex; flex-direction:column; gap:10px; flex:1; }
.blog-card-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; font-size:12px; color:var(--gray); }
.blog-card-cat{ font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--red); font-size:11px; }
.blog-card-dot{ opacity:.6; }
.blog-card-body h3{ font-size:18px; line-height:1.3; letter-spacing:-0.01em; }
.blog-card-body p{ font-size:13.5px; color:var(--gray); line-height:1.55; flex:1; }

/* ---------- Home: Latest Articles (feature-grid, always newest 4) ---------- */
#blog-preview{ padding-top:0; }
.blog-preview-head{ display:flex; justify-content:space-between; align-items:flex-end; gap:24px; flex-wrap:wrap; margin-bottom:44px; }
.blog-see-all{
  display:inline-flex; align-items:center; gap:7px; font-size:14.5px; font-weight:600; color:var(--red);
  padding:10px 4px; flex-shrink:0;
}
.blog-see-all svg{ width:16px; height:16px; stroke:var(--red); transition:transform .35s var(--ease); }
.blog-see-all:hover svg{ transform:translateX(5px); }

/* ---------- Home: "Watch it in action" — dynamic video thumbs + titles ---------- */
.yt-item{ display:flex; flex-direction:column; gap:12px; }
.yt-thumb img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; }
.yt-thumb .play{ position:relative; z-index:1; }
.yt-thumb .len{ z-index:1; }
.yt-title{ font-size:14.5px; font-weight:600; color:var(--ink); line-height:1.4; padding:0 2px; }

/* ---------- Blog Page Hero ---------- */
.blog-hero{ padding-top:150px; padding-bottom:50px; }
.blog-hero .eyebrow{ justify-content:flex-start; }
.blog-hero h1{ font-size:clamp(34px,5vw,54px); margin-bottom:14px; }
.blog-hero p{ font-size:17px; color:var(--gray); max-width:600px; line-height:1.6; margin-bottom:36px; }

.blog-toolbar{ border-radius:22px; padding:16px; display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.blog-search{ position:relative; flex:1; min-width:220px; }
.blog-search svg{ position:absolute; left:16px; top:50%; transform:translateY(-50%); width:17px; height:17px; stroke:var(--gray); pointer-events:none; }
.blog-search input{
  width:100%; padding:13px 16px 13px 44px; border-radius:14px; border:1px solid var(--glass-border);
  background:var(--surface-2); color:var(--ink); font-size:14.5px; font-family:inherit;
  transition:border-color .3s var(--ease), background .3s var(--ease);
}
.blog-search input:focus{ outline:none; border-color:var(--red); }
.blog-toolbar select{
  padding:13px 38px 13px 16px; border-radius:14px; border:1px solid var(--glass-border);
  background:var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239A9AA1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  appearance:none; -webkit-appearance:none; color:var(--ink); font-size:14px; font-family:inherit; cursor:pointer;
}
.blog-view-toggle{ display:flex; gap:4px; padding:4px; border-radius:12px; background:var(--surface-2); }
.blog-view-toggle button{ width:36px; height:36px; border-radius:9px; display:flex; align-items:center; justify-content:center; }
.blog-view-toggle button svg{ width:16px; height:16px; stroke:var(--gray); }
.blog-view-toggle button.active{ background:var(--red); }
.blog-view-toggle button.active svg{ stroke:#fff; }

.blog-cat-pills{ display:flex; flex-wrap:wrap; gap:8px; margin:26px 0 8px; }
.blog-cat-pill{
  font-size:13px; font-weight:600; padding:9px 16px; border-radius:999px; color:var(--gray-dark);
  background:var(--glass-bg); border:1px solid var(--glass-border);
  transition:background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.blog-cat-pill:hover{ border-color:rgba(var(--red-rgb),0.4); }
.blog-cat-pill.active{ background:var(--red); color:#fff; border-color:var(--red); }

/* ---------- Blog grid / list ---------- */
.blog-results-meta{ font-size:13.5px; color:var(--gray); margin:30px 0 22px; }
.blog-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
@media (max-width:980px){ .blog-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:640px){ .blog-grid{ grid-template-columns:1fr; } }
.blog-grid.is-list{ grid-template-columns:1fr; }
.blog-grid.is-list .blog-card{ flex-direction:row; }
.blog-grid.is-list .blog-card-thumb-link{ flex:0 0 260px; }
.blog-grid.is-list .blog-card-thumb{ height:100%; min-height:160px; }
@media (max-width:640px){ .blog-grid.is-list .blog-card{ flex-direction:column; } .blog-grid.is-list .blog-card-thumb-link{ flex:none; } }

.blog-empty{ text-align:center; padding:80px 20px; color:var(--gray); }
.blog-empty svg{ width:48px; height:48px; stroke:var(--gray); margin-bottom:18px; opacity:.5; }

.blog-pagination{ display:flex; justify-content:center; align-items:center; gap:8px; margin-top:56px; flex-wrap:wrap; }
.blog-pagination button{
  min-width:40px; height:40px; padding:0 12px; border-radius:12px; font-size:14px; font-weight:600; color:var(--gray-dark);
  background:var(--glass-bg); border:1px solid var(--glass-border);
  transition:background .3s var(--ease), color .3s var(--ease);
}
.blog-pagination button.active{ background:var(--red); color:#fff; border-color:var(--red); }
.blog-pagination button:disabled{ opacity:.35; }

/* ---------- Blog Detail / Article page ---------- */
.article-hero{ padding-top:150px; padding-bottom:0; }
.article-meta-row{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; font-size:13.5px; color:var(--gray); margin-bottom:20px; }
.article-meta-row .article-cat{
  font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--red); font-size:12px;
}
/* A post can sit in several categories — space them out when there's more than one. */
.article-meta-row .article-cat + .article-cat{ margin-left:8px; }
.article-meta-row .article-cat:hover{ text-decoration:underline; text-underline-offset:3px; }
.article-hero h1{ font-size:clamp(32px,5vw,52px); margin-bottom:14px; }
.article-subtitle{ font-size:18px; color:var(--gray); line-height:1.6; max-width:760px; margin-bottom:32px; }
.article-cover{ border-radius:28px; overflow:hidden; aspect-ratio:16/8; background:linear-gradient(135deg,var(--surface),var(--surface-2)); margin-bottom:0; }
.article-cover img{ width:100%; height:100%; object-fit:cover; }

.article-layout{ display:grid; grid-template-columns:220px 1fr; gap:56px; align-items:start; padding-top:60px; }
@media (max-width:900px){ .article-layout{ grid-template-columns:1fr; } }
.article-toc{ position:sticky; top:110px; border-radius:20px; padding:22px; }
@media (max-width:900px){ .article-toc{ position:static; margin-bottom:20px; } }
.article-toc-title{ font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--gray); margin-bottom:14px; }
.article-toc a{ display:block; font-size:13.5px; color:var(--gray); padding:6px 0; line-height:1.4; border-left:2px solid transparent; padding-left:12px; transition:color .25s ease, border-color .25s ease; }
.article-toc a:hover, .article-toc a.active{ color:var(--red); border-color:var(--red); }
.article-toc a.toc-h3{ padding-left:22px; font-size:12.5px; }

.article-body{ max-width:740px; font-size:17px; line-height:1.85; color:var(--gray-dark); }
.article-body h2{ font-size:26px; margin:44px 0 16px; letter-spacing:-0.01em; scroll-margin-top:110px; }
.article-body h3{ font-size:20px; margin:32px 0 12px; scroll-margin-top:110px; }
.article-body p{ margin-bottom:20px; }
.article-body ul, .article-body ol{ margin:0 0 20px 22px; }
.article-body li{ margin-bottom:8px; }
.article-body blockquote{
  border-left:3px solid var(--red); padding:4px 0 4px 22px; margin:28px 0; font-size:18px; font-style:italic; color:var(--ink);
}
.article-body img{ border-radius:18px; margin:24px 0; width:100%; }
.article-body pre{ background:var(--surface); border-radius:14px; padding:20px; overflow-x:auto; margin:24px 0; font-size:14px; }
.article-body code{ background:var(--surface); padding:2px 6px; border-radius:6px; font-size:.9em; }
.article-body pre code{ background:none; padding:0; }
.article-body hr{ border:none; border-top:1px solid var(--hairline); margin:36px 0; }
.article-body table{ width:100%; border-collapse:collapse; margin:24px 0; font-size:15px; }
.article-body table th, .article-body table td{ border:1px solid var(--hairline); padding:10px 14px; text-align:left; }
.article-body table th{ background:var(--surface); font-weight:700; }
.article-body a{ color:var(--red); text-decoration:underline; text-underline-offset:3px; }
.article-body .video-embed{ position:relative; aspect-ratio:16/9; border-radius:16px; overflow:hidden; margin:26px 0; }
.article-body .video-embed iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; }
.article-body .checklist{ list-style:none; margin-left:0; }
.article-body .checklist li{ display:flex; gap:10px; align-items:flex-start; }
.article-body .checklist input{ margin-top:5px; accent-color:var(--red); }
/* Remaining elements the editor can insert */
.article-body s, .article-body del, .article-body strike{ opacity:.75; }
.article-body .post-gallery{ display:grid; gap:10px; margin:24px 0; }
.article-body .post-gallery img{ margin:0; border-radius:12px; width:100%; }
.article-body u{ text-underline-offset:3px; }
.article-body iframe{ max-width:100%; }

.article-toolbelt{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; margin-top:48px; padding-top:28px; border-top:1px solid var(--hairline); max-width:740px; }
.article-share{ display:flex; gap:8px; }
.article-share a, .article-share button{
  width:38px; height:38px; border-radius:11px; display:flex; align-items:center; justify-content:center;
  background:var(--glass-bg); border:1px solid var(--glass-border); transition:background .3s var(--ease), transform .3s var(--ease);
}
.article-share a:hover, .article-share button:hover{ background:var(--red); transform:translateY(-2px); }
.article-share svg{ width:16px; height:16px; stroke:var(--ink); fill:none; }
.article-share a:hover svg, .article-share button:hover svg{ stroke:#fff; }
.article-share .fill-icon{ fill:var(--ink); stroke:none; }
.article-share a:hover .fill-icon, .article-share button:hover .fill-icon{ fill:#fff; }

.article-tags{ display:flex; flex-wrap:wrap; gap:8px; max-width:740px; margin-top:24px; }
.article-tag{ font-size:12.5px; font-weight:600; padding:7px 13px; border-radius:999px; background:var(--red-soft); color:var(--red); }

.article-related{ margin-top:20px; }
.article-prevnext{ display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:20px; }
@media (max-width:640px){ .article-prevnext{ grid-template-columns:1fr; } }

/* ---------- Comments ---------- */
.comments-section{ max-width:740px; margin-top:56px; padding-top:36px; border-top:1px solid var(--hairline); }
.comments-head{ display:flex; align-items:center; gap:12px; margin-bottom:20px; }
.comments-head-icon{
  width:34px; height:34px; border-radius:10px; flex-shrink:0; display:flex; align-items:center; justify-content:center;
  background:var(--red-soft); color:var(--red);
}
.comments-head-icon svg{ width:17px; height:17px; }
.comments-head h2{ font-size:21px; }

.comments-list{ display:flex; flex-direction:column; gap:20px; margin-bottom:8px; }
.comments-empty{ padding:18px 0 28px; }
.comments-empty-title{ font-size:15px; font-weight:600; color:var(--ink); margin-bottom:4px; }
.comments-empty-sub{ font-size:13.5px; color:var(--gray); }

.comment-item{ display:flex; gap:14px; }
.comment-avatar{
  width:38px; height:38px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center;
  background:var(--red-soft); color:var(--red); font-size:13px; font-weight:700;
}
.comment-body{ flex:1; min-width:0; }
.comment-meta{ display:flex; align-items:baseline; gap:10px; margin-bottom:4px; flex-wrap:wrap; }
.comment-name{ font-weight:700; font-size:14.5px; color:var(--ink); }
.comment-time{ font-size:12px; color:var(--gray); }
.comment-text{ font-size:14.5px; line-height:1.6; color:var(--gray-dark); white-space:pre-wrap; word-break:break-word; }

/* Comment form card */
.comment-form{ border-radius:20px; padding:28px; background:var(--surface-2); border:1px solid var(--hairline); margin-top:32px; }

.comment-form-head{ display:flex; align-items:flex-start; gap:14px; margin-bottom:24px; }
.comment-form-icon{
  width:38px; height:38px; border-radius:11px; flex-shrink:0; display:flex; align-items:center; justify-content:center;
  background:var(--red-soft); color:var(--red);
}
.comment-form-icon svg{ width:18px; height:18px; }
.comment-form-title{ font-size:17px; font-weight:700; color:var(--ink); margin-bottom:4px; }
.comment-form-subtitle{ font-size:13.5px; color:var(--gray); line-height:1.5; }

.comment-form .admin-field{ margin-bottom:20px; }
.comment-form .admin-field label{
  display:block; font-size:13.5px; font-weight:600; color:var(--ink); margin-bottom:8px;
}

.comment-input-wrap{ position:relative; }
.comment-input-icon{
  position:absolute; left:15px; top:14px; width:17px; height:17px; stroke:var(--gray); pointer-events:none;
}
.comment-textarea-wrap .comment-textarea-icon{ top:14px; }

.comment-input, .comment-textarea{
  width:100%; background:var(--surface); border:1px solid var(--hairline); border-radius:13px;
  color:var(--ink); font:inherit; font-size:14.5px; padding:13px 15px 13px 42px;
  transition:border-color .25s var(--ease), background .25s var(--ease);
}
.comment-input::placeholder, .comment-textarea::placeholder{ color:var(--gray); }
.comment-input:focus, .comment-textarea:focus{
  outline:none; border-color:var(--red); background:var(--surface-2);
}
.comment-textarea{ resize:vertical; min-height:110px; line-height:1.6; }
.comment-char-count{ text-align:right; font-size:12px; color:var(--gray); margin-top:6px; }

.comment-honeypot{ position:absolute; left:-9999px; top:-9999px; opacity:0; height:0; overflow:hidden; }

.comment-form-footer{
  display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap;
  margin-top:8px; padding-top:20px; border-top:1px solid var(--hairline);
}
.comment-form-note{ display:flex; align-items:flex-start; gap:9px; max-width:400px; }
.comment-form-note svg{ width:15px; height:15px; flex-shrink:0; margin-top:2px; stroke:var(--gray); }
.comment-form-note span{ font-size:12.5px; color:var(--gray); line-height:1.5; }

.comment-submit-btn{ padding:13px 22px; font-size:14px; flex-shrink:0; }
.comment-submit-btn svg{ width:16px; height:16px; }

.comment-error{ color:#e5484d; font-size:13px; margin-top:12px; min-height:16px; }

@media (max-width:560px){
  .comment-form{ padding:20px; }
  .comment-form-footer{ flex-direction:column; align-items:stretch; }
  .comment-submit-btn{ justify-content:center; }
}
.article-nav-card{ border-radius:20px; padding:22px; display:block; transition:transform .35s var(--ease); }
.article-nav-card:hover{ transform:translateY(-3px); }
.article-nav-card .dir{ font-size:11.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--red); margin-bottom:8px; display:block; }
.article-nav-card .ttl{ font-size:15.5px; font-weight:600; line-height:1.4; }
.article-nav-card.next{ text-align:right; }

/* ---------- Back to blog link ---------- */
.back-to-blog{ display:inline-flex; align-items:center; gap:8px; font-size:14px; font-weight:600; color:var(--gray); margin-bottom:28px; }
.back-to-blog svg{ width:15px; height:15px; stroke:var(--gray); }
.back-to-blog:hover{ color:var(--red); }
.back-to-blog:hover svg{ stroke:var(--red); }
