:root {
  --bg:white;
  --ink: black;
  --muted: black;
  --gap: 1.25rem;
}

* { box-sizing: border-box; }

    
@font-face {
  font-family:"Bembo";
  font-style: normal;
  src: url(fonts/BemboStd.woff2);
}

@font-face {
 font-family:"Bembo";
  font-style: italic;
  src: url(fonts/BemboStd-Italic.woff2);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--gap);
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.6 "Bembo",'Times New Roman', Times, serif;
  line-height: 1.2rem;
}

/* Remove focus visuals site-wide (requested) */
:focus, :focus-visible { outline: none !important; box-shadow: none !important; }

main {
  width: min(60%, 48rem);
  max-width: 48rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap);
  margin: 0 auto;
}

#stage {
  margin: 0;
  width: 100%;
  height: 60dvh;
  max-height: 60dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

  #info[open] {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    right: 1.25rem;
    margin: 0 auto;
    z-index: 3;
  }
#slide {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.45s ease;
}

#slide.ready { opacity: 1; }

figcaption, #counter {
  color: var(--muted);
}

#controls {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

button {
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

button:hover, a:hover { color: var(--ink); }

a { color: var(--muted); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.corner {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2;
}

#info {
  max-width: 34rem;
  padding: 2rem;
  border: 0;
  background: var(--bg);
  color: inherit;
}

#info[open] {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  position: fixed;
  
  top: 1.25rem;
  right: 1.25rem;
  left: auto;
  margin: 0;
  z-index: 3;
}
#info::backdrop { background:#9a7a6080; }
#info img { height: 15rem; object-fit: cover;}
#info div { flex: 1 1 1rem; }
#info p { margin: 0 0 0.9rem; }
#info .corner { position: absolute; font-size: 1.25rem; }

/* Timeline two-column layout inside the info dialog */
.timeline { display: flex; flex-direction: column; gap: 0.5rem; }
.timeline-row { display: grid; grid-template-columns: 4.5rem 1fr; column-gap: 1rem; align-items: start; }
.timeline .event { color: inherit; }

@media (max-width: 520px) {
  .timeline-row { grid-template-columns: 3.5rem 1fr; }
}

@media (max-width: 800px) {
  main { width: calc(100% - 2.5rem); }
  #stage { height: 62dvh; }
  #info { padding: 1.5rem; }
  #controls{display:none;}
}

@media (prefers-reduced-motion: reduce) {
  #slide { transition: none; }
}
