/* Paul.Breslin.ca — shared stylesheet ("Shoreline").
   Kin to phbphoto.ca (paper ground, light serif, Inter, photos lifted off the page) but its own:
   cool linen paper, left-aligned layout, Georgian Bay teal links, brass for years,
   photos matted like prints in an album.
   Light and dark follow the visitor's device setting. Colours are tokens; change them here only.
   After editing this file, bump ASSET_V in lib/site.php. */

:root {
  --ground: #F1F2ED;
  --surface: #FBFBF8;     /* the mat around photos */
  --ink: #1C2124;
  --text: #384045;
  --muted: #646D73;
  --rule: #D9DCD4;
  --accent: #2B6466;
  --accent-hover: #17403F;
  --brass: #946A2B;
  --shadow: 0 1px 2px rgba(20, 30, 30, .08), 0 12px 28px -14px rgba(20, 35, 40, .45);

  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --max: 1160px;
  --gutter: 32px;
  color-scheme: light;
}

/* Dark: a mid slate rather than near-black, so the matted photos still read as prints. */
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #31383B;
    --surface: #3E464A;
    --ink: #EEF0EC;
    --text: #D2D8D5;
    --muted: #A7B0AD;
    --rule: #4B5458;
    --accent: #8CCBC6;
    --accent-hover: #B4E0DC;
    --brass: #D8B06A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 28px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

