/* ============================================================
   Tellerio Stories — blog stylesheet.

   Base tokens (colors, fonts, stars canvas, media treatments)
   are lifted verbatim from the landing-page Cloudflare Worker
   at D:\Local Disk D\Projects\Tellerio\Tellerio Artworks\
   cloudflare-worker.js so /blog/ matches /get/ exactly.

   Blog-specific rules live in the BLOG ADDITIONS section at
   the end.
   ============================================================ */

/* ── Brand display font (used on top-level page titles only) ── */
@font-face {
  font-family: 'Lora';
  src: url('https://assets.cognicores.com/fonts/Lora-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Background: matches the app's gradient ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(to bottom, #1A0B2E 0%, #261738 50%, #0D1B2A 100%);
  color: #F8D27D;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Static star field — paints once, zero per-frame GPU cost ── */
#stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  /* No animation, no will-change — these would promote each star to its
     own composited layer and force per-frame GPU compositing. Static
     stars paint into the parent layer once and stay there. */
}

/* ── Main content ── */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 4rem 1.5rem 3rem;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
  color: #F8D27D;
}

/* ── Top-level brand title (Tellerio / Tellerio Stories) — Lora display font ── */
h1.brand-title {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  letter-spacing: 0;
}

.tagline {
  font-size: 1.15rem;
  opacity: 0.8;
  line-height: 1.6;
  max-width: 460px;
  text-align: center;
  margin: 0 auto 2.5rem;
}

/* ── Store badges ── */
.badges {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}
.badges a img {
  height: 52px;
  border-radius: 8px;
  transition: transform 0.2s;
}
.badges a img:hover { transform: scale(1.06); }

/* ── Video ── */
.video-wrapper {
  width: 100%;
  max-width: 720px;
  margin-bottom: 3.5rem;
}
.video-wrapper h2 {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.6;
  margin-bottom: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
.video-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ── Footer ── */
.footer {
  margin-top: 3rem;
  opacity: 0.55;
  font-size: 0.85rem;
  text-align: center;
}
.footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(248, 210, 125, 0.25);
  margin-left: 0.4em;
  transition: opacity 0.2s, border-color 0.2s;
}
.footer a:hover {
  opacity: 1;
  border-bottom-color: rgba(248, 210, 125, 0.7);
}
.footer .sep {
  opacity: 0.35;
  margin: 0 0.4em;
}

/* ── Mobile tweaks (from landing) ── */
@media (max-width: 600px) {
  h1 { font-size: 2.2rem; }
}


/* ============================================================
   BLOG ADDITIONS
   ============================================================ */

/* Shared container width for blog content */
.page-blog {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

/* Section labels (matches landing's uppercase-small h2 treatment) */
.section-label {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.6;
  margin-bottom: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── CTA card (primary + mid-story + post-story) ─────────── */
.cta-card {
  background: rgba(248, 210, 125, 0.08);
  border: 1px solid rgba(248, 210, 125, 0.25);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  margin: 2.5rem 0;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.cta-card .cta-headline {
  font-size: 1.4rem;
  font-weight: 700;
  color: #F8D27D;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.cta-card .cta-body {
  font-size: 1.05rem;
  opacity: 0.85;
  line-height: 1.55;
  margin-bottom: 1.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.cta-card .badges { margin-bottom: 0; }

.cta-card-compact {
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.cta-card-compact .cta-headline { font-size: 1.15rem; margin-bottom: 0.5rem; }
.cta-card-compact .cta-body { font-size: 0.95rem; margin-bottom: 1rem; }
.cta-card-compact .badges a img { height: 44px; }

/* ── Podcast audio player (gold-tinted, backdrop-blurred wrapper) ── */
.audio-wrapper {
  width: 100%;
  margin: 2rem 0 3rem;
  background: rgba(248, 210, 125, 0.08);
  border: 1px solid rgba(248, 210, 125, 0.25);
  border-radius: 14px;
  padding: 1.1rem 1.25rem 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.audio-wrapper .section-label {
  color: #F8D27D;
  text-align: left;
  margin-bottom: 0.85rem;
  opacity: 0.85;
}
.audio-wrapper audio.ap-audio { display: none; }

/* ── Custom audio player (replaces native <audio controls>) ───────
   Native chrome can't be made transparent — it's rendered by the
   browser as a fixed dark or light bar. We replace it with our own
   controls so the wrapper's gold tint + backdrop-blur show through. */
.ap-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.ap-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #F8D27D;
  color: #1A0B2E;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: transform 0.15s, opacity 0.2s;
}
.ap-toggle:hover { transform: scale(1.05); }
.ap-toggle:active { transform: scale(0.95); }
.ap-toggle:disabled { opacity: 0.5; cursor: wait; }
.ap-toggle svg { width: 18px; height: 18px; fill: currentColor; pointer-events: none; }
.ap-bar .ap-icon-pause { display: none; }
.ap-bar.playing .ap-icon-play  { display: none; }
.ap-bar.playing .ap-icon-pause { display: block; }
.ap-time {
  font-size: 0.8rem;
  color: rgba(248, 210, 125, 0.85);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 2.5em;
  text-align: center;
}
.ap-track {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  /* Bigger hit area without growing the visual height */
  padding: 12px 0;
  background-clip: content-box;
  box-sizing: content-box;
}
.ap-fill {
  height: 5px;
  background: #F8D27D;
  width: 0%;
  border-radius: inherit;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Post share section (between story body and CTA) ─────── */
.post-share {
  width: 100%;
  margin: 2.5rem 0 1.5rem;
  padding: 1.4rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}
.post-share-label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  color: #F8D27D;
}
.post-share .share-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}
.post-share .share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.15rem;
  background: rgba(248, 210, 125, 0.12);
  border: 1px solid rgba(248, 210, 125, 0.5);
  color: #F8D27D;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
}
.post-share .share-btn:hover { background: rgba(248, 210, 125, 0.22); }
.post-share .share-btn:active { transform: scale(0.97); }
.post-share .share-btn:disabled { opacity: 0.55; cursor: wait; }
.post-share .share-btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}
.post-share .share-feedback {
  font-size: 0.85rem;
  opacity: 0.7;
  color: #F5EFE0;
  min-height: 1.2em;
}
.post-share .share-feedback.ok    { color: #9DD79A; opacity: 1; }
.post-share .share-feedback.error { color: #E5928A; opacity: 1; }

/* ── Story article body ──────────────────────────────────── */
.story-body {
  width: 100%;
  color: #F5EFE0;
  font-size: 1.1rem;
  line-height: 1.75;
  margin: 1rem 0;
}
.story-body p {
  margin-bottom: 1.15rem;
}
.story-body .dialogue {
  /* Slight indent for attributed dialogue lines to break up the wall of text */
  padding-left: 0.25rem;
}
.story-body .speaker {
  color: #F8D27D;
  font-weight: 600;
}
.story-body a {
  color: #F8D27D;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(248, 210, 125, 0.4);
  transition: text-decoration-color 0.2s;
}
.story-body a:hover { text-decoration-color: #F8D27D; }
.story-body a:visited { color: #F8D27D; }

/* ── Related stories strip ───────────────────────────────── */
.related {
  width: 100%;
  margin: 3.5rem 0 2rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.related-card {
  display: block;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem 1.1rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, transform 0.2s;
}
.related-card:hover {
  background: rgba(248, 210, 125, 0.08);
  transform: translateY(-2px);
}
.related-card .related-title {
  color: #F8D27D;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.related-card .related-summary {
  color: #F5EFE0;
  opacity: 0.7;
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Blog home — post grid ───────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 1100px;
  margin: 2rem auto 0;
}
.post-card {
  display: block;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.post-card:hover {
  background: rgba(248, 210, 125, 0.08);
  transform: translateY(-3px);
  box-shadow: 0 12px 48px rgba(248, 210, 125, 0.15), 0 8px 32px rgba(0,0,0,0.4);
}
.post-card-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #1A0B2E;
}
.post-card .post-card-body { padding: 1.25rem 1.25rem 1.4rem; }
.post-card .post-card-title {
  color: #F8D27D;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.6rem;
}
.post-card .post-card-summary {
  color: #F5EFE0;
  opacity: 0.75;
  font-size: 0.95rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card .post-card-date {
  color: #F8D27D;
  opacity: 0.5;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.85rem;
}

/* ── Header nav for blog pages ───────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(26, 11, 46, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}
.site-nav a {
  color: #F8D27D;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.site-nav .brand { font-size: 1.1rem; }
.site-nav .nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.site-nav .nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.site-nav .nav-links a:hover { opacity: 1; }
.site-nav .nav-get {
  background: #F8D27D;
  color: #1A0B2E;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  transition: transform 0.2s;
}
.site-nav .nav-get:hover { transform: scale(1.04); }

@media (max-width: 600px) {
  .site-nav-inner { padding: 0.75rem 1rem; gap: 0.75rem; }
  .site-nav .brand { font-size: 1rem; }
  .site-nav .nav-links { gap: 1rem; }
  .site-nav .nav-links a { font-size: 0.85rem; }
  .site-nav .nav-get { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
}

/* ── Floating CTA pair (Try + Get) ─────────────────────────
   Desktop: stacked pills in bottom-right corner.
   Mobile (≤600px): full-width 50/50 bar at the bottom.
   Hidden until scrolled past 480px — matches the landing page. */
.floating-cta {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s;
}
.floating-cta.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.floating-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  min-width: 180px;
  transition: transform 0.2s;
}
.floating-cta-btn:hover { transform: scale(1.04); }
.floating-cta-primary {
  background: #F8D27D;
  color: #1A0B2E;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(248, 210, 125, 0.4);
}
.floating-cta-secondary {
  background: rgba(26, 11, 46, 0.85);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #F8D27D;
  border: 1px solid rgba(248, 210, 125, 0.55);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.floating-cta-arrow { font-size: 1.2rem; font-weight: 300; }
@media (max-width: 600px) {
  .floating-cta {
    flex-direction: row;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    gap: 0.5rem;
  }
  .floating-cta-btn {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 1rem;
  }
}

/* ── Mobile tweaks (blog) ────────────────────────────────── */
@media (max-width: 600px) {
  .page { padding: 2rem 1rem 2rem; }
  .cta-card { padding: 1.5rem 1.25rem; }
  .cta-card .cta-headline { font-size: 1.2rem; }
  .story-body { font-size: 1.05rem; }
}
