/* ── Single Post Layout ─────────────────────────────────────── */
.single-wrap {
  padding-top: var(--sp-12);
  padding-bottom: var(--sp-24);
}
.single-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: var(--sp-16);
  align-items: start;
}

/* ── Article Header ─────────────────────────────────────────── */
.article-header {
  margin-bottom: var(--sp-8);
}
.article-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--c-ink);
  line-height: 1.15;
  letter-spacing: -0.8px;
  margin-bottom: var(--sp-6);
}
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: var(--sp-6) 0;
  border-top: 1px solid var(--c-hairline);
  border-bottom: 1px solid var(--c-hairline);
}
.meta-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--c-ink);
  font-size: 0.875rem;
}
.meta-author .author-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  object-fit: cover;
}

/* ── Hero Image ─────────────────────────────────────────────── */
.article-hero-image {
  margin: var(--sp-8) 0;
  border-radius: var(--r-xl);
  overflow: hidden;
}
.article-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}
.image-caption {
  font-size: 0.8125rem;
  color: var(--c-muted);
  text-align: center;
  padding: 8px 0 0;
  font-style: italic;
}

/* ── Drop cap — first letter of first paragraph ─────────────── */
.single-article .entry-content > p:first-of-type::first-letter {
  float: left;
  font-size: 4.25rem;
  font-weight: 800;
  line-height: 0.78;
  color: var(--c-ink);
  font-family: var(--font);
  margin-right: 10px;
  margin-top: 6px;
  letter-spacing: -2px;
}

/* ── Article Body ───────────────────────────────────────────── */
.article-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-body);
  max-width: var(--content-w);
}

/* ── Author Box (single post) ───────────────────────────────── */
.author-box {
  display: flex;
  flex-direction: column;
  background: var(--c-surface-soft);
  border: 1px solid var(--c-hairline);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  margin-top: var(--sp-16);
}
.author-box-top {
  display: flex;
  gap: var(--sp-8);
  align-items: flex-start;
}
.author-avatar-wrap { flex-shrink: 0; }
.author-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--c-hairline);
  display: block;
}
.author-info { flex: 1; min-width: 0; }
.author-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 3px;
}
.author-name {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 2px;
  transition: color 0.15s;
}
.author-name:hover { color: var(--c-primary); }
.author-role {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--c-primary);
  margin-bottom: var(--sp-4);
}
.author-bio {
  font-size: 0.875rem;
  color: var(--c-body);
  line-height: 1.6;
  margin: 0 0 var(--sp-4);
}
.author-box-socials {
  display: flex;
  gap: 8px;
  margin-top: var(--sp-4);
  flex-wrap: wrap;
}
.author-box-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--c-hairline);
  color: var(--c-body);
  transition: background 0.15s, color 0.15s;
}
.author-box-social-link:hover {
  background: var(--c-primary);
  color: #fff;
}

/* ── Disclosure (subtle footnote inside author card) ─────────── */
.author-disclosure {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-top: var(--sp-4);
  margin-top: var(--sp-6);
  border-top: 1px solid var(--c-hairline);
  font-size: 0.75rem;
  color: var(--c-muted);
  line-height: 1.5;
}
.author-disclosure svg { flex-shrink: 0; color: var(--c-muted); position: relative; top: 1px; }
.author-disclosure strong { font-weight: 600; color: var(--c-body); }

/* ── Related Articles — shared header ───────────────────────── */
.related-posts { margin-top: var(--sp-16); }
.related-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--c-hairline);
}
/* 3-col grid (default) */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}
.related-grid .post-card { font-size: 0.875rem; }
.related-grid .card-title { font-size: 0.9375rem; -webkit-line-clamp: 3; }

/* 2-col grid */
.related-grid--2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-6);
}
.related-grid--2col .post-card { font-size: 0.875rem; }

/* List layout: image left, text right */
.related-list { display: flex; flex-direction: column; gap: var(--sp-6); }
.related-list-item {
  display: flex;
  gap: var(--sp-6);
  align-items: flex-start;
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--c-hairline);
}
.related-list-item:last-child { border-bottom: none; }
.related-list-thumb {
  flex-shrink: 0;
  width: 200px;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--r-md);
}
.related-list-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-list-body { flex: 1; min-width: 0; }
.related-list-body .card-title { font-size: 1rem; }

/* Compact layout: small thumb rows */
.related-compact { display: flex; flex-direction: column; gap: var(--sp-4); }
.related-compact-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-hairline-soft);
}
.related-compact-item:last-child { border-bottom: none; }
.related-compact-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 52px;
  overflow: hidden;
  border-radius: var(--r-sm);
}
.related-compact-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-compact-body { flex: 1; min-width: 0; }
.related-compact-title { font-size: 0.875rem; font-weight: 600; line-height: 1.35; }
.related-compact-title a { color: var(--c-ink); transition: color 0.15s; }
.related-compact-title a:hover { color: var(--c-primary); }

