/* ==========================================================
   "Sons, Not Bastards" website stylesheet
   Every page links to this one file, so a change here
   updates the whole site.
   ========================================================== */

/* ---------- 1. Colors and fonts (change these to restyle everything) ---------- */
:root {
  --ink:        #1d1813;   /* near black brown, like the dark oil paint on the cover */
  --ink-soft:   #2a231c;   /* slightly lighter dark, for the header and footer */
  --parchment:  #f6f0e4;   /* page background */
  --paper:      #fffaf1;   /* cards sit on this */
  --text:       #2b241d;   /* body text */
  --muted:      #6d6255;   /* captions, small print */
  --gold:       #b8922f;   /* accent lines and buttons */
  --gold-light: #e8d270;   /* bright title gold, echoing the cover lettering */
  --redcoat:    #7c2a22;   /* link color, a nod to the British uniforms */
  --rule:       #d9ccb4;   /* thin divider lines */
  --navy:       #0f1a2e;   /* deep navy, the Book page feature behind the cover */
  --navy-soft:  #16243d;   /* slightly lighter navy, header, footer, date boxes */

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body:    "EB Garamond", Georgia, "Times New Roman", serif;

  --max-width: 1100px;
}

/* ---------- 2. Basic reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--parchment);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--redcoat); text-underline-offset: 3px; }
a:hover { color: var(--gold); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- 3. Header and navigation (same on every page) ---------- */
.site-header {
  background: var(--navy-soft);
  border-bottom: 3px solid var(--gold);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-light);
  text-decoration: none;
}
.site-title:hover { color: #fff; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.site-nav a {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e9e1d2;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--gold-light); }

/* The page you are on gets a gold underline */
.site-nav a.active {
  color: var(--gold-light);
  border-bottom-color: var(--gold);
}

/* ---------- 4. Page headings (used on the four inner pages) ---------- */
.page-heading {
  text-align: center;
  padding: 3.5rem 1.25rem 2rem;
}
.page-heading h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.page-heading p {
  color: var(--muted);
  font-style: italic;
  margin: 0 auto;
  max-width: 40rem;
}

/* small gold ornament line under headings */
.ornament {
  width: 90px;
  height: 2px;
  background: var(--gold);
  margin: 1.2rem auto 0;
  position: relative;
}
.ornament::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  background: var(--gold);
  transform: translate(-50%, -50%) rotate(45deg);
}

main { padding-bottom: 4rem; }

/* ---------- 5. Home page: the book feature ---------- */
.hero {
  background:
    radial-gradient(ellipse at 30% 40%, rgba(184, 146, 47, 0.12), transparent 60%),
    var(--navy);
  color: #efe7d8;
  padding: 4rem 0;
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-cover img {
  width: 100%;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(232, 210, 112, 0.25);
}

/* small label under the cover image */
.cover-note {
  margin: 0.9rem 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #cfc4b0;
}

/* each phrase stays whole: "Hopkins Press, [Trade]," never splits */
.hero .eyebrow span { white-space: nowrap; }

.hero .container.hero-top { display: block; text-align: center; margin-bottom: 2.5rem; }

.hero .eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 1.25rem;
  color: var(--gold);
  margin: 0 0 0.75rem;
}

.hero-text h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  color: var(--gold-light);
  margin-bottom: 0.3em;
}

.hero-text .subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.95rem, 4.5vw, 3.15rem);   /* 3/4 the size of the title above */
  font-style: italic;
  line-height: 1.35;
  margin: 0 0 1.25rem;
  color: var(--gold-light);   /* same gold as the title above it */
}

.hero-text .byline {
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 1rem;
  color: #cfc4b0;
  margin: 0 0 1.75rem;
}

