/* Reset */
* {
  box-sizing: border-box;
}

/* Smooth scrolling for session index links */
html {
  scroll-behavior: smooth;
}

/* Base page */
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
  color: #f3eadf;
  background-color: #15120f;
  background-image:
    linear-gradient(rgba(21, 18, 15, 0.82), rgba(21, 18, 15, 0.82)),
    url("images/mapp2.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* Layout */
.container {
  width: min(900px, 92%);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 2rem 0;
  background: linear-gradient(
    to bottom,
    rgba(36, 27, 22, 0.96),
    rgba(24, 19, 16, 0.96)
  );
  border-bottom: 1px solid #4a3a2d;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.site-header h1 {
  margin: 0;
}

.tagline {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  color: #d8c7b3;
}

/* Navigation */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0;
}

.main-nav a,
.dropbtn {
  display: inline-block;
  padding: 0.6rem 1rem;
  color: #f8efe4;
  text-decoration: none;
  background: #3a2b21;
  border: 1px solid #6a5443;
  border-radius: 8px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.main-nav a:hover,
.dropbtn:hover {
  background: #4a372b;
}

.main-nav a.active,
.dropbtn.active {
  background: #5a4435;
  border-color: #8a6b55;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 1100;
  min-width: 180px;
  padding: 0.3rem 0;
  background: #2a1f18;
  border: 1px solid #6a5443;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.dropdown-content a {
  display: block;
  padding: 0.6rem 1rem;
  color: #f8efe4;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.dropdown-content a:hover {
  background: #4a372b;
}

/* Controlled by JavaScript */
.dropdown.show .dropdown-content {
  display: block;
}

/* Main content */
main {
  padding: 2rem 0;
}

/* Cards */
.card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: rgba(33, 25, 19, 0.92);
  border: 1px solid #4f3d31;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.hero h2 {
  margin-top: 0;
}

/* Prevent session titles from hiding behind the sticky header */
.session-section,
section[id] {
  scroll-margin-top: 220px;
}

/* Typography */
h2 {
  margin-top: 0;
  color: #f4d7a1;
}

h3 {
  color: #e6c891;
}

p,
li {
  color: #f3eadf;
}

ul {
  padding-left: 1.25rem;
}

/* Links inside content */
main a,
.card a {
  color: #f4d7a1;
}

main a:hover,
.card a:hover {
  color: #ffe2ab;
}

/* Horizontal separator */
hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid #4f3d31;
}

/* Session index */
.session-menu {
  margin: 0;
  padding-left: 1.25rem;
}

.session-menu li {
  margin-bottom: 0.6rem;
}

.session-menu li:last-child {
  margin-bottom: 0;
}

.session-menu a {
  font-size: 1.05rem;
  text-decoration: none;
}

.session-menu a:hover {
  text-decoration: underline;
}

/* Back to Index link */
.back-to-top {
  margin-top: 2rem;
  margin-bottom: 0;
  font-size: 0.95rem;
  text-align: right;
}

.back-to-top a {
  color: #f4d7a1;
  font-weight: bold;
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-to-top a:hover {
  color: #ffe2ab;
  text-decoration: underline;
}

/* Footer */
.site-footer {
  padding: 1rem 0 2rem;
  color: #c9b7a2;
  background: rgba(12, 9, 7, 0.35);
  border-top: 1px solid #4a3a2d;
}

/* Tables */
.table-wrap {
  width: 100%;
  margin-top: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lore-table {
  width: 100%;
  min-width: 640px;
  margin-top: 0;
  font-size: 0.95rem;
  color: #2b2118;
  background: #d8d2c2;
  border: 1px solid #5a4636;
  border-collapse: collapse;
}

.lore-table th,
.lore-table td {
  padding: 0.6rem 0.8rem;
  vertical-align: top;
  border: 1px solid #5a4636;
}

.lore-table thead {
  background: #6b6b6b;
}

.lore-table th {
  color: #ffffff;
  text-align: left;
}

.lore-table tbody tr:nth-child(even) {
  background: #cfc8b6;
}

/* Centered images */
.image-center {
  margin-top: 1rem;
  text-align: center;
}

.image-center img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  border: 1px solid #5a4636;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.image-caption {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #c9b7a2;
}

/* Optional portrait image style */
.portrait-image img {
  width: 100%;
  max-width: 320px;
}

/*
  Standard image row.

  On desktop, all images remain on one row.
  Four images will automatically share the available width.
*/
.image-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1.5rem;
  margin-top: 1rem;
}

