/* ==========================================================================
   jadeia.org — a chronicle kept in violet
   One stylesheet, no build step. Edit here and it applies everywhere.
   ========================================================================== */

:root {
  /* Ground: near-black violet, deepening toward the edges of the page */
  --void:          #0a0610;
  --void-2:        #120b1e;
  --panel:         #170e26;
  --panel-2:       #1e1331;

  /* Rules, borders, quiet structure */
  --rule:          #372550;
  --rule-soft:     rgba(120, 90, 170, 0.22);

  /* Text: muted violet-grey body, brighter violet for emphasis */
  --text:          #c4b8d8;
  --text-dim:      #8d81a6;
  --text-faint:    #8a7fa3;
  --violet:        #c2a5f2;
  --violet-deep:   #8f6fc8;

  /* Gold: headers, ornaments, trim */
  --gold:          #d8b45f;
  --gold-dim:      #9c7c34;

  /* The mat a print is mounted on */
  --mat:           #d4cade;
  --mat-edge:      #b3a6c4;

  /* Type. Swap --font-body in one place to change every page;
     --body-size is paired with it, since face and size go together. */
  --font-display:  'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-body:     'EB Garamond', Garamond, Georgia, 'Times New Roman', serif;
  --font-initial:  'UnifrakturMaguntia', Georgia, serif;
  --body-size:     clamp(1.12rem, 1.02rem + 0.4vw, 1.28rem);

  --measure:       64ch;
  --gutter:        clamp(1.15rem, 5vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--void);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, #241541 0%, transparent 62%),
    radial-gradient(ellipse 90% 50% at 50% 100%, #1a0f2c 0%, transparent 70%),
    var(--void);
  color: var(--text);
  font-family: var(--font-body);
  /* EB Garamond was cut for dark ink on light paper; reversed out of a dark
     ground it wants more size and leading than it would need in print. */
  font-size: var(--body-size);
  line-height: 1.78;
  text-rendering: optimizeLegibility;
}

/* --- Skeleton ----------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main { display: block; }

.measure { max-width: var(--measure); margin-inline: auto; }

/* --- Masthead ----------------------------------------------------------- */

.masthead {
  padding: clamp(1.75rem, 5vw, 3rem) 0 0;
  text-align: center;
}

.masthead__mark {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border: 0;
}

.masthead__mark:hover,
.masthead__mark:focus-visible { color: var(--violet); }

.nav {
  margin: 1.15rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 2rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.nav a {
  color: var(--text-dim);
  text-decoration: none;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid transparent;
}

.nav a:hover,
.nav a:focus-visible { color: var(--violet); border-bottom-color: var(--gold-dim); }

.nav [aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold-dim); }

/* --- Ornament ----------------------------------------------------------- */

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: clamp(2.25rem, 6vw, 3.5rem) auto;
  max-width: 26rem;
  color: var(--gold-dim);
  font-size: 0.72rem;
  letter-spacing: 0.6em;
  text-indent: 0.6em;
  border: 0;
}

.ornament::before,
.ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule) 40%, var(--gold-dim));
}

.ornament::after { background: linear-gradient(90deg, var(--gold-dim), var(--rule) 60%, transparent); }

.ornament--bare { max-width: none; }
.ornament--bare::before,
.ornament--bare::after { display: none; }

/* --- Headings ----------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
  color: var(--gold);
  margin: 0 0 0.75rem;
}

h1 {
  font-weight: 900;
  font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.4rem);
  letter-spacing: 0.1em;
  text-shadow: 0 0 34px rgba(160, 120, 240, 0.28);
}

h2 {
  font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.85rem);
  letter-spacing: 0.06em;
  color: var(--violet);
}

h3 {
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  text-transform: uppercase;
  color: var(--violet-deep);
}

/* --- Prose -------------------------------------------------------------- */

p { margin: 0 0 1.35rem; }

a {
  color: var(--violet);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

a:hover,
a:focus-visible { color: var(--gold); border-bottom-color: var(--gold-dim); }

:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }

em { font-style: italic; }

.lede {
  font-size: 1.16em;
  line-height: 1.7;
  color: #d3c9e4;
}