.hero-text .blurb { max-width: 40rem; color: #ddd3c2; font-size: 1.08rem; }
.hero-text .blurb p { margin: 0 0 1rem; }
.hero-text .blurb em { color: #efe7d8; }

.pub-note {
  font-size: 1rem;
  color: #b9ad98;
  font-style: italic;
  margin-top: 1rem;
}

/* ---------- 6. Buttons ---------- */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.button {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.7rem 1.6rem;
  border: 2px solid var(--gold);
  background: var(--gold);
  color: var(--ink);
  transition: background 0.2s, color 0.2s;
}
.button:hover { background: transparent; color: var(--gold-light); }

.button.outline { background: transparent; color: var(--gold-light); }
.button.outline:hover { background: var(--gold); color: var(--ink); }

/* ---------- 7. Home page: section below the hero ---------- */
.home-explore {
  padding: 3.5rem 0 0;
  text-align: center;
}
.home-explore h2 { font-size: 2.2rem; color: var(--ink); }

.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  text-align: left;
}

.explore-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
}
.explore-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(29, 24, 19, 0.12);
  color: var(--text);
}
.explore-card h3 { font-size: 1.6rem; color: var(--redcoat); margin-bottom: 0.3rem; }
.explore-card p { margin: 0; color: var(--muted); font-size: 1.05rem; }

/* ---------- 8. Author page ---------- */
.author {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: 3rem;
  align-items: start;
}

.author-photo img {
  width: 100%;
  border: 8px solid var(--paper);
  box-shadow: 0 10px 28px rgba(29, 24, 19, 0.18);
}

.author-bio h2 { font-size: 2rem; color: var(--ink); }
.author-bio > p:first-of-type::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 3.6rem;
  line-height: 0.85;
  padding: 0.3rem 0.5rem 0 0;
  color: var(--redcoat);
}

.author-links {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 1.05rem;
}

/* ---------- 9. People and Places galleries ---------- */
/* Two cards per row on desktop, one on phones. Two (not three) keeps each
   caption about 60 to 70 characters wide, like a book page, so the
   justified text doesn't open up big gaps between words. */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
  max-width: 980px;
  margin: 0 auto;
}
@media (max-width: 760px) {
  .gallery { grid-template-columns: 1fr; gap: 2rem; }
}

.gallery figure {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
}

/* Frames keep every thumbnail the same size so the grid lines up.
   Portraits are tall, places are wide. Each frame is a button, so
   clicking it opens the full image in the overlay. */
.gallery .frame {
  background: var(--navy);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  width: 100%;
  padding: 0;
  border: 0;
  display: block;
  cursor: zoom-in;
}
.gallery.places .frame { aspect-ratio: 3 / 2; }

.gallery .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.gallery figure:hover .frame img { transform: scale(1.03); }
.gallery .frame:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* Empty placeholder frame for images not supplied yet */
.frame.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b7f6d;
  font-style: italic;
  background: repeating-linear-gradient(45deg, #ece3d2, #ece3d2 12px, #e5dac6 12px, #e5dac6 24px);
}

.gallery figcaption {
  padding-top: 1rem;
  font-size: 1.05rem;
  line-height: 1.5;
}
/* the title, date and artist line, in bold */
.gallery .work-title { font-weight: 600; color: var(--ink); margin: 0; }
.gallery .work-note { margin: 0.5rem 0 0; }
.gallery figcaption { padding-left: 0.25rem; padding-right: 0.25rem; }

/* ---------- 9b. Enlarged image overlay ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(9, 15, 28, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }

.lightbox-inner {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-height: 100%;
}

/* fills the screen, never spills past it */
.lightbox-inner img {
  max-width: min(1400px, 92vw);
  max-height: 82vh;
  width: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: default;
}

.lightbox-inner figcaption {
  color: #e9e1d2;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  text-align: center;
  max-width: 60rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: 0;
  color: #e9e1d2;
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.75rem;
}
.lightbox-close:hover { color: var(--gold-light); }

/* stops the page behind the overlay from scrolling */
body.no-scroll { overflow: hidden; }

/* ---------- 10. Appearances page ---------- */
.events { max-width: 820px; margin: 0 auto; }

