/* ─────────────────────────────────────────────
   ELJ Ghost Theme — screen.css
   Unexpected. Useful. Quiet.
───────────────────────────────────────────── */

/* ── Tokens ── */
:root {
  --blue:   #002FA7;
  --paper:  #f0ece0;
  --ink:    #1a1a1a;
  --yellow: #e8c84a;
  --red:    #cc1a1a;
  --dark:   #0a1628;

  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-body:    'IM Fell English', 'Georgia', serif;
  --font-mono:    'Courier New', 'Courier', monospace;
  --font-hand:    'Caveat', cursive;

  --max-width: 760px;
  --wide-width: 1100px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 18px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover { text-decoration: underline; }

/* ── Header ── */
.site-header {
  border-bottom: 2px solid var(--blue);
  padding: 0 40px;
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.site-logo-link { display: flex; align-items: center; }
.site-logo { height: 44px; width: auto; }

.site-title-link { text-decoration: none; }
.site-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--blue);
  text-transform: uppercase;
}

/* ── Nav ── */
.site-nav { display: flex; gap: 0; list-style: none; }

.site-nav .nav {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav .nav li a,
.site-nav a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.7;
  padding: 0 20px;
  text-decoration: none;
  transition: opacity 0.15s;
}

.site-nav .nav li a:hover,
.site-nav a:hover { opacity: 1; color: var(--blue); }

/* ── Home Hero ── */
.home-hero {
  background: var(--blue);
  background-image: url('/assets/images/topo-hero.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 80px 40px 64px;
  position: relative;
}

.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 47, 167, 0.55);
  z-index: 0;
}

.home-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--yellow);
  opacity: 0.6;
  z-index: 1;
}

.home-hero-inner { position: relative; z-index: 1; }

.home-hero-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.home-title-block { flex: 1; }

.home-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 112px);
  letter-spacing: 0.02em;
  line-height: 0.92;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.home-title-first { color: var(--paper); }

.home-title-last  { color: var(--red); }

.home-description {
  font-family: var(--font-mono);
  font-size: 15px;
  font-style: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 1;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

.home-pin-wrap { flex-shrink: 0; align-self: flex-end; }

.home-pin { height: 140px; width: auto; display: block; }

/* ── Tag / Author Headers ── */
.tag-header,
.author-header {
  border-bottom: 2px solid var(--blue);
  padding: 48px 40px 40px;
}

.tag-header-inner,
.author-header-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.tag-title,
.author-name {
  font-family: var(--font-display);
  font-size: 48px;
  letter-spacing: 0.04em;
  color: var(--blue);
}

.tag-description,
.author-bio {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  opacity: 0.65;
  margin-top: 8px;
}

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ── Post Feed ── */
.post-feed-wrapper {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 56px 40px;
}

.post-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 48px 40px;
}

/* ── Post Card ── */
.post-card {
  border-top: 2px solid var(--blue);
  padding-top: 20px;
}

.post-card-image-link {
  display: block;
  margin-bottom: 16px;
  overflow: hidden;
}

.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: opacity 0.2s;
}

.post-card-image:hover { opacity: 0.9; }

.post-card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.45;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-card-tag {
  color: var(--blue);
  opacity: 1;
  font-weight: bold;
  text-decoration: none;
}

.post-card-tag:hover { text-decoration: underline; }

.post-card-meta-sep { opacity: 0.4; }

.post-card-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.post-card-title a {
  color: var(--ink);
  text-decoration: none;
}

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

.post-card-excerpt {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.65;
}

/* ── Pagination ── */
.pagination {
  margin-top: 56px;
  border-top: 1px solid rgba(0,47,167,0.15);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pagination a {
  color: var(--blue);
  text-decoration: none;
  font-weight: bold;
}

.pagination .page-number { opacity: 0.4; }

/* ── Post Full ── */
.post-full,
.page-full {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 40px 80px;
}

.post-header {
  margin-bottom: 40px;
  border-bottom: 2px solid var(--blue);
  padding-bottom: 32px;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.45;
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.post-tag {
  color: var(--blue);
  opacity: 1;
  text-decoration: none;
  font-weight: bold;
}

.post-date { opacity: 0.55; }

.post-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: 0.02em;
  line-height: 1.0;
  color: var(--ink);
  margin-bottom: 16px;
}

.post-excerpt {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
  opacity: 0.7;
  margin-top: 16px;
}

.post-feature-image {
  margin: 0 0 48px;
  max-width: var(--wide-width);
  margin-left: calc(50% - min(var(--wide-width) / 2, 50vw));
  width: min(var(--wide-width), 100vw);
}

.post-feature-image img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

.post-feature-image figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  opacity: 0.4;
  text-align: center;
  margin-top: 8px;
}

