/*
 * thelarks.net shared theme: paper and ink, 19th-century type and ornaments.
 * Served by the main worker at /assets/theme.css and linked from every page
 * that wants the look (homepage, photos).
 *
 * Type: Latin Antique 1889 (display, capitals) and ornaments from Font
 * Revival (MIT); Libre Caslon Text (OFL) for reading text. See
 * /assets/licenses/.
 */

@font-face {
  font-family: 'Latin Antique 1889';
  src: url('/assets/fonts/LatinAntique1889-Regular.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Libre Caslon Text';
  src: url('/assets/fonts/LibreCaslonText-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Libre Caslon Text';
  src: url('/assets/fonts/LibreCaslonText-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Libre Caslon Text';
  src: url('/assets/fonts/LibreCaslonText-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3efe6;
  --paper-light: #fbf9f4;   /* mats, buttons, raised surfaces */
  --ink: #24211d;
  --ink-soft: #6f665a;      /* secondary text */
  --rule: #d9d1c3;          /* hairlines and borders */
  --accent: #9c3b2b;        /* printer's red, used sparingly */

  --font-display: 'Latin Antique 1889', Georgia, serif;
  --font-text: 'Libre Caslon Text', Georgia, 'Times New Roman', serif;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
}

a {
  color: inherit;
}

/* "THE LARKS" set in the revived display face. Capitals only by design. */
.wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* The lark: an 1832 Baltimore songbird cut, drawn in the current text colour
   (masking lets one SVG take any colour). Size it with width/height. */
.lark {
  display: inline-block;
  width: 48px;
  aspect-ratio: 1928 / 2048;
  background-color: currentColor;
  -webkit-mask: url('/assets/ornaments/lark.svg') center / contain no-repeat;
  mask: url('/assets/ornaments/lark.svg') center / contain no-repeat;
}

/* Starburst between hairlines:
   <div class="ornament-divider" aria-hidden="true"><span class="star"></span></div> */
.ornament-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(320px, 70%);
  margin: 0 auto;
  color: var(--ink);
}
.ornament-divider::before,
.ornament-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid currentColor;
  opacity: 0.45;
}
.ornament-divider .star {
  width: 60px;
  aspect-ratio: 1269 / 2048;
  background-color: currentColor;
  -webkit-mask: url('/assets/ornaments/starburst.svg') center / contain no-repeat;
  mask: url('/assets/ornaments/starburst.svg') center / contain no-repeat;
}

/* Matted print: natural aspect ratio, cream mat, hairline edge, square
   corners, like a framed photo. Put an <img> inside. */
.mat {
  display: block;
  margin: 0;
  background: var(--paper-light);
  border: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(36, 33, 29, 0.06), 0 8px 24px rgba(36, 33, 29, 0.08);
}
.mat img {
  display: block;
}

/* Paper button with an ink hairline. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.7em 1.6em;
  background: var(--paper-light);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-family: var(--font-text);
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn:hover {
  background: var(--ink);
  color: var(--paper-light);
}
.btn svg {
  width: 18px;
  height: 18px;
}

/* Site header and footer, shared by pages outside the homepage. */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.site-brand .lark {
  width: 34px;
}
.site-brand .wordmark {
  font-size: 22px;
  white-space: nowrap;
  padding-top: 3px; /* optical: caps sit high next to the bird */
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 15px;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}
.site-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 600px) {
  .site-header {
    padding: 12px 14px;
  }
  .site-brand .lark {
    width: 28px;
  }
  .site-brand .wordmark {
    font-size: 18px;
  }
  .site-nav {
    gap: 12px;
    font-size: 14px;
  }
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 24px 48px;
  color: var(--ink-soft);
  font-size: 14px;
  font-style: italic;
}
.site-footer .lark {
  width: 28px;
  opacity: 0.8;
}

/* Lightbox: the photo shown as a matted print on a dark backdrop, inside a
   faint printer's border of radiant fans (Baltimore 1832, long primer 22)
   drawn around the whole screen. Toggle .active on .lightbox to open. Markup:
   <div class="lightbox">
     <button class="lightbox-close">&times;</button>
     <button class="lightbox-prev"></button>
     <figure class="lightbox-print"><img> <figcaption>…</figcaption></figure>
     <button class="lightbox-next"></button>
   </div>
   Pages can set --lightbox-img-max-h to leave room for taller captions. */
.lightbox {
  --frame-inset: 18px;   /* gap between the screen edge and the border */
  --frame-width: 20px;   /* height of the fan band */
  --frame-clear: calc(var(--frame-inset) + var(--frame-width) + 10px); /* controls sit inside it */
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(24, 22, 19, 0.96);
}
.lightbox.active {
  display: flex;
}
.lightbox::before {
  /* The border itself. Edges tile in whole repeats at any screen size. */
  content: '';
  position: absolute;
  inset: var(--frame-inset);
  border: var(--frame-width) solid transparent;
  border-image: url('/assets/ornaments/lightbox-frame.svg') 33.334% round;
  opacity: 0.3;
  pointer-events: none;
}
.lightbox-print {
  margin: 0;
  padding: 22px 22px 16px;
  background: var(--paper-light);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: calc(100vw - 2 * var(--frame-clear) - 120px);
}
.lightbox-print img {
  display: block;
  max-width: 100%;
  max-height: var(--lightbox-img-max-h, calc(100vh - 2 * var(--frame-clear) - 90px));
  width: auto;
  height: auto;
  margin: 0 auto;
}
.lightbox-print figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  min-height: 1.4em;
  margin-top: 12px;
  font-size: 15px;
  font-style: italic;
  color: var(--ink-soft);
  text-align: left;
}
.lightbox-print figcaption .lightbox-album {
  margin-left: auto;
  white-space: nowrap;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: 0;
  color: var(--paper-light);
  font-family: var(--font-text);
  font-size: 40px;
  line-height: 1;
  padding: 10px 14px;
  cursor: pointer;
  opacity: 0.7;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  opacity: 1;
}
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  outline: 1px solid rgba(251, 249, 244, 0.6);
  outline-offset: 2px;
}
.lightbox-close {
  top: var(--frame-clear);
  right: var(--frame-clear);
}
/* Arrows: curled triangular terminals (Boston 1889 word pieces), drawn in
   the paper colour through a mask. */
.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}
.lightbox-prev { left: var(--frame-clear); }
.lightbox-next { right: var(--frame-clear); }
.lightbox-prev::before,
.lightbox-next::before {
  content: '';
  display: block;
  width: 44px;
  aspect-ratio: 1773 / 1690;
  background-color: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
}
/* Deliberately crossed: each terminal's curl points away from the photo
   (prev shows the right-pointing piece, next the left-pointing one). */
.lightbox-prev { --arrow: url('/assets/ornaments/arrow-right.svg'); }
.lightbox-next { --arrow: url('/assets/ornaments/arrow-left.svg'); }
.lightbox-prev[hidden],
.lightbox-next[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .lightbox {
    --frame-inset: 8px;
    --frame-width: 12px;
  }
  .lightbox-print {
    max-width: calc(100vw - 2 * var(--frame-clear));
    padding: 10px 10px 8px;
  }
  .lightbox-print img {
    max-height: var(--lightbox-img-max-h, calc(100vh - 2 * var(--frame-clear) - 120px));
  }
  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: var(--frame-clear);
    transform: none;
  }
  .lightbox-prev::before,
  .lightbox-next::before {
    width: 34px;
  }
}
