/* Base Reset and General Styles */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Open Sans", sans-serif;
  background-color: #dbca9a;
  color: #34544f;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overscroll-behavior: contain;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

/* Header and Navigation */
header {
  background-color: #c08b51;
  padding: 1rem;
  text-align: center;
  font-family: "Cinzel", serif;
  font-size: 2rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

nav {
  background-color: #a7623c;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.5rem;
  flex-wrap: wrap;
  position: sticky;
  top: 4.5rem;
  z-index: 15;
}

nav a {
  text-decoration: none;
  color: #dbca9a;
  font-weight: bold;
}

/* Main Layout */
main {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: auto 1fr;
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Footer */
footer {
  background-color: #34544f;
  padding: 0.5rem;
  text-align: center;
  color: #dbca9a;
  border-top: 4px solid #786f5d;
  margin-top: 2rem;
}

/* Character Section */
.character-section {
  grid-column: 1 / span 2;
  background-color: #786f5d;
  padding: 2rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

.character-section h2 {
  margin-bottom: 2rem;
  font-size: 2rem;
  text-align: center;
}

/* Countdown */
#countdown {
  font-size: 1.5rem;
}

/* Carousel Wrapper */
.carousel-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  overflow: visible;
  position: relative;
}

/* Splide Carousel Styles */
.splide__track {
  overflow: visible;
}

.splide__slide {
  display: flex;
  justify-content: center;
}

.character-card {
  background-color: #786f5d;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  color: #dbca9a;
  width: 300px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.character-card img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

/* Focused Center Card */
.splide__slide.is-active .character-card {
  transform: scale(1.1);
  opacity: 1;
}

/* Dim Side Cards */
.splide__slide:not(.is-active) .character-card {
  transform: scale(0.9);
  opacity: 0.5;
}

/* General Grid Items */
.grid-item {
  background-color: #786f5d;
  padding: 1.5rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 250px;
  box-sizing: border-box;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item h2 {
  margin-bottom: 1rem; 
}

/* Button Styles */
button {
  background-color: #34544f;
  color: #dbca9a;
  border: none;
  padding: 0.75rem 1.5rem; 
  border-radius: 6px; 
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 1rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
  background-color: #a7623c;
  transform: translateY(-2px); 
}

/* Hover Lift Effects */
.grid-item,
.character-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover,
.character-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

#overlayMenu {
  display: none;
}

.campaign-title {
  text-decoration: none;
  color: inherit;
  font-family: "Cinzel", serif;
  font-size: 2rem;
}

.campaign-title:hover {
  text-decoration: underline;
}

/* Lore Page Specific Styles */
.page-title {
  text-align: center;
  width: 100%;
  font-family: "Cinzel", serif;
  font-size: 2.5rem;
  margin: 2rem 0;
  color: #34544f;
}

.category-title {
  text-align: center;
  width: 100%;
  font-family: "Cinzel", serif;
  font-size: 2rem;
  margin: 2rem 0 1rem;
  color: #a7623c;
}

.lore-main {
  width: 100%;
  max-width: none;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.lore-container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.lore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1400px;
}

.lore-card {
  background-color: #786f5d;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  text-align: center;
  height: 100%;
  min-height: 350px;
}

.lore-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.lore-card h2 {
  margin: 1rem 0 0.5rem;
  font-size: 1.5rem;
  color: #dbca9a;
}

.lore-card p {
  padding: 0 1rem 1rem;
  color: #dbca9a;
}

.lore-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

.lore-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem; /* ✨ space between buttons and cards */
}

.filter-btn {
  background-color: #a7623c;
  color: #dbca9a;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.filter-btn:hover {
  background-color: #34544f;
}


/* Responsive adjustments */
@media (max-width: 768px) {
  main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
  }

  .lore-main,
  .lore-container {
    width: 100%;
    padding: 1rem 0;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
  }

  .page-title,
  .category-title {
    text-align: center;
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
  }

  .lore-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 2rem;
    padding: 0 1rem;
    box-sizing: border-box;
  }

  .lore-card {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
  }

  /* Mobile: show overlay menu */
  #overlayMenu {
    display: block;
  }

  .character-section {
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
  }

  .carousel-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .splide__slide {
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
  }

  .character-card {
    width: 90%;
    max-width: 280px;
    margin: 0 auto;
  }

  nav {
    display: none;
  }

  /* Burger menu button */
  #burger {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #dbca9a;
    cursor: pointer;
    z-index: 100;
  }

  /* Full screen overlay */
  .overlay {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 99;
    top: 0;
    left: 0;
    background-color: rgba(52, 84, 79, 0.95);
    overflow-x: hidden;
    transition: width 0.5s;
  }

  .overlay-content {
    position: absolute;
    top: 25%;
    width: 100%;
    text-align: center;
  }

  .overlay a {
    padding: 1rem;
    text-decoration: none;
    font-size: 2rem;
    color: #dbca9a;
    display: block;
    transition: 0.3s;
  }

  .overlay a:hover {
    color: #a7623c;
  }

  .recaps-main {
    padding: 0 2rem !important;
  }

  /* Mobile Menu Dark Background Fade */
#menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6); /* ⭐ Dark translucent background */
  z-index: 98; /* Behind the overlay menu (which is z-index 99) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* When overlay is open */
.overlay.show ~ #menu-backdrop {
  opacity: 1;
  pointer-events: all;
}

}

/* Animation for Overlay Opening */
@keyframes scaleFadeIn {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.overlay.show {
  animation: scaleFadeIn 0.5s ease forwards;
}

/* Fade-in Animation */
.fade-in {
  animation: fadeIn 0.6s ease forwards;
  opacity: 0; /* Start invisible, will fade in */
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Recaps Page Specific Styles */
.recaps-main {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 2rem;
  box-sizing: border-box;
}

.recaps-container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
}

.recaps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.recap-card {
  background-color: #786f5d;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  color: #dbca9a;
  text-align: center;
  min-height: 275px; 
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recap-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

.recap-card button {
  background-color: #34544f;
  color: #dbca9a;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin-top: 1rem;
  cursor: pointer;
  margin-top: auto;
}

.recap-card button:hover {
  background-color: #a7623c;
}

/* Recap Detail Page */
.recap-detail-main {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.recap-detail-container {
  width: 100%;
  max-width: 800px;
  background-color: #786f5d;
  padding: 2rem;
  border-radius: 8px;
  color: #dbca9a;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  text-align: left;
}

.recap-full-text {
  margin-top: 2rem;
  font-size: 1rem;
  line-height: 1.6;
}

.recap-detail-container button {
  background-color: #34544f;
  color: #dbca9a;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  margin-top: 2rem;
  cursor: pointer;
}

.recap-detail-container button:hover {
  background-color: #a7623c;
}

nav a.active-link {
  border-bottom: 2px solid #dbca9a;
  padding-bottom: 0.25rem;
  font-weight: bold;
}

/* Card Hover Polishes */
.grid-item,
.lore-card,
.recap-card,
.character-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover,
.lore-card:hover,
.recap-card:hover,
.character-card:hover {
  transform: translateY(-6px); 
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3); 
}
