/* Blog styling aligned with the gabrielzschmitz portfolio's newspaper
 * aesthetic. Palette, serif typography, and dark mode mirror
 * static/assets/css/main.css. */

:root {
  /* LIGHT MODE */
  --bg: #f9f6ee;
  --text-color: #0a0a0a;
  --text-subtle: #33302c;
  --badge-text: #e6dfcc;
  --burgundy: #7a0e1c;
  --burgundy-hover: #9e1426;
  --border-color: #1a1816;
  --light-border: #d2c8b6;
  --paper-texture-subtle: rgba(0, 0, 0, 0.03);
  --blank: rgba(0, 0, 0, 0);
  --code-bg: rgba(0, 0, 0, 0.04);

  /* FONTS */
  --font-headers: 'Cormorant Garamond', Georgia, serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-accent: 'Eczar', serif;
  --font-mono: 'Courier Prime', monospace;
  --font-symbol: 'Noto Sans Symbols', 'Lora', serif;
  --font-hiero: 'Noto Sans Egyptian Hieroglyphs', 'Lora', serif;
  --font-key: 'Noto Sans Symbols 2', 'Lora', serif;

  --max-width: 46rem;
}

/* DARK MODE */
html.dark-mode,
body.dark-mode {
  --bg: #0d0d0d;
  --text-color: #e6dfcc;
  --text-subtle: #b5ad9e;
  --badge-text: #e6dfcc;
  --burgundy: #8f1726;
  --burgundy-hover: #b32438;
  --border-color: #e6dfcc;
  --light-border: #2a2824;
  --paper-texture-subtle: rgba(255, 255, 255, 0.02);
  --code-bg: rgba(255, 255, 255, 0.06);

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 10px 10px;
  display: flex;
  justify-content: center;
  background-color: var(--bg);
  color: var(--text-color);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.2px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.4s ease, color 0.4s ease;
}

a {
  color: var(--burgundy);
  transition: color 0.2s ease;
}

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

.newspaper-wrapper {
  max-width: 960px;
  width: 100%;
  border: 2px solid var(--border-color);
  padding: 20px 20px;
  background-color: var(--bg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 1;
  transition: border-color 0.4s ease;
}

.site-header,
.site-main,
.site-footer {
  padding: 0;
}

.seal-key {
  font-family: var(--font-key);
  font-style: normal;
  font-weight: normal;
}

.seal-ornament {
  font-family: var(--font-symbol);
  font-style: normal;
  font-weight: normal;
}

/* THEME / CONTROL TOGGLES */
.blog-controls {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-seal {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  justify-content: center;
  align-items: center;
  cursor: pointer;
  background-color: var(--blank);
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.3s ease;
}

#ModeToggle,
#BackToTop {
  display: flex;
}

#BackToTop[hidden] {
  display: none !important;
}

.mode-seal:hover {
  background-color: var(--burgundy);
  color: var(--badge-text);
  border-color: var(--burgundy);
}

.seal-icon {
  font-family: var(--font-symbol);
  font-weight: 800;
}

/* SITE HEADER / NAV */
.site-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0;
  margin-bottom: 10px;
}

.site-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-serif);
  font-weight: 1000;
  font-size: 2.25rem;
  line-height: 2.25;
  letter-spacing: 2px;
  color: var(--text-color);
  text-decoration: none;
}

.site-title:hover {
  color: var(--burgundy);
}

.nav-sep {
  font-family: var(--font-symbol);
  color: var(--burgundy);
  font-size: 0.8rem;
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  margin: 0 1rem;
  color: var(--text-subtle);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1rem;
  letter-spacing: 2px;
  font-weight: 400;
  line-height: 2.25;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--burgundy);
  text-decoration: underline;
}

/* BLOG HOME */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1,
.site-main>h1 {
  font-family: var(--font-headers);
  font-weight: 600;
  font-size: 2.2rem;
  color: var(--burgundy);
  line-height: 1.2;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--light-border);
  margin-bottom: 12px;
}

.site-main h2,
.site-main h3 {
  font-family: var(--font-headers);
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.25;
}

.site-main h2 {
  font-size: 1.7rem;
  border-bottom: 1px dashed var(--light-border);
  padding-bottom: 8px;
}

.site-main h3 {
  font-size: 1.35rem;
}

