/*
Theme Name: BORSTEV Journal
Theme URI: https://borstev.com
Author: BORSTEV
Description: A focused editorial theme for the BORSTEV Journal.
Version: 1.0.2
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: borstev-journal
*/

:root {
  --borstev-blue: #3369c7;
  --borstev-deep-blue: #3351bc;
  --borstev-bright-blue: #4686d4;
  --ink: #142033;
  --muted: #657083;
  --paper: #f6f5f2;
  --surface: #ffffff;
  --pale-blue: #edf3fc;
  --line: #d9e1eb;
  --navy: #0d1b32;
  --radius: 18px;
  --shadow: 0 18px 55px rgba(20, 32, 51, .09);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
a:hover { color: var(--borstev-deep-blue); }
:focus-visible { outline: 3px solid var(--borstev-bright-blue); outline-offset: 4px; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  z-index: 100000; top: 8px; left: 8px; width: auto; height: auto; padding: 10px 14px;
  margin: 0; overflow: visible; clip: auto; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow);
}
.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }
.container { width: min(100% - 40px, 1180px); margin: 0 auto; }

.site-header {
  position: sticky; z-index: 20; top: 0; border-bottom: 1px solid rgba(217,225,235,.8);
  background: rgba(246,245,242,.93); backdrop-filter: blur(14px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 74px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: .93rem; font-weight: 900; letter-spacing: -.035em; text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.brand-name { font-size: 1.06rem; letter-spacing: -.04em; }
.brand-section { padding-left: 10px; border-left: 1px solid var(--line); color: var(--muted); font-size: .76rem; font-weight: 750; letter-spacing: .02em; }
.primary-nav { display: none; align-items: center; gap: 22px; }
.primary-nav a { color: #40506a; font-size: .8rem; font-weight: 750; text-decoration: none; }
.primary-nav a:hover, .primary-nav .current-menu-item > a { color: var(--borstev-deep-blue); }
.header-cta, .button-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 15px;
  border: 1px solid var(--borstev-blue); border-radius: 999px; background: var(--borstev-blue); color: #fff;
  font-size: .79rem; font-weight: 850; line-height: 1; text-decoration: none; white-space: nowrap;
}
.header-cta:hover, .button-link:hover { border-color: var(--borstev-deep-blue); background: var(--borstev-deep-blue); color: #fff; }

.journal-hero { padding: 76px 0 66px; background: linear-gradient(135deg, #edf3fc 0%, #f6f5f2 62%, #fff 100%); }
.journal-hero-grid { display: grid; gap: 34px; align-items: end; }
.eyebrow { margin: 0 0 16px; color: var(--borstev-blue); font-size: .71rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.journal-hero h1, .entry-title, .not-found-title { margin: 0; font-weight: 850; letter-spacing: -.065em; line-height: .98; }
.journal-hero h1 { max-width: 720px; font-size: clamp(3rem, 8vw, 6.5rem); }
.journal-hero h1 span { color: var(--borstev-blue); }
.journal-intro { max-width: 405px; margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.55; }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-links a { padding: 8px 11px; border: 1px solid #c6d6ee; border-radius: 999px; color: var(--borstev-deep-blue); font-size: .76rem; font-weight: 800; text-decoration: none; }
.hero-links a:hover { border-color: var(--borstev-blue); background: #fff; }

.journal-content { padding: 58px 0 90px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: 1.1rem; letter-spacing: -.03em; }
.section-heading p { margin: 0; color: var(--muted); font-size: .82rem; }
.post-grid { display: grid; gap: 18px; }
.post-card { display: flex; flex-direction: column; min-height: 100%; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 0 rgba(20,32,51,.02); }
.post-card:hover { border-color: #a9c4ec; box-shadow: var(--shadow); transform: translateY(-2px); }
.post-card, .post-card * { transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.post-card-meta, .entry-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; color: var(--muted); font-size: .75rem; font-weight: 700; }
.post-card-category { color: var(--borstev-blue); font-size: .69rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.post-card h2 { margin: 27px 0 13px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.045em; line-height: 1.08; }
.post-card h2 a { text-decoration: none; }
.post-card h2 a:hover { color: var(--borstev-deep-blue); }
.post-card-excerpt { margin: 0; color: var(--muted); font-size: .94rem; }
.post-card-footer { margin-top: auto; padding-top: 26px; }
.text-link { color: var(--borstev-deep-blue); font-size: .84rem; font-weight: 850; text-decoration: none; }
.text-link:hover { color: var(--borstev-blue); text-decoration: underline; text-underline-offset: 4px; }
.empty-journal { padding: 48px; border: 1px dashed #b9c9e0; border-radius: var(--radius); background: var(--surface); }
.empty-journal h2 { margin-top: 0; }
.empty-journal p { max-width: 600px; color: var(--muted); }

.article-hero { padding: 68px 0 52px; background: var(--pale-blue); }
.article-hero-inner { width: min(100% - 40px, 860px); margin: 0 auto; }
.back-link { display: inline-flex; margin-bottom: 34px; color: var(--borstev-deep-blue); font-size: .8rem; font-weight: 850; text-decoration: none; }
.back-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.entry-title { font-size: clamp(2.55rem, 6vw, 5.35rem); }
.entry-meta { margin-top: 26px; }
.entry-meta a { color: inherit; text-decoration: none; }
.entry-meta a:hover { color: var(--borstev-deep-blue); }
.article-layout { display: grid; gap: 42px; width: min(100% - 40px, 1120px); margin: 0 auto; padding: 48px 0 90px; }
.article-content { min-width: 0; max-width: 760px; }
.entry-content { color: #27364b; font-size: 1.08rem; line-height: 1.78; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2, .entry-content h3 { color: var(--ink); letter-spacing: -.045em; line-height: 1.1; }
.entry-content h2 { margin: 64px 0 18px; font-size: clamp(1.85rem, 4vw, 2.7rem); }
.entry-content h3 { margin: 38px 0 14px; font-size: clamp(1.35rem, 3vw, 1.7rem); }
.entry-content p, .entry-content ul, .entry-content ol { margin: 0 0 23px; }
.entry-content ul, .entry-content ol { padding-left: 1.35em; }
.entry-content li { margin-bottom: 9px; }
.entry-content a { color: var(--borstev-deep-blue); font-weight: 720; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--borstev-blue); }
.entry-content strong { color: var(--ink); }
.entry-content blockquote { margin: 32px 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--borstev-blue); color: #40506a; font-size: 1.22rem; line-height: 1.52; }
.entry-content table { width: 100%; margin: 32px 0; border-collapse: collapse; font-size: .92rem; }
.entry-content th, .entry-content td { padding: 13px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.entry-content th { background: #eef4fd; color: var(--ink); }
.entry-content .wp-block-embed { margin: 0 0 38px; }
.entry-content .wp-block-embed__wrapper { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 14px; background: var(--navy); box-shadow: var(--shadow); }
.entry-content .wp-block-embed iframe { position: absolute; width: 100%; height: 100%; inset: 0; border: 0; }
.article-aside { align-self: start; padding: 25px; border: 1px solid #cbd9ee; border-radius: var(--radius); background: #f1f6fe; }
.article-aside p { margin: 0 0 12px; color: var(--borstev-deep-blue); font-size: .73rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.article-aside h2 { margin: 0 0 15px; font-size: 1.35rem; letter-spacing: -.04em; line-height: 1.12; }
.article-aside span { display: block; margin-bottom: 20px; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.article-aside .button-link { width: 100%; }
.entry-footer { margin-top: 55px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; }
.entry-footer a { color: var(--borstev-deep-blue); }
.post-navigation { display: flex; justify-content: space-between; gap: 20px; margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line); }
.post-navigation a { max-width: 48%; color: var(--borstev-deep-blue); font-size: .84rem; font-weight: 800; text-decoration: none; }

.site-footer { margin-top: auto; padding: 50px 0 30px; background: var(--navy); color: #d9e4f5; }
.footer-grid { display: grid; gap: 32px; }
.footer-brand .brand { color: #fff; }
.footer-brand .brand-section { border-color: #3a4d6b; color: #b8c6da; }
.footer-copy { max-width: 320px; margin: 14px 0 0; color: #b8c6da; font-size: .88rem; line-height: 1.55; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.footer-links a { color: #d9e4f5; font-size: .83rem; font-weight: 700; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 38px; padding-top: 22px; border-top: 1px solid #293d5c; color: #9fb0c8; font-size: .75rem; }
.footer-bottom a { color: inherit; text-decoration: none; }

.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: .82rem; font-weight: 800; text-decoration: none; }
.pagination .current, .pagination a:hover { border-color: var(--borstev-blue); background: var(--borstev-blue); color: #fff; }

@media (min-width: 720px) {
  .container { width: min(100% - 72px, 1180px); }
  .header-inner { min-height: 82px; }
  .primary-nav { display: flex; }
  .journal-hero { padding: 118px 0 95px; }
  .journal-hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(260px, .55fr); gap: 80px; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .post-card:first-child { grid-column: span 2; min-height: 300px; padding: 38px; background: linear-gradient(135deg, #fff 0%, #f1f6fe 100%); }
  .post-card:first-child h2 { max-width: 750px; font-size: clamp(2rem, 4vw, 3.45rem); }
  .post-card:first-child .post-card-excerpt { max-width: 600px; font-size: 1.04rem; }
  .article-hero { padding: 104px 0 78px; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 72px; padding-top: 72px; }
  .article-aside { position: sticky; top: 106px; }
  .footer-grid { grid-template-columns: 1.1fr .9fr; align-items: end; }
  .footer-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 719px) {
  .brand-section { display: none; }
  .header-cta { min-height: 40px; padding: 9px 12px; font-size: .74rem; }
  .entry-content { font-size: 1rem; }
  .entry-content h2 { margin-top: 48px; }
  .entry-content table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