/* ── Post Content ── */
.gh-content > * + * { margin-top: 1.5em; }

.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4 {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  color: var(--blue);
  margin-top: 2em;
  margin-bottom: 0.4em;
  line-height: 1.1;
}

.gh-content h2 { font-size: 36px; }
.gh-content h3 { font-size: 28px; }
.gh-content h4 { font-size: 22px; }

.gh-content p {
  font-size: 18px;
  line-height: 1.75;
}

.gh-content a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gh-content blockquote {
  border-left: 3px solid var(--yellow);
  padding-left: 24px;
  margin-left: 0;
  font-style: italic;
  color: var(--ink);
  opacity: 0.8;
}

.gh-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: #e8e0d0;
  padding: 2px 6px;
  border-radius: 2px;
}

.gh-content pre {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--dark);
  color: var(--paper);
  padding: 24px;
  overflow-x: auto;
  line-height: 1.6;
  margin: 2em 0;
}

.gh-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.gh-content hr {
  border: none;
  border-top: 2px solid var(--blue);
  margin: 2.5em 0;
}

.gh-content ul,
.gh-content ol {
  padding-left: 1.5em;
}

.gh-content li { margin-bottom: 0.4em; }

.gh-content figure { margin: 2em 0; }

.gh-content figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.4;
  text-align: center;
  margin-top: 8px;
}

.gh-content table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 14px;
  margin: 2em 0;
}

.gh-content th {
  border-bottom: 2px solid var(--blue);
  padding: 8px 12px;
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
}

.gh-content td {
  border-bottom: 1px solid rgba(0,47,167,0.1);
  padding: 8px 12px;
}

/* ── Post Footer ── */
.post-footer {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--yellow);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.post-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-author {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.55;
}

.post-author-name {
  color: var(--blue);
  opacity: 1;
  font-weight: bold;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-tags .post-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--blue);
  color: var(--paper);
  padding: 3px 8px;
  text-decoration: none;
}

.post-tags .post-tag:hover { background: var(--dark); }

.post-back {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}

.post-back:hover { text-decoration: underline; }

/* ── About bio layout ── */
.about-bio {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
  padding: 48px 0 60px;
  max-width: var(--wide-width);
  margin: 0 auto;
}

.page-full.page-about { padding: 40px 40px 0; }

.about-portrait {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--blue);
}

.about-bio-text .post-title {
  font-family: var(--font-display);
  font-size: 48px;
  color: var(--ink);
  margin-bottom: 24px;
}

@media (max-width: 700px) {
  .about-bio {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 0 48px;
  }
  .about-portrait { max-width: 180px; }
  .page-full.page-about { padding: 32px 20px 0; }
}

/* ── Footer ── */
.site-footer {
  border-top: 2px solid var(--blue);
  padding: 24px 40px;
  background: var(--paper);
}

.site-footer-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-footer-mark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--blue);
  opacity: 0.5;
}

.site-footer-copy {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--ink);
  opacity: 0.4;
}

.site-footer-tagline {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13px;
  color: var(--ink);
  opacity: 0.35;
  margin-left: auto;
}

/* ── Error ── */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  padding: 80px 40px;
}

.error-page-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.error-code {
  font-family: var(--font-display);
  font-size: 120px;
  color: var(--blue);
  line-height: 1;
  opacity: 0.15;
  margin-bottom: 16px;
}

.error-message {
  font-family: var(--font-body);
  font-size: 24px;
  color: var(--ink);
  margin-bottom: 24px;
}

.error-back {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .site-header { padding: 0 20px; }
  .home-hero { padding: 48px 20px 40px; }
  .home-pin-wrap { display: none; }
  .post-feed-wrapper { padding: 40px 20px; }
  .post-feed { grid-template-columns: 1fr; gap: 32px; }
  .post-full, .page-full { padding: 40px 20px 60px; }
  .site-footer { padding: 20px; }
  .site-footer-tagline { display: none; }
  .post-footer { flex-direction: column; }
  .tag-header, .author-header { padding: 32px 20px; }
}

/* ── Projects page ── */
.projects-header {
  background: var(--dark);
  background-image: url('/assets/images/safety-mapper-hero.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 80px 40px 64px;
  position: relative;
}

.projects-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 47, 167, 0.55);
  z-index: 0;
}

.projects-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--yellow);
  opacity: 0.6;
  z-index: 1;
}

