/*
Theme Name: Archival Monograph
Theme URI: https://example.com/archival-monograph
Author: Julian Vane
Author URI: https://example.com
Description: A warm-paper editorial portfolio theme for graphic designers. Terracotta accent, Inter + Playfair Display italic + JetBrains Mono. Includes a Projects custom post type for case studies, a filtered gallery homepage, and a case study template.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: archival-monograph
Tags: portfolio, one-column, two-columns, custom-menu, featured-images, translation-ready, editor-style
*/

/* ---------- Tokens ---------- */
:root {
  --background: oklch(0.955 0.018 80);
  --foreground: oklch(0.24 0.012 55);
  --muted-fg: oklch(0.24 0.012 55 / 0.6);
  --border: oklch(0.24 0.012 55 / 0.12);
  --accent: oklch(0.58 0.17 32);
  --accent-fg: oklch(0.98 0.012 80);
  --card: oklch(0.98 0.012 80);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-serif: 'Playfair Display', ui-serif, Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-display);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; padding: 0; }
::selection { background: color-mix(in oklab, var(--accent) 20%, transparent); }

/* ---------- Layout ---------- */
.container { max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* ---------- Nav (translucent glass) ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
}
.site-nav__inner {
  position: relative;
  height: 4rem;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 80rem; margin: 0 auto; padding: 0 1.5rem;
}
.site-nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in oklab, var(--background) 55%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid color-mix(in oklab, var(--foreground) 10%, transparent);
}
.brand {
  font-weight: 700; letter-spacing: -0.03em; font-size: 1.125rem; line-height: 1;
}
.brand__dot { color: var(--accent); }
.site-nav__links {
  display: flex; align-items: center; gap: 0.25rem;
  font-family: var(--font-mono); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.15em;
  list-style: none; margin: 0; padding: 0;
}
.site-nav__links a {
  padding: 0.5rem 0.75rem; border-radius: 999px; transition: color .2s, background .2s;
}
.site-nav__links a:hover { color: var(--accent); }
.site-nav__links a.is-active { background: color-mix(in oklab, var(--foreground) 5%, transparent); }
.nav-cta {
  margin-left: 0.5rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 999px;
  background: var(--foreground); color: var(--background);
  transition: background .2s;
}
.nav-cta:hover { background: var(--accent); }
.nav-cta__dot {
  width: 0.375rem; height: 0.375rem; border-radius: 999px;
  background: color-mix(in oklab, var(--background) 80%, transparent);
  animation: pulse 2s infinite;
}
@media (max-width: 640px) { .nav-cta { display: none; } }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted-fg);
}
.eyebrow--accent { color: var(--accent); }
.serif-italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.headline { font-weight: 700; letter-spacing: -0.03em; line-height: 0.9; text-wrap: balance; }
.h1 { font-size: clamp(2.5rem, 6vw, 6rem); }
.h2 { font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -0.03em; font-weight: 700; line-height: 1; }
.h3 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.lead { font-size: 1.125rem; color: var(--muted-fg); text-wrap: pretty; }
.prose p { font-size: 1.125rem; line-height: 1.65; text-wrap: pretty; margin: 0 0 1.25rem; }
.prose h2 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; margin: 2.5rem 0 1rem; }
.prose h3 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 0.75rem; }
.prose img { margin: 2rem 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { border-left: 2px solid var(--accent); padding-left: 1.25rem; font-family: var(--font-serif); font-style: italic; font-size: 1.5rem; margin: 2rem 0; }

/* ---------- Home hero ---------- */
.hero { padding: 6rem 0; border-bottom: 1px solid var(--border); }
.hero__title { margin: 0 0 2rem; }
.hero__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.5rem; align-items: end; }
.hero__lead { grid-column: span 12; }
.hero__meta { grid-column: span 12; font-family: var(--font-mono); font-size: 0.625rem; text-transform: uppercase; letter-spacing: -0.01em; }
.hero__meta div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 0.25rem 0; }
.hero__meta .accent { color: var(--accent); }
@media (min-width: 768px) {
  .hero { padding: 8rem 0; }
  .hero__lead { grid-column: span 5; }
  .hero__meta { grid-column: 10 / span 3; }
}

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; padding: 3rem 0; }
.filter {
  padding: 0.375rem 1rem; border-radius: 999px; border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em;
  transition: border-color .2s, background .2s, color .2s;
  display: inline-block; text-decoration: none;
}
.filter:hover { border-color: var(--foreground); }
.filter.is-active { background: var(--foreground); color: var(--background); border-color: var(--foreground); }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: 1fr; gap: 3rem 3rem; padding-bottom: 8rem; }
@media (min-width: 768px) { .gallery { grid-template-columns: 1fr 1fr; gap: 6rem 3rem; } }
.tile { display: block; opacity: 0; transform: translateY(20px); animation: revealUp .8s var(--ease) both; }
.tile__frame { overflow: hidden; margin-bottom: 1.5rem; }
.tile__img { width: 100%; aspect-ratio: 4/5; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.05) inset; transition: transform .7s var(--ease); }
.tile:hover .tile__img { transform: scale(1.02); }
.tile__row { display: flex; justify-content: space-between; align-items: flex-start; }
.tile__cat { font-family: var(--font-mono); font-size: 0.625rem; text-transform: uppercase; color: var(--accent); margin-bottom: 0.25rem; display: block; letter-spacing: 0.15em; }
.tile__year { font-family: var(--font-mono); font-size: 0.625rem; padding: 0.25rem 0.5rem; border: 1px solid var(--border); }
@keyframes revealUp { from{opacity:0; transform:translateY(20px)} to{opacity:1; transform:translateY(0)} }

