/* ==========================================================================
   Magazine Article Styles
   Premium editorial styling for long-form content
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  --article-max-width: 680px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --color-text: #1a1a1a;
  --color-text-light: #3d3d3d;
  --color-text-muted: #6b6b6b;
  --color-accent: #a08b68;
  --color-background: #faf8f5;
  --color-rule: rgba(26, 26, 26, 0.1);
}

/* --------------------------------------------------------------------------
   Article Container
   -------------------------------------------------------------------------- */
.magazine-article {
  max-width: var(--article-max-width);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  background: var(--color-background);
}

/* --------------------------------------------------------------------------
   Article Header
   -------------------------------------------------------------------------- */
.article-header {
  text-align: center;
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--color-rule);
}

.article-category {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.article-title {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-text);
  margin: 0 0 1rem;
}

.article-subtitle {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-text-muted);
  margin: 0 0 1.5rem;
}

.article-meta {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.article-date,
.article-read-time {
  display: inline-block;
}

/* --------------------------------------------------------------------------
   Article Body
   -------------------------------------------------------------------------- */
.article-body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-text-light);
}

.article-body p {
  max-width: 65ch;
  margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   Drop Cap
   -------------------------------------------------------------------------- */
.article-body > p:first-of-type::first-letter,
.drop-cap::first-letter {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  float: left;
  line-height: 1;
  margin: 0 0.1em 0 0;
  padding: 0;
  color: var(--color-accent);
}

/* Contain the float properly */
.drop-cap {
  display: flow-root;
}

.drop-cap + p {
  clear: both;
}

/* --------------------------------------------------------------------------
   Section Headings
   -------------------------------------------------------------------------- */
.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-rule);
}

.article-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* --------------------------------------------------------------------------
   Article Dividers
   -------------------------------------------------------------------------- */
.article-divider {
  text-align: center;
  margin: 2.5rem 0;
  color: var(--color-text-muted);
  font-size: 1.25rem;
  letter-spacing: 0.5em;
}

.article-divider::before {
  content: '• • •';
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Pull Quotes
   -------------------------------------------------------------------------- */
.pull-quote {
  position: relative;
  text-align: center;
  margin: 3rem auto;
  padding: 2rem 1rem;
  max-width: 90%;
}

.pull-quote::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: 6rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.3;
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
}

.pull-quote p {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0;
  max-width: none;
}

.pull-quote cite {
  display: block;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-style: normal;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

.pull-quote cite::before {
  content: '— ';
}

/* --------------------------------------------------------------------------
   Blockquotes
   -------------------------------------------------------------------------- */
.article-body blockquote {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--color-text-light);
  background: rgba(160, 139, 104, 0.05);
  border-left: 3px solid var(--color-accent);
  margin: 2rem 0;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
}

.article-body blockquote p {
  margin-bottom: 0.75rem;
  max-width: none;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

.article-body blockquote cite {
  display: block;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-style: normal;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

.article-body blockquote cite::before {
  content: '— ';
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */
.article-body a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color 0.2s ease;
}

.article-body a:hover {
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Lists
   -------------------------------------------------------------------------- */
.article-body ul,
.article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  max-width: 65ch;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body ul li::marker {
  color: var(--color-accent);
}

.article-body ol li::marker {
  color: var(--color-accent);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Images & Figures
   -------------------------------------------------------------------------- */
.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
}

.article-body figure {
  margin: 2.5rem 0;
}

.article-body figcaption {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-style: italic;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 0.75rem;
}

/* --------------------------------------------------------------------------
   Article CTA
   -------------------------------------------------------------------------- */
.article-cta {
  background: transparent;
  border: none;
  padding: 0;
  text-align: center;
  margin: 3rem 0;
}

.article-cta p {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  max-width: none;
}

.article-cta .book-title {
  font-weight: 600;
}

.article-cta a {
  color: #a08b68;
  text-decoration: underline;
  text-decoration-color: rgba(160, 139, 104, 0.4);
  text-underline-offset: 0.15em;
  transition: text-decoration-color 0.2s ease;
}

.article-cta a:hover {
  text-decoration-color: #a08b68;
}

/* --------------------------------------------------------------------------
   Article Footer / Sign-off
   -------------------------------------------------------------------------- */
.article-footer,
.article-signoff {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-rule);
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */

/* Focus states */
.magazine-article a:focus,
.magazine-article button:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.magazine-article a:focus:not(:focus-visible),
.magazine-article button:focus:not(:focus-visible) {
  outline: none;
}

.magazine-article a:focus-visible,
.magazine-article button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .magazine-article,
  .magazine-article * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --color-text: #000000;
    --color-text-light: #000000;
    --color-text-muted: #333333;
    --color-accent: #8b6914;
    --color-background: #ffffff;
    --color-rule: #000000;
  }

  .article-body blockquote {
    background: #f0f0f0;
    border-left-width: 4px;
  }

  .pull-quote::before {
    opacity: 0.6;
  }
}

/* --------------------------------------------------------------------------
   Responsive Styles (768px breakpoint)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .magazine-article {
    padding: 0 1rem 3rem;
  }

  /* Header */
  .article-title {
    font-size: 2rem;
  }

  .article-subtitle {
    font-size: 1.125rem;
  }

  .article-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Body text */
  .article-body {
    font-size: 1rem;
    line-height: 1.75;
  }

  /* Drop cap */
  .article-body > p:first-of-type::first-letter,
  .drop-cap::first-letter {
    font-size: 2.75rem;
  }

  /* Headings */
  .article-body h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
  }

  .article-body h3 {
    font-size: 1.25rem;
  }

  /* Pull quotes */
  .pull-quote {
    margin: 2rem auto;
    padding: 1.5rem 0.5rem;
    max-width: 100%;
  }

  .pull-quote::before {
    font-size: 4rem;
  }

  .pull-quote p {
    font-size: 1.25rem;
  }

  /* Blockquotes */
  .article-body blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1rem 1rem 1.5rem;
  }

  /* Philosophy page mobile centering */
  .philosophy-content,
  .philosophy-article .article-body {
    text-align: center;
  }

  .philosophy-content p,
  .philosophy-article .article-body p {
    text-align: center;
  }

  .philosophy-content h2,
  .philosophy-article .article-body h2 {
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
  .magazine-article {
    max-width: 100%;
    padding: 0;
    background: white;
  }

  .article-header {
    border-bottom-color: #ccc;
  }

  .article-title {
    font-size: 2rem;
  }

  .article-body {
    font-size: 11pt;
    line-height: 1.6;
  }

  .article-body h2 {
    font-size: 14pt;
    border-top-color: #ccc;
    page-break-after: avoid;
  }

  /* Hide non-essential elements */
  .article-cta,
  .toc,
  .table-of-contents,
  nav {
    display: none !important;
  }

  /* Prevent page breaks inside */
  .pull-quote,
  blockquote,
  figure {
    page-break-inside: avoid;
  }

  /* Show link URLs */
  .article-body a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  /* Drop cap adjustments */
  .article-body > p:first-of-type::first-letter,
  .drop-cap::first-letter {
    font-size: 3rem;
    color: #333;
  }
}
