/*
 * Hand-translated from the Tailwind utility classes + design tokens used by
 * components/layout/Header.tsx and components/layout/Footer.tsx in the main
 * Next.js app (see tailwind.config.ts for the brand/ink/surface color scale),
 * plus a simple typography system for post content.
 */

:root {
  --brand-primary: #1B4332;
  --brand-accent: #52B788;
  --brand-gold: #D4A017;
  --ink: #0F1419;
  --ink-light: #3D4852;
  --ink-muted: #7B8794;
  --surface: #FAFAF8;
  --surface-2: #F3F4F0;
  --surface-3: #E8EAE3;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, 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: rgba(255,255,255,0.95);
  border-bottom: 1px solid var(--surface-3);
  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.1875rem; }
.site-nav__links { display: none; align-items: center; gap: 0.25rem; }
@media (min-width: 768px) { .site-nav__links { display: flex; } }
.site-nav__links > a {
  color: var(--ink-light);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}
.site-nav__links > a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav__right { display: flex; align-items: center; gap: 0.75rem; }
.site-nav__cta {
  display: none;
  background: var(--brand-gold);
  color: #ffffff !important;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  transition: filter .15s ease;
}
@media (min-width: 768px) { .site-nav__cta { display: inline-flex; } }
.site-nav__cta:hover { filter: brightness(0.92); }
.site-nav__mobile-cta {
  display: block;
  margin-top: 0.75rem;
  text-align: center;
  background: var(--brand-gold);
  color: #ffffff !important;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
}

.site-nav__dropdown { position: relative; }
.site-nav__dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-light);
  background: none;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.site-nav__dropdown-trigger:hover { color: var(--ink); background: var(--surface-2); }
.site-nav__dropdown-trigger svg { color: var(--ink-muted); opacity: 0.6; transition: transform .15s ease; }
.site-nav__dropdown-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }

.site-nav__mega {
  display: none;
  position: absolute;
  left: 0;
  top: 2.75rem;
  width: 55rem;
  max-width: 90vw;
  background: #ffffff;
  border: 1px solid var(--surface-3);
  border-radius: 1rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  padding: 1.25rem;
  z-index: 50;
}
.site-nav__mega.is-open { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (min-width: 1024px) { .site-nav__mega.is-open { grid-template-columns: repeat(6, 1fr); } }
.site-nav__mega-col p {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--surface-3);
}
.site-nav__mega-col ul { list-style: none; margin: 0; padding: 0; }
.site-nav__mega-col li a {
  display: block;
  padding: 0.3rem 0;
  font-size: 0.8125rem;
  color: var(--ink-light);
}
.site-nav__mega-col li a:hover { color: var(--ink); }

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

.site-nav__mobile { display: none; padding: 0.5rem 0 1rem; }
.site-nav__mobile.is-open { display: block; }
.site-nav__mobile > a {
  display: block;
  padding: 0.625rem 0.5rem;
  color: var(--ink-light);
  border-radius: 0.5rem;
  font-size: 0.9375rem;
}
.site-nav__mobile > a:hover { background: var(--surface-2); }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-primary); color: rgba(255,255,255,0.6); }
.site-footer__inner { max-width: 72rem; margin: 0 auto; padding: 4rem 1rem; }
@media (min-width: 640px) { .site-footer__inner { padding: 4rem 1.5rem; } }

.site-footer__grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; margin-bottom: 3rem; }
@media (min-width: 768px) { .site-footer__grid { grid-template-columns: 1fr 2fr 1fr 1fr; } }

.site-footer__brand { grid-column: span 1; }
.site-footer__logo { height: 2.1875rem; width: auto; filter: brightness(0) invert(1); margin-bottom: 1rem; }
.site-footer__brand p { font-size: 0.875rem; line-height: 1.6; margin: 0; }

.site-footer__col--wide { grid-column: span 2; }
.site-footer__col h3 {
  color: var(--brand-accent);
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem;
}
.site-footer__col-heading-spaced { margin-top: 2rem !important; }
.site-footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.875rem; }
.site-footer__col ul.site-footer__two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1.5rem; }
.site-footer__col a:hover { color: #ffffff; }

.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
}
@media (min-width: 768px) { .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: 1.5rem; }
.site-footer__bottom-links a:hover { color: rgba(255,255,255,0.7); }