/* ── Page layout ────────────────────────────────────────────── */
.page-wrap { padding: var(--sp-12) 0 var(--sp-24); }

.page-layout {
  max-width: var(--content-w);
}

/* Left: content flush left */
.page-layout--left {
  margin-left: 0;
  margin-right: auto;
}

/* Center: content centered (default) */
.page-layout--center {
  margin-left: auto;
  margin-right: auto;
}

/* Right: content flush right */
.page-layout--right {
  margin-left: auto;
  margin-right: 0;
}

.page-header  { margin-bottom: var(--sp-10); }
.page-title   { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; color: var(--c-ink); letter-spacing: -0.5px; }
.page-body    { font-size: 1rem; line-height: 1.75; }

/* Title alignment */
.page-header--left   { text-align: left; }
.page-header--center { text-align: center; }
.page-header--right  { text-align: right; }

/* Sidebar layout */
.page-layout--has-sidebar {
  max-width: var(--container-w, 1200px);
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w, 300px);
  gap: var(--sp-12);
  align-items: start;
}
.page-sidebar {
  position: sticky;
  top: calc(var(--header-h, 120px) + var(--sp-6));
}

@media (max-width: 900px) {
  .page-layout--has-sidebar {
    grid-template-columns: 1fr;
  }
  .page-sidebar { display: none; }
}

/* ── Comments ───────────────────────────────────────────────── */
.comments-area {
  margin-top: var(--sp-16);
  padding-top: var(--sp-12);
  border-top: 1px solid var(--c-hairline);
}
.comments-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--sp-8);
}
.comment-list         { margin: 0; }
.comment              { padding: var(--sp-8) 0; border-bottom: 1px solid var(--c-hairline-soft); }
.comment-author b     { font-weight: 600; color: var(--c-ink); }
.comment-metadata a   { font-size: 0.8125rem; color: var(--c-muted); }
.comment-content p    { font-size: 0.9375rem; color: var(--c-body); margin-top: 4px; }

/* Comment form */
.comment-form label  { display: block; font-size: 0.875rem; font-weight: 600; color: var(--c-ink); margin-bottom: 4px; }
.comment-form input:not([type="checkbox"]):not([type="submit"]),
.comment-form textarea {
  width: 100%;
  border: 1.5px solid var(--c-hairline);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--c-ink);
  background: var(--c-canvas);
  margin-bottom: var(--sp-6);
  transition: border-color 0.18s;
}
.comment-form input:not([type="checkbox"]):not([type="submit"]):focus-visible,
.comment-form textarea:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 0;
  border-color: var(--c-primary);
}
.comment-form textarea       { min-height: 120px; resize: vertical; }

/* Custom validation — themed error state */
.comment-form input.ops-field-error:not([type="checkbox"]):not([type="submit"]),
.comment-form textarea.ops-field-error {
  border-color: var(--c-down);
}
.ops-field-error-msg {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  color: var(--c-down);
  margin-top: -8px;
  margin-bottom: var(--sp-6);
}
.comment-form .submit {
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 10px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
  width: 100%;
}
.comment-form .submit:hover { background: var(--c-primary-active); }

/* Cookie consent checkbox — inline with label */
.comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: var(--sp-6);
}
.comment-form-cookies-consent input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin: 3px 0 0;
  accent-color: var(--c-primary);
  cursor: pointer;
}
.comment-form-cookies-consent label {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--c-muted);
  margin-bottom: 0;
  cursor: pointer;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────
   INFINITE SCROLL UI
   ───────────────────────────────────────────────────────────── */

/* Feed container */
.ops-infinite-feed { display: block; }

/* Article sentinel (invisible — only watched by IntersectionObserver) */
.ops-is-sentinel {
  height: 1px;
  width: 100%;
  pointer-events: none;
  margin: var(--sp-4) 0 0;
}

/* Divider between auto-loaded articles */
.ops-is-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-10) 0 var(--sp-6);
}
.ops-is-divider::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: var(--c-hairline);
}
.ops-is-divider-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--c-canvas, #fff);
  border: 1px solid var(--c-hairline);
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--c-muted);
  text-transform: uppercase;
}

/* Loader */
.ops-is-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: var(--sp-10) 0;
  color: var(--c-muted);
  font-size: 0.875rem;
}
.ops-is-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--c-hairline);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: ops-spin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes ops-spin { to { transform: rotate(360deg); } }

/* ── Custom comment items ───────────────────────────────────── */
.ops-comment {
  padding: var(--sp-6) 0;
  border-bottom: 1px solid var(--c-hairline-soft);
}
.ops-comment:last-child { border-bottom: none; }
.ops-comment-head {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.ops-comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  object-fit: cover;
  flex-shrink: 0;
}
.ops-comment-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ops-comment-author {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-ink);
}
.ops-comment-date {
  font-size: 0.75rem;
  color: var(--c-muted);
}
.ops-comment-text p {
  font-size: 0.9375rem;
  color: var(--c-body);
  line-height: 1.65;
  margin: 0;
}

