/*
Theme Name: SellSEO Blog
Theme URI: https://sellseo.ai/blog
Author: SellSEO
Description: The SellSEO blog, built on the same design system as the app. It loads the site's own /assets/app.css rather than restating the tokens, so the blog cannot drift away from sellseo.ai; everything below is only what a blog needs and the app does not have.
Version: 1.0
License: GPL-2.0-or-later
Text Domain: sellseo
*/

/* ------------------------------------------------------------------
   Everything here assumes /assets/app.css is already loaded: the
   colours, buttons, pills, .section, .card, .footer and the nav are
   all its. Only blog-shaped things live in this file.
   ------------------------------------------------------------------ */

/* ---------- Utilities the app's stylesheet does not carry ----------
   app.css was written for the app, which never needed a visually-hidden
   class; WordPress core markup (labels, pagination, comment forms) emits
   .screen-reader-text and expects it to exist. Without these the search
   form's label sits in the sidebar as loose visible text. */
.sr-only,
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  position: static !important;
  width: auto; height: auto;
  clip: auto; margin: 0;
}

/* ---------- Block editor content ----------
   Alignment and caption classes Gutenberg emits inside .prose. */
.prose .alignleft { float: left; margin: 4px 24px 16px 0; }
.prose .alignright { float: right; margin: 4px 0 16px 24px; }
.prose .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.prose .alignwide { margin-left: -40px; margin-right: -40px; max-width: none; }
.prose .wp-caption-text, .prose .wp-element-caption { color: var(--ink-3); font-size: 13.5px; margin-top: 8px; }
.prose .wp-block-image { margin: 26px 0; }
.prose .wp-block-image img { border-radius: 12px; }
.prose .wp-block-button__link { background: var(--brand); color: #fff; border-radius: var(--radius-btn); padding: 12px 22px; font-weight: 600; text-decoration: none; display: inline-block; }
.prose .wp-block-quote { margin: 26px 0; padding-left: 20px; border-left: 3px solid var(--brand); color: var(--ink-2); }
.prose .wp-block-separator { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
.prose .wp-block-embed { margin: 26px 0; }
.prose > *:last-child { margin-bottom: 0; }

.blog-wrap { max-width: 1240px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) clamp(20px, 5vw, 56px); }

/* ---------- Masthead ---------- */
.blog-head { position: relative; overflow: hidden; background: var(--dark); color: #fff; }
.blog-head .orb { opacity: .55; }
.blog-head-in { position: relative; z-index: 2; max-width: 1240px; margin: 0 auto; padding: clamp(40px, 6vw, 76px) clamp(20px, 5vw, 56px) clamp(32px, 4vw, 52px); }
.blog-head h1 { color: #fff; max-width: 16ch; margin-bottom: 14px; }
.blog-head p { color: rgba(255,255,255,.72); font-size: 16.5px; max-width: 60ch; margin: 0; }
.blog-head .pill-dark { background: rgba(53,226,122,.12); color: var(--neon); margin-bottom: 18px; }
.blog-head .crumb { color: rgba(255,255,255,.5); font-size: 13.5px; margin-bottom: 14px; }
.blog-head .crumb a { color: rgba(255,255,255,.7); }
.blog-head .crumb a:hover { color: var(--neon); }

/* ---------- Category rail ---------- */
.cat-rail { display: flex; gap: 8px; flex-wrap: wrap; padding: 20px clamp(20px, 5vw, 56px) 0; max-width: 1240px; margin: 0 auto; }
.cat-rail a {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 13.5px/1 var(--font-body);
  padding: 9px 15px; border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.cat-rail a:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); }
.cat-rail a.is-active { background: var(--mint); color: var(--mint-ink); box-shadow: inset 0 0 0 1px transparent; }
.cat-rail a .n { color: var(--ink-3); font-weight: 500; }
.cat-rail a.is-active .n { color: var(--mint-ink); opacity: .7; }

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post-grid > * { min-width: 0; }
.post-card {
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); overflow: hidden;
  transition: transform .14s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.post-card .thumb { display: block; aspect-ratio: 16 / 9; background: var(--mint); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .thumb.is-blank { background: linear-gradient(135deg, var(--dark), var(--dark-2)); position: relative; }
.post-card .thumb.is-blank::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 72% 28%, rgba(53,226,122,.42), transparent 58%);
}
.post-card .body { padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card h2, .post-card h3 { font-size: 19px; margin: 0; line-height: 1.25; }
.post-card h2 a, .post-card h3 a { color: var(--ink); }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--brand-deep); }
.post-card .excerpt { color: var(--ink-2); font-size: 14.5px; margin: 0; }
.post-card .foot { margin-top: auto; padding-top: 4px; }

