/* ============================================
   estoescribo.com — Custom Styles
   Force light mode | Editorial design system
   ============================================ */

/* === FORCE LIGHT MODE === */
:root {
  color-scheme: light only;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light only;
  }
  html, body {
    background-color: #FAF9F6 !important;
    color: #1C1C1E !important;
  }
}

html[data-theme="dark"],
html.dark {
  color-scheme: light only !important;
}

/* === BASE === */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: #FAF9F6;
  color: #1C1C1E;
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  overflow-x: hidden;
}

::selection {
  background-color: #A8432A;
  color: #FAF9F6;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}

.font-serif {
  font-family: 'Lora', Georgia, serif;
}

.font-sans {
  font-family: 'Inter', system-ui, sans-serif;
}

/* === ARTICLE CONTENT === */
.article-content {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.8;
  color: #2D2D2D;
}

@media (min-width: 768px) {
  .article-content {
    font-size: 1.25rem;
    line-height: 1.85;
  }
}

.article-content p {
  margin-bottom: 1.5em;
}

.article-content h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  color: #1C1C1E;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .article-content h2 {
    font-size: 1.75rem;
  }
}

.article-content h3 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.5em;
  color: #1C1C1E;
}

.article-content a {
  color: #A8432A;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.article-content a:hover {
  color: #8B3620;
}

.article-content blockquote {
  border-left: 3px solid #A8432A;
  padding-left: 1.25em;
  margin: 2em 0;
  font-style: italic;
  color: #595959;
}

.article-content ul,
.article-content ol {
  margin: 1.5em 0;
  padding-left: 1.5em;
}

.article-content li {
  margin-bottom: 0.5em;
}

.article-content ul li::marker {
  color: #A8432A;
}

.article-content ol li::marker {
  color: #A8432A;
  font-weight: 600;
}

.article-content strong {
  font-weight: 600;
  color: #1C1C1E;
}

.article-content em {
  font-style: italic;
}

.article-content hr {
  border: none;
  border-top: 1px solid #E5E1DB;
  margin: 2.5em 0;
}

.article-content figure {
  margin: 2em 0;
}

.article-content figcaption {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  color: #757575;
  text-align: center;
  margin-top: 0.75em;
}

/* === FIRST PARAGRAPH — same as all others, no special treatment === */

/* === NAVIGATION === */
.nav-header {
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  background-color: rgba(250, 249, 246, 0.85);
  border-bottom: 1px solid rgba(229, 225, 219, 0.5);
  transition: box-shadow 0.3s ease;
}

.nav-header.scrolled {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-link {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #595959;
  transition: color 0.2s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: #1C1C1E;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #A8432A;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* === LOGO === */
.logo {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.375rem;
  font-weight: 600;
  color: #1C1C1E;
  letter-spacing: -0.03em;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.7;
}

.logo span {
  font-style: italic;
  font-weight: 400;
}

/* === POST CARDS === */
.post-card {
  background-color: transparent;
  border-radius: 0;
  padding: 1.75rem 0;
  border-bottom: 1px solid #E5E1DB;
  transition: background-color 0.2s ease;
}

.post-card:last-child {
  border-bottom: none;
}

.post-card:hover {
  background-color: rgba(240, 237, 232, 0.3);
}

.post-card-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  color: #1C1C1E;
  letter-spacing: -0.02em;
  line-height: 1.25;
  transition: color 0.2s ease;
}

.post-card:hover .post-card-title {
  color: #A8432A;
}

.post-card-excerpt {
  font-family: 'Lora', Georgia, serif;
  color: #595959;
  line-height: 1.6;
}

/* === TAGS/BADGES === */
.tag {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #A8432A;
  background-color: rgba(168, 67, 42, 0.1);
  padding: 0.25em 0.75em;
  border-radius: 9999px;
  display: inline-block;
  transition: background-color 0.2s ease;
}

.tag:hover {
  background-color: rgba(168, 67, 42, 0.18);
}

/* === FEATURED POST === */
.featured-card {
  background-color: #F0EDE8;
  border-radius: 1rem;
  padding: 2.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 768px) {
  .featured-card {
    padding: 3rem;
  }
}

.featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* === READING PROGRESS BAR === */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #A8432A, #8B3620);
  z-index: 100;
  transition: width 0.1s linear;
}

/* === FOOTER === */
.site-footer {
  background-color: #1C1C1E;
  color: #9B9B9B;
}

.site-footer a {
  color: #9B9B9B;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: #FAF9F6;
}

.footer-heading {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FAF9F6;
  margin-bottom: 1rem;
}

/* === MOBILE MENU === */
.mobile-menu {
  position: fixed;
  inset: 0;
  background-color: rgba(250, 249, 246, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu a {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: #1C1C1E;
  transition: color 0.2s ease;
}

.mobile-menu a:hover {
  color: #A8432A;
}

/* === HAMBURGER === */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 95;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #1C1C1E;
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === SCROLL TO TOP === */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background-color: #1C1C1E;
  color: #FAF9F6;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background-color: #A8432A;
}

/* === TRANSITIONS === */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === PRINT STYLES === */
@media print {
  .nav-header,
  .site-footer,
  .scroll-top,
  .reading-progress,
  .mobile-menu {
    display: none !important;
  }
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }
  .article-content a {
    color: black;
    text-decoration: underline;
  }
  .article-content a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-in {
    opacity: 1;
    transform: none;
  }
}

/* Focus styles */
:focus-visible {
  outline: 2px solid #A8432A;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.5rem;
  background-color: #1C1C1E;
  color: #FAF9F6;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0 0 0.5rem 0.5rem;
  z-index: 200;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}
