/* styles.css — Jason Harvey Book Design */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }

:root {
  --color-fg: #000000;
  --color-bg: #ffffff;
  --color-logo: #231F20;
  --font-serif: "Montagu Slab", Georgia, "Times New Roman", serif;
  --tracking: 0.03em;
  --header-pad-x: 40px;
  --header-h-desktop: 73px;
}

html, body {
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: var(--tracking);
  line-height: 1.28;
  -webkit-font-smoothing: antialiased;
}

p { margin: 0; }

/* --- Header --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h-desktop);
  padding: 0 var(--header-pad-x);
}
.site-header .wordmark { font-size: 16px; }
.site-header .email { font-size: 16px; }
.site-header .logo img { height: 48px; width: auto; }

@media (max-width: 719px) {
  .site-header {
    flex-direction: column;
    height: auto;
    padding: 20px 16px;
    gap: 8px;
  }
  .site-header .wordmark { font-size: 20px; order: 2; }
  .site-header .logo { order: 1; }
  .site-header .logo img { height: 38px; }
  .site-header .email { display: none; }
}

/* --- Cover grid --- */
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 0;
  margin: 0;
}
.cover {
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  cursor: pointer;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover:focus-visible {
  outline: 2px solid #000;
  outline-offset: -2px;
}

@media (max-width: 1199px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 979px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 719px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Mobile footer --- */
.site-footer {
  display: none;
  padding: 40px 16px;
  text-align: center;
}
.site-footer .email { font-size: 16px; }

@media (max-width: 719px) {
  .site-footer { display: block; }
}

/* --- Lightbox --- */
#lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: transparent;
  color: #ffffff;
}
#lightbox::backdrop {
  background: rgba(0, 0, 0, 0.85);
}
#lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
}

#lightbox-image {
  max-height: 85vh;
  max-width: 90vw;
  object-fit: contain;
}
#lightbox-meta {
  margin-top: 24px;
  text-align: center;
  max-width: 600px;
  padding: 0 16px;
}
#lightbox-title { font-size: 18px; }
#lightbox-author { font-size: 16px; margin-top: 4px; }
#lightbox-publisher { font-size: 16px; margin-top: 4px; opacity: 0.85; }

#lightbox-close {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 32px;
  height: 32px;
}
#lightbox-close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

html.lightbox-open,
body.lightbox-open { overflow: hidden; }
