/* ============================================================
   Point Numera Blog — main.css
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400&display=swap');

/* Ancizar Sans — self-hosted variable font */
@font-face {
  font-family: 'Ancizar Sans';
  src: url('/assets/fonts/AncizarSans-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Ancizar Sans';
  src: url('/assets/fonts/AncizarSans-Italic-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ============================================================
   Design Tokens
   ============================================================ */

:root {
  /* Colors */
  --green-primary:  #0E4F47;
  --green-secondary: #A4D6A4;
  --yellow:         #F4ECBD;
  --dark:           #0a0f0e;
  --dark-surface:   #111a18;
  --dark-border:    #1e2e2b;
  --text-primary:   #f0ede4;
  --text-muted:     #8a9e9a;
  --error:          #e65c5c;
  --success:        #4ecb71;
  --warning:        #e6c35c;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  32px;
  --space-xl:  64px;
  --space-xxl: 96px;

  /* Border radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--dark);
  color: var(--text-primary);
  font-family: 'PT Sans', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* ============================================================
   Reading Progress Bar
   ============================================================ */

#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background-color: var(--yellow);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ============================================================
   Navigation
   ============================================================ */

#site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: transparent;
  transition: background-color 200ms ease;
}

#site-nav.scrolled {
  background-color: var(--green-primary);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  height: 32px;
  display: block;
}

.nav-cta {
  background-color: var(--yellow);
  color: var(--dark);
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-family: 'PT Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  transition: opacity 200ms ease;
  white-space: nowrap;
}

.nav-cta:hover {
  opacity: 0.88;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: 200ms ease;
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: var(--dark);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

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

.nav-overlay a {
  color: var(--text-primary);
  font-size: 24px;
  font-family: 'Ancizar Sans', 'PT Sans', Georgia, serif;
  font-weight: 600;
  text-decoration: none;
  transition: color 200ms ease;
}

.nav-overlay a:hover {
  color: var(--yellow);
}

/* ============================================================
   Homepage Hero
   ============================================================ */

.home-hero {
  background-color: var(--green-primary);
  padding: 96px 24px 80px;
  text-align: center;
}

.home-hero .eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.home-hero h1 {
  font-family: 'Ancizar Sans', 'PT Sans', Georgia, serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
}

.home-hero .subtitle {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 560px;
  margin: 16px auto 0;
}

/* ============================================================
   Category Filter
   ============================================================ */

.category-filter {
  background-color: var(--dark);
  padding: 28px 24px 0;
}

.category-filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  background: transparent;
  border: 1px solid var(--dark-border);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-family: 'PT Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease, background-color 200ms ease;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.filter-pill.active {
  background-color: var(--yellow);
  color: var(--dark);
  border-color: var(--yellow);
  font-weight: 700;
}

/* ============================================================
   Post Grid
   ============================================================ */

.post-grid-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

/* ============================================================
   Post Card
   ============================================================ */

.post-card {
  background-color: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  transition: border-color 200ms ease;
}

.post-card:hover {
  border-color: var(--yellow);
}

.post-card .card-link {
  display: flex;
  flex-direction: column;
  padding: 24px;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.card-category {
  display: inline-block;
  border: 1px solid var(--green-secondary);
  color: var(--green-secondary);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  margin-bottom: 12px;
  text-transform: capitalize;
}

.card-title {
  font-family: 'Ancizar Sans', 'PT Sans', Georgia, serif;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 10px;
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
  margin-bottom: 0;
}

.card-meta {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--dark-border);
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  gap: 16px;
}

/* ============================================================
   Pagination
   ============================================================ */

.pagination {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.page-btn {
  background: transparent;
  border: 1px solid var(--dark-border);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-family: 'PT Sans', sans-serif;
  font-size: 14px;
  text-decoration: none;
  transition: border-color 200ms ease, color 200ms ease, background-color 200ms ease;
}

.page-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.page-btn.active {
  background-color: var(--yellow);
  color: var(--dark);
  border-color: var(--yellow);
  font-weight: 700;
}

/* ============================================================
   Post Hero
   ============================================================ */

.post-hero {
  background-color: var(--green-primary);
  padding: 80px 24px 64px;
  text-align: center;
}

.post-hero .post-category {
  display: inline-block;
  border: 1px solid var(--green-secondary);
  color: var(--green-secondary);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  margin-bottom: 20px;
  text-transform: capitalize;
}

.post-hero h1 {
  font-family: 'Ancizar Sans', 'PT Sans', Georgia, serif;
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  max-width: 840px;
  margin: 0 auto 16px;
}

.post-hero .post-excerpt {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 24px;
}

.post-hero .post-meta {
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   Post Body
   ============================================================ */

.post-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px;
}

.post-body h2 {
  font-family: 'Ancizar Sans', 'PT Sans', Georgia, serif;
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 48px 0 16px;
}

.post-body h3 {
  font-family: 'Ancizar Sans', 'PT Sans', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 32px 0 12px;
}

.post-body p {
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.post-body ul,
.post-body ol {
  margin-bottom: 24px;
  padding-left: 24px;
  list-style: initial;
}

.post-body ol {
  list-style: decimal;
}

.post-body li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--text-primary);
}

.post-body a {
  color: var(--green-secondary);
  text-decoration: none;
  transition: text-decoration 200ms ease;
}

.post-body a:hover {
  text-decoration: underline;
}

.post-body strong {
  color: var(--text-primary);
  font-weight: 700;
}

.post-body em {
  font-style: italic;
}

.post-body blockquote {
  border-left: 4px solid var(--dark-border);
  padding: 16px 24px;
  margin: 32px 0;
  color: var(--text-muted);
  font-style: italic;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--dark-border);
  margin: 48px 0;
}

.post-body img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 32px auto;
}

