:root {
  --bg: #000000;
  --card: #13131a;
  --accent: #d6a756;
  --text: #e6e6eb;
  --muted: #9ca3af;
  --border: #1f1f2b;
  --glow: 0 0 12px rgba(214, 167, 86, 0.4);
  --radius: 12px;
  --transition: 0.25s ease;
  --max-width: 1100px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

img { max-width: 100%; display: block; border-radius: var(--radius); }

header.site-header {
  background: #050508;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Center the logo and keep utilities on either side */
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 18px;
  display: grid;
  /* left and right columns flex equally; middle holds the logo */
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

/* Ensure the brand wrapper centers itself within its column */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Push the right-hand utility bar (Search + Patreon) to the far right */
.header-inner .utility-links:last-child {
  margin-left: auto;
}

.brand-logo {
  display: block;
  margin: 0 auto;
  width: clamp(220px, 36vw, 420px);
  max-height: 120px;
  height: auto;
  border-radius: 0;
  object-fit: contain;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links a {
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  transition: var(--transition);
  text-transform: uppercase; /* This makes the link text all caps */
}

.nav-links a:hover, .nav-links a:focus, .nav-links a.active {
  color: var(--accent);
  background: rgba(214, 167, 86, 0.08);
  box-shadow: var(--glow);
}

/* Base hamburger button (hidden on desktop by default; shown in the mobile media query) */
.menu-toggle {
  display: none;            /* stays hidden on desktop; mobile overrides this */
  flex-direction: column;
  justify-content: space-between;
  width: 32px;              /* width of the button */
  height: 24px;             /* height to fit three bars and gaps */
  padding: 0;
  border: none;
  background: transparent;  /* no background box */
  cursor: pointer;
  outline: none;            /* remove focus outline */
  -webkit-tap-highlight-color: transparent; /* remove touch highlight */
}

/* The three bars inside the burger icon */
.menu-toggle span {
  display: block;
  width: 100%;              /* each bar spans the full button width */
  height: 3px;              /* thickness of each bar */
  background: var(--accent);/* golden colour defined in :root */
  border-radius: 3px;
  margin-bottom: 5px;       /* spacing between bars */
}

.menu-toggle span:last-child {
  margin-bottom: 0;         /* no extra space after the last bar */
}


.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.utility-links {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-only {
  display: none;
}

.btn, button, input[type="submit"] {
  background: linear-gradient(120deg, #c79132, #e2b35e);
  color: #0b0b0f;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--glow);
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  box-shadow: none;
}

.btn:hover, .btn:focus, button:hover, input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 15px rgba(226, 179, 94, 0.6);
}

main { max-width: var(--max-width); margin: 0 auto; padding: 32px 18px 60px; }

.hero-heading {
  position: absolute;
  top: 7rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--text);
  z-index: 1;
  pointer-events: none;
}
.hero-heading h2 {
  font-size: 4rem;      /* adjust size as desired */
  margin: 0;
}

.no-break { white-space: nowrap; }

.hero-heading p {
  font-size: 2rem;
  margin: 0.1rem 0 0;
}

.hero {
  /* break out of the max‑width container to span edge‑to‑edge */
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;

  /* give it the height you want */
  min-height: 60vh; /* adjust as desired */

  /* display your image anchored at the top */
  background: url('../img/Blackh.png') top center/cover no-repeat;

  /* remove the old card styling */
  padding: 0;
  border: none;
  border-radius: 0;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;        /* controls how tall the fade is */
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0.7) 100%
  );
}

.hero-kicker {
  margin: 0;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--muted);
}

.hero-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
}

.hero-subtitle {
  margin: 0 auto;
  max-width: 640px;
  color: var(--muted);
}
.mobile-patreon {
  display: none;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section {
  margin-top: 36px;
}

.section h2 {
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-align: center;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.cards.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover, .card:focus-within { box-shadow: var(--glow); transform: translateY(-1px); }

/* Home page card images: square thumbnails */
.cards > a.card > img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
}

.card .faction-icon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 0;
  cursor: pointer;
}

