/* ============================================
   KAYJAH DESIGN STUDIO — Single Journal Article
   Apple HIG–inspired: clarity, depth, deference

   Principles:
   - Content commands focus, UI recedes
   - 8pt spacing grid, generous whitespace
   - Reading-optimised typography (65–75 ch)
   - Spring-based, purposeful motion
   - Frosted glass & layered depth
   ============================================ */


/* ── Design tokens (article-scoped) ────────────── */

.single-journal {
  --sj-gold:       var(--gold);
  --sj-gold-light: var(--gold-light);
  --sj-dark:       #1a1a1e;
  --sj-dark-alt:   #141416;
  --sj-light:      #F8F6F2;
  --sj-body:       #4a4a4a;
  --sj-body-light: rgba(248, 246, 242, 0.6);
  --sj-radius:     20px;
  --sj-radius-sm:  12px;
  --sj-radius-xs:  8px;
  --sj-spring:     cubic-bezier(0.22, 1, 0.36, 1);
  --sj-ease:       cubic-bezier(0.25, 0.1, 0.25, 1);
  --sj-shadow-sm:  0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --sj-shadow-md:  0 4px 16px rgba(0,0,0,0.06), 0 12px 40px rgba(0,0,0,0.06);
  --sj-shadow-lg:  0 8px 32px rgba(0,0,0,0.08), 0 24px 64px rgba(0,0,0,0.08);
  --sj-reading:    680px;
}


/* ═══════════════════════════════
   READING PROGRESS BAR
   ═══════════════════════════════ */

.sj-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: var(--z-nav);
  pointer-events: none;
}

.sj-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--sj-gold), #d4b68f);
  border-radius: 0 2px 2px 0;
  transition: width 0.15s linear;
  will-change: width;
}


/* ═══════════════════════════════
   HERO — immersive, editorial
   ═══════════════════════════════ */

.sj-hero {
  position: relative;
  height: 85vh;
  min-height: 520px;
  max-height: 860px;
  overflow: hidden;
}

.sj-hero > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  transition: transform 12s var(--sj-ease);
}

.sj-hero.loaded > img {
  transform: scale(1);
}

.sj-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.1) 0%,
    transparent 35%,
    rgba(0, 0, 0, 0.55) 75%,
    rgba(0, 0, 0, 0.75) 100%
  );
  pointer-events: none;
}

.sj-hero-content {
  position: absolute;
  bottom: 72px;
  left: var(--gutter);
  right: var(--gutter);
  z-index: 2;
  max-width: 760px;
}

/* Category badge — frosted glass pill */
.sj-hero-cat {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--sj-light);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 20px;
  border-radius: 100px;
  margin-bottom: 20px;
}

/* Title — large, editorial serif */
.sj-hero-title {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 300;
  color: var(--sj-light);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}

/* Meta line — date + read time */
.sj-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  color: rgba(248, 246, 242, 0.65);
  letter-spacing: 0.01em;
}

.sj-hero-meta-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(248, 246, 242, 0.35);
  flex-shrink: 0;
}

/* Scroll hint — subtle animated pill */
.sj-scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  opacity: 0.5;
  transition: opacity 0.6s var(--sj-ease);
}

.sj-scroll-hint:hover {
  opacity: 0.8;
}

.sj-scroll-pill {
  width: 22px;
  height: 36px;
  border-radius: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 7px;
}

.sj-scroll-dot {
  width: 3px;
  height: 7px;
  border-radius: 1.5px;
  background: rgba(255, 255, 255, 0.6);
  animation: sj-scroll-bob 2s var(--sj-ease) infinite;
}

@keyframes sj-scroll-bob {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(10px); opacity: 0.25; }
}


/* ═══════════════════════════════
   ARTICLE BODY — reading focus
   ═══════════════════════════════ */

.sj-article {
  padding: var(--space-lg) var(--gutter);
}

.sj-article-inner {
  max-width: var(--sj-reading);
  margin: 0 auto;
}


/* ── Back link ──────────────────── */

.sj-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.3s var(--sj-ease), gap 0.3s var(--sj-ease);
}

