@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ── */
:root {
  --sidebar-bg:    #1a1a1a;
  --sidebar-fg:    #f0f0f0;
  --accent:        #6fc3df;
  --accent-dark:   #4aa8c8;
  --accent-faint:  rgba(111, 195, 223, 0.08);
  --main-bg:       #f9f9f9;
  --text:          #2a2a2a;
  --sidebar-width: 360px;
  /* link colours for light main area — dark enough for 5:1+ on #f9f9f9 */
  --link:          #1a6a8a;
  --link-hover:    #0e4457;
  --link-visited:  #124e66;
}

/* ── Base ── */
html {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}

/* Global link styles for main (light) area */
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:visited { color: var(--link-visited); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* Sidebar link overrides — light on dark */
#sidebar a { color: var(--accent); text-decoration: none; }
#sidebar a:hover { color: #fff; text-decoration: underline; }
#sidebar a:visited { color: #4a98b5; }  /* solid muted teal — readable on #1a1a1a, distinct from #6fc3df */
#sidebar a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

body.is-prologue {
  background: var(--main-bg);
  min-height: 100vh;
}

/* ── Split layout ── */
.split-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sidebar-image {
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-image img {
  width: 100%;
  object-fit: cover;
  max-height: 45vh;
  display: block;
  transition: transform .4s ease;
}

.sidebar-image:hover img {
  transform: scale(1.03);
}

.sidebar-meta {
  padding: 2rem 1.75rem 2.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

/* Site breadcrumb */
.site-title {
  margin-bottom: .5rem;
}

.site-title a {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  transition: color .2s;
}

.site-title a:hover {
  color: #fff;
}

#sidebar h1 {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
  margin: .5rem 0 .8rem;
  color: #fff;
  letter-spacing: -.01em;
}

.meta-date {
  font-size: .85rem;
  color: #909090;
  letter-spacing: .02em;
}

.meta-location {
  font-size: .85rem;
  color: #a8a8a8;
  margin-top: .15rem;
}

/* Decorative rule between meta and labels */
.sidebar-meta::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
  margin: 1.1rem 0;
}

.meta-labels {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.label-tag {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .2rem .65rem;
  border-radius: 999px;
  transition: background .2s, color .2s;
}

.label-tag:hover {
  background: var(--accent);
  color: #111;
}

/* Label pill link states — keep accent colour, dim on visited */
a.label-tag { text-decoration: none; color: var(--accent); }
a.label-tag:visited { color: #4a98b5; border-color: #4a98b5; }  /* solid, no opacity trick */
a.label-tag:visited:hover { opacity: 1; background: var(--accent); color: #111; border-color: var(--accent); }
a.label-tag:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 999px; }

/* ── Main content ── */
#main {
  flex: 1;
  overflow-y: auto;
  background: var(--main-bg);
  display: flex;
  flex-direction: column;
}

.inner {
  max-width: 70ch;
  width: 100%;
  padding: 3.5rem 4rem;
  flex: 1;
}

/* ── Article body ── */
.event-body {
  font-size: 1.075rem;
  line-height: 1.85;
}

.event-body h2,
.event-body h3 {
  margin: 2rem 0 .75rem;
  color: #111;
  font-weight: 700;
}

.event-body h2 {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: .4rem;
}

.event-body p {
  margin-bottom: 1.25rem;
}

/* Poem stanzas: <p> whose sole child is <em> */
.event-body p:has(> em:only-child) {
  background: var(--accent-faint);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 .4rem .4rem 0;
  font-size: 1.05rem;
  color: #333;
}

.event-body em {
  font-style: italic;
}

.event-body blockquote {
  border-left: 3px solid var(--accent-dark);
  padding: .6rem 1.25rem;
  margin: 1.25rem 0;
  color: #666;
  font-size: .95rem;
}

.event-body blockquote p {
  margin-bottom: 0;
}

/* Images and figures */
.event-body figure {
  margin: 2rem 0;
  text-align: center;
}

/* Nested figures (image pairs) rendered side by side */
.event-body figure > figure {
  display: inline-block;
  margin: .4rem;
  vertical-align: top;
}

.event-body figure img {
  max-width: 100%;
  height: auto;
  border-radius: .3rem;
  cursor: pointer;
  transition: opacity .2s, box-shadow .2s;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .12);
}

.event-body figure img:hover {
  opacity: .88;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .18);
}

.event-body a {
  color: var(--link);
  text-decoration: none;
}

.event-body a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.event-body a:visited {
  color: var(--link-visited);
}

/* ── Footer ── */
#main footer {
  padding: 1.5rem 4rem 2rem;
  color: #aaa;
  font-size: .82rem;
  text-align: center;
  border-top: 1px solid #e5e5e5;
}

/* ── Lightbox ── */
#lightbox{display:none;position:fixed;inset:0;background:rgba(0,0,0,.9);
  z-index:9999;align-items:center;justify-content:center;
  flex-direction:column;gap:.5rem}
#lightbox img{max-width:90vw;max-height:80vh;object-fit:contain}
.lb-close{position:fixed;top:1rem;right:1.5rem;font-size:2.5rem;
  color:#fff;cursor:pointer;line-height:1;opacity:.8}
.lb-close:hover{opacity:1}
.lb-nav{position:fixed;top:50%;transform:translateY(-50%);font-size:3rem;
  color:#fff;cursor:pointer;padding:.5rem;user-select:none;opacity:.7}
.lb-nav:hover{opacity:1}
.lb-prev{left:1rem}.lb-next{right:1rem}
.lb-caption{color:#ccc;font-size:.9rem;text-align:center;max-width:80vw}

/* ── Mobile (≤ 768 px) ── */
@media (max-width: 768px) {
  .split-layout {
    flex-direction: column;
    height: auto;
  }

  #sidebar {
    width: 100%;
    height: auto;
    position: static;
    overflow-y: visible;
  }

  .sidebar-image img {
    max-height: 55vw;
  }

  .inner {
    padding: 2rem 1.5rem;
  }

  #main footer {
    padding: 1.25rem 1.5rem 1.75rem;
  }
}

/* ── Narrow mobile (≤ 480 px) ── */
@media (max-width: 480px) {
  .sidebar-meta {
    padding: 1.5rem 1.25rem 2rem;
  }

  #sidebar h1 {
    font-size: 1.25rem;
  }

  .inner {
    padding: 1.5rem 1rem;
  }
}
