/* LUX — custom.css
   Contemplative devotional blog. Dark default, light toggle.
   Cormorant Garamond (wordmark) + Source Serif 4 (body) + Inter (UI) */

/* ============================================================
   VARIABLES — dark default
   ============================================================ */
:root {
  --theme:     #0e0e0e;
  --primary:   #e8dfd1;
  --secondary: #8a8478;
  --accent:    #b8956a;
  --rule:      rgba(232,223,209,0.15);

  --font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-ui:   'Inter', system-ui, -apple-system, sans-serif;
  --font-mark: 'Cormorant Garamond', Georgia, serif;

  --content-width: 680px;
  --font-scale: 1;
}

/* ============================================================
   LIGHT MODE
   ============================================================ */
html[data-theme="light"] {
  --theme:     #f5f0e8;
  --primary:   #3a3028;
  --secondary: #6c6c6c;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: calc(18px * var(--font-scale));
  background: var(--theme);
  color: var(--primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--theme);
  color: var(--primary);
  line-height: 1.78;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--primary);
}

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

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--theme);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0 1.2rem;
}

/* Wordmark — inline SVG using Cormorant Garamond Italic.
   font-size on .lux-wordmark drives the SVG height via height:1em on the child SVG.
   fill:currentColor in the SVG inherits color from here, so light/dark works automatically. */
.lux-wordmark {
  display: block;
  font-size: 3.2rem;
  color: var(--primary);
  text-decoration: none;
  line-height: 0;
}

.lux-wordmark:hover {
  color: var(--primary);
}

.lux-wordmark-svg {
  height: 1em;
  width: auto;
  overflow: visible;
  display: block;
}

.lux-tagline {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.72rem;
  color: var(--secondary);
  opacity: 0.7;
  letter-spacing: 0.06em;
  margin-top: 1rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-top: 0.9rem;
  font-family: var(--font-ui);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-nav a {
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--primary);
}

/* Theme toggle */
#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--secondary);
  display: flex;
  align-items: center;
  transition: color 0.2s;
  line-height: 1;
}

#theme-toggle:hover {
  color: var(--primary);
}

[data-theme="dark"] #lux-sun-icon  { display: none; }
[data-theme="light"] #lux-moon-icon { display: none; }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
main {
  flex: 1;
  width: 100%;
  max-width: calc(var(--content-width) + 4rem);
  margin: 0 auto;
  padding: 1.75rem 2rem 3rem;
}

/* ============================================================
   HOMEPAGE — CARD GRID
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.card-grid:empty { display: none; }

.featured-divider {
  text-align: center;
  color: var(--accent);
  font-size: 1.1rem;
  opacity: 0.5;
  padding: 0.85rem 0 0.65rem;
  user-select: none;
}

/* Post card — image or fallback */
.post-card {
  display: block;
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  text-decoration: none;
  background-color: var(--theme);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--rule);
}

/* Gradient overlay — only when image is present */
.post-card--img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 25%, rgba(0,0,0,0.62) 100%);
  pointer-events: none;
}

.post-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1rem 0.9rem;
  z-index: 1;
}

/* Text on image cards: always white */
.post-card--img .post-card-title {
  color: #fff;
}

.post-card--img .post-card-meta {
  color: rgba(255,255,255,0.7);
}

/* Text on fallback cards: theme colours */
.post-card:not(.post-card--img) .post-card-title {
  color: var(--primary);
}

.post-card:not(.post-card--img) .post-card-meta {
  color: var(--secondary);
}

.post-card-desc {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.78rem;
  line-height: 1.42;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card--img .post-card-desc {
  color: rgba(255,255,255,0.72);
}

.post-card:not(.post-card--img) .post-card-desc {
  color: var(--secondary);
}

.post-card-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.35;
  margin-bottom: 0.3rem;
}