.sj-back:hover {
  color: var(--sj-gold);
  gap: 10px;
}

.sj-back svg {
  flex-shrink: 0;
  transition: transform 0.3s var(--sj-ease);
}

.sj-back:hover svg {
  transform: translateX(-2px);
}


/* ── Pull quote — editorial accent ─── */

.sj-pullquote {
  position: relative;
  font-family: var(--serif);
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  line-height: 1.5;
  text-align: center;
  padding: 48px 24px;
  margin: 0 0 48px;
  border: none;
}

.sj-pullquote::before {
  content: '\201C';
  display: block;
  font-family: var(--serif);
  font-size: 72px;
  font-style: normal;
  line-height: 1;
  color: var(--sj-gold);
  opacity: 0.35;
  margin-bottom: 8px;
}

.sj-pullquote::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--sj-gold);
  border-radius: 1px;
  margin: 24px auto 0;
  opacity: 0.5;
}


/* ── Excerpt / lead paragraph ──────── */

.sj-lead {
  font-family: var(--sans);
  font-size: clamp(17px, 1.8vw, 19px);
  font-weight: 400;
  color: var(--ink-2);
  line-height: 1.75;
  margin-bottom: 32px;
}


/* ── Article prose styling ─────────── */

.sj-body {
  font-family: var(--sans);
  font-size: 16.5px;
  color: var(--sj-body);
  line-height: 1.85;
}

.sj-body p {
  margin-bottom: 24px;
}

.sj-body p:last-child {
  margin-bottom: 0;
}

/* Drop cap on first paragraph */
.sj-body > p:first-child::first-letter {
  font-family: var(--serif);
  float: left;
  font-size: 3.5em;
  line-height: 0.8;
  padding-right: 10px;
  padding-top: 6px;
  color: var(--ink);
  font-weight: 400;
}

.sj-body h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 2.5vw, 30px);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.25;
  margin: 48px 0 20px;
  letter-spacing: -0.01em;
}

.sj-body h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin: 40px 0 16px;
}

.sj-body h4 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.4;
  margin: 32px 0 12px;
}

.sj-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 54, 69, 0.25);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s;
}

.sj-body a:hover {
  text-decoration-color: var(--accent);
}

.sj-body ul,
.sj-body ol {
  margin: 0 0 24px 24px;
  padding: 0;
}

.sj-body li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.sj-body li::marker {
  color: var(--sj-gold);
}

.sj-body blockquote {
  position: relative;
  margin: 32px 0;
  padding: 20px 0 20px 24px;
  border-left: 3px solid var(--sj-gold);
  font-style: italic;
  color: var(--ink-2);
}

.sj-body blockquote p {
  margin-bottom: 0;
}

.sj-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--sj-radius-sm);
  margin: 32px 0;
  box-shadow: var(--sj-shadow-sm);
}

.sj-body figure {
  margin: 40px 0;
}

.sj-body figure img {
  margin: 0 0 12px;
  width: 100%;
}

.sj-body figcaption {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.5;
}

.sj-body hr {
  border: none;
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 48px 0;
}

.sj-body pre {
  background: var(--surface-1);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--sj-radius-sm);
  padding: 24px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  margin: 32px 0;
}

.sj-body code {
  font-size: 0.9em;
  background: var(--surface-1);
  padding: 2px 6px;
  border-radius: 4px;
}

.sj-body pre code {
  background: none;
  padding: 0;
}


/* ── Article divider ───────────────── */

.sj-divider {
  width: 100%;
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 48px 0;
}


/* ── Tags ──────────────────────────── */

.sj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 48px;
}

.sj-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--surface-1);
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 6px 14px;
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.3s var(--sj-ease);
}

.sj-tag:hover {
  color: var(--sj-gold);
  border-color: rgba(200, 169, 126, 0.3);
  background: var(--sj-gold-light);
}


/* ── Share row ─────────────────────── */

.sj-share {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sj-share-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-right: 4px;
}

.sj-share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-1);
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s var(--sj-ease);
}