/* ── Load More button ───────────────────────────────────────── */
.ops-load-more-wrap {
  margin: var(--sp-8) 0;
  text-align: center;
}
.ops-load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--c-surface-soft);
  border: 1.5px solid var(--c-hairline);
  border-radius: var(--r-pill);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-body);
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}
.ops-load-more-btn:hover:not(:disabled) {
  border-color: var(--c-primary);
  color: var(--c-primary);
}
.ops-load-more-btn:disabled { opacity: 0.6; cursor: wait; }
.ops-load-more-btn span { font-weight: 400; color: var(--c-muted); }

/* ── Custom comment field values (displayed in comment) ─────── */
.ops-comment-cf-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: var(--sp-4);
}
.ops-comment-cf {
  font-size: 0.75rem;
  color: var(--c-muted);
  background: var(--c-surface-soft);
  border-radius: var(--r-pill);
  padding: 2px 10px;
}
.ops-comment-cf strong { color: var(--c-body); font-weight: 600; }

/* ── Custom input field in form ─────────────────────────────── */
.comment-form-custom-field {
  margin-bottom: var(--sp-6);
}

/* ── Comment form field rows ────────────────────────────────── */
.comment-form-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
}
.comment-form-fields-single {
  display: grid;
  grid-template-columns: 1fr;
}
@media (max-width: 600px) {
  .comment-form-fields-row { grid-template-columns: 1fr; }
}

/* End marker — hidden */
.ops-is-end { display: none; }

/* Next Article divider — hidden */
.ops-is-divider { display: none; }

/* Loaded articles get a subtle top border */
.ops-article-wrap--loaded {
  border-top: none;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .single-layout { grid-template-columns: 1fr; }
  .single-sidebar { display: none; }
  .related-grid        { grid-template-columns: repeat(2, 1fr); }
  .related-grid--2col  { grid-template-columns: 1fr; }
  .related-list-thumb  { width: 130px; }
}
@media (max-width: 600px) {
  .author-box-top      { flex-direction: column; }
  .related-grid        { grid-template-columns: 1fr; }
  .related-list-item   { flex-direction: column; }
  .related-list-thumb  { width: 100%; }

  /* Mobile spacing */
  .single-wrap {
    padding-top: var(--sp-8);
    padding-bottom: var(--sp-16);
  }

  /* Hero image: keep rounded corners on mobile */
  .article-hero-image {
    border-radius: var(--r-lg);
  }

  .article-title  { font-size: 1.5rem; letter-spacing: -0.4px; }
  .article-body   { font-size: 0.9375rem; }
  .author-box     { padding: var(--sp-6); gap: var(--sp-6); }
  .related-posts  { margin-top: var(--sp-12); }
  .comments-area  { margin-top: var(--sp-12); padding-top: var(--sp-8); }
}

/* ═══════════════════════════════════════════════════════════════
   AUTHOR PAGE
   ═══════════════════════════════════════════════════════════════ */
.author-page-wrap {
  padding: var(--sp-16) 0 var(--sp-24);
}

/* Profile Card */
.author-profile-card {
  display: flex;
  gap: var(--sp-10);
  align-items: flex-start;
  background: var(--c-surface-soft);
  border: 1px solid var(--c-hairline);
  border-radius: var(--r-xl);
  padding: var(--sp-10);
  margin-bottom: var(--sp-8);
}
.author-profile-avatar-col { flex-shrink: 0; }
.author-profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--c-hairline);
  display: block;
}
.author-profile-body { flex: 1; min-width: 0; }
.author-profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-6);
  margin-bottom: var(--sp-4);
}
.author-profile-name {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 800;
  color: var(--c-ink);
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin: 0;
}
.author-profile-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-primary);
  margin: 4px 0 0;
}
.author-profile-stats {
  text-align: right;
  flex-shrink: 0;
}
.author-stat-count {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-ink);
  line-height: 1;
}
.author-stat-label {
  font-size: 0.75rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.author-profile-bio {
  font-size: 0.9375rem;
  color: var(--c-body);
  line-height: 1.65;
  margin: 0 0 var(--sp-6);
}

/* Social links on author page */
.author-profile-socials {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.author-social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--c-hairline);
  color: var(--c-body);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.author-social-link:hover {
  background: var(--c-primary);
  color: #fff;
}

/* Posts section */
.author-posts-section { margin-top: var(--sp-12); }
.author-posts-heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--c-ink);
  letter-spacing: -0.3px;
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-4);
  border-bottom: 2px solid var(--c-hairline);
}
.no-posts {
  text-align: center;
  color: var(--c-muted);
  padding: var(--sp-16) 0;
}

/* Author page responsive */
@media (max-width: 700px) {
  .author-profile-card    { flex-direction: column; }
  .author-profile-avatar  { width: 80px; height: 80px; }
  .author-profile-header  { flex-direction: column; }
  .author-profile-stats   { text-align: left; }
}