.projects-header-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.projects-title-block { flex: 1; }

.projects-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 112px);
  letter-spacing: 0.02em;
  color: var(--paper);
  line-height: 0.92;
  margin-bottom: 16px;
}

.projects-pin-wrap { flex-shrink: 0; align-self: flex-end; }

.projects-pin {
  height: 140px;
  width: auto;
  display: block;
  overflow: visible;
}

.projects-subtitle {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.75;
  max-width: 480px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

.projects-wrapper {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 56px 40px 80px;
}

.projects-section { margin-bottom: 64px; }

.projects-section-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue);
}

.section-label-text {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.1em;
  color: var(--blue);
}

.section-label-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.4;
}

/* Flagship card — full width, prominent */
.project-card--flagship {
  display: flex;
  flex-direction: column;
  background: var(--blue);
  background-image: url('/assets/images/safety-mapper-hero.png');
  background-size: cover;
  background-position: center;
  position: relative;
  text-decoration: none;
  transition: opacity 0.15s;
  overflow: hidden;
}

.project-card--flagship::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 47, 167, 0.78);
  z-index: 0;
}

.project-card--flagship .project-card-body {
  position: relative;
  z-index: 1;
  padding: 28px 32px 32px;
}

.project-card--flagship { cursor: default; }

.project-card--flagship .project-card-image {
  height: 260px;
  background-size: cover;
  background-position: center;
  background-color: var(--dark);
}

.project-card--flagship .project-card-title {
  font-family: var(--font-display);
  font-size: 40px;
  letter-spacing: 0.03em;
  color: var(--paper);
  line-height: 1.05;
  margin-bottom: 10px;
}

.project-card--flagship .project-card-excerpt {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--paper);
  opacity: 0.75;
  max-width: 600px;
  margin-bottom: 20px;
}

.project-card-links {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 4px;
}

.project-link--demo {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--yellow);
  text-decoration: none;
}

.project-link--demo:hover { opacity: 0.8; text-decoration: none; }

.project-link--github {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(240,236,224,0.45);
  text-decoration: none;
}

.project-link--github:hover { color: rgba(240,236,224,0.75); text-decoration: none; }

/* Lab grid — two columns */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.project-card--lab {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,47,167,0.2);
  border-top: 3px solid var(--blue);
  padding: 24px;
}

.project-card--lab .project-card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
}

.project-card--lab .project-card-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 10px;
}

.project-card--lab .project-card-excerpt {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.65;
  flex-grow: 1;
  margin-bottom: 16px;
}

.project-card--lab .project-link--demo {
  color: var(--blue);
}

.project-card--lab .project-link--github {
  color: rgba(10,22,40,0.35);
}

.project-card--lab .project-link--github:hover {
  color: rgba(10,22,40,0.65);
}

@media (max-width: 700px) {
  .projects-header { padding: 48px 20px 40px; }
  .projects-header::after { left: 20px; right: 20px; }
  .projects-title { font-size: 48px; }
  .projects-wrapper { padding: 40px 20px 60px; }
  .lab-grid { grid-template-columns: 1fr; }
  .project-card--flagship .project-card-body { padding: 20px; }
}

/* ── Ghost-specific overrides ── */
.gh-content .kg-width-wide {
  margin-left: calc(50% - 400px);
  width: 800px;
  max-width: 100vw;
}

.gh-content .kg-width-full {
  margin-left: calc(-40px);
  width: calc(100% + 80px);
  max-width: 100vw;
}

.gh-content .kg-image-card img,
.gh-content .kg-gallery-image img { width: 100%; }

.gh-content .kg-gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 2em 0;
}

.gh-content .kg-bookmark-card {
  border: 1px solid rgba(0,47,167,0.15);
  border-left: 3px solid var(--blue);
  padding: 16px;
  margin: 2em 0;
  font-family: var(--font-mono);
  font-size: 13px;
}

.gh-content .kg-bookmark-title {
  font-weight: bold;
  color: var(--blue);
  margin-bottom: 4px;
}

.gh-content .kg-bookmark-description {
  opacity: 0.6;
  font-size: 12px;
}

.gh-content .kg-callout-card {
  background: rgba(0,47,167,0.06);
  border-left: 3px solid var(--blue);
  padding: 16px 20px;
  margin: 2em 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.gh-content .kg-toggle-card {
  border: 1px solid rgba(0,47,167,0.15);
  padding: 16px;
  margin: 1.5em 0;
}

.gh-content .kg-toggle-heading-text {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  color: var(--blue);
}