/* Lightbox modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.open {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 70%;
  max-height: 80%;
}

.modal-content img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
  display: block;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

@media (max-width: 720px) {
  .modal-content {
    max-width: 90%;
    max-height: 90%;
  }
}
.card .summary {
  margin-bottom: 12px;
  color: var(--text);
}

.card details summary {
  cursor: pointer;
  color: var(--accent);
  text-decoration: underline;
  margin-bottom: 8px;
}

.card details {
  margin: 0;
  padding: 0;
}

.meta-strip {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list li { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.timeline-date { font-weight: 700; }

.newsletter {
  background: var(--card);
  border: 1px dashed var(--accent);
  padding: 18px;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
}

.newsletter form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.newsletter input[type="email"] { padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: #0f0f15; color: var(--text); }

.footer {
  background: #07070c;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 24px 18px 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.footer h4 { margin-top: 0; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin: 6px 0; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }

.legal-bar { border-top: 1px solid var(--border); text-align: center; color: var(--muted); padding: 12px; font-size: 14px; }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(214, 167, 86, 0.12); color: var(--accent); font-size: 13px; }

.grid-tight { display: grid; gap: 10px; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.82); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.lightbox.active { display: flex; }
.lightbox-content { background: var(--card); border-radius: var(--radius); padding: 16px; max-width: 900px; width: 100%; border: 1px solid var(--border); }
.lightbox header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lightbox img { width: 100%; max-height: 60vh; object-fit: contain; background: #0f0f15; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-btn { border: 1px solid var(--border); background: #0f0f15; color: var(--text); padding: 8px 12px; border-radius: 999px; cursor: pointer; transition: var(--transition); }
.filter-btn.active, .filter-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow); }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-rows: 160px auto; }
.gallery figcaption { padding: 10px; font-size: 14px; color: var(--muted); }
.gallery .fallback { display: grid; place-items: center; color: var(--muted); background: #0f0f15; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border: 1px solid var(--border); padding: 10px; text-align: left; }
.table th { background: #0f0f15; }

.latest-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 10px; }
.latest-strip a { display: block; padding: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.latest-strip a:hover { box-shadow: var(--glow); color: var(--accent); }

.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 16px; }

.search-box { width: 100%; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); background: #0f0f15; color: var(--text); }
.search-results { margin-top: 16px; display: grid; gap: 10px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.books-page {
  background: var(--bg);
  color: var(--text);
}

.book-hero-card {
  display: flex;
  gap: 24px;
  align-items: center;
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  color: var(--text);
}

.book-hero-card img {
  border-radius: 16px;
  max-width: 260px;
  width: 100%;
  height: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.book-hero-content h2 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--accent);
  text-align: left;
}

.book-hero-content p {
  margin-top: 0;
  margin-bottom: 18px;
  color: var(--text);
}

.book-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}


@media (max-width: 720px) {
  /* Hide the desktop newsletter/search/Patreon bar */
  .site-header .utility-links {
    display: none;
  }

  /* Collapse the nav into a vertical list; hide it by default */
  nav .nav-links {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
  }
  nav.open .nav-links {
    display: flex;
  }
  .nav-links .mobile-only {
    display: block;
    margin-top: 12px;
  }

  /* Use flexbox for the header row to centre the crest */
  .header-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 18px;
    position: relative; /* anchor for burger/nav positioning */
  }

  /* Enlarge the logo and keep it centred */
  .brand-logo {
    width: clamp(200px, 70vw, 420px);
    max-height: 160px;
    margin: 0 auto;
    display: block;
  }

  /* Position the nav (burger) on the right and align it vertically with the logo */
  nav {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    height: auto;
    z-index: 40;
  }
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
  }
  .menu-toggle span {
    display: block;
    height: 3px;
    background: var(--accent); /* gold bars */
    border-radius: 3px;
  }

  /* Turn the nav into a full‑screen overlay when open */
  nav.open {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;      /* remove the translateY inherited from nav */
    background: #050508;  /* dark backdrop */
    padding-top: 6rem;    /* leave space for the crest and burger row */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 50;
  }
  nav.open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 0;
  }
  nav.open .nav-links a {
    font-size: 1.25rem;
    color: var(--text);
  }

  /* Adjust hero heading position and size */
  .hero-heading {
    position: absolute;
    top: 4rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    width: 100%;
  }
  .hero-heading h2 {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 auto;
    max-width: 90%;
  }
  .hero-heading p {
    font-size: 2rem;
  }

  /* Show the Patreon button below the hero */
  .mobile-patreon {
    display: flex;
    justify-content: center;
    margin: 20px 0;
  }

  /* Stack cards vertically */
  .cards {
    grid-template-columns: 1fr;
  }
  .cards.two-column {
    grid-template-columns: 1fr;
  }
  .cards > a.card > img {
    height: 100px;
  }
  .section {
    margin-top: 24px;
  }

  main {
    padding: 24px 16px 48px;
  }

  /* Newsletter layout stacks its fields */
  .newsletter {
    grid-template-columns: 1fr;
  }
  .newsletter form {
    grid-template-columns: 1fr;
  }

  .hero-topbar {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 600px) {
  .book-hero-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .book-hero-card img {
    max-width: 100%;
  }

  .book-hero-actions {
    width: 100%;
    flex-direction: column;
  }

  .book-hero-actions .btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 720px) {
  .card .faction-icon {
    width: 3.5rem;
    height: 3.5rem;
    top: 0.5rem;
    right: 0.5rem;
  }
}