@media (max-width: 640px) { :root { --gutter: 16px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link { position: absolute; left: -9999px; top: 0; padding: 10px 14px; background: var(--ink); color: var(--ground); z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* Small letter-spaced label, the same device phbphoto uses under its name */
.label {
  font-family: var(--sans); font-size: 11.5px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.year { font-family: var(--serif); font-variant-numeric: tabular-nums lining-nums; color: var(--brass); }
.label .year { font-family: var(--sans); }
.meta { font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.center { text-align: center; margin-top: 22px; }

/* ---- Header ---- */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px 32px; flex-wrap: wrap; padding-top: 26px; padding-bottom: 18px;
}
.wordmark { text-decoration: none; color: var(--ink); display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.wordmark:hover { color: var(--ink); }
.wordmark b { font-family: var(--serif); font-weight: 400; font-size: 27px; letter-spacing: -0.01em; }
.nav { display: flex; gap: 6px 24px; flex-wrap: wrap; font-size: 14.5px; }
.nav a { color: var(--text); text-decoration: none; padding: 2px 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--accent); }
.nav a[aria-current] { color: var(--ink); border-bottom-color: var(--brass); }
.nav .out::after { content: " ↗"; font-size: 12px; color: var(--muted); }

.crumbs { font-size: 14px; color: var(--muted); padding-top: 26px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs + .page-head { padding-top: 18px; }

/* ---- Photos matted like prints ---- */
.print { background: var(--surface); padding: 10px 10px 0; box-shadow: var(--shadow); margin: 0; }
.print img { width: 100%; padding-bottom: 10px; }
.print figcaption { font-family: var(--serif); font-style: italic; font-size: 15px; line-height: 1.4; color: var(--muted); padding: 0 2px 10px; margin-top: -3px; }
.print a { display: block; }
.print a:hover img { outline: 2px solid var(--accent); outline-offset: -2px; }
.print.single { width: fit-content; max-width: 100%; margin: 26px auto 22px; }
.print.single img { max-height: 76vh; width: auto; }

/* ---- Home intro ---- */
.intro { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; padding: 64px 0 56px; }
.intro h1 { font-size: clamp(40px, 6vw, 64px); font-weight: 300; margin-top: 6px; }
.intro .lede { font-family: var(--serif); font-size: 21px; line-height: 1.5; margin: 22px 0 0; max-width: 34em; }
.intro .print { transform: rotate(.6deg); }
@media (max-width: 820px) { .intro { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; } .intro .print { transform: none; } }

.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; border-top: 1px solid var(--rule); padding-top: 22px; margin: 0 0 26px; scroll-margin-top: 16px; }
.section-head h2 { font-size: 28px; font-weight: 300; }

/* ---- Cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px 30px; margin-bottom: 64px; }
.card { text-decoration: none; color: inherit; display: block; }
.card .print { aspect-ratio: 4 / 3.3; display: flex; flex-direction: column; }
.card .print img { flex: 1; min-height: 0; object-fit: cover; }
.card:hover .print { outline: 2px solid var(--accent); outline-offset: 3px; }
.card h3 { font-size: 21px; margin-top: 14px; }
.card:hover h3 { color: var(--accent); }
.card p { margin: 4px 0 0; font-size: 14.5px; color: var(--muted); }
/* Home page: four cards in one row, or two by two, never three and one. */
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 500px) { .cards-4 { grid-template-columns: 1fr; } }

/* ---- "Elsewhere": family sites ---- */
.elsewhere { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); column-gap: 24px; border-top: 1px solid var(--rule); margin-bottom: 72px; }
.elsewhere a { text-decoration: none; padding: 18px 0; border-bottom: 1px solid var(--rule); color: var(--ink); }
.elsewhere a span { display: block; font-size: 13.5px; color: var(--muted); }
.elsewhere a b { font-family: var(--serif); font-weight: 400; font-size: 19px; }
.elsewhere a:hover b { color: var(--accent); }

/* ---- Inner page heading ---- */
.page-head { padding: 54px 0 34px; max-width: 46em; }
.page-head h1 { font-size: clamp(36px, 5vw, 52px); font-weight: 300; margin-top: 8px; }
.page-head p { font-family: var(--serif); font-size: 20px; line-height: 1.5; margin: 18px 0 0; }

.prose { max-width: 40em; }
.prose p { margin: 0 0 1em; }

/* ---- Career: awards ---- */
.award { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 40px; align-items: start; margin-bottom: 56px; scroll-margin-top: 16px; }
.award h3 { font-size: 28px; font-weight: 300; margin: 6px 0 12px; }
.award p { margin: 0 0 1em; }
.award .mark { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }
.award > div:first-child { position: sticky; top: 24px; }
.award-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.award-photos .wide { grid-column: 1 / -1; }
@media (max-width: 820px) { .award { grid-template-columns: 1fr; gap: 24px; } .award > div:first-child { position: static; } }

/* ---- Career: timeline ---- */
.timeline { list-style: none; padding: 0; margin: 0 0 64px; border-top: 1px solid var(--rule); }
.timeline > li { display: grid; grid-template-columns: 130px 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.timeline > li > .year { font-size: 18px; padding-top: 2px; }
.timeline h3 { font-size: 21px; }
.timeline .role { font-size: 14.5px; color: var(--muted); margin: 2px 0 8px; }
.timeline ul { margin: 0; padding-left: 18px; font-size: 15px; }
.timeline .tech { font-size: 13px; color: var(--muted); margin: 8px 0 0; letter-spacing: .02em; }
.timeline .honour { color: var(--brass); }
.timeline .honour a { color: inherit; }
@media (max-width: 560px) { .timeline > li { grid-template-columns: 1fr; gap: 4px; } }

/* ---- Family ---- */
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 64px; }
.person { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: start; }
.person h3 { font-size: 24px; font-weight: 300; margin: 2px 0 8px; }
.person p { margin: 0; font-size: 15.5px; }
@media (max-width: 820px) { .people { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .person { grid-template-columns: 110px 1fr; gap: 16px; } }
.family-photo { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 36px; align-items: start; margin-bottom: 56px; }
.family-photo dl { margin: 0; font-size: 15px; }
.family-photo dt { font-weight: 600; color: var(--ink); margin-top: 12px; }
.family-photo dt:first-child { margin-top: 0; }
.family-photo dd { margin: 2px 0 0; }
@media (max-width: 820px) { .family-photo { grid-template-columns: 1fr; gap: 20px; } }
.family-single { max-width: 680px; margin-bottom: 56px; }

/* ---- Albums ---- */
.year-group { display: grid; grid-template-columns: 110px 1fr; gap: 24px; border-top: 1px solid var(--rule); padding-top: 22px; margin-bottom: 48px; }
.year-group > .year { font-size: 34px; font-weight: 300; line-height: 1; }
.year-group .cards { margin-bottom: 0; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 640px) { .year-group { grid-template-columns: 1fr; gap: 14px; } }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.thumbs a { display: block; background: var(--surface); padding: 6px; box-shadow: var(--shadow); }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.thumbs a:hover { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) { .thumbs { grid-template-columns: repeat(3, 1fr); gap: 6px; } .thumbs a { padding: 3px; } }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; max-width: 720px; margin: 0 auto 48px; }
.pager .meta { margin: 0; }
.button { display: inline-block; padding: 10px 20px; border: 1px solid var(--ink); color: var(--ink); text-decoration: none; font-size: 14px; letter-spacing: .03em; }
.button:hover { background: var(--ink); color: var(--ground); }
.button[aria-disabled="true"] { visibility: hidden; }

/* ---- Maps ---- */
.map { height: min(72vh, 680px); min-height: 380px; border: 10px solid var(--surface); box-shadow: var(--shadow); margin-bottom: 22px; background: var(--rule); }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 30px; align-items: start; margin-bottom: 56px; }
.track-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); font-size: 14.5px; }
.track-list li { border-bottom: 1px solid var(--rule); }
.track-list button { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 4px; cursor: pointer; color: var(--text); }
.track-list button:hover, .track-list button[aria-pressed="true"] { color: var(--accent); }
.track-list button[aria-pressed="true"] { font-weight: 600; }
.track-list button:focus-visible { outline: 2px solid var(--accent); }
.track-list .swatch { width: 14px; height: 4px; border-radius: 2px; align-self: center; flex: none; }
.track-list .t { color: var(--muted); font-size: 13px; }
@media (max-width: 860px) { .map-layout { grid-template-columns: 1fr; } }
.leaflet-container { font-family: var(--sans); }

