/* ===========================================
   RANTS - STYLE.CSS
   Editorial typography for long-form essays
   Gambarino (headings) + Seltzer Light (body)
=========================================== */

/* ===========================================
   FONTS
=========================================== */
@import url('https://fonts.googleapis.com/css2?family=Gambarino&display=swap');

/* Seltzer Light - self-hosted or fallback */
@font-face {
  font-family: 'Seltzer';
  src: url('/fonts/Seltzer-Light.woff2') format('woff2'),
       url('/fonts/Seltzer-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* ===========================================
   THEME TOKENS
=========================================== */
:root {
  /* Rants Typography */
  --font-rant-heading: 'Gambarino', 'Times New Roman', Georgia, serif;
  --font-rant-body: 'Seltzer', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Fallback if Seltzer doesn't load */
  --font-rant-body-fallback: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  
  /* Light Theme */
  --rant-bg: #ffffff;
  --rant-text: #1a1a1a;
  --rant-muted: #666666;
  --rant-border: #e5e5e5;
  --rant-quote-bg: transparent;
  
  /* Transitions */
  --rant-transition: 0.3s ease;
}

html[data-theme="dark"] {
  --rant-bg: #050505;
  --rant-text: #f5f5f5;
  --rant-muted: #999999;
  --rant-border: #333333;
  --rant-quote-bg: transparent;
}

/* ===========================================
   RANTS INDEX PAGE
=========================================== */
.rants-page {
  background: var(--rant-bg);
  color: var(--rant-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.rants-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
  flex: 1;
}

/* Page Header */
.rants-header {
  margin-bottom: 4rem;
  text-align: left;
}

.rants-title {
  font-family: var(--font-rant-heading);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  color: var(--rant-text);
}

.rants-subtitle {
  font-family: var(--font-rant-body), var(--font-rant-body-fallback);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--rant-muted);
  line-height: 1.6;
  max-width: 50ch;
}

/* Rants List */
.rants-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rants-list li {
  margin-bottom: 2.5rem;
}

/* Quoted Title Links */
.rant-link {
  font-family: var(--font-rant-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  color: var(--rant-text);
  text-decoration: none;
  display: inline-block;
  position: relative;
  transition: opacity var(--rant-transition);
  line-height: 1.3;
}

.rant-link::before {
  content: '"';
}

.rant-link::after {
  content: '"';
}

.rant-link:hover {
  opacity: 0.6;
}

/* Subtle underline on hover */
.rant-link span {
  position: relative;
}

.rant-link span::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--rant-text);
  transition: width var(--rant-transition);
}

.rant-link:hover span::after {
  width: 100%;
}

/* ===========================================
   RANT DETAIL PAGE (Essay Mode)
=========================================== */
.rant-page {
  background: var(--rant-bg);
  color: var(--rant-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.rant-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
  flex: 1;
}

/* Essay Header */
.rant-header {
  margin-bottom: 3rem;
  text-align: left;
}

.rant-title {
  font-family: var(--font-rant-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--rant-text);
}

/* Metadata */
.rant-meta {
  font-family: var(--font-rant-body), var(--font-rant-body-fallback);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--rant-muted);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.rant-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Essay Body */
.rant-content {
  font-family: var(--font-rant-body), var(--font-rant-body-fallback);
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--rant-text);
}

.rant-content p {
  margin-bottom: 1.75rem;
}

.rant-content p:first-of-type {
  font-size: 1.35rem;
  line-height: 1.7;
}

/* Section Headers */
.rant-content h2 {
  font-family: var(--font-rant-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  color: var(--rant-text);
  opacity: 0.9;
  transition: opacity var(--rant-transition);
}

/* Intersection observer: headers sharpen on scroll */
.rant-content h2.in-view {
  opacity: 1;
}

/* Lists */
.rant-content ul,
.rant-content ol {
  margin-bottom: 1.75rem;
  padding-left: 1.5rem;
}

.rant-content li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.rant-content ul li {
  list-style-type: disc;
}

.rant-content ol li {
  list-style-type: decimal;
}

/* Links within essay */
.rant-content a {
  color: var(--rant-text);
  text-decoration: underline;
  text-decoration-color: var(--rant-muted);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--rant-transition);
}

.rant-content a:hover {
  text-decoration-color: var(--rant-text);
}

/* Blockquotes */
.rant-content blockquote {
  margin: 2.5rem 0;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--rant-border);
  font-style: italic;
  color: var(--rant-muted);
}

/* Horizontal rule */
.rant-content hr {
  border: none;
  height: 1px;
  background: var(--rant-border);
  margin: 3rem 0;
}

/* ===========================================
   RANT FOOTER (End of Essay)
=========================================== */
.rant-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rant-border);
}

.rant-back {
  font-family: var(--font-rant-body), var(--font-rant-body-fallback);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--rant-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--rant-transition);
}

.rant-back:hover {
  color: var(--rant-text);
}

.rant-back::before {
  content: '←';
}

/* ===========================================
   RESPONSIVE
=========================================== */
@media (max-width: 768px) {
  .rants-container,
  .rant-container {
    padding: 4rem 1.5rem 3rem;
  }
  
  .rants-header {
    margin-bottom: 3rem;
  }
  
  .rant-content {
    font-size: 1.1rem;
  }
  
  .rant-content p:first-of-type {
    font-size: 1.2rem;
  }
  
  .rant-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .rants-container,
  .rant-container {
    padding: 3rem 1.25rem 2rem;
  }
  
  .rant-link {
    font-size: 1.5rem;
  }
}