/* RESET + BOX MODEL */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* DEFAULT BODY + ROOT COLORS FROM THEME */
body {
  font-family: 'Source Sans Pro', Arial, Verdana, sans-serif;
  background-color: var(--primary-bg);
  color: var(--text-color);
}

/* BANNER + TOGGLE BUTTON */
.banner {
  height: 12rem;
  background: url('../assets/images/colors.JPG') no-repeat center 75%;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #eeeeee;
  position: relative;
}

.banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.banner-text {
  position: relative;
  z-index: 2;
}

.banner-text h1 {
  /* Old: font-size: 4rem; */
  /* Updated: Use clamp for responsive font scaling */
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  margin: 0;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.banner-text p {
  /* Old: font-size: 2rem; */
  /* Updated: Use clamp for responsive font scaling */
  font-size: clamp(1.5rem, 5vw, 1.75rem);
  margin: 0.25rem 0 0;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* TOGGLE BUTTON */
.theme-toggle-button {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background-color: var(--link-color);
  color: #fff;
  font-size: 1rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.theme-toggle-button:hover {
  background-color: var(--link-hover);
}

/* MENU NAVIGATION */
nav {
  display: block;
}

.menu {
  background-color: var(--menu-bg);
  position: relative;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background 0.4s ease, color 0.4s ease;
  /* Removed: Not needed with theme toggle */
}

.menu::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.menu ul {
  list-style: none;
  display: flex;
  justify-content: center;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 2;
}

.menu li {
  margin: 0.48rem 0.6rem 0rem 0.8rem;
  display: inline;
}

.menu a {
  text-decoration: none;
  padding: 0.75rem 0;
  /* Old: font-size: 0.96rem; */
  /* Updated: Use clamp for responsive font scaling */
  font-size: clamp(0.9rem, 2.5vw, 0.96rem);
  font-weight: 500;
  letter-spacing: 0.033em;
  font-family: 'Source Sans Pro', 'Verdana', 'Arial', sans-serif;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  transition: color 0.3s ease;
  color: var(--menu-text);
}

.menu a:hover {
  /* Old: color: #d0d0d0; */
  /* Updated: Use --link-hover for consistent theming */
  color: var(--link-hover);
  text-decoration: underline;
}

/* MOBILE MENU */
.menu-toggle {
  display: none;
}

.hamburger {
  display: none;
  font-size: 2rem;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  cursor: pointer;
  color: white;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  transition: background 0.3s ease;
}

.hamburger:hover {
  background: rgba(0, 0, 0, 0.5);
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  /* Old: width: 50vw; */
  /* Updated: Increased width for better usability */
  width: 50vw;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  padding: 6rem 1rem 1rem;
  border-radius: 0 0 12px 0;
  overflow: hidden;
  /* Added: Smooth slide-in transition */
  transition: transform 0.3s ease-in-out;
  transform: translateX(-100%);
}

.mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu li {
  margin: 0.5rem 0;
}

.mobile-menu a {
  color: white;
  text-decoration: none;
  /* Old: font-size: 1.2rem; */
  /* Updated: Use clamp for responsive font scaling */
  font-size: clamp(1rem, 3vw, 1.1rem);
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.mobile-menu a:hover,
.mobile-menu a:active {
  background-color: rgba(255, 255, 255, 0.1);
}

.menu-toggle:checked + nav.menu + .mobile-menu {
  display: block;
  transform: translateX(0);
}

/* PAGE LAYOUT */
.layout {
  background-color: var(--layout-bg);
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  flex: 1;
}

/* BLOCKS */
.block {
  padding: 2rem;
  overflow-y: auto;
}

.block.right,
.block.content {
  background-color: var(--item-bg);
  /* Old: padding: 1.2%; */
  /* Updated: Use rem for consistent spacing */
  padding: 1rem;
  background: var(--primary-bg);
  border: 1px solid var(--border-color);
  border-radius: 6 MOUSEOVER
  color: var(--text-color);
}

/* Old: .block.left, */
.block.right,
.block.content {
  background-color: var(--item-bg);
  /* Old: padding: 1.2%; */
  /* Updated: Use rem for consistent spacing */
  padding: 1rem;
  background: var(--primary-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
}

/* Old: .block.left { */
.block.left {
  display: none;
}

.block.right {
  flex: 1 1 26%;
}

.block.content {
  flex: 1 1 74%;
}

/* SECTIONS + ELEMENTS */
.section {
  margin-bottom: 1.25em;
  border-bottom: 1px solid var(--border-color);
  padding: 0.6em;
}

.element {
  margin-bottom: 0.8rem;
}

.element.title {
  color: var(--title-color);
}

.element.ul {
  list-style: none;
  padding: 0;
}

.element.substance li {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  line-height: 1;
  text-align: left;
}

.element li a {
  color: #777;
  text-decoration: none;
}

.element li a:hover {
  color: blue;
  text-decoration: underline;
}

.element.substance .theme-toggle,
.element.substance .layout-toggle {
  display: inline-block;
  margin-right: 10px;
  padding: 0.5rem 1rem;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.element.substance .theme-toggle:hover,
.element.substance .layout-toggle:hover {
  background: #555;
}

.element:last-child {
  margin-bottom: 0;
}

/* FOOTER */
.footer {
  background-color: var(--footer-bg);
  color: var(--text-color);
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  border: 1px solid #ccc;
}

.footer-text {
  font-size: 0.85rem;
}

/* RESPONSIVE BEHAVIOR */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .block.left,
  .block.content,
  .block.right {
    flex: 1 1 100%;
    :root {
      font-size: 15px;
    }
  }

  .block.content {
    order: -1;
  }

  nav.menu {
    display: none;
  }

  .hamburger {
    display: block;
  }
}

@media (max-width: 480px) {
  :root {
    font-size: 14px;
  }
}

/* MOBILE MENU BACKGROUND IMAGE */
/* Restored: Exact original .mobile-menu-bg styles */
.mobile-menu-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 1;
  z-index: 1;
  pointer-events: none;
}

/* Restored: Exact original overlay */
.mobile-menu-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5); /* 🟤 darker veil */
  z-index: 2;
}

/* Restored: Exact original dynamic theming backgrounds */
[data-theme="white-theme"] .mobile-menu-bg {
  background-image: url('assets/images/bottom-image-positive.jpg');
}

[data-theme="black-theme"] .mobile-menu-bg {
  background-image: url('assets/images/bottom-image-negative.jpg');
}

/* Previous: Attempted changes with fallback and higher specificity */
/*
.mobile-menu-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: #333;
  opacity: 1;
  z-index: 1;
  pointer-events: none;
}
[data-theme="white-theme"] .mobile-menu .mobile-menu-bg {
  background-image: url('../assets/images/bottom-image-positive.jpg') !important;
}
[data-theme="black-theme"] .mobile-menu .mobile-menu-bg {
  background-image: url('../assets/images/bottom-image-negative.jpg') !important;
}
*/

/* LOGO FLOATING ABOVE MENU */
.mobile-logo {
  position: absolute;
  top: -35px;
  left: 1rem;
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  background-color: white;
  padding: 5px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  z-index: 1000;
}

/* MAIN MOBILE MENU CONTAINER */
.mobile-menu {
  display: none;
  position: absolute;
  top: 0;
  /* Old: width: 50vw; */
  /* Updated: Increased width for better usability */
  width: 80vw;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  padding: 6rem 1rem 1rem;
  border-radius: 0 0 12px 0;
  overflow: hidden;
  /* Added: Smooth slide-in transition */
  transition: transform 0.3s ease-in-out;
  transform: translateX(-100%);
}

/* MENU LIST */
.mobile-menu-list {
  position: relative;
  z-index: 2;
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu-list li {
  margin-bottom: 1rem;
}

.mobile-menu-list a {
  color: white;
  text-decoration: none;
  /* Old: font-size: 1.2rem; */
  /* Updated: Use clamp for responsive font scaling */
  font-size: clamp(1rem, 3vw, 1.1rem);
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.mobile-menu-list a:hover {
  background-color: rgba(255,255,255,0.1);
}

/* Links */
a {
  color: var(--link-color);
}

a:hover {
  color: var(--link-hover);
}

:root {
  /* Font Base System */
  --font-sans: 'Inter', sans-serif;
  --font-serif: 'Lora', serif;
  --font-classic: 'Merriweather', serif;
  --font-quote: 'Playfair Display', serif;
  --font-global: 'Noto Serif', serif;

  /* Size Scaling */
  --font-size-base: 1rem;
  --font-size-small: 0.9rem;
  --font-size-large: 1.15rem;
  /* Responsive base font size */
  font-size: 16px; /* Default desktop */
}

/* ========== FONT CLASSES ========== */
.font-body {
  font-family: var(--font-body);
  font-family: var(--font-global);
  font-size: var(--font-size-base);
  line-height: 1.75;
}

.font-social {
  font-family: var(--font-sans);
  font-size: var(--font-size-small);
  line-height: 1.5;
}

.font-quote {
  font-family: var(--font-quote);
  font-style: italic;
  font-size: var(--font-size-large);
  line-height: 1.6;
}

.font-editorial {
  font-family: var(--font-classic);
  font-size: 1.05rem;
  line-height: 1.6;
}

h1, h2, h3, h4,
.element.title {
  font-family: var(--font-serif);
  font-family: var(--font-title);
}

.stacked-card {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 240px;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  font-family: 'Source Sans Pro', sans-serif;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  z-index: 3;
  overflow: hidden;
}

.stacked-card .card-content {
  animation: fade 0.5s ease-in-out;
  transition: opacity 0.5s;
}

@keyframes fade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