/* ---- Footer ---- */
.site-foot { border-top: 1px solid var(--rule); padding: 26px 0 40px; font-size: 13.5px; color: var(--muted); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }

/* ---- Lightbox (from Jim.Breslin.ca) ---- */
.lightbox {
  border: 0; padding: 0; margin: 0;
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: rgba(22, 26, 28, .97); color: #ECEEEA; overflow: hidden;
}
.lightbox::backdrop { background: rgba(22, 26, 28, .6); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr; }
.lb-top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
}
.lb-count { font-size: 14px; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.lb-stage {
  margin: 0; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 0 64px calc(20px + env(safe-area-inset-bottom, 0px));
}
.lb-stage img {
  max-width: 100%; max-height: calc(100dvh - 130px); width: auto; height: auto;
  border: 8px solid #F4F4F0; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8); transition: opacity .15s;
}
.lightbox.loading .lb-stage img { opacity: .35; }
.lb-stage figcaption { max-width: 70ch; text-align: center; font-family: var(--serif); font-style: italic; font-size: 17px; }
.lb-btn { font: inherit; color: #ECEEEA; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .25); border-radius: 3px; cursor: pointer; }
.lb-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .18); }
.lb-btn:disabled { opacity: 0; pointer-events: none; }
.lb-close { padding: 6px 12px; font-size: 14px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; font-size: 1.5rem; }
.lb-prev { left: max(8px, env(safe-area-inset-left, 0px)); }
.lb-next { right: max(8px, env(safe-area-inset-right, 0px)); }
@media (max-width: 720px) {
  .lb-stage { padding-left: 8px; padding-right: 8px; }
  .lb-nav { top: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: none; width: 56px; height: 44px; }
  .lb-stage img { max-height: calc(100dvh - 160px); border-width: 5px; }
  .lb-close span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