/* === Timeline styles === */
.timeline {
  position: relative;
  margin: 0 auto;
  padding: 20px 0;
  max-width: 800px;
  overflow: hidden;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: var(--accent);
}
.timeline-year {
  display: block;
  width: 100%;
  text-align: center;
  margin: 30px 0 10px;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  clear: both;
}
.timeline-event {
  position: relative;
  width: calc(50% - 40px);
  padding: 10px 20px;
  box-sizing: border-box;
}
.timeline-event.left {
  float: left;
  text-align: right;
  clear: both;
}
.timeline-event.right {
  float: right;
  text-align: left;
  clear: both;
}
.timeline-event::before {
  content: '';
  position: absolute;
  top: 16px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  z-index: 1;
}
.timeline-event.left::before {
  right: -8px;
}
.timeline-event.right::before {
  left: -8px;
}
.timeline-date {
  font-weight: 700;
  color: var(--accent);
}

@media (max-width: 720px) {
  /* Stack each event full width and add extra spacing */
  .timeline-event {
    width: 100%;
    float: none;
    margin: 0 0 24px;
    padding-left: 32px;
    position: relative;
    text-align: left;
  }
  /* Hide the central vertical line entirely on small screens */
  .timeline::before {
    display: none;
  }
  /* Turn the markers into small bullets aligned with the text */
  .timeline-event::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
  }
  /* Left-align year headings and give them more room */
  .timeline-year {
    clear: both;
    margin: 40px 0 16px;
    text-align: left;
  }
}

/* Grey cards for the About page */
.about-page .about-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  color: var(--text);
}

/* About page image layout */
.about-card.about-with-image,
.about-card.author-card {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
}

.about-with-image .about-image img {
  max-width: 300px;
  height: auto;
  border-radius: var(--radius);
}

.about-card.about-with-image .about-text,
.about-card.author-card .author-text {
  flex: 1 1 0;
}

/* Portrait styling for author card */
.about-card.author-card .author-image {
  max-width: 30%;
  height: auto;
  border-radius: var(--radius);
}

@media (max-width: 720px) {
  .about-card.about-with-image,
  .about-card.author-card {
    flex-direction: column;
    gap: 16px;
  }

  .about-with-image .about-image img,
  .about-card.author-card .author-image {
    max-width: 100%;
  }
}

/* === MailerLite embed styling overrides === */
.newsletter .ml-form-embedWrapper,
.newsletter .ml-form-embedContainer {
  background: var(--card) !important;
  border: none !important;
  padding: 18px !important;
  border-radius: var(--radius) !important;
  color: var(--text) !important;
}

.ml-embedded h4 {
  color: var(--accent) !important;
}

.ml-embedded p {
  color: var(--muted) !important;
}

.ml-embedded input[type="email"],
.ml-embedded input[type="text"],
.ml-embedded input[type="checkbox"],
.ml-embedded select {
  background: #0f0f15 !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 10px !important;
}

.ml-embedded button.primary {
  background: linear-gradient(120deg, #c79132, #e2b35e) !important;
  color: #0b0b0f !important;
  border-radius: 999px !important;
  padding: 10px 16px !important;
  font-weight: 700 !important;
  box-shadow: var(--glow) !important;
  border: none !important;
  cursor: pointer !important;
}

.ml-embedded button.primary:hover {
  box-shadow: 0 0 15px rgba(226, 179, 94, 0.6) !important;
}

/* Ensure the MailerLite embed spans the full width of the newsletter card */
.newsletter .ml-embedded {
  grid-column: 1 / -1;
}