/* ARCHIVUM / WRITINGS INDEX */
.archive-intro-banner {
  border-bottom: 3px double var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

.archive-code {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  color: var(--burgundy);
  letter-spacing: 2px;
  font-weight: 600;
}

.archive-intro-banner h2 {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 5px 0;
  letter-spacing: 1px;
  color: var(--text-color);
  border-bottom: none;
  padding-bottom: 0;
}

.archive-intro-banner p {
  font-size: 0.9rem;
  color: var(--text-subtle);
  font-family: var(--font-serif);
  opacity: 0.85;
  margin: 0;
  padding-bottom: 0;
}

.featured-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.writings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.grid-card {
  border: 1px solid var(--border-color);
  padding: 20px;
  background-color: var(--paper-texture-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grid-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.grid-card .card-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-featured {
  grid-column: span 1;
  background-color: transparent;
  border: 2px solid var(--border-color);
}

.card-badge {
  position: absolute;
  top: -10px;
  right: 15px;
  background: var(--burgundy);
  color: #fff;
  font-family: var(--font-headers);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 8px;
  letter-spacing: 1px;
}

.card-meta {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  color: var(--burgundy);
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.card-meta .bullet {
  margin: 0 4px;
  color: var(--text-subtle);
}

.card-title {
  margin-bottom: 10px;
}

.card-featured .card-title {
  font-size: 1.6rem;
}

.card-title a {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.2;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-title a:hover {
  color: var(--burgundy);
}

.card-text {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 15px;
  padding-bottom: 0;
  font-family: var(--font-serif);
  flex-grow: 1;
}

.card-featured .drop-cap-p::first-letter {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  float: left;
  font-size: 3.5rem;
  line-height: 0.8;
  padding-top: 4px;
  padding-right: 10px;
  padding-bottom: 2px;
  color: var(--burgundy);
}

.card-read-btn {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--burgundy);
  text-decoration: none;
  align-self: flex-start;
  margin-top: auto;
}

.card-read-btn:hover {
  text-decoration: underline;
  color: var(--burgundy-hover);
}

@media (max-width: 850px) {

  .writings-grid,
  .featured-row {
    grid-template-columns: 1fr;
  }

  .card-featured {
    grid-column: span 1;
  }
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.post-item {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--light-border);
}

.post-item:first-child {
  padding-top: 0;
}

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

.post-date {
  display: block;
  color: var(--burgundy);
  font-family: var(--font-serif);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.post-link {
  font-family: var(--font-headers);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
  line-height: 1.2;
  transition: color 0.2s ease;
}

.post-link:hover {
  color: var(--burgundy);
  text-decoration: underline;
}

.post-desc {
  margin: 0.25rem 0 0;
  color: var(--text-subtle);
  font-size: 0.92rem;
}

/* PAGE CONTENT */
.page-content {
  font-family: var(--font-serif);
}

.page-content p {
  padding-bottom: 12px;
}

.page-content img {
  max-width: 100%;
  height: auto;
}

.page-content pre {
  background: var(--paper-texture-subtle);
  border: 1px solid var(--light-border);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.page-content code {
  font-family: var(--font-mono);
  background: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-size: 0.9em;
}

.page-content pre code {
  background: none;
  padding: 0;
}

.page-content table {
  border-collapse: collapse;
  margin: 1rem 0;
}

.page-content th,
.page-content td {
  border: 1px solid var(--light-border);
  padding: 0.4rem 0.75rem;
}

.page-content blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--burgundy);
  color: var(--text-color);
  background-color: var(--paper-texture-subtle);
  font-style: italic;
}

.page-content .MathJax {
  font-size: 1em;
}

.page-content mjx-container[jax="CHTML"][display="true"] {
  display: block;
  margin: 1rem 0;
  text-align: center;
}

.page-content hr {
  border: none;
  border-top: 1px dashed var(--light-border);
  margin: 1.5rem 0;
}

.sidebar-box {
  border: 1px solid var(--border-color);
  padding: 20px;
}

.lamb-illustration-box {
  text-align: center;
  border: 3px double var(--border-color);
  background-color: var(--paper-texture-subtle);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.lamb-illustration-box .seal-link {
  width: 100%;
  height: 100%;
}

.lamb-illustration-box .illustration-border {
  border: 1px double var(--border-color);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lamb-illustration-box .lamb-symbol {
  font-size: 2.25rem;
  margin-bottom: 6px;
}

.lamb-illustration-box .illustration-caption {
  font-size: 0.95rem;
}

.lamb-illustration-box .latin-sub {
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Post header image + caption, styled as a box like the lamb illustration */
.page-content p:has(img):has(em) {
  text-align: center;
  border: 3px double var(--border-color);
  background-color: var(--paper-texture-subtle);
  padding: 18px;
  margin: 0 0 20px;
}

.page-content p:has(img):has(em) img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 12px;
  border: 1px solid var(--light-border);
}

.page-content p:has(img):has(em) em {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
  line-height: 1.5;
}

.page-content p:has(img):has(em) a {
  color: var(--burgundy);
}

.page-content p:has(img):has(em) a:hover {
  color: var(--burgundy-hover);
}

.illustration-border {
  border: 1px double var(--border-color);
  padding: 20px 10px;
}

.lamb-symbol {
  font-family: var(--font-symbol);
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--burgundy);
}

.lamb-symbol .lamb-hiero {
  font-family: var(--font-hiero);
}

.illustration-caption {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 2px;
}

.latin-sub {
  color: var(--text-subtle);
  font-style: italic;
  opacity: 0.8;
  margin-top: 4px;
}

.seal-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.seal-link:hover {
  transform: translateY(-2px);
}

.seal-link .illustration-caption {
  color: var(--text-color);
  transition: color 0.2s ease;
}

.seal-link:hover .illustration-caption,
.seal-link:hover .lamb-symbol {
  color: var(--burgundy-hover);
}


/* TAXONOMIES */
.page-taxonomies,
.taxonomy-list,
.taxonomy-item {
  margin: 0;
}

.page-taxonomies {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--light-border);
}

.taxonomy-name {
  color: var(--text-subtle);
  margin-right: 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.taxonomy-term,
.taxonomy-list a {
  color: var(--burgundy);
  text-decoration: none;
  margin-right: 0.75rem;
}

.taxonomy-term:hover,
.taxonomy-list a:hover {
  text-decoration: underline;
  color: var(--burgundy-hover);
}

.taxonomy-list li {
  margin-bottom: 0.5rem;
  list-style: none;
}

.taxonomy-count,
.taxonomy-list a+.taxonomy-count {
  color: var(--text-subtle);
  font-size: 0.85rem;
}

/* PAGE NAV */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--light-border);
}

.nav-prev,
.nav-next {
  text-decoration: none;
  color: var(--text-subtle);
  transition: color 0.2s ease;
}

.nav-prev:hover,
.nav-next:hover {
  color: var(--burgundy);
}

/* FOOTER */
.site-footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1rem;
  text-decoration: none;
  border-top: 1px dashed var(--light-border);
  color: var(--text-subtle);
  font-size: 0.85rem;
}

.site-footer p a {
  text-decoration: none;
  color: var(--text-subtle);
}

.site-footer a:hover {
  color: var(--burgundy);
}