.post-card-meta {
  font-family: var(--font-ui);
  font-size: 0.63rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.post-card-section {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.post-card--img .post-card-section {
  color: rgba(255,255,255,0.55);
}

.post-card:not(.post-card--img) .post-card-section {
  color: var(--accent);
  opacity: 0.75;
}

.post-meta-section {
  color: var(--accent);
  opacity: 0.8;
}

.post-card--img:hover .post-card-title {
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.45);
  text-underline-offset: 3px;
}

.post-card:not(.post-card--img):hover .post-card-title {
  color: var(--accent);
}

/* ============================================================
   POST LIST — section pages (/posts/)
   ============================================================ */
.post-list {
  list-style: none;
}

.post-item {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}

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

.post-body {
  min-width: 0;
}

.post-title a {
  font-family: var(--font-body);
  font-size: 1.12rem;
  font-weight: 400;
  color: var(--primary);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.2s;
}

.post-title a:hover {
  color: var(--accent);
}

.post-meta {
  margin-top: 0.45rem;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--secondary);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.meta-sep {
  opacity: 0.35;
  user-select: none;
}

/* ============================================================
   SECTION LIST PAGE
   ============================================================ */
.section-heading {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.section-description {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.86rem;
  color: var(--secondary);
  line-height: 1.6;
  margin-bottom: 1.75rem;
  opacity: 0.85;
}

/* ============================================================
   SINGLE / ARTICLE
   ============================================================ */
.article-cover-wrap {
  margin-bottom: 2.5rem;
  border-radius: 2px;
  overflow: hidden;
  max-width: var(--content-width);
}

.article-cover {
  width: 100%;
  height: auto;
  display: block;
}

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.article-title {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 400;
  color: var(--primary);
  line-height: 1.22;
  margin-bottom: 1.1rem;
}

.article-subtitle {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--secondary);
  line-height: 1.45;
  margin-bottom: 1.1rem;
}

.article-meta {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.article-content {
  font-size: 1rem;
  line-height: 1.85;
  max-width: var(--content-width);
}

.article-content p {
  margin-bottom: 1.6rem;
}

.article-content h2 {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 3rem;
  margin-bottom: 1.1rem;
  opacity: 0.85;
}

.article-content h3 {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 2.25rem;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.article-content h4 {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--secondary);
  text-transform: uppercase;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}

.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(184,149,106,0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

.article-content a:hover {
  color: var(--primary);
  text-decoration-color: rgba(232,223,209,0.4);
}

.article-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.1rem 0 0.1rem 1.6rem;
  margin: 2rem 0;
  color: var(--secondary);
  font-style: italic;
}

.article-content blockquote p {
  margin-bottom: 0.6rem;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 3rem auto;
  width: 40%;
}

.article-content ul,
.article-content ol {
  padding-left: 1.4rem;
  margin-bottom: 1.5rem;
}

.article-content li {
  margin-bottom: 0.4rem;
}

.article-content code {
  font-size: 0.88em;
  background: rgba(232,223,209,0.06);
  border: 1px solid var(--rule);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

.article-content pre {
  background: rgba(232,223,209,0.04);
  border: 1px solid var(--rule);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border-radius: 2px;
}

.article-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.6;
}

.article-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  margin: 2rem auto;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
body.page-about main {
  max-width: 960px;
}

.about-bio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding-top: 1rem;
  padding-bottom: 4rem;
}

.about-avatar {
  width: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.about-text {
  font-size: 1rem;
  line-height: 1.82;
}

.about-text p {
  margin-bottom: 1.5rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 600px) {
  .about-bio {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   SUBSCRIBE
   ============================================================ */
.footer-subscribe {
  padding: 2rem 0 1.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}

.footer-subscribe p {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--secondary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.subscribe-btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid rgba(184,149,106,0.45);
  padding: 0.5rem 1.4rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.subscribe-btn:hover {
  background: var(--accent);
  color: var(--theme);
  border-color: var(--accent);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 2rem;
  text-align: center;
}

.footer-copy {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  color: var(--secondary);
  letter-spacing: 0.04em;
  opacity: 0.6;
}

.footer-copy a {
  color: inherit;
  text-decoration: none;
}

.footer-copy a:hover {
  color: var(--accent);
}

/* ============================================================
   TEXT SIZE ADJUSTER
   ============================================================ */
.text-sizer {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 200;
  opacity: 0.45;
  transition: opacity 0.25s;
}

.text-sizer:hover {
  opacity: 1;
}

.text-sizer button {
  background: var(--theme);
  border: 1px solid var(--rule);
  color: var(--secondary);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  width: 28px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1;
  padding: 0;
}

.text-sizer button:hover {
  color: var(--accent);
  border-color: rgba(184,149,106,0.55);
}

/* ============================================================
   HAMBURGER + MOBILE NAV
   ============================================================ */
#nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--secondary);
  align-items: center;
  transition: color 0.2s;
}

#nav-toggle:hover {
  color: var(--primary);
}

#mobile-nav {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: var(--theme);
  border-top: 1px solid var(--rule);
  padding: 1rem 0 1.2rem;
}

#mobile-nav.open {
  display: flex;
}

#mobile-nav a {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondary);
  text-decoration: none;
  padding: 0.6rem 0;
  transition: color 0.2s;
}

#mobile-nav a:hover {
  color: var(--primary);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pagination a {
  color: var(--accent);
  text-decoration: none;
  opacity: 0.8;
}

.pagination a:hover {
  opacity: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  html {
    font-size: calc(17px * var(--font-scale));
  }

  main {
    padding: 1.25rem 1.25rem 2.5rem;
  }

  .lux-wordmark {
    font-size: 2.4rem !important;
  }

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

  .article-title {
    font-size: 1.55rem;
  }

  .header-nav a {
    display: none;
  }

  #nav-toggle {
    display: flex;
  }

  .text-sizer {
    bottom: 1rem;
    right: 1rem;
  }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header,
  .site-footer,
  .text-sizer {
    display: none !important;
  }

  html, body {
    background: white !important;
    color: black !important;
    font-family: Georgia, 'Times New Roman', serif !important;
    font-size: 11pt !important;
    line-height: 1.65 !important;
  }

  main {
    max-width: 100% !important;
    padding: 0 !important;
  }

  .article-title {
    color: black !important;
    font-size: 20pt !important;
    margin-bottom: 0.5rem !important;
  }

  .article-meta {
    color: #444 !important;
    font-size: 8.5pt !important;
    margin-bottom: 2rem !important;
  }

  .article-content {
    color: black !important;
    font-size: 11pt !important;
    line-height: 1.65 !important;
  }

  .article-content a {
    color: black !important;
    text-decoration: underline !important;
  }

  .article-content blockquote {
    color: #333 !important;
    border-left-color: #aaa !important;
  }

  .article-content hr {
    border-top-color: #ccc !important;
  }

  @page {
    margin: 2.5cm 3cm;
  }
}
