/* LORICA — custom.css
   Scribal-philosophical reading site.
   Source Serif 4 + Inter. Dark/light toggle. */

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --theme:     #1c1814;
  --primary:   #d9cfbd;
  --secondary: #8e8472;
  --accent:    #c89968;
  --rule:      rgba(217,207,189,0.18);

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

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

html[data-theme="light"] {
  --theme:     #f5f0e6;
  --primary:   #2a2520;
  --secondary: #6b5f55;
  --accent:    #9a6e38;
  --rule:      rgba(42,37,32,0.15);
}

/* ============================================================
   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: 8px 0 6px;
  transition: padding 0.4s ease;
}

.header-logo {
  width: 160px;
  max-width: 88vw;
  height: auto;
  transition: width 0.4s ease;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.header-nav a:hover {
  opacity: 1;
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--accent);
  opacity: 0.82;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

#theme-toggle:hover { opacity: 1; }

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

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

/* ============================================================
   HOMEPAGE
   ============================================================ */

.home-hero {
  text-align: center;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0;
}

.home-hero-logo {
  width: 420px;
  max-width: 88vw;
  height: auto;
  margin: 0 auto;
}

.home-tagline {
  display: block;
  margin: 0.8rem auto 1.4rem;
  padding: 0;
}

.lorica-wordmark {
  font-family: var(--font-body);
  font-size: 1.6rem;
  font-weight: 400;
  font-style: normal;
  font-variant-ligatures: none;
  letter-spacing: 0.02em;
  color: #d9cfbd;
  transition: font-size 0.4s ease;
}

.lorica-wordmark__l {
  color: #c89968;
}

.lorica-sundial {
  display: block;
  height: 1rem;
  width: auto;
  margin: 0 auto;
}

#lorica-sundial-wrap {
  text-align: center;
}

.about-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding-bottom: 4rem;
}

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;
}

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

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

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

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


/* Cover image row layout */
.post-item--cover {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.post-cover-wrap {
  flex-shrink: 0;
  width: 260px;
  aspect-ratio: 1 / 1;
  display: block;
  overflow: hidden;
  border-radius: 4px;
  background: #2a2420;
}

.post-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

html[data-theme="light"] .post-cover-wrap {
  background: #2a2420;
  padding: 6px;
  border-radius: 6px;
}

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

@media (max-width: 600px) {
  .post-item--cover {
    flex-direction: column;
    align-items: flex-start;
  }
  .post-cover-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
  }
}

.post-title a {
  font-family: var(--font-body);
  font-size: 1.15rem;
  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.69rem;
  color: var(--secondary);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.post-section-label {
  color: var(--accent);
  font-weight: 500;
}

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

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

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

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

html[data-theme="light"] .article-cover-wrap {
  background: #2a2420;
  padding: 6px;
  border-radius: 6px;
}

html[data-theme="light"] .article-content img {
  outline: 6px solid #2a2420;
  outline-offset: 0;
  border-radius: 4px;
}

.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-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-section-label {
  color: var(--accent);
}

/* Article body text */
.article-content {
  font-size: 1rem;
  line-height: 1.82;
  max-width: var(--content-width);
}

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

.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;
}

.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(200,153,104,0.45);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

.article-content a:hover {
  color: var(--primary);
  text-decoration-color: rgba(217,207,189,0.45);
}

.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%;
}

.lorica-divider {
  text-align: center;
  margin: 3rem auto;
}

.lorica-divider svg {
  opacity: 0.7;
}

.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(217,207,189,0.08);
  border: 1px solid var(--rule);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

.article-content pre {
  background: rgba(217,207,189,0.06);
  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: 4px;
  margin: 2rem auto;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-content {
  font-size: 1rem;
  line-height: 1.82;
  max-width: var(--content-width);
}

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

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

/* ============================================================
   SUBSCRIBE BLOCK (bottom of articles)
   ============================================================ */
.subscribe-block {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-top: 4.5rem;
  padding: 2.25rem 0;
  text-align: center;
}

.subscribe-block p {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  color: var(--secondary);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.subscribe-btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.71rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(200,153,104,0.55);
  padding: 0.45rem 1.2rem;
  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-subscribe {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  margin-left: -2rem;
  margin-right: -2rem;
  padding-left: 2rem;
  padding-right: 2rem;
  border-bottom: 1px solid var(--rule);
}

.footer-subscribe p {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--secondary);
  letter-spacing: 0.04em;
  margin-bottom: 0.8rem;
}

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

.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(200,153,104,0.55);
}

/* ============================================================
   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: 2.5rem 1.25rem 4rem;
  }

  .home-wordmark,
  .header-logo {
    width: 280px;
  }

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

  .header-nav {
    gap: 1.25rem;
    font-size: 0.68rem;
  }

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

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header,
  .site-footer,
  .text-sizer,
  .subscribe-block,
  .header-nav {
    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 h2 {
    color: black !important;
    font-size: 8pt !important;
    letter-spacing: 0.15em !important;
    margin-top: 2rem !important;
  }

  .article-content h3 {
    color: black !important;
    font-size: 12pt !important;
  }

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


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