/* ============================================================================
   PAGES.CSS  ·  Layouts specific to the inner pages
   (work · contact · certifications · about · blog · post)
   Loaded AFTER sections.css so it reuses every token + component already defined.
   ========================================================================== */

/* ============================ INNER PAGE HEADER =========================== */
/* Compact hero used at the top of every inner page. */
.page-header { padding-block: calc(var(--nav-h) + var(--space-7)) var(--space-6); }
.page-header .eyebrow { margin-bottom: var(--space-3); }
.page-header h1 { max-width: 16ch; }
.page-header .lead { color: var(--text-muted); font-size: var(--fs-lg);
  max-width: 60ch; margin-top: var(--space-4); }

/* Two-column header variant (about / contact) */
.header-split { display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-7); align-items: center; }

/* ============================== FILTER BAR =============================== */
/* Reused on work, certifications, and blog to filter a grid by category. */
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--space-2);
  margin-bottom: var(--space-6); }
.filter-btn {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  background: var(--bg-surface); border: 1px solid var(--border);
  padding: 0.5rem 0.9rem; border-radius: var(--radius-pill);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.filter-btn:hover { border-color: var(--brand); color: var(--text); }
.filter-btn.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Items hidden by the filter */
.is-filtered-out { display: none !important; }

/* ============================ WORK / PROJECTS ============================= */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
/* (project cards reuse .work-card / .work-cover / .work-body from sections.css) */

/* ============================ CONTACT PAGE =============================== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-7);
  align-items: start; }

.contact-aside h2 { font-size: var(--fs-h2); margin-bottom: var(--space-3); }
.contact-aside h2 .em { color: var(--brand); font-style: italic; }
.contact-aside p { color: var(--text-muted); margin-bottom: var(--space-5); max-width: 44ch; }

/* Email row */
.contact-email { display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border: 1px solid var(--border);
  border-radius: var(--radius-media); background: var(--bg-surface);
  margin-bottom: var(--space-3); }
.contact-email .ic { width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px;
  display: grid; place-items: center; background: var(--color-surface-alt); color: var(--brand); }
.contact-email .ic svg { width: 18px; height: 18px; }
.contact-email .l { font-family: var(--font-mono); font-size: 0.65rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-faint); }
.contact-email .v { font-weight: 500; }
.contact-email .copy { margin-left: auto; font-family: var(--font-mono);
  font-size: 0.7rem; color: var(--text-muted); background: var(--color-surface-alt);
  padding: 0.4rem 0.7rem; border-radius: var(--radius-pill); }
.contact-email .copy:hover { color: var(--text); }

.contact-socials { display: flex; flex-wrap: wrap; gap: var(--space-4);
  margin-top: var(--space-5); }
.contact-socials a { font-family: var(--font-mono); font-size: var(--fs-xs);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); }

/* Form card */
.form-card { padding: var(--space-5); }
.form-card h3 { font-size: var(--fs-h3); margin-bottom: var(--space-4); }
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: var(--space-4); }
.field label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--color-faint); }
.field input, .field textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1.5px solid var(--border); border-radius: var(--radius-btn);
  padding: 0.8rem 0.9rem; transition: border-color var(--dur-fast) var(--ease); width: 100%;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.field .error { font-size: var(--fs-xs); color: var(--color-error); display: none; }
.field.has-error input, .field.has-error textarea { border-color: var(--color-error); }
.field.has-error .error { display: block; }
.form-card .btn { width: 100%; justify-content: center; }
.form-note { font-size: var(--fs-xs); color: var(--color-faint); margin-top: var(--space-3); }
/* Success state (revealed by JS after submit) */
.form-success { display: none; text-align: center; padding: var(--space-5) 0; }
.form-success.is-visible { display: block; }
.form-success .ok { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto var(--space-3);
  display: grid; place-items: center; background: color-mix(in srgb, var(--color-success) 15%, transparent);
  color: var(--color-success); }
.form-success h3 { margin-bottom: var(--space-2); }
.form-success p { color: var(--text-muted); }

