/* --- Base Variables & Color Palette --- */
:root {
  --deep-forest-base: #0b1c14; /* Our base dark green */
  --pine-needle: #1a3c28; /* Rich green for borders/boxes */
  --moss-light: #4a7055; /* Hover state green */
  --parchment: #eae5d9; /* Off-white/cream for main text */
  --gold-accent: #d4af37; /* Warm golden accent for links */

  /* Fonts */
  --font-mythic: "Cormorant Garamond", serif;
  --font-body: "Palatino Linotype", "Book Antiqua", serif;
}

/* --- Global Styles & Woodland Background --- */
body {
  /* 1. The Woodland Background Image */
  background-image: url("images/forest.jpg");

  /* 2. Background Settings: Fixed, centered, and scaled to cover the screen */
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* Parallax effect: Content scrolls, background stays still */
  background-repeat: no-repeat;

  /* Fallback color if the image fails to load */
  background-color: var(--deep-forest-base);

  color: var(--parchment);
  font-family: var(--font-body);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

/* --- Typography --- */
h1,
h2,
h3 {
  font-family: var(--font-mythic);
  color: var(--gold-accent);
  font-weight: normal;
  letter-spacing: 1px;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9); /* Stronger shadow for photo background */
}

a {
  color: var(--moss-light);
  text-decoration: none;
  border-bottom: 1px dashed var(--moss-light);
  transition: all 0.3s ease;
}

a:hover {
  color: var(--gold-accent);
  border-bottom: 1px solid var(--gold-accent);
}

/* --- Layout Containers (Updated for Photo Background) --- */
.grove-container {
  max-width: 800px;
  width: 90%;
  margin: 50px auto; /* Added more space top/bottom */
  padding: 40px;

  /* 3. The Readability Overlay: A dark, semi-transparent green box */
  background-color: rgba(11, 28, 20, 0.9); /* Deep forest base at 95% opacity */

  border: 1px solid rgba(74, 112, 85, 0.5); /* Subtle border */
  border-radius: 8px; /* Softer edges */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8); /* Deeper shadow for float */
}

header {
  text-align: center;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--moss-light);
  padding-bottom: 5px;
}

/* --- Mythological Accents --- */
.rune-divider {
  text-align: center;
  color: var(--gold-accent);
  font-size: 1.5rem;
  margin: 10px 0;
  opacity: 0.7;
}

/* A special class for character bios or folklore tales */
.folklore-entry {
  /* Using a slightly different background tone inside the container */
  background: rgba(26, 60, 40, 0.6);
  padding: 20px;
  border-left: 4px solid var(--gold-accent);
  margin-bottom: 20px;
}

/* --- Stylized Navigation Menu --- */
.woodland-nav {
  margin-top: 5px;
  margin-bottom: 5px;
  text-align: center;
  border-bottom: 1px solid rgba(74, 112, 85, 0.3); /* Soft mossy line under the menu */
  padding-bottom: 5px;
}

.woodland-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 10px; /* Controls the space between your links */
  flex-wrap: wrap;
}

.woodland-nav li {
  position: relative;
}

/* Base style for the navigation links */
.woodland-nav a {
  font-family: var(--font-mythic);
  font-size: 1.3rem;
  color: var(--parchment);
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: none; /* Removes the dashed line from your global link styles */
  transition: all 0.4s ease;
  display: block;
  padding: 5px 10px;
}

/* The Glowing Hover State */
.woodland-nav a:hover,
.woodland-nav a.active {
  color: var(--gold-accent);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.5); /* Soft golden glow */
}

/* The Magical Appearing Rune/Star */
.woodland-nav a::after {
  content: "✦"; /* You can change this to ✧, ↟, or even an emoji like 🍂 */
  display: block;
  text-align: center;
  font-size: 0.9rem;
  color: var(--gold-accent);
  opacity: 0; /* Hidden by default */
  transform: translateY(-10px); /* Starts slightly higher up */
  transition: all 0.3s ease;
}

/* Triggers the rune to drop down and fade in on hover */
.woodland-nav a:hover::after,
.woodland-nav a.active::after {
  opacity: 1;
  transform: translateY(2px);
}