/* ---------- Featured ---------- */
.featured { padding: 6rem 0; border-top: 1px solid var(--foreground); }
.featured__grid { display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media (min-width: 768px) { .featured__grid { grid-template-columns: repeat(12, 1fr); gap: 3rem; } .featured__body { grid-column: span 8; } .featured__aside { grid-column: span 4; display: flex; flex-direction: column; justify-content: flex-end; gap: 1.5rem; } }
.featured__title { margin: 0 0 2rem; }
.featured__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.05) inset; }
.read-more { display: inline-flex; align-items: center; gap: 1rem; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.read-more__arrow { width: 1.5rem; height: 1.5rem; border: 1px solid var(--foreground); border-radius: 999px; display: grid; place-items: center; transition: background .2s, color .2s; }
.read-more:hover .read-more__arrow { background: var(--foreground); color: var(--background); }

/* ---------- Case study ---------- */
.case { padding: 4rem 0 6rem; }
.case__back { display: inline-block; margin-bottom: 1rem; }
.case__back:hover { color: var(--accent); }
.case__head { display: grid; grid-template-columns: 1fr; gap: 2rem; padding: 3rem 0; border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { .case__head { grid-template-columns: repeat(12, 1fr); } .case__head-main { grid-column: span 8; } .case__meta { grid-column: 9 / span 4; align-self: end; } }
.case__meta { font-family: var(--font-mono); font-size: 0.625rem; text-transform: uppercase; }
.case__meta div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 0.25rem 0; }
.case__meta .accent { color: var(--accent); }
.case__cover { width: 100%; margin: 3rem 0; aspect-ratio: 16/10; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.05) inset; }
.case__body { display: grid; grid-template-columns: 1fr; gap: 3rem; margin-top: 2rem; }
@media (min-width: 768px) { .case__body { grid-template-columns: repeat(12, 1fr); } .case__body-label { grid-column: span 4; } .case__body-text { grid-column: span 7; } }

/* ---------- Prev/Next ---------- */
.pager { display: grid; grid-template-columns: 1fr; gap: 2rem; padding: 4rem 0; border-top: 1px solid var(--border); }
@media (min-width: 768px) { .pager { grid-template-columns: 1fr 1fr; } .pager__next { text-align: right; } }
.pager__label { font-family: var(--font-mono); font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted-fg); margin-bottom: 0.5rem; }
.pager__title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; transition: color .2s; }
.pager a:hover .pager__title { color: var(--accent); }

/* ---------- Page (about / contact) ---------- */
.page-shell { padding: 6rem 0; }
.page-title { margin: 0 0 4rem; }
.page-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media (min-width: 768px) { .page-grid { grid-template-columns: repeat(12, 1fr); } .page-grid__main { grid-column: span 7; } .page-grid__aside { grid-column: 9 / span 4; } }
.services { list-style: none; margin: 0; padding: 0; }
.services li { display: flex; align-items: baseline; gap: 0.75rem; border-bottom: 1px solid var(--border); padding: 0.5rem 0; font-size: 0.875rem; }
.services li::before { content: "→"; font-family: var(--font-mono); font-size: 0.625rem; color: var(--accent); }
.contact-mail { font-family: var(--font-mono); font-size: clamp(1.5rem, 4vw, 2.5rem); text-decoration: underline; text-underline-offset: 4px; word-break: break-all; }
.contact-mail:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { background: var(--foreground); color: var(--background); margin-top: 8rem; padding: 6rem 1.5rem; }
.site-footer__inner { max-width: 80rem; margin: 0 auto; display: flex; flex-direction: column; gap: 3rem; align-items: flex-end; justify-content: space-between; }
@media (min-width: 768px) { .site-footer__inner { flex-direction: row; } }
.site-footer__cta { max-width: 28rem; align-self: flex-start; }
.site-footer__cta h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.03em; margin: 0 0 2rem; }
.site-footer__mail {
  font-family: var(--font-mono); font-size: clamp(1.25rem, 3vw, 1.875rem);
  text-decoration: underline; word-break: break-all;
}
.site-footer__mail:hover { color: var(--accent); }
.site-footer__cols { display: flex; gap: 3rem; font-family: var(--font-mono); font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.2em; opacity: .6; }
.site-footer__cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 8rem 0; }

/* ---------- WP alignment helpers ---------- */
.alignwide { max-width: 90rem; margin-left: auto; margin-right: auto; }
.alignfull { width: 100%; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
