/* ============================================
   The Ritual Journal Collective — Style System
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=Source+Sans+3:wght@400;500;600&display=swap");

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

/* Variables */
:root {
  --bg: #faf8f4;
  --bg-secondary: #f3efe8;
  --text: #1e1c1a;
  --text-muted: #6b6560;
  --accent: #8b7355;
  --accent-dark: #5c4a32;
  --rust: #a0522d;
  --sand: #c4a882;
  --border: #e5ddd0;
  --max-width: 740px;
  --font-serif: "Lora", Georgia, serif;
  --font-sans:
    "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #1a1612;
  --bg-secondary: #231f1a;
  --text: #f0ece4;
  --text-muted: #b5ad9e;
  --accent: #c4a882;
  --accent-dark: #d4b896;
  --rust: #cc7755;
  --sand: #8b7355;
  --border: #3a342c;
}

/* Base */
html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: 2.5rem 0;
}

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

/* Links */
a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Site Header
   ============================================ */

.site-header {
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .page-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: normal;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  cursor: pointer;
}

.site-logo:hover {
  text-decoration: none;
  color: var(--accent-dark);
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 0.35rem 0.65rem;
  border-radius: 3px;
  text-decoration: none;
  transition:
    color 0.15s,
    background-color 0.15s;
  cursor: pointer;
}

.site-nav a:hover {
  color: var(--text);
  background-color: var(--bg-secondary);
  text-decoration: none;
}

/* Theme toggle button */
#theme-toggle {
  background-color: var(--bg-secondary);
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 6px;
  margin-left: 0.5rem;
  transition:
    color 0.15s,
    background-color 0.15s,
    border-color 0.15s;
  flex-shrink: 0;
}

#theme-toggle:hover {
  background-color: var(--border);
  border-color: var(--accent-dark);
  color: var(--accent-dark);
}

#theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* Light mode: show moon, hide sun */
#theme-toggle #icon-moon {
  display: block;
}
#theme-toggle #icon-sun {
  display: none;
}

/* Dark mode: show sun, hide moon */
[data-theme="dark"] #theme-toggle #icon-moon {
  display: none;
}
[data-theme="dark"] #theme-toggle #icon-sun {
  display: block;
}

/* ============================================
   Layout
   ============================================ */

.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.article-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   Typography
   ============================================ */

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  color: var(--text);
  line-height: 1.3;
}

h1 {
  font-size: 2.1rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.4rem;
  margin-top: 2.75rem;
  margin-bottom: 0.85rem;
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1.35rem;
}

ul,
ol {
  margin-bottom: 1.35rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

/* Article body — use serif for credibility */
article p,
article li {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.85;
}

/* Drop cap on first paragraph */
article > p:first-of-type::first-letter,
.article-body > p:first-of-type::first-letter {
  font-family: var(--font-serif);
  font-size: 3.25em;
  font-weight: 700;
  float: left;
  line-height: 0.8;
  margin: 0.08em 0.1em 0 0;
  color: var(--accent);
}

/* ============================================
   Breadcrumb
   ============================================ */

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 0.35rem;
}

/* ============================================
   Article Elements
   ============================================ */

.article-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.article-meta a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
}

.article-meta a:hover {
  text-decoration: underline;
}

.article-meta .author-descriptor {
  font-style: italic;
}

.article-meta .meta-dot {
  color: var(--border);
}

.article-date {
  color: var(--text-muted);
}

.article-summary {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.75;
  border-left: 3px solid var(--sand);
  padding: 0.75rem 1.25rem;
  margin-bottom: 2.5rem;
  color: var(--text);
  background-color: var(--bg-secondary);
  border-radius: 0 4px 4px 0;
}

/* ============================================
   Step List — editorial numbered steps
   ============================================ */

.step-list {
  counter-reset: steps;
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.5rem;
}

.step-list li {
  counter-increment: steps;
  position: relative;
  padding: 1rem 1rem 1rem 3.5rem;
  margin-bottom: 0.85rem;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  border: 1px solid var(--border);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.75;
}

.step-list li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2.75rem;
  background-color: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px 0 0 4px;
  flex-shrink: 0;
}

/* ============================================
   Comparison Table
   ============================================ */

.comparison-table {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.comparison-table th {
  background-color: var(--bg-secondary);
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);
}

.comparison-table th:last-child {
  border-right: none;
}

.comparison-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
}

.comparison-table td:last-child {
  border-right: none;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:nth-child(even) td {
  background-color: #fdf9f4;
}

/* ============================================
   Disclaimer Block
   ============================================ */

.disclaimer-block {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
  border: 1px solid var(--border);
  border-left: 3px solid var(--sand);
  padding: 0.85rem 1.1rem;
  background-color: var(--bg-secondary);
  margin: 2.5rem 0;
  line-height: 1.6;
  border-radius: 0 4px 4px 0;
}

/* ============================================
   FAQ Section
   ============================================ */

.faq-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
}

.faq-answer {
  color: var(--text-muted);
  line-height: 1.8;
  font-family: var(--font-serif);
  font-size: 1rem;
}

/* ============================================
   Related Practices
   ============================================ */

.related-practices {
  border-top: 2px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 2.5rem;
}