.dropcap::first-letter {
  float: left;
  font-family: var(--font-initial);
  font-size: 3.9em;
  line-height: 0.76;
  padding: 0.08em 0.14em 0 0;
  color: var(--violet);
  text-shadow: 0 0 28px rgba(150, 110, 230, 0.4);
}

.page-head {
  padding: clamp(2.5rem, 7vw, 4.25rem) 0 0;
  text-align: center;
}

.page-head p { color: var(--text-dim); }

/* --- Plates ------------------------------------------------------------- */

.plate {
  margin: clamp(2rem, 5vw, 3rem) 0;
}

.plate__mount {
  padding: clamp(0.65rem, 2vw, 1.1rem);
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.5), transparent 55%),
    var(--mat);
  border: 1px solid var(--gold-dim);
  box-shadow:
    0 0 0 1px rgba(10, 6, 16, 0.9),
    0 18px 46px rgba(0, 0, 0, 0.55);
}

.plate__mount img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--mat-edge);
  filter: saturate(0.92) brightness(0.97);
  background: var(--mat);
}

/* Shown only if a plate file is not yet mounted in assets/img/plates/. */
.plate__mount.is-unmounted {
  display: grid;
  place-items: center;
  min-height: 14rem;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border-style: dashed;
}

.plate__mount.is-unmounted img { display: none; }

.plate__mount.is-unmounted::after {
  content: "\2726";
  color: var(--gold-dim);
  font-size: 1.6rem;
}

.plate figcaption {
  margin-top: 0.95rem;
  text-align: center;
}

.plate__number {
  display: block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}

.plate__title {
  display: block;
  margin-top: 0.3rem;
  font-style: italic;
  font-size: 1.06rem;
  color: var(--text);
}

.plate__credit {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-faint);
}

.plate__credit a { color: var(--text-dim); border-bottom-color: transparent; }
.plate__credit a:hover,
.plate__credit a:focus-visible { color: var(--violet); border-bottom-color: var(--rule); }

/* --- Gallery ------------------------------------------------------------ */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: clamp(1.75rem, 4vw, 2.75rem);
  margin: clamp(2rem, 5vw, 3rem) 0;
}

.gallery .plate { margin: 0; }

/* --- Chronicle index ---------------------------------------------------- */

.entries {
  list-style: none;
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  padding: 0;
}

.entries li + li {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule-soft);
}

.entry__link {
  display: block;
  border: 0;
  color: inherit;
}

.entry__num {
  display: block;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.entry__title {
  margin: 0.4rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--violet);
}

.entry__link:hover .entry__title,
.entry__link:focus-visible .entry__title { color: var(--gold); }

.entry__standfirst {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98em;
}

.entry__plate {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* --- Article ------------------------------------------------------------ */

.article {
  padding-top: clamp(2.5rem, 7vw, 4.25rem);
}

.article__head { text-align: center; margin-bottom: clamp(2rem, 5vw, 3rem); }
.article__body { margin: 0 auto; max-width: var(--measure); }
.article__body p:last-of-type { margin-bottom: 0; }

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.pagination a { border-bottom: 0; color: var(--text-dim); }
.pagination a:last-child { margin-left: auto; text-align: right; }
.pagination a:hover,
.pagination a:focus-visible { color: var(--gold); }
.pagination__spacer { flex: 1; }

/* --- Colophon ----------------------------------------------------------- */

.colophon {
  margin-top: clamp(3.5rem, 9vw, 6rem);
  padding: 2.25rem 0 clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--rule-soft);
  text-align: center;
}

.colophon__date {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.colophon__aside {
  margin: 1rem 0 0;
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-faint);
}

.colophon__aside a { color: var(--text-dim); border-bottom-color: var(--rule); }
.colophon__aside a:hover,
.colophon__aside a:focus-visible { color: var(--violet); }

/* --- Odds --------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 30rem) {
  .nav { gap: 0.45rem 1.25rem; }
  .dropcap::first-letter { font-size: 3.2em; }
}

@media print {
  body { background: #fff; color: #000; }
  .nav, .pagination { display: none; }
}

