/*
 * Shared presentation for Forage's public, crawlable surfaces.
 * Structure and route behavior stay in their owning templates/handlers.
 */
:root {
  --public-ink: #20170f;
  --public-muted: #6f665d;
  --public-paper: #fffaf0;
  --public-card: rgba(255, 255, 255, 0.82);
  --public-line: rgba(107, 79, 46, 0.18);
  --public-accent: #6b4f2e;
  --public-accent-strong: #51381f;
  --public-focus: #d56f16;
  --public-radius: 18px;
  --public-shadow: 0 18px 50px rgba(66, 41, 18, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  text-rendering: optimizeLegibility;
}

a,
button,
input,
textarea,
select,
[tabindex] {
  -webkit-tap-highlight-color: transparent;
}

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--public-focus) !important;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--public-ink);
  font: 600 13px/1 "Space Grotesk", system-ui, sans-serif;
  text-decoration: none;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Planet, author stream, and article detail */
.blog-header {
  position: relative;
}

.blog-header::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin: 24px auto 0;
  background: var(--secondary, #e88d2a);
}

.blog-meta-bar {
  flex-wrap: wrap;
}

.blog-meta-bar a,
.post-footer a,
.back-link,
.read-more {
  border-radius: 999px;
}

.blog-feed {
  display: grid;
  gap: 20px;
}

.blog-post {
  overflow: clip;
  padding: clamp(20px, 4vw, 32px) !important;
  border: 1px solid var(--public-line) !important;
  border-radius: var(--public-radius);
  background: var(--public-card);
  box-shadow: var(--public-shadow);
}

.blog-post:last-child {
  border-bottom: 1px solid var(--public-line) !important;
}

.blog-post h2 {
  font-size: clamp(24px, 4vw, 34px) !important;
  line-height: 1.08;
}

.blog-post h2 a,
.post-header h1 {
  text-wrap: balance;
}

.blog-post h2 a:hover,
.blog-post h2 a:focus-visible {
  color: var(--public-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.blog-post .post-header {
  align-items: flex-start !important;
}

.blog-post .post-header img,
.author-avatar {
  width: 64px !important;
  height: 64px !important;
}

.blog-post .post-body,
.post-summary {
  color: #3f372f;
}

.post-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
}

.post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 15px;
  color: var(--public-paper);
  background: var(--public-accent);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.read-more:hover {
  background: var(--public-accent-strong);
}

.public-state {
  grid-column: 1 / -1;
  padding: clamp(32px, 8vw, 72px) 24px;
  border: 1px dashed var(--public-line);
  border-radius: var(--public-radius);
  color: var(--public-muted);
  background: rgba(255, 255, 255, 0.52);
  text-align: center;
}

.public-state[hidden] {
  display: none;
}

.public-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--public-ink);
  font-family: "Newsreader", Georgia, serif;
  font-size: 22px;
  font-style: italic;
}

.public-state button {
  margin-top: 16px;
  padding: 9px 16px;
  border: 1px solid var(--public-accent);
  border-radius: 999px;
  color: var(--public-accent);
  background: transparent;
  font: 600 13px "Space Grotesk", system-ui, sans-serif;
  cursor: pointer;
}

.post-header,
.post-content,
.comments-section {
  width: min(760px, 100%);
}

.post-header h1 {
  font-size: clamp(38px, 8vw, 64px) !important;
  line-height: 0.98 !important;
}

.post-content {
  font-size: clamp(17px, 2vw, 19px);
}

/* Landing and invite dialog */
.landing-learn a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255, 249, 237, 0.9) !important;
  background: rgba(10, 9, 8, 0.52);
  backdrop-filter: blur(8px);
}

.landing-learn a:hover {
  color: #fff9ed !important;
  background: rgba(10, 9, 8, 0.78);
}

.landing-about {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: clamp(80px, 12vw, 150px) 24px;
  color: #fff9ed;
  background:
    radial-gradient(circle at 20% 10%, rgba(137, 77, 13, 0.28), transparent 36rem),
    #0a0908;
}

.landing-about__inner {
  width: min(960px, 100%);
  margin: 0 auto;
}

.landing-about__eyebrow {
  color: #e9b879;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.landing-about h2 {
  max-width: 820px;
  margin: 14px 0 24px;
  font: italic 500 clamp(42px, 9vw, 92px) / 0.94 "Newsreader", Georgia, serif;
  text-wrap: balance;
}

.landing-about__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.landing-about__card {
  padding: 24px;
  border: 1px solid rgba(255, 249, 237, 0.16);
  border-radius: 18px;
  background: rgba(255, 249, 237, 0.06);
}

.landing-about__card h3 {
  margin-bottom: 8px;
  font: italic 500 24px/1.1 "Newsreader", Georgia, serif;
}

.landing-about__card p {
  color: rgba(255, 249, 237, 0.68);
  font-size: 14px;
  line-height: 1.65;
}

.token-modal[hidden] {
  display: none;
}

.token-modal {
  padding: 24px;
}

.token-box {
  position: relative;
  width: min(430px, 100%);
  border: 1px solid rgba(255, 249, 237, 0.15);
  border-radius: 18px;
  background: rgba(18, 14, 10, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.token-box .close-btn {
  top: 12px;
  right: 12px;
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
}

.token-box input {
  min-height: 48px;
}

.token-status {
  min-height: 22px;
  margin: 12px 0 0 !important;
}

.token-status[data-state="error"] {
  color: #ffb4a7;
}

.token-status[data-state="success"] {
  color: #9ce9bd;
}

@media (max-width: 720px) {
  .blog-feed {
    padding-inline: 14px !important;
  }

  .blog-post {
    border-radius: 14px;
  }

  .blog-post .post-header {
    gap: 12px !important;
  }

  .blog-post .post-header img,
  .author-avatar {
    width: 48px !important;
    height: 48px !important;
  }

  .blog-post .post-meta-line {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 2px;
  }

  .landing-about__grid {
    grid-template-columns: 1fr;
  }

  .token-box {
    padding: 34px 22px 24px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