/* ---------- 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: var(--ink-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}
.post-back:hover { color: var(--ink); }
.post-card {
  background: #ffffff;
  border: 1px solid var(--surface-3);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(15,20,25,.06), 0 1px 2px -1px rgba(15,20,25,.06);
}
.post-thumb { width: 100%; aspect-ratio: 1200 / 630; background: var(--brand-primary); object-fit: cover; }
.post-body { padding: 2rem; }
.post-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--brand-primary);
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
}
.post-title { font-family: Georgia, serif; font-size: 1.875rem; font-weight: 700; color: var(--ink); 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 var(--surface-3); }
.post-byline time, .post-byline .post-author { font-size: 0.75rem; color: var(--ink-muted); }
.post-author-name { font-size: 0.875rem; font-weight: 600; color: var(--ink); }

.post-content { color: var(--ink-light); line-height: 1.75; max-width: none; }
.post-content h1 { font-family: Georgia, serif; font-size: 1.875rem; font-weight: 700; color: var(--ink); margin: 0 0 1.5rem; }
.post-content h2 { font-family: Georgia, serif; font-size: 1.5rem; font-weight: 700; color: var(--ink); margin: 3rem 0 1rem; }
.post-content h3 { font-family: Georgia, serif; font-size: 1.125rem; font-weight: 600; color: var(--ink); margin: 2rem 0 0.5rem; }
.post-content p { margin: 0 0 1rem; }
.post-content a { color: var(--brand-primary); text-decoration: underline; }
.post-content strong { font-weight: 700; color: var(--ink); }
.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 var(--brand-accent);
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--ink-muted);
  font-style: italic;
}
.post-content img { width: 100%; border-radius: 0.75rem; border: 1px solid var(--surface-3); margin: 1rem 0; }
.post-content code { background: var(--surface-2); color: var(--ink); 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: var(--surface-2);
  color: var(--ink);
  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; padding: 0; }

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  overflow-x: auto;
  display: block;
}
.post-content th, .post-content td {
  padding: 0.625rem 1rem;
  border: 1px solid var(--surface-3);
  text-align: left;
}
.post-content th { background: var(--surface-2); font-weight: 600; color: var(--ink); }

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

.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 var(--surface-3);
}
.comment-list li::before {
  content: attr(data-initial);
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: var(--surface-2);
  color: var(--brand-primary);
  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: var(--ink); }
.comment-list time { display: block; font-size: 0.75rem; color: var(--ink-muted); margin: 0.125rem 0 0.5rem; }
.comment-list .comment-body-text { color: var(--ink-light); font-size: 0.9375rem; line-height: 1.6; }

.post-comments .comment-respond {
  background: #ffffff;
  border: 1px solid var(--surface-3);
  border-radius: 1rem;
  padding: 1.75rem;
}
.comment-reply-title { font-size: 1.125rem; font-weight: 700; color: var(--ink); margin: 0 0 0.375rem; }
.comment-notes { font-size: 0.8125rem; color: var(--ink-muted); margin: 0 0 1.25rem; }
.comment-form .required { color: #C0392B; }
.comment-form p { margin: 0 0 1rem; }
.comment-form label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--ink-light); 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 var(--surface-3);
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  transition: border-color .15s ease, background-color .15s ease;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--brand-accent); 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: var(--ink-muted); }
.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: var(--brand-primary);
  color: #ffffff;
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s ease;
}
.comment-form .form-submit input:hover { filter: brightness(1.1); }

/* ---------- 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); } }
.blog-index__card {
  display: block;
  background: #ffffff;
  border: 1px solid var(--surface-3);
  border-radius: 1rem;
  overflow: hidden;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.blog-index__card:hover { border-color: var(--brand-accent); box-shadow: 0 8px 24px -4px rgba(15,20,25,.12); transform: translateY(-2px); }
.blog-index__card img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--brand-primary); }
.blog-index__card-fallback {
  width: 100%;
  aspect-ratio: 1200 / 630;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom right, var(--brand-primary), #12251d);
}
.blog-index__card-fallback span { color: rgba(255,255,255,0.9); font-weight: 700; font-size: 1.125rem; padding: 0 1rem; text-align: center; }
.blog-index__card-body { padding: 1.25rem; }
.blog-index__card h2 { font-family: Georgia, serif; font-size: 1.0625rem; font-weight: 700; color: var(--ink); margin: 0.5rem 0; }
.blog-index__card p { font-size: 0.875rem; color: var(--ink-muted); 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: var(--ink-light);
  background: #ffffff;
  border: 1px solid var(--surface-3);
}
.blog-pagination a.page-numbers:hover { border-color: var(--brand-accent); color: var(--brand-primary); background: var(--surface-2); }
.blog-pagination .page-numbers.current { background: var(--brand-primary); border-color: var(--brand-primary); color: #ffffff; }
.blog-pagination .page-numbers.dots { border: none; background: none; color: var(--ink-muted); }
.blog-pagination .prev.page-numbers, .blog-pagination .next.page-numbers { padding: 0 1rem; }