.related-practices h2 {
  margin-top: 0;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.related-practices ul {
  list-style: none;
  padding-left: 0;
}

.related-practices ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.related-practices ul li:last-child {
  border-bottom: none;
}

.related-practices ul li a {
  color: var(--accent-dark);
  font-family: var(--font-serif);
  font-size: 0.975rem;
  transition: color 0.15s;
  cursor: pointer;
}

.related-practices ul li a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ============================================
   Sources
   ============================================ */

.sources {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.825rem;
  color: var(--text-muted);
}

.sources h2 {
  font-size: 0.75rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 600;
}

.sources ol,
.sources ul {
  padding-left: 1.5rem;
}

.sources li {
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

.sources a {
  word-break: break-all;
  color: var(--accent-dark);
}

/* ============================================
   Product Recommendation
   ============================================ */

.product-rec {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 1.1rem 1.35rem;
  margin: 2.5rem 0;
  border-radius: 0 4px 4px 0;
  position: relative;
}

.product-rec::before {
  content: "Recommended Resource";
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-sans);
  margin-bottom: 0.4rem;
}

.product-rec .product-rec-label {
  display: none;
}

.product-rec p {
  margin-bottom: 0;
  font-size: 0.95rem;
  font-family: var(--font-serif);
}

.product-rec a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--sand);
  text-underline-offset: 2px;
  cursor: pointer;
}

.product-rec a:hover {
  color: var(--text);
}

/* ============================================
   Author Card
   ============================================ */

.author-card {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: #fff;
  flex-shrink: 0;
}

.author-card-info h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.author-card-descriptor {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
  display: block;
}

.author-social {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.author-social a {
  font-size: 0.85rem;
  color: var(--accent-dark);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  transition: background-color 0.15s;
  cursor: pointer;
}

.author-social a:hover {
  background-color: var(--bg-secondary);
  text-decoration: none;
}

/* ============================================
   Post Grid (Homepage)
   ============================================ */

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.post-card {
  border: 1px solid var(--border);
  padding: 1.35rem;
  border-radius: 4px;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  box-shadow: 0 2px 14px rgba(139, 115, 85, 0.14);
  border-color: var(--sand);
}

.post-card-cluster {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
  font-family: var(--font-sans);
  display: block;
  margin-bottom: 0.5rem;
}

.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.45;
  margin-bottom: 0.75rem;
  display: block;
  color: var(--text);
  text-decoration: none;
  flex: 1;
}

.post-card-title:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
}

.post-card-meta .meta-dot {
  color: var(--border);
}

/* Featured article card */
.featured-card {
  border: 1px solid var(--border);
  padding: 1.75rem;
  border-radius: 4px;
  margin-bottom: 3rem;
  cursor: pointer;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
  border-left: 4px solid var(--accent);
}

.featured-card:hover {
  box-shadow: 0 3px 18px rgba(139, 115, 85, 0.14);
  border-left-color: var(--rust);
}

/* Homepage section headings */
.section-heading {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.section-heading a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.section-heading a:hover {
  color: var(--accent-dark);
}

/* ============================================
   Hero (Homepage)
   ============================================ */

.hero {
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 2.35rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.75;
  font-family: var(--font-serif);
}

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

.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: auto;
}

.site-footer .page-container {
  text-align: center;
}

.site-footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.site-footer nav {
  margin-bottom: 0.75rem;
}

.site-footer nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.15s;
  cursor: pointer;
}

.site-footer nav a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================
   Static Pages (About, Disclaimer, etc.)
   ============================================ */

.page-hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.page-hero h1 {
  font-size: 1.9rem;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.page-body h2 {
  margin-top: 2rem;
}

.page-body p,
.page-body li {
  color: var(--text);
}

/* Team / author grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.team-card {
  border: 1px solid var(--border);
  padding: 1.35rem;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  transition:
    box-shadow 0.2s,
    border-color 0.2s;
}

.team-card:hover {
  box-shadow: 0 2px 10px rgba(139, 115, 85, 0.1);
  border-color: var(--sand);
}

.team-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: #fff;
  margin: 0 auto 0.75rem;
}

.team-card h3 {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.team-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.team-card a {
  font-size: 0.85rem;
  cursor: pointer;
}

/* Contact form area */
.contact-block {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.contact-block p {
  margin-bottom: 0.5rem;
}

.contact-email {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-dark);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  h1 {
    font-size: 1.65rem;
  }

  h2 {
    font-size: 1.25rem;
    margin-top: 2rem;
  }

  h3 {
    font-size: 1.05rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .site-header .page-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    gap: 0;
  }

  .site-nav a {
    padding: 0.3rem 0.5rem;
    font-size: 0.82rem;
  }

  .article-container,
  .page-container {
    padding: 0 1rem;
  }

  .author-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-social {
    justify-content: center;
  }

  main {
    padding: 1.5rem 0;
  }

  .step-list li {
    padding: 0.85rem 0.85rem 0.85rem 3.25rem;
  }

  .step-list li::before {
    width: 2.5rem;
  }

  /* No drop cap on mobile — too small */
  article > p:first-of-type::first-letter,
  .article-body > p:first-of-type::first-letter {
    font-size: 1em;
    float: none;
    margin: 0;
    color: inherit;
  }
}