/* --- Two-Column Layout --- */

/* Change max-width on your existing container to 1000px so there is room for the sidebar */
.grove-container {
  max-width: 1000px;
}

.content-wrapper {
  display: flex;
  gap: 20px; /* Space between sidebar and main content */
  align-items: flex-start; /* Keeps the sidebar from stretching to the bottom if main content is long */
}

/* --- Sidebar Styles --- */
.sidebar {
  flex: 0 0 250px; /* Forces the sidebar to stay exactly 250px wide */
}

.sidebar-widget {
  background: rgba(11, 28, 20, 0.4); /* Very subtle dark background */
  border: 1px solid rgba(74, 112, 85, 0.3); /* Soft mossy border */
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 4px;
}

.sidebar-widget h3 {
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3); /* Subtle gold line */
  padding-bottom: 5px;
}

.sidebar-widget p {
  font-size: 0.95rem;
  margin: 0;
}

/* --- Main Content Area --- */
.main-content {
  flex: 1; /* Takes up all remaining space */
}

/* --- Mobile Responsiveness --- */
/* If the screen is smaller than 768px (like a phone), stack the columns */
@media (max-width: 768px) {
  .content-wrapper {
    flex-direction: column;
  }

  .sidebar {
    flex: none; /* Removes the fixed width */
    width: 100%; /* Makes sidebar full width on phones */
    order: 2; /* Pushes the sidebar BELOW the main content on phones (optional) */
  }

  .main-content {
    order: 1; /* Keeps main content on top on phones */
  }
}
/* --- Sidebar Questionnaire Form --- */
.mythic-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  -webkit-user-select: none; /* Prevents text highlighting when clicking rapidly (Safari/iOS) */
  user-select: none; /* Prevents text highlighting when clicking rapidly */
  transition: color 0.2s ease;
}

.checkbox-container:hover {
  color: var(--gold-accent);
}

/* Hide the default browser checkbox */
.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Create a custom magical checkbox */
.checkmark {
  height: 18px;
  width: 18px;
  background-color: rgba(11, 28, 20, 0.6);
  border: 1px solid var(--moss-light);
  border-radius: 3px;
  margin-right: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
}

/* Hover state for the box */
.checkbox-container:hover input ~ .checkmark {
  border-color: var(--gold-accent);
}

/* When the box is checked, add the gold star symbol */
.checkbox-container input:checked ~ .checkmark::after {
  content: "✦";
  color: var(--gold-accent);
  font-size: 0.9rem;
}

/* The Submit Button */
.woodland-btn {
  margin-top: 10px;
  background: rgba(26, 60, 40, 0.8);
  color: var(--parchment);
  border: 1px solid var(--moss-light);
  padding: 8px 15px;
  font-family: var(--font-mythic);
  font-size: 1.1rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 3px;
}

.woodland-btn:hover {
  background: rgba(11, 28, 20, 0.9);
  color: var(--gold-accent);
  border-color: var(--gold-accent);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3); /* Soft magical glow */
}

/* --- Questionnaire Response Message --- */
#form-response {
  display: none; /* Keeps it hidden until the button is clicked */
  margin-top: 15px;
  color: var(--gold-accent);
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
}
/* --- Decorative Images --- */
.decor-right {
  float: right;
  max-width: 120px; /* Keeps the image from getting too huge */
  margin: 5px 0 15px 20px; /* Adds invisible space: top right bottom left */
  opacity: 0.85; /* Makes it blend slightly into the forest atmosphere */
  filter: drop-shadow(
    2px 4px 6px rgba(0, 0, 0, 0.6)
  ); /* A soft shadow for depth */
}

.decor-left {
  float: left;
  max-width: 120px;
  margin: 5px 20px 15px 0;
  opacity: 0.85;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.6));
}

/* --- Sidebar Decorations --- */
.sidebar-image {
  display: block; /* Forces the image onto its own line */
  max-width: 80%; /* Keeps it nicely sized within the widget */
  margin: 15px auto 0; /* Centers it left/right and adds 15px of space on top */
  opacity: 0.85; /* Blends it slightly into the forest */
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.6)); /* Soft shadow */
}

