/* joshuatacke.com — one stylesheet for the whole site */
@import url("fonts.css");

:root {
  --paper: #F4EFE6;
  --paper-deep: #EDE6D9;
  --plate: #E0D7C7;
  --rule: #D8CFBF;
  --ink: #1C1A17;
  --ink-soft: #4A453E;
  --muted: #6B645A;
  --seal: #A8322A;
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
}
a { color: var(--ink); text-decoration: none; }
a:hover, a:focus-visible { color: var(--seal); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 48px; }
@media (max-width: 700px) { .wrap { padding: 0 20px; } body { font-size: 17px; } }

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 12px 32px; padding: 32px 0 24px; border-bottom: 1px solid var(--rule);
}
.site-name { font-size: 26px; letter-spacing: 0.04em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.site-nav a[aria-current="page"] { color: var(--seal); }

.label {
  font-size: 14px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
  margin: 0;
}

/* Placeholder for images not yet added */
.ph {
  background: var(--plate); border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 20px; color: var(--muted); font-style: italic;
}

/* Home */
.hero { padding-top: 40px; }
.hero-image { width: 100%; height: min(640px, 70vh); object-fit: cover; }
.hero-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding-top: 18px; }
.hero-caption p { margin: 0; max-width: 760px; }
.cta { color: var(--seal); white-space: nowrap; }

.statement { padding: 112px 0 0; }
.statement p { margin: 0 auto; max-width: 820px; text-align: center; font-size: clamp(22px, 3vw, 30px); line-height: 1.45; }

.section { padding-top: 112px; }
.corpus { border-top: 1px solid var(--rule); margin-top: 8px; }
.corpus-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px;
  padding: 26px 0; border-bottom: 1px solid var(--rule);
}
.corpus-row .num { color: var(--seal); width: 40px; font-size: 20px; }
.corpus-row .title { font-size: clamp(24px, 3vw, 30px); flex: 1 1 360px; }
.corpus-row .meta { color: var(--muted); }

.works { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 32px; margin-top: 24px; }
.works figure { margin: 0; }
.works .img, .works .ph { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.works figcaption { padding-top: 12px; line-height: 1.4; }
.works figcaption span { display: block; color: var(--muted); font-size: 16px; }

.player { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 32px; padding: 36px; border: 1px solid var(--rule); }
.player-info { flex: 1 1 320px; }
.player-title { font-size: 26px; font-style: italic; }
.player-meta { color: var(--muted); font-size: 17px; }
.play-btn {
  width: 64px; height: 64px; flex: none; border-radius: 50%;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.play-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.play-btn svg { width: 22px; height: 22px; }

.site-footer {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px;
  margin-top: 112px; padding: 32px 0 64px; border-top: 1px solid var(--rule);
}
.site-footer div { display: flex; flex-direction: column; gap: 8px; }
.site-footer .note { color: var(--muted); line-height: 1.5; }

/* Information page */
.prose { max-width: 720px; padding: 64px 0 0; }
.prose h1 { font-weight: 400; font-size: 44px; margin: 0 0 24px; }
.prose h2 { font-weight: 400; margin: 48px 0 12px; }
.prose p { margin: 0 0 1em; }

/* Codex viewer */
.codex-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 48px 0 28px; }
.codex-head h1 { margin: 0; font-weight: 400; font-style: italic; font-size: clamp(32px, 5vw, 48px); line-height: 1.15; }
.codex-head p { margin: 6px 0 0; color: var(--muted); font-size: 19px; }

.pill {
  min-height: 48px; padding: 10px 20px; border: 1px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink); font: inherit; font-size: 17px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
}
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pill:disabled { opacity: 0.5; cursor: default; }