/* Lead card: first post on the index runs full width. */
.post-lead { display: grid; grid-template-columns: 1.05fr 1fr; gap: 0; margin-bottom: 22px; }
.post-lead .thumb { aspect-ratio: auto; min-height: 300px; }
.post-lead .body { padding: clamp(24px, 3vw, 40px); gap: 14px; justify-content: center; }
.post-lead h2 { font-size: clamp(24px, 2.6vw, 32px); font-family: var(--font-display); letter-spacing: -.02em; }
.post-lead .excerpt { font-size: 16px; }

/* ---------- Single post ---------- */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.post-body {
  background: var(--surface); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: clamp(24px, 4vw, 52px);
}
.post-body > *:first-child { margin-top: 0; }
.prose { font-size: 16.5px; line-height: 1.75; color: var(--ink); }
.prose p { margin: 0 0 20px; }
.prose h2 { font-size: clamp(22px, 2.4vw, 28px); margin: 40px 0 14px; }
.prose h3 { font-size: 20px; margin: 32px 0 10px; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose img { border-radius: 12px; height: auto; }
.prose figure { margin: 26px 0; }
.prose figcaption { color: var(--ink-3); font-size: 13.5px; margin-top: 8px; }
.prose blockquote {
  margin: 26px 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--brand);
  color: var(--ink-2); font-size: 17.5px; font-style: italic;
}
.prose code { background: var(--surface-2); border-radius: 6px; padding: 2px 6px; font-size: .9em; }
.prose pre { background: var(--dark); color: #d7f5e4; border-radius: 12px; padding: 18px 20px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 14.5px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

.post-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink-3); font-size: 13.5px; }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

/* ---------- Sidebar ---------- */
.side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 88px; }
.side .card { padding: 20px; }
.side h3 { font-size: 15px; margin: 0 0 12px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li { font-size: 14.5px; line-height: 1.5; margin-bottom: 10px; }
.side li a { color: var(--ink-2); }
.side li a:hover { color: var(--brand-deep); }
.side-cta { background: var(--dark); color: #fff; border-radius: var(--radius-card); padding: 24px; position: relative; overflow: hidden; }
.side-cta h3 { color: #fff; font-size: 18px; }
.side-cta p { color: rgba(255,255,255,.7); font-size: 14px; }
.side-cta .btn { width: 100%; }

/* ---------- Pagination, search, misc ---------- */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.pager .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px;
  background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 14px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.pager .page-numbers:hover { color: var(--ink); }
.pager .page-numbers.current { background: var(--brand); color: #fff; box-shadow: none; }
.blog-search { display: flex; gap: 8px; }
.blog-search input[type="search"] {
  flex: 1; min-width: 0; font: 400 14.5px/1 var(--font-body);
  padding: 11px 14px; border-radius: var(--radius-btn);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.blog-search input[type="search"]:focus { outline: none; border-color: var(--brand); }
.empty { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 48px; text-align: center; }

/* The blog nav link in the shared footer, so the column matches the others. */
.footer .foot-list li a b { font-weight: 700; color: #fff; }

@media (max-width: 1000px) {
  .post-layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .post-lead { grid-template-columns: 1fr; }
  .post-lead .thumb { min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
}