/* --- Guestbook Sidebar Widget --- */
.guestbook-widget {
  background-color: rgba(244, 235, 216, 0.05); /* A very faint parchment glow */
  border: 1px solid var(--gold-accent, #d4af37);
  padding: 15px;
  margin-top: 10px; /* Creates space between this and the questionnaire */
  border-radius: 4px;
  text-align: center;
}

.guestbook-widget h3 {
  margin-top: 0;
  color: var(--gold-accent, #d4af37);
  border-bottom: 1px dashed rgba(212, 175, 55, 0.4);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.guestbook-widget p {
  font-size: 0.9rem;
  margin-bottom: 10px;
  font-style: italic;
}

/* --- Woodland Footer & Counter --- */
.woodland-footer {
  text-align: center;
  margin-top: 10px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-top: 1px dashed rgba(212, 175, 55, 0.4); /* Soft gold dashed line */
  color: #a3b1a6; /* A faded, mossy text color */
}

.woodland-footer p {
  margin: 5px 0;
  font-size: 0.95rem;
}

.visitor-counter {
  margin: 15px 0;
}

/* Adds a nice frame around whichever counter image you use */
.visitor-counter img {
  border: 1px solid var(--gold-accent, #d4af37);
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.footer-credits {
  font-size: 0.8rem;
  opacity: 0.7;
  font-style: italic;
  margin-top: 5px;
}

/* --- Cabinet of Curiosities Grid Layout --- */

.cabinet-header {
  text-align: center;
  margin-bottom: 10px;
}

.cabinet-header h2 {
  font-size: 2.2rem;
  margin-bottom: 5px;
}

/* The magic of CSS Grid */
.cabinet-grid {
  display: grid;
  /* This automatically fits as many 250px cards as it can in a row, and wraps the rest */
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px; /* Space between the items */
  padding: 10px;
}

/* Individual Item Cards */
.cabinet-item {
  background: rgba(26, 60, 40, 0.6);
  border: 1px solid var(--moss-light);
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.4s ease; /* Smooth animation */
}

/* The Hover Effect */
.cabinet-item:hover {
  transform: translateY(-8px); /* Lifts the card up slightly */
  border-color: var(--gold-accent);
  box-shadow: 0 10px 20px rgba(212, 175, 55, 0.15); /* Soft golden glow */
}

/* Item Images */
.cabinet-item img {
  width: 100%;
  height: 180px;
  object-fit: cover; /* Ensures photos fill the space without stretching */
  border-radius: 4px;
  margin-bottom: 15px;
  border: 1px solid rgba(0, 0, 0, 0.5);
}

/* Overriding default link styles for the text inside the card */
.cabinet-item h3 {
  margin-top: 0;
  margin-bottom: 10px;
  border-bottom: none;
}

.cabinet-item p {
  font-size: 0.95rem;
  color: var(--parchment);
  margin: 0;
  line-height: 1.5;
}

/* --- Point and Click Scenes --- */
.scene-container {
  position: relative; /* This is the magical rule that traps the hitbox inside the image */
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  border: 2px solid var(--pine-needle);
  border-radius: 4px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8);
}

.scene-image {
  width: 100%;
  display: block;
  border-radius: 2px;
}

/* The clickable area */
.hitbox {
  position: absolute;
  display: block;

  /* REMOVE THIS LINE LATER to make the box completely invisible! */
  border: 2px dashed rgba(212, 175, 55, 0.6);

  transition: all 0.3s ease;
}

/* Adds a soft magical glow when the mouse hovers over the secret area */
.hitbox:hover {
  background-color: rgba(212, 175, 55, 0.15);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* --- Clickable Sign Overlay --- */
.sign-overlay {
  position: absolute;
  display: block;
  z-index: 10; /* Ensures the sign sits ON TOP of the background image */
  transition: all 0.3s ease;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.8));
}

/* Make the image inside the link fill the space perfectly */
.sign-overlay img {
  width: 100%;
  display: block;
}

/* A magical hover effect for the sign */
.sign-overlay:hover {
  transform: scale(1.05) rotate(-2deg); /* Slightly enlarges and tilts the sign */
  filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.6)); /* Golden glow */
}

/* --- Immersive Point-and-Click Pages --- */
body.immersive-page {
  background-image: none !important;
  background-color: #030805 !important;
  align-items: center;
  min-height: 100vh;
}

/* --- Library Reading Rooms (The Content Pages) --- */

.tome-page {
  background-color: #f4ebd8; /* Warm parchment */
  color: #2c1e16; /* Dark brown ink */
  padding: 40px;
  border-radius: 4px;
  border: 1px solid #dcb982;
  box-shadow:
    inset 0 0 50px rgba(139, 105, 20, 0.1),
    0 5px 15px rgba(0, 0, 0, 0.5);
  font-size: 1.1rem;
  line-height: 1.6;
}

.tome-page h2 {
  color: #4a3b2c;
  border-bottom: 2px solid rgba(139, 105, 20, 0.4);
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 10px;
}

/* Styling for your web catalog index cards */
.index-card {
  background: #fffdf7;
  border: 1px solid #e0d5c1;
  padding: 15px 20px;
  margin-bottom: 15px;
  border-left: 5px solid var(--pine-needle); /* Uses your existing dark green variable */
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.05);
}

