/*
 * Hand-translated from the Tailwind utility classes used by
 * src/components/ui/Navbar.tsx and src/components/ui/Footer.tsx in the
 * main Next.js app, plus a simple typography system for post content.
 * Values match Tailwind's default scale (spacing, color, breakpoints) so
 * this reads as pixel-equivalent without pulling a build pipeline into
 * a PHP-only theme.
 */

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  color: #111827;
  background: #f9fafb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.site-main { min-height: 60vh; }

/* ---------- Nav ---------- */
.site-nav {
  background: #ffffff;
  border-bottom: 1px solid #f3f4f6;
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-nav__inner { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .site-nav__inner { padding: 0 1.5rem; } }
.site-nav__row { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.site-nav__logo img { width: auto; height: 2.5rem; }
.site-nav__links { display: none; align-items: center; gap: 1.5rem; }
@media (min-width: 768px) { .site-nav__links { display: flex; } }
.site-nav__links > a {
  color: #4b5563;
  font-size: 0.875rem;
  font-weight: 500;
}
.site-nav__links > a:hover { color: #111827; }
.site-nav__cta {
  background: #4f46e5;
  color: #ffffff !important;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color .15s ease;
}
.site-nav__cta:hover { background: #4338ca; }

.site-nav__auth { position: relative; }
.site-nav__auth-trigger {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background: none;
  border: 1px solid #e5e7eb;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.site-nav__auth-trigger:hover { border-color: #d1d5db; background: #f9fafb; }
.site-nav__auth-trigger svg { color: #9ca3af; transition: transform .15s ease; }
.site-nav__auth-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.site-nav__auth-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 2.5rem;
  width: 12rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  padding: 0.25rem 0;
  z-index: 50;
}
.site-nav__auth-menu.is-open { display: block; }
.site-nav__auth-menu a {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #374151;
}
.site-nav__auth-menu a:hover { background: #f9fafb; }
.site-nav__auth-menu-cta { color: #4f46e5 !important; font-weight: 500; }

.site-nav__hamburger {
  display: block;
  padding: 0.5rem;
  color: #4b5563;
  background: none;
  border: none;
  cursor: pointer;
}
@media (min-width: 768px) { .site-nav__hamburger { display: none; } }

.site-nav__mobile { display: none; padding-bottom: 1rem; }
.site-nav__mobile.is-open { display: block; }
.site-nav__mobile > a {
  display: block;
  padding: 0.5rem;
  color: #374151;
  border-radius: 0.375rem;
}
.site-nav__mobile > a:hover { background: #f9fafb; }
.site-nav__mobile-auth { border-top: 1px solid #f3f4f6; margin-top: 0.5rem; padding-top: 0.5rem; }
.site-nav__mobile-auth a { display: block; padding: 0.5rem; border-radius: 0.375rem; color: #374151; }
.site-nav__mobile-auth-cta { color: #4f46e5 !important; font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer { background: #111827; color: #9ca3af; }
.site-footer__inner { max-width: 72rem; margin: 0 auto; padding: 3rem 1rem; }
@media (min-width: 640px) { .site-footer__inner { padding: 3rem 1.5rem; } }
.site-footer__brand { margin-bottom: 2rem; }
.site-footer__logo { width: auto; height: 2.25rem; filter: brightness(0) invert(1); margin-bottom: 0.75rem; }
.site-footer__brand p { font-size: 0.875rem; line-height: 1.6; margin: 0; }

.site-footer__grid { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 768px) { .site-footer__grid { grid-template-columns: repeat(5, 1fr); gap: 2rem; } }
.site-footer__col { border-bottom: 1px solid #1f2937; padding: 0; }
@media (min-width: 768px) { .site-footer__col { border-bottom: none; } }
.site-footer__col h3 {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  margin: 0 0 0.75rem;
  padding: 1rem 0 0;
}
@media (min-width: 768px) { .site-footer__col h3 { padding-top: 0; } }
.site-footer__col ul { list-style: none; margin: 0; padding: 0 0 1rem; display: flex; flex-direction: column; gap: 0.625rem; font-size: 0.875rem; }
@media (min-width: 768px) { .site-footer__col ul { padding-bottom: 0; } }
.site-footer__col a:hover { color: #ffffff; }

.site-footer__bottom {
  border-top: 1px solid #1f2937;
  margin-top: 2rem;
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
}
@media (min-width: 640px) { .site-footer__bottom { flex-direction: row; } }
.site-footer__bottom > p { margin: 0; }
.site-footer__bottom-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem; }
.site-footer__bottom-links a:hover { color: #ffffff; }
.site-footer__ext-link, .site-footer__x-link { display: flex; align-items: center; gap: 0.5rem; }
.site-footer__ext-link img { border-radius: 0.125rem; }

/* ---------- Post content ---------- */
.post-wrap { max-width: 72rem; margin: 0 auto; padding: 3rem 1rem; }
@media (min-width: 640px) { .post-wrap { padding: 3rem 1.5rem; } }
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 2rem;
}
.post-back:hover { color: #111827; }
.post-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}
.post-thumb { width: 100%; aspect-ratio: 1200 / 630; background: #4f46e5; object-fit: cover; }
.post-body { padding: 2rem; }
.post-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  background: #e0e7ff;
  color: #4338ca;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
}
.post-title { font-size: 1.875rem; font-weight: 700; color: #111827; margin: 0 0 1rem; }
.post-byline { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid #f3f4f6; }
.post-byline time, .post-byline .post-author { font-size: 0.75rem; color: #6b7280; }
.post-author-name { font-size: 0.875rem; font-weight: 600; color: #111827; }

.post-content { color: #374151; line-height: 1.75; max-width: none; }
.post-content h1 { font-size: 1.875rem; font-weight: 700; color: #111827; margin: 0 0 1.5rem; }
.post-content h2 { font-size: 1.5rem; font-weight: 700; color: #111827; margin: 3rem 0 1rem; }
.post-content h3 { font-size: 1.125rem; font-weight: 600; color: #111827; margin: 2rem 0 0.5rem; }
.post-content p { margin: 0 0 1rem; }
.post-content a { color: #4f46e5; text-decoration: underline; }
.post-content strong { font-weight: 700; color: #111827; }
.post-content ul, .post-content ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.375rem; }
.post-content blockquote {
  border-left: 3px solid #c7d2fe;
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  color: #4b5563;
  font-style: italic;
}
.post-content img { width: 100%; border-radius: 0.75rem; border: 1px solid #e5e7eb; margin: 1rem 0; }
.post-content code { background: #f3f4f6; color: #1f2937; padding: 0.125rem 0.375rem; border-radius: 0.25rem; font-size: 0.9em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.post-content pre {
  background: #111827;
  color: #4ade80;
  border-radius: 0.75rem;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin: 1.5rem 0;
}
.post-content pre code { background: none; color: inherit; padding: 0; }

/* ---------- Key Takeaways / Table of Contents callout blocks ---------- */
/* Common blocks from external content tools (e.g. Outrank/GetAutoSEO-style
   output) — adapted from that tool's own reference CSS to this theme's
   actual content wrapper (.post-content, not .post-body) and indigo palette,
   rather than the arbitrary sky-blue/purple accents it shipped with. */
.post-content .key-takeaways {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid #c7d2fe;
  border-left: 4px solid #4f46e5;
  border-radius: 0.75rem;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  clear: both;
}
.post-content .key-takeaways h2 {
  font-size: 1.0625rem;
  margin: 0 0 0.75rem;
  color: #3730a3;
}
.post-content .key-takeaways ul { margin: 0; padding-left: 1.25rem; }
.post-content .key-takeaways li { margin-bottom: 0.5rem; }
.post-content .key-takeaways li:last-child { margin-bottom: 0; }

.post-content .table-of-contents {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border: 1px solid #e5e7eb;
  border-left: 4px solid #6b7280;
  border-radius: 0.75rem;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.post-content .table-of-contents h2 { font-size: 1.0625rem; margin: 0 0 0.75rem; }
.post-content .table-of-contents ul { margin: 0; padding-left: 0; list-style: none; }
.post-content .table-of-contents li { margin-bottom: 0.5rem; padding-left: 1.25rem; position: relative; }
.post-content .table-of-contents li::before { content: "→"; position: absolute; left: 0; color: #4f46e5; }
.post-content .table-of-contents a { color: #374151; text-decoration: none; font-weight: 500; }
.post-content .table-of-contents a:hover { color: #4f46e5; text-decoration: underline; }

/* Deliberately-marked keyword highlight — not applied to every <strong>,
   only content explicitly wrapped in .keyword-highlight, since blanket-
   highlighting all bold text site-wide would be visually noisy. */
.post-content .keyword-highlight {
  background-color: #fef08a;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* Generic "download / edit" resource CTA card some content includes.
   Two naming variants supported since source content isn't consistent
   about which it uses. */
.post-content .wp-custom-section,
.post-content .bw-doc-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  margin: 2rem 0;
}
.post-content .wp-custom-image,
.post-content .bw-doc-left { flex: 1 1 200px; text-align: center; }
.post-content .wp-custom-image img,
.post-content .bw-doc-thumb {
  width: 100%;
  max-width: 200px;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.1);
  margin: 0 auto;
}
.post-content .wp-custom-content,
.post-content .bw-doc-right { flex: 2 1 300px; }
.post-content .wp-custom-content h2,
.post-content .bw-doc-title { margin: 0 0 0.5rem; font-size: 1.375rem; }
.post-content .wp-custom-content p,
.post-content .bw-doc-desc { margin: 0 0 1rem; color: #6b7280; }
.post-content .btn-container,
.post-content .bw-doc-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.post-content .btn,
.post-content .bw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: filter .15s ease, transform .15s ease;
}
.post-content .btn-download,
.post-content .bw-btn-download { background: #4f46e5; color: #ffffff !important; }
.post-content .btn-edit,
.post-content .bw-btn-edit { background: #ffffff; color: #4f46e5 !important; border: 2px solid #4f46e5; }
.post-content .btn:hover,
.post-content .bw-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
@media (max-width: 640px) {
  .post-content .wp-custom-section,
  .post-content .bw-doc-section { text-align: center; }
  .post-content .btn-container,
  .post-content .bw-doc-buttons { justify-content: center; }
}

/* ---------- Comments (WP native comment_form() / wp_list_comments()) ---------- */
.post-comments { max-width: none; margin: 2.5rem 0 0; }
.post-comments > h2 { font-size: 1.25rem; font-weight: 700; color: #111827; margin-bottom: 1.25rem; }

/* Existing comments */
.comment-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.comment-list li {
  display: flex;
  gap: 0.875rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.comment-list li::before {
  content: attr(data-initial);
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: #e0e7ff;
  color: #4338ca;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.comment-list .post-author-name { font-size: 0.9375rem; font-weight: 600; color: #111827; }
.comment-list time { display: block; font-size: 0.75rem; color: #9ca3af; margin: 0.125rem 0 0.5rem; }
.comment-list .comment-body-text { color: #374151; font-size: 0.9375rem; line-height: 1.6; }

/* Comment form — wraps the .comment-respond block WP renders */
.post-comments .comment-respond {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.75rem;
}
.comment-reply-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.375rem;
}
.comment-notes {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0 0 1.25rem;
}
.comment-form .required { color: #dc2626; }
.comment-form p { margin: 0 0 1rem; }
.comment-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font: inherit;
  color: #111827;
  background: #f9fafb;
  transition: border-color .15s ease, background-color .15s ease;
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: #4f46e5;
  background: #ffffff;
}
.comment-form textarea { min-height: 7rem; resize: vertical; }
@media (min-width: 640px) {
  .comment-form-author, .comment-form-email { display: inline-block; width: calc(50% - 0.5rem); vertical-align: top; }
  .comment-form-author { margin-right: 1rem; }
}
.comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #6b7280;
}
.comment-form-cookies-consent input { margin-top: 0.1875rem; }
.comment-form-cookies-consent label { margin: 0; font-weight: 400; }
.comment-form .form-submit { margin-top: 1.25rem; margin-bottom: 0; }
.comment-form .form-submit input {
  background: #4f46e5;
  color: #ffffff;
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease;
}
.comment-form .form-submit input:hover { background: #4338ca; }

/* ---------- Blog index ---------- */
.blog-index { max-width: 72rem; margin: 0 auto; padding: 3rem 1rem; }
@media (min-width: 640px) { .blog-index { padding: 3rem 1.5rem; } }
.blog-index__grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .blog-index__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .blog-index__grid { grid-template-columns: repeat(3, 1fr); } }
.blog-index__card {
  display: block;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  overflow: hidden;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.blog-index__card:hover { border-color: #c7d2fe; box-shadow: 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.blog-index__card img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; background: #4f46e5; }
.blog-index__card-body { padding: 1.25rem; }
.blog-index__card h2 { font-size: 1.0625rem; font-weight: 700; color: #111827; margin: 0.5rem 0; }
.blog-index__card p { font-size: 0.875rem; color: #6b7280; margin: 0; }

/* ---------- Pagination (the_posts_pagination() default markup) ---------- */
.blog-pagination { max-width: 72rem; margin: 2.5rem auto 0; padding: 0 1rem; }
@media (min-width: 640px) { .blog-pagination { padding: 0 1.5rem; } }
.blog-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}
.blog-pagination a.page-numbers:hover { border-color: #c7d2fe; color: #4338ca; background: #eef2ff; }
.blog-pagination .page-numbers.current { background: #4f46e5; border-color: #4f46e5; color: #ffffff; }
.blog-pagination .page-numbers.dots { border: none; background: none; color: #9ca3af; }
.blog-pagination .prev.page-numbers,
.blog-pagination .next.page-numbers { padding: 0 1rem; }
