@import url("https://fonts.googleapis.com/css2?family=Great+Vibes&family=Montserrat:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&display=swap");
@import "./tokens.css";

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  background: var(--btp-cream);
  color: var(--btp-evergreen);
  font-family: var(--btp-font-body);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 90% 55% at 0% -10%, rgba(231, 201, 189, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(138, 154, 132, 0.16), transparent 50%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--btp-terracotta);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--btp-evergreen);
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--btp-terracotta);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 100;
  background: var(--btp-evergreen);
  color: var(--btp-cream);
  padding: 0.65rem 1rem;
  font-weight: 600;
}

.skip:focus {
  top: 12px;
}

/* Header — match marketing site */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--btp-header-h);
  background: rgba(248, 244, 238, 0.82);
  backdrop-filter: saturate(1.1) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--btp-border);
  box-shadow: 0 10px 30px rgba(33, 56, 46, 0.05);
  background: rgba(248, 244, 238, 0.94);
}

.header-inner {
  width: var(--btp-wrap);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--btp-evergreen);
}

.brand .mark {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand .wordmark {
  height: 28px;
  width: auto;
  max-width: min(200px, 38vw);
  object-fit: contain;
}

@media (max-width: 720px) {
  .brand .wordmark {
    display: none;
  }
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--btp-border);
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--btp-evergreen);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle span::before {
  top: -6px;
}

.nav-toggle span::after {
  top: 6px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.nav a,
.nav-dropdown summary {
  text-decoration: none;
  color: var(--btp-evergreen);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav a:hover,
.nav a.is-current,
.nav-dropdown summary:hover {
  color: var(--btp-terracotta);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown .drop {
  display: none;
  position: absolute;
  top: calc(100% + 0.9rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  padding: 0.85rem;
  background: var(--btp-surface);
  border: 1px solid var(--btp-terracotta);
  box-shadow: var(--btp-shadow);
  z-index: 30;
}

.nav-dropdown[open] .drop {
  display: grid;
  gap: 0.2rem;
}

.nav-dropdown .drop a {
  padding: 0.5rem 0.4rem;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-cta,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.4rem;
  border: 1px solid var(--btp-evergreen);
  background: var(--btp-evergreen);
  color: var(--btp-cream) !important;
  text-decoration: none !important;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.nav-cta {
  padding: 0.7rem 1.05rem;
}

.btn:hover,
.nav-cta:hover {
  background: var(--btp-terracotta);
  border-color: var(--btp-terracotta);
  transform: translateY(-1px);
}

/* Blog surfaces */
.eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--btp-terracotta);
}

.blog-hero {
  padding: clamp(3.5rem, 8vw, 5.5rem) 0 2rem;
  border-bottom: 1px solid var(--btp-border);
  background: linear-gradient(135deg, rgba(231, 201, 189, 0.35), rgba(248, 244, 238, 0.9));
}

.blog-hero.compact {
  padding: 3rem 0 1.5rem;
}

.blog-hero-inner {
  width: var(--btp-wrap);
  margin: 0 auto;
}

.blog-hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--btp-font-display);
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  font-weight: 600;
  line-height: 1.22;
  max-width: 36ch;
  text-wrap: balance;
}

.hero-lead {
  margin: 0;
  max-width: 40ch;
  color: var(--btp-text-muted);
  font-size: 1.08rem;
}

.tag-pillar {
  margin: 1rem 0 0;
}

.feed {
  padding: 3rem 0 4.5rem;
}

.feed-inner {
  width: var(--btp-wrap);
  margin: 0 auto;
}

.post-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.post-card {
  display: grid;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--btp-border);
  background: rgba(255, 253, 249, 0.75);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--btp-terracotta);
}

.post-card-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--btp-bg-deep);
}

.post-card-media--empty {
  background: linear-gradient(135deg, #efe8dc, #e7c9bd);
}

.post-card-body {
  padding: 1.25rem 1.2rem 1.4rem;
}

.post-card h2 {
  margin: 0 0 0.5rem;
  font-family: var(--btp-font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}

.post-card p {
  margin: 0;
  color: var(--btp-text-muted);
  font-size: 0.95rem;
}

.post-meta {
  margin-top: 0.75rem !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--btp-sage) !important;
}

.empty-feed {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed var(--btp-border);
  color: var(--btp-text-muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--btp-border);
}

.page-num {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--btp-text-muted);
}

.text-link {
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--btp-evergreen);
  border-bottom: 1px solid var(--btp-terracotta);
  padding-bottom: 0.15rem;
}

.article {
  padding-bottom: 4rem;
}

.article-hero {
  width: min(720px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.5rem) 0 1.5rem;
}

.page-template .article:not(:has(.article-hero)) {
  padding-top: clamp(3rem, 6vw, 4.5rem);
}

.article-hero h1 {
  margin: 0 0 0.85rem;
  font-family: var(--btp-font-display);
  font-size: clamp(2.1rem, 4vw, 3rem);
  line-height: 1.15;
}

.article-feature {
  width: min(960px, calc(100% - 2.5rem));
  margin: 0 auto 2rem;
}

.article-feature img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-body {
  width: min(680px, calc(100% - 2.5rem));
  margin: 0 auto;
  font-size: 1.08rem;
}

.article-body > * + * {
  margin-top: 1.15rem;
}

.article-village-cta {
  width: min(680px, calc(100% - 2.5rem));
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--btp-border);
}

/* A post whose own closing already invites to The Village does not get a second invitation. */
.article-body:has(a[href*="skool.com/the-village-by-beyond-the-plan-2795"]) + .article-village-cta {
  display: none;
}

.gh-content h2,
.gh-content h3 {
  font-family: var(--btp-font-display);
  line-height: 1.2;
}

.gh-content a {
  color: var(--btp-terracotta);
}

.gh-content blockquote {
  border-left: 2px solid var(--btp-terracotta);
  padding-left: 1rem;
  font-family: var(--btp-font-display);
  font-style: italic;
  margin: 1.5rem 0;
}

/* Footer — match marketing site */
.site-footer {
  padding: 3.5rem 0 2rem;
  background: #efe8dc;
  border-top: 1px solid var(--btp-border);
}

.footer-top {
  width: var(--btp-wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 3rem;
}

.footer-brand img {
  width: min(220px, 70%);
  height: auto;
  margin-bottom: 0.85rem;
}

.footer-brand p {
  margin: 0;
  color: var(--btp-text-muted);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.site-footer h2 {
  margin: 0 0 0.9rem;
  font-family: var(--btp-font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.site-footer a {
  text-decoration: none;
  color: var(--btp-text-muted);
  font-size: 0.92rem;
}

.footer-meta {
  width: var(--btp-wrap);
  margin: 2.25rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--btp-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--btp-text-muted);
  font-size: 0.8rem;
}

@media (max-width: 980px) {
  .post-grid,
  .footer-top,
  .footer-cols {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: grid;
  }

  .nav {
    position: fixed;
    inset: var(--btp-header-h) 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem;
    background: var(--btp-cream);
    border-bottom: 1px solid var(--btp-border);
    max-height: calc(100dvh - var(--btp-header-h));
    overflow: auto;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a,
  .nav-dropdown summary {
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--btp-border);
  }

  .nav-dropdown .drop {
    position: static;
    transform: none;
    display: none;
    min-width: 0;
    margin: 0.35rem 0 0.75rem;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0 0 0 0.75rem;
  }

  .nav-dropdown[open] .drop {
    display: grid;
  }

  .nav-cta {
    margin-top: 1rem;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