.index-card h3 {
  margin-top: 0;
  margin-bottom: 5px;
  color: var(--pine-needle);
}

.dewey-number {
  font-weight: bold;
  color: var(--gold-accent);
  font-family: monospace;
  font-size: 1rem;
  float: right;
}

/* --- Parchment Link Lists --- */
.parchment-list {
  list-style: none; /* Removes the standard bullet points */
  padding: 0;
  margin: 0;
}

.parchment-list li {
  margin-bottom: 0px;
  padding-bottom: 0px;
  border-bottom: 1px dashed rgba(139, 105, 20, 0.3); /* A soft divider between entries */
}

.parchment-list li:last-child {
  border-bottom: none; /* Removes the line under the final item */
}

.parchment-link {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 600;
  color: #4a3b2c; /* Dark brown ink */
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  margin-bottom: 5px;
}

.parchment-link:hover {
  color: var(--gold-accent);
  border-bottom: 2px solid var(--gold-accent);
}

.parchment-description {
  margin: 0;
  color: #5a4b3c;
  font-size: 1.05rem;
}

/* --- bookshelf Hitbox Positions --- */
#door-museums {
  top: 5%;
  left: 10%;
  width: 40%;
  height: 15%;
}

#door-indieweb {
  top: 35%;
  left: 30%;
  width: 40%;
  height: 15%;
}

#door-resources {
  top: 75%;
  left: 30%;
  width: 40%;
  height: 15%;
}

#door-secret-library {
  top: 5%;
  left: 50%;
  width: 40%;
  height: 15%;
}

#corridor-exit {
  top: 85%;
  left: 5%;
  width: 20%;
}

/* --- Static Scene Decorations --- */
.scene-prop {
  position: absolute;
  z-index: 5; /* Keeps them above the background, but below hitboxes just in case */
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.7));
}

.scene-prop img {
  width: 100%;
  display: block;
}

/* --- Corridor Sign Positions --- */
#sign-weblibrary {
  top: 50%;
  left: 5%;
  width: 20%;
}

#sign-indieweb {
  top: 45%;
  left: 45%;
  width: 20%;
}

#sign-botany {
  top: 47%;
  left: 67%;
  width: 20%;
}

/* --- Bestiary & Lore Profiles --- */
.bestiary-portrait {
  float: right;
  max-width: 350px;
  margin: 0 0 20px 30px;
  border-radius: 8px;
  border: 2px solid var(--gold-accent, #d4af37);
  box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.15);
  background-color: #fffdf7;
  padding: 10px;
}

.bestiary-portrait img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.lore-section {
  margin-bottom: 30px;
}

