/* =========================================
   GLOBAL STYLES (global.css)
   Requires: theme.css
========================================= */

/* Import Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Inter:wght@400;500;600&font-display=swap");

/* --- Resets --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* --- Base Body Styling --- */
body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  color: var(--text-main);
}

img {
  width: auto;
  height: auto;
}

/* --- Buttons --- */
.btn {
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9rem;
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}
.btn-primary:hover {
  background-color: #c92a37;
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: #111;
}
.btn-secondary:hover {
  background-color: #e58d14;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
}
.btn-outline:hover {
  background-color: var(--color-accent);
  color: #111;
}

.break-str {
  font-size: 100%;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

/* --- Global Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  max-width: 100vw;
  width: 100%;
  background-color: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-xl);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.logo img {
  height: 50px;
  width: auto;
  border-radius: 50%;
}

.navbar .logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: var(--spacing-lg);
}

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  color: #f8f9fa;
}

.nav-links a:hover {
  color: var(--color-secondary);
}

/* --- Global Footer --- */
.footer {
  background-color: #151b2b; /* Hardcoded dark theme color */
  color: #f8f9fa; /* Hardcoded light text */
  padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-lg);
  text-align: center;
  border-top: 2px solid var(--color-primary);
  margin-top: var(--spacing-xl);
  position: relative;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.footer-logo {
  color: var(--color-primary);
  font-size: 1.25rem;
}

.footer-bottom {
  margin-top: var(--spacing-lg);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Utility Classes --- */
/* The layout requirement you mentioned: rows on PC, columns on Mobile */
.responsive-grid {
  display: flex;
  flex-direction: row; /* Row by default for larger screens */
  gap: var(--spacing-lg);
  width: 100%;
}

.responsive-grid > * {
  flex: 1; /* Makes children take equal width */
}

/* --- Hamburger Menu Base Styles --- */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  z-index: 1001; /* Keeps it above the sliding menu */
}

.menu-toggle .bar {
  width: 25px;
  height: 3px;
  background-color: var(--color-accent); /* Festive Gold */
  transition: all 0.3s ease-in-out;
  border-radius: 3px;
}

/* --- Mobile Responsiveness Adjustments --- */
@media (max-width: 768px) {
  .navbar {
    padding: var(--spacing-md) var(--spacing-lg);
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
  }

  .logo p {
    font-size: 70%;
  }

  .menu-toggle {
    display: flex;
  }

  /* The Sliding Mobile Menu */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(11, 15, 25, 0.98); /* Solid dark background */
    backdrop-filter: blur(15px);
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-xl) 0;
    gap: var(--spacing-lg);
    border-bottom: 2px solid var(--color-primary);

    /* Animation properties */
    transform: translateY(-150%);
    opacity: 0;
    transition:
      transform 0.4s ease,
      opacity 0.4s ease;
    z-index: -1;
  }

  /* When JavaScript adds the 'active' class, the menu slides in */
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
  }

  /* Animate Hamburger into an 'X' */
  .menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* Apply Column Layout for Mobile */
  .responsive-grid {
    flex-direction: column;
  }

  .break-str {
    font-size: 60%;
  }

  /* -----------------------------------
       9. FOOTER MOBILE FIXES
       ----------------------------------- */

  .footer {
    /* Adds a safety bumper of padding on the left and right */
    padding: var(--spacing-lg) 15px;
    overflow-x: hidden;
  }

  .footer p,
  .footer a,
  .footer span {
    /* Allows the email address and social links to break naturally */
    white-space: normal;
    overflow-wrap: break-word;

    /* 'break-word' is smarter than 'break-all' for footers. 
           It only chops a word if it's longer than the whole screen (like an email). */
    word-break: break-word;

    /* Gives the text some breathing room when it stacks on multiple lines */
    line-height: 1.6;
  }
}