.image-item {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.image-item img {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto;
  border: 1px solid #5a4636;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* Hero cards */
.hero-card {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.hero-image {
  flex: 0 0 260px;
  text-align: center;
}

.hero-image img {
  width: 100%;
  max-width: 260px;
  height: auto;
  border: 1px solid #5a4636;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.hero-info {
  flex: 1;
  min-width: 0;
}

.hero-info h3 {
  margin-top: 0;
}

/* Session image collage */
.session-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 180px;
  gap: 12px;
  margin: 2rem 0;
}

.gallery-item {
  grid-column: span 4;
  grid-row: span 1;
  margin: 0;
  overflow: hidden;
  background: #171310;
  border: 1px solid #5a4636;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.gallery-item-large {
  grid-column: span 8;
  grid-row: span 2;
}

.gallery-item-wide {
  grid-column: span 8;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.25s ease,
    filter 0.25s ease;
}

.gallery-item:hover img {
  filter: brightness(1.05);
  transform: scale(1.03);
}

/* Mobile-friendly improvements */
@media (max-width: 700px) {
  body {
    background-attachment: scroll;
  }

  .container {
    width: 94%;
  }

  .site-header {
    position: static;
    padding: 1.25rem 0;
  }

  .site-header h1 {
    font-size: 1.5rem;
    line-height: 1.25;
  }

  .tagline {
    margin-bottom: 0.9rem;
    font-size: 0.95rem;
  }

  .main-nav {
    gap: 0.5rem;
  }

  .main-nav a,
  .dropbtn {
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
  }

  .dropdown-content {
    min-width: 160px;
  }

  main {
    padding: 1.2rem 0;
  }

  .card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  /* Header is not sticky on mobile */
  .session-section,
  section[id] {
    scroll-margin-top: 20px;
  }

  h2 {
    font-size: 1.3rem;
  }

  h3 {
    font-size: 1.05rem;
  }

  p,
  li {
    font-size: 0.98rem;
  }

  .session-menu a {
    font-size: 1rem;
  }

  .lore-table {
    min-width: 560px;
    font-size: 0.9rem;
  }

  .lore-table th,
  .lore-table td {
    padding: 0.5rem 0.65rem;
  }

  .image-center img {
    max-width: 100%;
    height: auto;
  }

  .portrait-image img {
    max-width: 100%;
  }

  /*
    Mobile image row:
    two images per row.
  */
  .image-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .image-row .image-item {
    flex: 0 1 calc(50% - 0.5rem);
    max-width: calc(50% - 0.5rem);
  }

  .image-row .image-item img {
    width: 100%;
    max-width: 180px;
    height: auto;
    margin: 0 auto;
  }

  .image-row .image-caption {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  /* Hero cards on mobile */
  .hero-card {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
  }

  .hero-image {
    flex: none;
  }

  .hero-image img {
    width: 100%;
    max-width: 180px;
    height: auto;
  }

  .hero-info {
    width: 100%;
    text-align: left;
  }

  .hero-info h3 {
    text-align: center;
  }

  /* Session collage on mobile */
  .session-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 180px;
    gap: 10px;
  }

  .gallery-item,
  .gallery-item-wide {
    grid-column: span 1;
    grid-row: span 1;
  }

  .gallery-item-large {
    grid-column: span 2;
    grid-row: span 2;
  }
}

/* Extra-small phones */
@media (max-width: 430px) {
  .main-nav a,
  .dropbtn {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }

  .hero-card {
    gap: 0.75rem;
  }

  .hero-image img {
    max-width: 165px;
  }

  /* Keep two images per row on smaller phones */
  .image-row {
    gap: 0.7rem;
  }

  .image-row .image-item {
    flex-basis: calc(50% - 0.35rem);
    max-width: calc(50% - 0.35rem);
  }

  .image-row .image-item img {
    max-width: 150px;
  }

  .image-row .image-caption {
    font-size: 0.78rem;
  }

  /* Stack the session collage on very small screens */
  .session-gallery {
    display: block;
  }

  .gallery-item,
  .gallery-item-large,
  .gallery-item-wide {
    width: 100%;
    height: 230px;
    margin-bottom: 12px;
  }
}