.post-body img + em {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 8px;
}

.post-body code {
  background-color: var(--dark-surface);
  border: 1px solid var(--dark-border);
  color: var(--yellow);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 14px;
}

.post-body pre {
  background-color: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 32px 0;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--yellow);
  font-size: 14px;
}

/* ============================================================
   Callout
   ============================================================ */

.callout {
  padding: 20px 24px;
  border-radius: var(--radius-md);
  margin: 32px 0;
}

.callout p {
  margin-bottom: 0;
}

.callout[data-type="insight"] {
  background-color: var(--green-primary);
  color: var(--text-primary);
}

.callout[data-type="tip"] {
  background-color: var(--dark-surface);
  border-left: 3px solid var(--yellow);
  color: var(--text-primary);
}

.callout[data-type="warning"] {
  background-color: var(--dark-surface);
  border-left: 3px solid var(--error);
  color: var(--text-primary);
}

.callout[data-type="example"] {
  background-color: var(--dark-surface);
  border-left: 3px solid var(--green-secondary);
  color: var(--text-primary);
}

/* ============================================================
   Pull Quote
   ============================================================ */

.pullquote {
  font-family: 'PT Sans', sans-serif;
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700;
  font-style: italic;
  color: var(--yellow);
  border-left: 4px solid var(--yellow);
  padding: 16px 24px;
  margin: 40px 0;
  line-height: 1.4;
}

/* ============================================================
   CTA Block
   ============================================================ */

.cta-block {
  background-color: var(--green-primary);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  margin: 48px 0;
  text-align: center;
}

.cta-heading {
  font-family: 'Ancizar Sans', 'PT Sans', Georgia, serif;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.2;
}

.cta-subtext {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.cta-button {
  display: inline-block;
  background-color: var(--yellow);
  color: var(--dark);
  font-family: 'PT Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: opacity 200ms ease;
  border: none;
}

.cta-button:hover {
  opacity: 0.88;
}

/* ============================================================
   Related Posts
   ============================================================ */

.related-posts {
  background-color: var(--dark-surface);
  padding: 64px 24px;
}

.related-heading {
  max-width: 1200px;
  margin: 0 auto 32px;
  font-family: 'Ancizar Sans', 'PT Sans', Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.related-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

/* ============================================================
   Post Navigation (prev/next)
   ============================================================ */

.post-nav {
  background-color: var(--green-primary);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.post-nav-item {
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  transition: background-color 200ms ease;
}

.post-nav-item:hover {
  background-color: rgba(0, 0, 0, 0.15);
}

.post-nav-item:first-child {
  border-right: 1px solid var(--dark-border);
}

.post-nav-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.post-nav-title {
  font-family: 'Ancizar Sans', 'PT Sans', Georgia, serif;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.3;
}

/* ============================================================
   404 Page
   ============================================================ */

.page-404 {
  background-color: var(--dark);
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px;
}

.error-code {
  font-family: 'Ancizar Sans', 'PT Sans', Georgia, serif;
  font-size: clamp(80px, 15vw, 160px);
  color: var(--yellow);
  line-height: 1;
  margin-bottom: 16px;
}

.page-404 h1 {
  font-family: 'Ancizar Sans', 'PT Sans', Georgia, serif;
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.page-404 p {
  color: var(--text-muted);
  font-size: 17px;
  margin-bottom: 32px;
  max-width: 480px;
}

.page-404-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  background-color: var(--yellow);
  color: var(--dark);
  font-family: 'PT Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: opacity 200ms ease;
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--text-primary);
  font-family: 'PT Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--text-primary);
  text-decoration: none;
  transition: border-color 200ms ease, color 200ms ease;
}

.btn-secondary:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

/* ============================================================
   Footer
   ============================================================ */

#site-footer {
  background-color: var(--green-primary);
  padding: 64px 24px 32px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-logo {
  height: 28px;
  filter: brightness(0) invert(1);
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 8px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 200ms ease;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 13px;
}

.footer-rss {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-rss a {
  color: var(--green-secondary);
  text-decoration: none;
}

.footer-rss a:hover {
  text-decoration: underline;
}

/* ============================================================
   Utilities
   ============================================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Responsive — Tablet (768px+)
   ============================================================ */

@media (min-width: 768px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-copy {
    text-align: right;
  }
}

/* ============================================================
   Responsive — Desktop (1024px+)
   ============================================================ */

@media (min-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr 1fr;
    align-items: start;
  }

  .nav-hamburger {
    display: none;
  }

  .nav-cta {
    display: inline-block;
  }
}

/* ============================================================
   Responsive — Mobile nav
   ============================================================ */

@media (max-width: 1023px) {
  .nav-cta {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }
}

@media (max-width: 600px) {
  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-item:first-child {
    border-right: none;
    border-bottom: 1px solid var(--dark-border);
  }

  .cta-block {
    padding: 40px 24px;
  }
}