.lore-section h3 {
  color: var(--pine-needle, #2b4435);
  border-bottom: 1px dotted rgba(139, 105, 20, 0.4);
  padding-bottom: 5px;
  margin-bottom: 15px;
}

/* Clears the float so the next elements don't get trapped next to the image */
.clear-float {
  clear: both;
}
/* --- Gallery Wall & Picture Frames --- */
.gallery-wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.framed-artwork {
  max-width: 320px;
  text-align: center;
}

.physical-frame {
  background-color: #fcfaf5; /* Warm cream matting */
  padding: 25px; /* Creates the matting space around the art */
  border: 10px solid #2c241b; /* Dark espresso wood outer frame */
  box-shadow:
    8px 10px 20px rgba(0, 0, 0, 0.3),
    /* Dropshadow on the wall */ inset 0px 4px 8px rgba(0, 0, 0, 0.1); /* Inner shadow on the matting */
  position: relative;
  margin-bottom: 10px;
}

/* Adds a delicate inner gold rim right next to the painting */
.physical-frame::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 1px solid var(--gold-accent, #d4af37);
  pointer-events: none;
}

.physical-frame img {
  width: 100%;
  display: block;
  /* Adds a slight texture to the image edge */
  box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.5);
}

/* --- Updated Museum Plaque --- */
.museum-plaque {
  background-color: #f4ebd8; /* Solid, warm parchment background */
  border: 1px solid #c2b59b;
  padding: 10px 15px;
  display: inline-block;
  font-size: 0.9rem;
  border-radius: 2px;
  /* An optional trick: pulling the margin up slightly makes the plaque overlap the frame naturally! */
  margin-top: -5px;
  position: relative;
  z-index: 2;
}

.museum-plaque h3 {
  margin: 0 0 5px 0;
  font-size: 1.15rem;
  color: #1a1410; /* Very deep, warm espresso black */
  border: none;
  font-weight: 600;
}

.museum-plaque p {
  margin: 0;
  font-style: italic;
  font-size: 0.85rem;
  color: #3b2c20; /* Darker warm brown */
}
/* --- Lightbox Modal --- */

/* The dark background overlay */
.modal {
  display: none; /* Keeps it completely hidden until clicked */
  position: fixed; /* Locks it to the screen */
  z-index: 100; /* Puts it on top of the entire forest */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(26, 20, 16, 0.9); /* Very dark espresso overlay */
  -webkit-backdrop-filter: blur(
    4px
  ); /* Adds Safari support for the blur effect */
  backdrop-filter: blur(4px); /* Adds a nice modern blur to the background */
}

/* The expanded image itself */
.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85vh; /* Prevents it from getting taller than the screen */
  margin-top: 5vh;
  border: 4px solid #f4ebd8; /* A thin parchment rim around the full art */
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.8);
  border-radius: 2px;
}

/* The 'X' to close it */
.close-btn {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #f4ebd8;
  font-size: 45px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.close-btn:hover {
  color: var(--gold-accent, #d4af37);
}

/* Turns the cursor into a pointer so visitors know they can click the art */
.framed-artwork img {
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.framed-artwork img:hover {
  opacity: 0.85; /* Slight dim when hovered to show interactivity */
}

/* --- Visual Archive Grid --- */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 5px;
  margin-top: 20px;
}

/* The individual clickable card */
.archive-card {
  display: flex;
  flex-direction: column;
  background-color: #fcfaf5;
  border: 1px solid #c2b59b;
  border-radius: 2px;
  overflow: hidden;
  text-decoration: none;
  text-transform: none; /* <--- Add this! Stops links from capitalizing */
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.archive-card:hover {
  transform: translateY(-4px); /* Slight lift on hover */
  box-shadow: 4px 6px 15px rgba(0, 0, 0, 0.15);
}

/* The preview picture */
.archive-preview {
  width: 100%;
  height: 130px; /* Keeps the cards compact */
  object-fit: cover; /* Crops the screenshot nicely without distorting it */
  border-bottom: 1px solid #e0d8c3;
}

/* The text section below the picture */
.archive-info {
  padding: 5px;
}

.archive-info h3 {
  margin: 0 0 8px 0;
  font-size: 1.15rem;
  color: #1a1410;
  border: none;
  text-transform: none !important; /* <--- The magic override! */
}

.archive-info p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #3b2c20;
}