.sj-share-btn:hover {
  background: var(--sj-dark);
  border-color: var(--sj-dark);
  color: var(--sj-light);
  transform: translateY(-2px);
  box-shadow: var(--sj-shadow-sm);
}

.sj-share-btn svg {
  width: 16px;
  height: 16px;
}


/* ═══════════════════════════════
   AUTHOR CARD — Apple-style
   ═══════════════════════════════ */

.sj-author {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 32px;
  background: var(--surface-1);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--sj-radius);
  margin-top: 48px;
}

.sj-author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
}

.sj-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sj-author-info {
  min-width: 0;
}

.sj-author-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sj-gold);
  margin-bottom: 4px;
}

.sj-author-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
}

.sj-author-bio {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-top: 4px;
}


/* ═══════════════════════════════
   RELATED ARTICLES — card grid
   ═══════════════════════════════ */

.sj-related {
  padding: var(--space-lg) 0;
  background: var(--surface-1);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.sj-related-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sj-related-head {
  text-align: center;
  margin-bottom: 48px;
}

.sj-related-overline {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--sj-gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.sj-related-overline::before,
.sj-related-overline::after {
  content: '';
  width: 24px;
  height: 1.5px;
  background: var(--sj-gold);
  border-radius: 1px;
  opacity: 0.5;
}

.sj-related-heading {
  font-family: var(--serif);
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Card grid */
.sj-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Individual card */
.sj-related-card {
  display: block;
  text-decoration: none;
  border-radius: var(--sj-radius);
  overflow: hidden;
  background: var(--surface-0);
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: var(--sj-shadow-sm);
  transition: transform 0.5s var(--sj-spring),
              box-shadow 0.5s var(--sj-ease);
}

.sj-related-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--sj-shadow-md);
}

/* Card image */
.sj-related-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.sj-related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s var(--sj-ease);
}

.sj-related-card:hover .sj-related-img img {
  transform: scale(1.05);
}

/* Card body */
.sj-related-body {
  padding: 24px;
}

.sj-related-cat {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--sj-gold);
  margin-bottom: 8px;
}

.sj-related-name {
  font-family: var(--serif);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s var(--sj-ease);
}

.sj-related-card:hover .sj-related-name {
  color: var(--accent);
}

.sj-related-date {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-muted);
}


/* ═══════════════════════════════
   CTA BAND — premium dark
   ═══════════════════════════════ */

.sj-cta {
  background: var(--sj-dark);
  padding: var(--space-lg) var(--gutter);
}

.sj-cta-inner {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.sj-cta-overline {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--sj-gold);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.sj-cta-overline::before {
  content: '';
  width: 24px;
  height: 1.5px;
  background: var(--sj-gold);
  border-radius: 1px;
}

.sj-cta-title {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 300;
  color: var(--sj-light);
  margin-bottom: 16px;
}

.sj-cta-title em {
  font-style: italic;
  color: var(--sj-gold);
}

.sj-cta-text {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--sj-body-light);
  margin-bottom: 40px;
  line-height: 1.6;
}

.sj-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 16px 48px;
  background: var(--sj-gold);
  color: var(--sj-dark);
  border: none;
  border-radius: 100px;
  cursor: pointer;
  text-decoration: none;
  min-height: 52px;
  transition: background 0.3s var(--sj-ease), transform 0.3s var(--sj-ease),
              box-shadow 0.3s var(--sj-ease);
  box-shadow: 0 4px 16px rgba(200, 169, 126, 0.3);
}

.sj-cta-btn:hover {
  background: #d4b68f;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(200, 169, 126, 0.4);
}

.sj-cta-btn:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}


/* ═══════════════════════════════
   SCROLL REVEAL — Apple fade-up
   ═══════════════════════════════ */

.sj-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--sj-spring),
              transform 0.8s var(--sj-spring);
}

.sj-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.sj-reveal-delay-1 { transition-delay: 0.1s; }
.sj-reveal-delay-2 { transition-delay: 0.2s; }
.sj-reveal-delay-3 { transition-delay: 0.3s; }
