/* ===================================
   FONTS
   =================================== */
/* Google Fonts - Rajdhani */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@600&display=swap');

@font-face {
  font-family: 'Uncial Antiqua';
  src: url('../asset/fonts/uncial-antiqua/UncialAntiqua-RegularUncial.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'FOBO16thCenturyRoman';
  src: url('../asset/fonts/FOBO16thCenturyRoman/FOBO16thCenturyRoman.woff2') format('woff2'),
       url('../asset/fonts/FOBO16thCenturyRoman/FOBO16thCenturyRoman.woff') format('woff'),
       url('../asset/fonts/FOBO16thCenturyRoman/FOBO16thCenturyRoman.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===================================
   GLOBAL STYLES & RESET
   =================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color palette - update these based on your design */
  --bg-primary: #2a1810;
  --bg-secondary: #3d2819;
  --text-primary: #f4e4c1;
  --text-secondary: #d4b896;
  --accent-gold: #c9a961;
  --accent-red: #8b2e2e;
  --border-color: #5a4232;
  
  /* Typography */
  --font-main: 'Rajdhani', sans-serif;
  --font-heading: 'Uncial Antiqua', 'Cinzel', 'Georgia', serif;
  --font-dropcap: 'FOBO16thCenturyRoman', Georgia, serif;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Layout */
  --max-width: 1400px;
  --header-height: 80px;
  --header-top-height: 220px;
}

body {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 26px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Repeating background overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../asset/ui/backgrounds/RepeatBackground.webp');
  background-repeat: repeat;
  background-size: auto;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

/* Ensure all direct children of body are above the overlay */
body > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--text-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===================================
   HEADER
   =================================== */
.site-header {
  background-color: transparent;
  position: relative;
  z-index: 1000;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Logo area - large, centered */
.header-top {
  background: linear-gradient(180deg, rgba(0,0,0,0.15), transparent);
  padding-top: var(--spacing-lg);
}

.top-logo {
  height: var(--header-top-height);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  max-height: calc(var(--header-top-height) - 32px);
  width: auto;
  display: block;
}

/* Main menu band - dark with gold text */
.main-menu-band {
  background-color: rgba(42, 24, 16, 0.95);
  border-top: 3.2px solid rgba(0,0,0,0.35);
  border-bottom: 3.2px solid rgba(0,0,0,0.35);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  margin-top: calc(var(--spacing-md) * 0.8);
  position: relative;
  backdrop-filter: blur(2px);
}

.main-menu-band .header-container {
  position: relative;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-sm);
  position: absolute;
  right: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
}

/* Opt the hamburger out of all global button hover/focus/active effects */
.menu-toggle,
.menu-toggle:hover:not(:disabled),
.menu-toggle:active,
.menu-toggle:focus {
  background: none !important;
  border: none !important;
  color: inherit !important;
  box-shadow: none !important;
}

.menu-toggle .hamburger {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--accent-gold);
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.menu-toggle.active .hamburger:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active .hamburger:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .hamburger:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.main-menu-band .nav-inner {
  display: flex;
  gap: var(--spacing-lg);
  align-items: center;
  min-height: 50px;
  justify-content: center;
  padding: var(--spacing-xs) 0;
}

.main-menu-band a {
  color: var(--accent-gold);
  font-family: var(--font-heading);
  padding: 8px 16px;
  text-decoration: none;
  letter-spacing: 0.08em;
  font-size: 1rem;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.main-menu-band a:hover {
  color: var(--text-primary);
}

/* Legacy nav styles - can be removed if not used elsewhere */
.main-nav {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.main-nav a {
  font-size: 1rem;
  font-weight: 500;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.main-nav a:hover {
  background-color: rgba(201, 169, 97, 0.1);
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: 4px;
  margin-left: var(--spacing-md);
  border-left: 1px solid rgba(201, 169, 97, 0.3);
  padding-left: var(--spacing-md);
}

.lang-btn {
  background: none;
  border: 1px solid rgba(201, 169, 97, 0.4);
  color: var(--accent-gold);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 0.2s, border-color 0.2s;
}

.lang-btn:hover,
.lang-btn.active {
  background-color: rgba(201, 169, 97, 0.15);
  border-color: var(--accent-gold);
}

.lang-btn.active {
  font-weight: bold;
}

.donate-btn {
  background-color: var(--accent-red);
  color: var(--text-primary) !important;
  padding: var(--spacing-xs) var(--spacing-md) !important;
  border-radius: 6px;
}

.donate-btn:hover {
  background-color: #a13636 !important;
}

/* ===================================
   FOOTER
   =================================== */
.site-footer {
  background-color: rgba(42, 24, 16, 0.95);
  border-top: 3px solid var(--border-color);
  margin-top: auto;
  padding: var(--spacing-lg) var(--spacing-md);
  backdrop-filter: blur(2px);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.social-links {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.social-links a {
  display: flex;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
  opacity: 1;
  transform: scale(1.12);
}

.social-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* ===================================
   FOOTER LAYOUT
   =================================== */
.newsletter-section {
  display: flex;
  justify-content: center;
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--spacing-md);
}

.newsletter-section iframe,
.sender-form-field iframe {
  border: none !important;
  display: block;
}

.footer-bottom {
  display: flex;
  justify-content: center;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  width: 100%;
}

.footer-main {
  display: flex;
  gap: var(--spacing-xl);
  align-items: center;
}

.footer-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--spacing-md);
  flex-shrink: 0;
  flex: 1;
}

/* ===================================
   MAIN CONTENT
   =================================== */
main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing-md);
  width: 100%;
}

/* ===================================
   BUTTONS
   =================================== */
button,
.btn {
  font-family: var(--font-main);
  font-size: 1rem;
  padding: var(--spacing-xs) var(--spacing-md);
  background-color: var(--accent-gold);
  color: var(--bg-primary);
  border: 2px solid var(--accent-gold);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

button:hover:not(:disabled),
.btn:hover {
  background-color: #dbbe78; /* brighter gold — stays filled, clearly active */
  color: var(--bg-primary);
  border-color: #dbbe78;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===================================
   MODAL
   =================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 3px solid var(--border-color);
  border-radius: 8px;
  padding: var(--spacing-lg);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* ===================================
   RESPONSIVE
   =================================== */
/* Tablet - adjust spacing */
@media (max-width: 1024px) and (min-width: 769px) {
  .main-menu-band .nav-inner {
    gap: var(--spacing-md);
  }
  
  .main-menu-band a {
    font-size: 0.95rem;
    padding: 6px 12px;
  }
}

/* Mobile - hamburger menu */
@media (max-width: 768px) {
  /* Band must be relative so the absolute hamburger positions inside it */
  .main-menu-band {
    min-height: 52px;
    position: relative;
  }

  /* Give the inner container real height so top:50% on the hamburger works correctly */
  .main-menu-band .header-container {
    min-height: 52px;
  }

  /* Hamburger — absolute inside the band */
  .menu-toggle {
    display: block;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
  }

  /* When active, anchor the × to the top of the expanded band */
  .menu-toggle.active {
    top: 14px;
    transform: none;
  }

  /* Hidden by default — collapses the band to just the hamburger row */
  .main-menu-band .nav-inner {
    display: none;
  }

  /* Expanded: in-flow vertical block, band grows downward naturally */
  .main-menu-band .nav-inner.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 3rem 0 1.5rem;
    gap: 0;
  }

  /* Large touch-friendly links */
  .main-menu-band .nav-inner.active a {
    width: 100%;
    text-align: center;
    padding: 0.9rem 2rem;
    font-size: 1.4rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid rgba(201, 169, 97, 0.15);
  }

  .main-menu-band .nav-inner.active a:last-of-type {
    border-bottom: none;
  }

  /* Lang switcher below the links, centred, no left border */
  .main-menu-band .nav-inner.active .lang-switcher {
    margin-top: 1.25rem;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
  }

  /* Prevent scrolling behind open menu — NOT used with in-flow menu, removed */

  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm);
  }

  .main-nav a {
    font-size: 0.9rem;
    padding: var(--spacing-xs);
  }

  .footer-main {
    flex-direction: column;
    gap: var(--spacing-lg);
  }

  .footer-aside {
    align-items: center;
    width: 100%;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  main {
    padding: var(--spacing-md) var(--spacing-sm);
  }
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.hidden {
  display: none !important;
}

/* ===================================
   SHARED: BIO SECTION (CHARACTER & LORE PAGES)
   =================================== */

/* Bio text area */
.bio-content {
  padding: var(--spacing-xs) var(--spacing-lg);
}

/* Bio paragraph text */
.bio-content p {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 26px;
  line-height: 1.6;
  color: #3A1F16;
}

/* Illuminated drop cap — first capital letter styled as medieval manuscript */
.bio-content p:first-of-type::first-letter {
  font-family: var(--font-dropcap) !important;
  font-weight: normal !important;
  font-size: 8.75rem !important;
  float: left;
  line-height: 0.75 !important;
  padding-right: 0;
  margin-right: -0.2em;
  padding-top: 0.05em;
  color: #1F2421 !important;
}

@media (min-width: 769px) {
  .bio-content p:first-of-type::first-letter {
    font-size: 10.5rem !important;
  }
}