.events h2 {
  font-size: 1.9rem;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.4rem;
  margin-top: 2.5rem;
}

.event-list { list-style: none; margin: 0; padding: 0; }

.event {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.event-date {
  text-align: center;
  background: var(--navy-soft);
  color: var(--gold-light);
  padding: 0.6rem 0.4rem;
  font-family: var(--font-display);
  line-height: 1.1;
  align-self: start;
}
.event-date .month { display: block; text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.95rem; }
.event-date .day   { display: block; font-size: 2.3rem; font-weight: 600; }
.event-date .year  { display: block; font-size: 0.9rem; color: #cfc4b0; }

.event h3 { font-size: 1.5rem; margin-bottom: 0.2rem; color: var(--ink); }
.event p { margin: 0.15rem 0; }
.event .time { color: var(--muted); }

.event.past { opacity: 0.7; }

.empty-note { color: var(--muted); font-style: italic; }

/* ---------- 11. Footer ---------- */
.site-footer {
  background: var(--navy-soft);
  color: #b9ad98;
  text-align: center;
  font-size: 0.95rem;
  padding: 2rem 1.25rem;
  border-top: 3px solid var(--gold);
}
.site-footer a { color: var(--gold-light); }
.site-footer p { margin: 0.25rem 0; }

/* ---------- 12. Phones and small screens ---------- */
@media (max-width: 760px) {
  .site-header .container { justify-content: center; text-align: center; }
  .site-nav ul { justify-content: center; }

  .hero { padding: 2.5rem 0; }
  .hero .container,
  .author {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-cover,
  .author-photo { max-width: 280px; margin: 0 auto; }
  /* headings and buttons stay centered on phones; the description
     paragraphs stay justified (see section 13) */
  .hero-text { text-align: center; }
  .hero .eyebrow { font-size: 1.1rem; letter-spacing: 0.12em; }
  .hero .container.hero-top { margin-bottom: 2rem; }
  .hero-text .blurb { margin: 0 auto; }
  .button-row { justify-content: center; }

  .event { grid-template-columns: 80px 1fr; gap: 1rem; }
  .event-date .day { font-size: 1.8rem; }
}

/* ---------- 13. Fully justified text, like a printed book ----------
   Every paragraph of reading text is justified on both margins.
   Headings, the nav, buttons, and the bold title lines are not. */
.hero-text .blurb p,
.author-bio p,
.gallery .work-note,
.author-links p,
.empty-note {
  text-align: justify;
  text-justify: inter-word;
  text-wrap: pretty;   /* balances line breaks across the whole paragraph */
}
/* Narrow columns (gallery cards, phones): let the browser hyphenate long
   words at line ends, as printed books do, so justified lines don't
   open up wide gaps between words. */
.gallery .work-note { -webkit-hyphens: auto; hyphens: auto; }
@media (max-width: 760px) {
  .hero-text .blurb p,
  .author-bio p,
  .empty-note { -webkit-hyphens: auto; hyphens: auto; }
}

/* ---------- 14. Images that show whole instead of cropped ----------
   Add "fit" to a frame (class="frame zoom fit") for wide paintings in
   the tall People frames, or tall photos in the wide Places frames. */
.gallery .frame.fit img { object-fit: contain; }

/* ---------- 15. Links page ---------- */
.links { max-width: 860px; margin: 0 auto; }
.links h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.1rem);
  color: var(--ink);
  text-align: center;
  margin-bottom: 1.5rem;
}
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
.link-list li:first-child { border-top: 1px solid var(--rule); }
.link-list a {
  grid-column: 1;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.25;
}
.link-list a:hover { text-decoration: underline; }
.link-list .link-place { grid-column: 1; color: var(--muted); font-size: 1.18rem; }
.link-list .link-host {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--muted);
  font-size: 1rem;
  font-style: italic;
}
@media (max-width: 760px) {
  .link-list li { grid-template-columns: 1fr; }
  .link-list .link-host { grid-column: 1; grid-row: auto; }
}
