/* SYMIOS — public blog (depends on home.css tokens, .symios-home-page) */

.blog-page {
  min-height: 100vh;
  padding: calc(88px + env(safe-area-inset-top, 0px)) 20px 64px;
  max-width: 760px;
  margin: 0 auto;
  font-family: var(--font-os, system-ui, sans-serif);
  color: var(--text-main, #0f172a);
}

.blog-page--list {
  max-width: 820px;
}

.blog-page-hero-title {
  font-family: var(--font-ft, var(--font-os, system-ui, sans-serif));
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--blue-dark, #0a1628);
  margin: 0 0 8px;
}

html.symios-home-page[data-theme="dark"] .blog-page-hero-title {
  color: var(--text-main, #e8eef5);
}

.blog-page-hero-sub {
  font-size: 0.95rem;
  color: var(--blue-mid, #3d5a73);
  margin: 0 0 40px;
  line-height: 1.5;
}

html.symios-home-page[data-theme="dark"] .blog-page-hero-sub {
  color: var(--text-muted, #9fb0c3);
}

@media (max-width: 640px) {
  .blog-page {
    padding-top: calc(150px + env(safe-area-inset-top, 0px));
  }
}

.blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Fade-up stagger uses .anim-fadeup + .is-visible from home.css (symios.js IntersectionObserver). */
@media (prefers-reduced-motion: reduce) {
  .blog-page--list .anim-fadeup,
  .blog-page--article .anim-fadeup {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

.blog-list-item {
  list-style: none;
  margin: 0;
  padding: 0;
}

.blog-list-item-link {
  display: block;
  border: 1px solid var(--gold, #c9a227);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: inherit;
  text-decoration: none;
  outline-offset: 3px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

html.symios-home-page[data-theme="dark"] .blog-list-item-link {
  background: rgba(8, 17, 27, 0.45);
  border-color: rgba(201, 162, 39, 0.55);
}

.blog-list-item-link:hover {
  border-color: var(--blue-dark, #0a1628);
  background: rgba(255, 255, 255, 0.5);
}

html.symios-home-page[data-theme="dark"] .blog-list-item-link:hover {
  border-color: var(--gold, #d4af37);
  background: rgba(12, 24, 36, 0.65);
}

.blog-list-item-link:hover .blog-list-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-list-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.blog-list-meta {
  font-size: 0.8rem;
  color: var(--blue-mid, #3d5a73);
  margin: 0 0 0.65rem;
}

html.symios-home-page[data-theme="dark"] .blog-list-meta {
  color: var(--text-muted, #9fb0c3);
}

.blog-list-excerpt {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
  color: var(--text-main, #0f172a);
}

html.symios-home-page[data-theme="dark"] .blog-list-excerpt {
  color: var(--text-main, #e8eef5);
}

.blog-list-read {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-dark, #0a1628);
}

html.symios-home-page[data-theme="dark"] .blog-list-read {
  color: var(--gold, #d4af37);
}

.blog-list-item-link:hover .blog-list-read {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--blue-mid, #3d5a73);
  border: 1px dashed rgba(201, 162, 39, 0.5);
  border-radius: 12px;
}

.blog-article-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue-dark, #0a1628);
  text-decoration: none;
}

.blog-article-back:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

html.symios-home-page[data-theme="dark"] .blog-article-back {
  color: var(--gold, #d4af37);
}

.blog-article-title {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}

.blog-article-meta {
  font-size: 0.88rem;
  color: var(--blue-mid, #3d5a73);
  margin: 0 0 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
}

html.symios-home-page[data-theme="dark"] .blog-article-meta {
  color: var(--text-muted, #9fb0c3);
}

.blog-article-body {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-main, inherit);
  overflow-x: auto;
}

/* CMS headings / bold labels (e.g. TL;DR): Bootstrap’s heading color stays dark in dark theme */
.blog-article-body :where(h1, h2, h3, h4, h5, h6) {
  color: var(--text-main, #0f172a);
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
  line-height: 1.25;
}

.blog-article-body :where(h4, h5, h6) {
  margin-top: 1.25rem;
}

.blog-article-body :where(strong, b) {
  font-weight: 700;
  color: var(--blue-dark, #1a3352);
}

html.symios-home-page[data-theme="dark"] .blog-article-body :where(h1, h2, h3, h4, h5, h6),
html.symios-home-page[data-theme="dark"] .blog-article-body :where(strong, b) {
  color: var(--text-main, #eef4fc);
}

.blog-article-body p {
  margin: 0 0 1rem;
}

.blog-article-body ul,
.blog-article-body ol {
  margin: 0 0 1rem 1.25rem;
}

.blog-article-body a {
  color: var(--blue-dark, #0a1628);
  text-decoration: underline;
  text-underline-offset: 2px;
}

html.symios-home-page[data-theme="dark"] .blog-article-body a {
  color: var(--gold, #d4af37);
}

.blog-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Scroll container for wide CMS tables (wrapper added in blog/details.php); radius lives on the table only. */
.blog-article-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0;
  width: 100%;
  max-width: 100%;
  scrollbar-width: thin;
}

/* CMS tables: match Symios light/dark tokens (inline cell colors may still override) */
.blog-article-body table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-main, inherit);
  background: var(--surface-1, #fff);
  border: 1px solid var(--border-strong, rgba(38, 76, 114, 0.18));
  box-shadow: var(--shadow-soft, 0 2px 12px rgba(38, 76, 114, 0.08));
}

.blog-article-body caption {
  caption-side: bottom;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted, #8a9aab);
  text-align: left;
}

.blog-article-body th,
.blog-article-body td {
  border: 1px solid var(--border-subtle, rgba(38, 76, 114, 0.07));
  padding: 0.55rem 0.8rem;
  text-align: left;
  vertical-align: top;
  color: inherit;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Plain tables (only td): first row acts as header. :has() unsupported → rows stay striped only. */
.blog-article-body thead th,
.blog-article-body table:not(:has(thead)):not(:has(th)) tbody tr:first-child td {
  background: var(--blue-dark, #1a3352);
  color: #ffffff;
  font-weight: 700;
  border-color: rgba(26, 51, 82, 0.35);
}

.blog-article-body thead th a,
.blog-article-body table:not(:has(thead)):not(:has(th)) tbody tr:first-child td a {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.45);
}

.blog-article-body thead th a:hover,
.blog-article-body table:not(:has(thead)):not(:has(th)) tbody tr:first-child td a:hover {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.85);
}

/* Beat .blog-article-body :where(strong, b) so header row bold matches header text color */
.blog-article-body thead th :where(strong, b),
.blog-article-body table:not(:has(thead)):not(:has(th)) tbody tr:first-child td :where(strong, b) {
  color: inherit;
}

html.symios-home-page[data-theme="dark"] .blog-article-body thead th :where(strong, b),
html.symios-home-page[data-theme="dark"]
  .blog-article-body
  table:not(:has(thead)):not(:has(th))
  tbody
  tr:first-child
  td
  :where(strong, b) {
  color: inherit;
}

.blog-article-body tbody th {
  background: rgba(26, 51, 82, 0.09);
  font-weight: 600;
  color: var(--blue-dark, #1a3352);
  border-color: var(--border-subtle, rgba(38, 76, 114, 0.07));
}

.blog-article-body tbody tr:nth-child(even) {
  background: var(--surface-soft, #f3f7fb);
}

.blog-article-body tbody tr:nth-child(odd) {
  background: var(--surface-1, #fff);
}

html.symios-home-page[data-theme="dark"] .blog-article-body table {
  background: var(--surface-2, #0d1826);
  border-color: var(--border-subtle, rgba(172, 197, 228, 0.12));
  box-shadow: var(--shadow-card, 0 8px 24px rgba(0, 0, 0, 0.24));
}

html.symios-home-page[data-theme="dark"] .blog-article-body thead th,
html.symios-home-page[data-theme="dark"]
  .blog-article-body
  table:not(:has(thead)):not(:has(th))
  tbody
  tr:first-child
  td {
  background: var(--gold, #d7b57a);
  color: var(--gold-text, #08111b);
  border-color: rgba(8, 17, 27, 0.22);
}

html.symios-home-page[data-theme="dark"] .blog-article-body thead th a,
html.symios-home-page[data-theme="dark"]
  .blog-article-body
  table:not(:has(thead)):not(:has(th))
  tbody
  tr:first-child
  td
  a {
  color: var(--gold-text, #08111b);
  text-decoration-color: rgba(8, 17, 27, 0.45);
}

html.symios-home-page[data-theme="dark"] .blog-article-body thead th a:hover,
html.symios-home-page[data-theme="dark"]
  .blog-article-body
  table:not(:has(thead)):not(:has(th))
  tbody
  tr:first-child
  td
  a:hover {
  color: var(--blue-dark, #eaf2fc);
  text-decoration-color: currentColor;
}

html.symios-home-page[data-theme="dark"] .blog-article-body tbody th {
  background: rgba(215, 181, 122, 0.14);
  color: var(--gold-light, #f4d38c);
  border-color: var(--border-subtle, rgba(172, 197, 228, 0.12));
}

html.symios-home-page[data-theme="dark"] .blog-article-body tbody tr:nth-child(even) {
  background: var(--surface-soft, #0f1c2d);
}

html.symios-home-page[data-theme="dark"] .blog-article-body tbody tr:nth-child(odd) {
  background: var(--surface-2, #0d1826);
}

html.symios-home-page[data-theme="dark"] .blog-article-body caption {
  color: var(--text-muted, #8095ab);
}

/* Article footer / author sign-off (grey in light & dark); CMS <footer> inside body or DB field on .blog-page */
.blog-article-body > footer,
.blog-article-body .blog-article-footer,
.blog-page > footer.blog-article-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle, rgba(38, 76, 114, 0.07));
  color: var(--text-muted, #8a9aab);
  font-size: 0.85rem;
  line-height: 1.6;
}

.blog-page > footer.blog-article-footer {
  margin-top: 0;
}


html.symios-home-page[data-theme="dark"] .blog-article-body > footer,
html.symios-home-page[data-theme="dark"] .blog-article-body .blog-article-footer,
html.symios-home-page[data-theme="dark"] .blog-page > footer.blog-article-footer {
  border-top-color: var(--border-subtle, rgba(172, 197, 228, 0.12));
  color: var(--text-muted, #8095ab);
}

.blog-article-body > footer :where(strong, b),
.blog-article-body .blog-article-footer :where(strong, b),
.blog-page > footer.blog-article-footer :where(strong, b) {
  color: inherit;
  font-weight: 700;
}

.blog-page > footer.blog-article-footer a {
  color: var(--text-mid, #4a6a8a);
  text-decoration: underline;
  text-underline-offset: 2px;
}

html.symios-home-page[data-theme="dark"] .blog-page > footer.blog-article-footer a {
  color: var(--text-sec, #a5b8ce);
}

/* Common CMS pattern: <hr> then bio / closing copy */
.blog-article-body > hr:last-of-type ~ p {
  color: var(--text-muted, #8a9aab);
  font-size: 0.85rem;
}

html.symios-home-page[data-theme="dark"] .blog-article-body > hr:last-of-type ~ p {
  color: var(--text-muted, #8095ab);
}

.blog-article-body > hr:last-of-type ~ p :where(strong, b) {
  color: inherit;
  font-weight: 700;
}