/* =========================== CERTIFICATE LIGHTBOX ======================== */
/* The certificate image opens here; hidden until JS adds .is-open */
.lightbox { position: fixed; inset: 0; z-index: 300; display: none;
  place-items: center; padding: var(--space-4);
  background: rgba(20, 19, 15, 0.82); backdrop-filter: blur(4px); }
.lightbox.is-open { display: grid; }
.lightbox__panel { background: var(--bg-surface); border-radius: var(--radius-card);
  max-width: 760px; width: 100%; overflow: hidden; box-shadow: var(--shadow-lg); }
.lightbox__head { display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.lightbox__head h3 { font-size: 1.15rem; }
.lightbox__close { width: 36px; height: 36px; border-radius: 50%; display: grid;
  place-items: center; color: var(--text); }
.lightbox__close:hover { background: var(--color-surface-alt); }
/* Certificate image placeholder — replace .cert-image-ph with a real <img> */
.cert-image-ph { aspect-ratio: 1.414 / 1; background: var(--color-surface-alt);
  display: grid; place-items: center; color: var(--color-faint); font-family: var(--font-mono);
  font-size: var(--fs-sm); border-bottom: 1px solid var(--border); }
.lightbox__foot { display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); padding: var(--space-3) var(--space-4); flex-wrap: wrap; }
.lightbox__foot .meta { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }

/* ================================ PROSE ================================== */
/* Readable long-form column, used by About and the article Post page. */
.prose { max-width: 68ch; margin-inline: auto; }
.prose > * + * { margin-top: var(--space-4); }
.prose p { font-size: 1.15rem; line-height: 1.8; color: var(--text); }
.prose h2 { font-size: clamp(1.6rem, 2.6vw, 2rem); margin-top: var(--space-6); }
.prose h3 { font-size: 1.35rem; margin-top: var(--space-5); }
.prose a:not(.btn) { color: var(--brand); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.25rem; display: flex; flex-direction: column;
  gap: var(--space-2); }
.prose ul { list-style: disc; } .prose ol { list-style: decimal; }
.prose li { font-size: 1.1rem; line-height: 1.7; padding-left: 0.25rem; }
.prose li::marker { color: var(--accent); }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: var(--space-4);
  margin-block: var(--space-5); }
.prose blockquote p { font-family: var(--font-display); font-style: italic;
  font-size: 1.5rem; line-height: 1.4; color: var(--brand); }
.prose figure { margin-block: var(--space-5); }
.prose figure img, .prose .figure-ph { border-radius: var(--radius-media); width: 100%; }
.prose .figure-ph { aspect-ratio: 16 / 9; background: var(--color-surface-alt);
  display: grid; place-items: center; color: var(--color-faint); font-family: var(--font-mono);
  font-size: var(--fs-sm); }
.prose figcaption { font-size: var(--fs-xs); color: var(--color-faint);
  text-align: center; margin-top: var(--space-2); }
.prose code { font-family: var(--font-mono); font-size: 0.85em;
  background: var(--color-surface-alt); padding: 0.15em 0.4em; border-radius: 5px; }

/* Key-takeaways callout inside articles */
.takeaways { background: var(--bg-surface); border: 1px solid var(--border);
  border-left: 4px solid var(--color-ochre); border-radius: var(--radius-media);
  padding: var(--space-4) var(--space-5); margin-block: var(--space-6); }
.takeaways h3 { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--color-ochre); margin-bottom: var(--space-3); }
.takeaways ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.takeaways li { position: relative; padding-left: 1.5rem; font-size: 1.05rem; }
.takeaways li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }

/* =============================== ABOUT PAGE ============================== */
.about-hero .portrait-ph { aspect-ratio: 4 / 5; }
.about-hero .hero-cta { margin-top: var(--space-5); }
/* Interests / "beyond work" row */
.interests { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.interest { background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-media); padding: var(--space-4); }
.interest .ic { width: 40px; height: 40px; border-radius: var(--radius-media);
  display: grid; place-items: center; background: var(--color-surface-alt);
  color: var(--brand); margin-bottom: var(--space-3); }