.spread {
  display: flex; flex-wrap: wrap; gap: 48px; padding: 40px;
  background: var(--paper-deep); border: 1px solid var(--rule);
  touch-action: pan-y;
}
.spread-plate { flex: 1 1 420px; }
.spread-plate img, .spread-plate .ph { width: 100%; aspect-ratio: 19 / 23; object-fit: contain; }
.spread-text { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.spread-count { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pill.small { min-height: 44px; padding: 6px 16px; font-size: 16px; }
.spread-plate.is-detail img { object-fit: cover; }

.lang-toggle { display: none; gap: 8px; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.col .label { color: var(--seal); padding-bottom: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.verse { list-style: none; margin: 0; padding: 0; font-size: 20px; line-height: 1.7; }
.verse li { position: relative; padding-left: 36px; }
.verse li[data-n]::before {
  content: attr(data-n); position: absolute; left: 0; top: 0.2em;
  font-size: 13px; color: var(--muted); font-variant-numeric: oldstyle-nums;
}
.verse.greek { font-size: 21px; }
.empty { color: var(--muted); font-style: italic; }
.scholion { border-top: 1px solid var(--rule); padding-top: 14px; color: var(--ink-soft); font-size: 17px; }
.scholion b { color: var(--seal); font-weight: 400; }

.step { display: flex; justify-content: space-between; gap: 16px; }
.btn {
  min-height: 48px; padding: 10px 20px; border: 1px solid var(--ink);
  background: transparent; color: var(--ink); font: inherit; font-size: 17px; cursor: pointer;
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: 0.35; cursor: default; }

.index { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 28px; }
.index button {
  width: 44px; height: 44px; border: 1px solid var(--rule); background: transparent;
  color: var(--ink); font: inherit; font-size: 16px; cursor: pointer;
}
.index button[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.colophon {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px;
  margin-top: 80px; padding: 32px 0 64px; border-top: 1px solid var(--rule);
  color: var(--ink-soft); font-size: 17px; line-height: 1.55;
}
.colophon .label { display: block; padding-bottom: 8px; }

/* Phone: one language at a time, plate first, full-bleed */
@media (max-width: 820px) {
  .spread { padding: 0; gap: 20px; background: none; border: 0; }
  .spread-text { gap: 18px; }
  .lang-toggle { display: flex; }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .columns[data-show="greek"] .col.en, .columns[data-show="english"] .col.gr { display: none; }
  .step { position: sticky; bottom: 0; background: var(--paper); padding: 12px 0; border-top: 1px solid var(--rule); }
  .step .btn { flex: 1; }
}

/* The book: photographs of the bound codex */
.book { padding-top: 96px; }
.book-note { color: var(--muted); margin: 8px 0 24px; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.book-item { display: block; background: #E9E9E7; }
.book-item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: opacity .2s; }
.book-item:hover img { opacity: .85; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.lightbox::backdrop { background: rgba(28, 26, 23, .92); }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; margin: 0 auto; }
.lightbox form { display: flex; justify-content: flex-end; padding-bottom: 10px; }
.lightbox .btn { background: var(--paper); }

/* Verse: hanging lines and the line-range label */
.verse li .main, .verse li .cont { display: block; }
.verse li .cont { padding-left: 2em; }
.verse li + li { margin-top: 2px; }
.lines { margin-left: 14px; letter-spacing: 0.08em; }
.codex-head .greek-title { margin: 4px 0 0; font-size: 22px; color: var(--ink-soft); }
[hidden] { display: none !important; }

/* Diglot: Greek and English line by line, always aligned */
.columns { display: block; }
.diglot-head, .diglot li { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; }
.diglot-head { padding-bottom: 10px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.diglot-head .label { color: var(--seal); }
.diglot { list-style: none; margin: 0; padding: 0; line-height: 1.45; }
.diglot li { padding: 5px 0; }
.diglot .n { font-size: 13px; color: var(--muted); padding-top: 0.35em; font-variant-numeric: oldstyle-nums; }
.diglot .gr { font-size: 20px; }
.diglot .en { font-size: 18px; color: var(--ink-soft); }
.diglot .main, .diglot .cont { display: block; }
.diglot .cont { padding-left: 1.5em; }
.spread-plate { flex: 1 1 360px; }
.spread-text { flex: 1.4 1 520px; }
@media (max-width: 820px) {
  .diglot-head { display: none; }
  .diglot li { grid-template-columns: 30px minmax(0, 1fr); }
  .diglot .en { grid-column: 2; padding-top: 2px; }
  .columns[data-show="greek"] .en, .columns[data-show="english"] .gr { display: none; }
  .columns[data-show="english"] .en { grid-column: 2; grid-row: 1; }
}

/* Paintings */
.paint-grid { columns: 2 360px; column-gap: 32px; margin-top: 24px; }
.paint-grid figure { break-inside: avoid; margin: 0 0 32px; }
.paint-grid img { width: 100%; height: auto; }
.paint-grid figcaption, .painting figcaption { padding-top: 10px; line-height: 1.4; }
.paint-grid figcaption span, .painting figcaption span { display: block; color: var(--muted); font-size: 16px; }
.paintings { padding-top: 48px; }
.page-title { font-weight: 400; font-size: 44px; margin: 0 0 40px; }
.painting { margin: 0 0 88px; scroll-margin-top: 24px; }
.painting img { width: 100%; height: auto; max-height: 85vh; object-fit: contain; }
.painting .wall { background: #F1F0EE; display: flex; justify-content: center; }
.t-gr { display: block; font-size: 1.1em; }
figcaption .t-en { font-style: italic; color: var(--ink-soft); }
.index button.wide { width: auto; padding: 0 14px; }
.intro { margin: 0; font-size: 22px; line-height: 1.55; color: var(--ink-soft); max-width: 34em; }
.hero-image { object-fit: contain; background: #EBEBEB; height: min(720px, 75vh); }

/* Book viewer: full screen, click to zoom */
.lightbox { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; background: rgba(28, 26, 23, .96); color: var(--paper); }
.lightbox::backdrop { background: rgba(28, 26, 23, .96); }
.lightbox-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 24px; padding: 14px 20px; font-size: 16px; }
.lightbox-bar #lightbox-caption { flex: 1; }
.lightbox-hint { color: #A59F94; font-style: italic; }
.lightbox-bar form { display: block; padding: 0; }
.lightbox-bar .btn { background: var(--paper); min-height: 44px; }
.lightbox-stage { position: absolute; inset: 72px 72px 24px; overflow: hidden; display: flex; align-items: center; justify-content: center; cursor: zoom-in; touch-action: none; }
.lightbox-stage img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .25s ease; }
.lightbox-stage.zoomed { cursor: zoom-out; }
.lightbox-stage.zoomed img { transform: scale(2.1); transition: transform .25s ease, transform-origin .05s linear; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 52px; height: 72px; border: 0; background: transparent; color: var(--paper); font-size: 48px; line-height: 1; cursor: pointer; }
.lightbox-nav.prev { left: 10px; } .lightbox-nav.next { right: 10px; }
@media (max-width: 700px) { .lightbox-stage { inset: 64px 8px 64px; } .lightbox-hint { display: none; } .lightbox-nav { top: auto; bottom: 6px; transform: none; } }
.prose .bio { font-size: 22px; line-height: 1.6; }

/* Contact / Bio: two equal columns */
.about { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 48px 96px; padding-top: 64px; }
.about-h { font-weight: 400; font-size: 32px; margin: 0 0 20px; }
.about-p { font-size: 20px; line-height: 1.6; margin: 0; }