.interest .ic svg { width: 20px; height: 20px; }
.interest h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.interest p { font-size: var(--fs-sm); color: var(--text-muted); }

/* =============================== BLOG INDEX ============================== */
/* Featured post = full-width split card at the top of the blog index */
.post-featured { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 0;
  overflow: hidden; margin-bottom: var(--space-6); }
.post-featured .cover { min-height: 320px; background: linear-gradient(150deg, var(--color-pine), #2E5A4C); }
.post-featured .body { padding: var(--space-6); display: flex; flex-direction: column;
  gap: var(--space-3); justify-content: center; }
.post-featured h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.post-featured p { color: var(--text-muted); }

/* ============================== ARTICLE / POST ========================== */
/* Reading-progress bar pinned under the nav */
.reading-progress { position: fixed; top: var(--nav-h); left: 0; height: 3px; width: 0%;
  background: var(--accent); z-index: 90; transition: width 0.1s linear; }

.article-header { padding-block: calc(var(--nav-h) + var(--space-6)) var(--space-5);
  text-align: center; }
.article-header .pill { background: var(--color-surface-alt); color: var(--text-muted);
  margin-bottom: var(--space-3); }
.article-header h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); max-width: 20ch;
  margin-inline: auto; }
.article-header .standfirst { font-size: var(--fs-lg); color: var(--text-muted);
  max-width: 60ch; margin: var(--space-4) auto 0; }
.article-byline { display: flex; align-items: center; justify-content: center; gap: var(--space-3);
  margin-top: var(--space-5); font-size: var(--fs-sm); color: var(--text-muted); }
.article-byline .avatar { width: 40px; height: 40px; border-radius: 50%;
  background: var(--color-surface-alt); }
.article-byline b { color: var(--text); font-weight: 600; }
.article-byline .sep { color: var(--border); }

.article-cover { max-width: 960px; margin: 0 auto var(--space-6); }
.article-cover .figure-ph { aspect-ratio: 21 / 9; border-radius: var(--radius-card);
  background: linear-gradient(150deg, var(--color-pine), #2E5A4C);
  display: grid; place-items: center; color: rgba(255,255,255,0.5); font-family: var(--font-mono); }

/* Author box at the end of an article */
.author-box { max-width: 68ch; margin: var(--space-7) auto 0; padding: var(--space-5);
  display: flex; gap: var(--space-4); align-items: center; }
.author-box .avatar { width: 64px; height: 64px; border-radius: 50%; flex: 0 0 64px;
  background: var(--color-surface-alt); }
.author-box .name { font-family: var(--font-display); font-size: 1.25rem; }
.author-box .bio { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 0.25rem; }

/* Share + back row */
.article-foot { max-width: 68ch; margin: var(--space-5) auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  flex-wrap: wrap; }
.article-foot .share { display: flex; gap: var(--space-2); }
.article-foot .share a { width: 40px; height: 40px; border-radius: 50%; display: grid;
  place-items: center; border: 1px solid var(--border); color: var(--text); }
.article-foot .share a:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Related posts */
.related { margin-top: var(--space-8); }
.related h2 { font-size: var(--fs-h3); margin-bottom: var(--space-5); }

/* ============================================================================
   RESPONSIVE additions for inner pages
   ========================================================================== */
@media (max-width: 960px) {
  .header-split,
  .contact-grid,
  .post-featured { grid-template-columns: 1fr; gap: var(--space-6); }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .interests { grid-template-columns: repeat(2, 1fr); }
  .post-featured .cover { min-height: 220px; }
}
@media (max-width: 640px) {
  .project-grid { grid-template-columns: 1fr; }
  .interests { grid-template-columns: 1fr; }
  .article-foot { flex-direction: column; align-items: flex-start; }
  .author-box { flex-direction: column; text-align: center; }
}
