/* ==========================================================================
   Montreal Muslims — theme.css
   Design tokens, base styles, header/nav, layout, footer.
   Palette from the group logo: deep navy #070991 + gold #c39330.
   Font: "Comfortaa" (closest free match to TT Rounds Condensed) + "Nunito".
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;600;700&family=Nunito:wght@400;600;700;800&display=swap");

:root {
  /* Brand colors */
  --navy: #070991;
  --navy-dark: #05066b;
  --navy-darker: #030447;
  --navy-soft: #eceefb;
  --gold: #c39330;
  --gold-dark: #a67c24;
  --gold-soft: #f7efdd;

  /* Neutrals */
  --bg: #f4f5fa;
  --surface: #ffffff;
  --border: #e2e4f0;
  --text: #23243a;
  --text-muted: #6b6e8a;
  --danger: #c0392b;
  --success: #1e8e5a;

  /* Type */
  --font-heading: "Comfortaa", "Nunito", sans-serif;
  --font-body: "Nunito", sans-serif;

  /* Misc */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(7, 9, 145, 0.08);
  --shadow-lg: 0 8px 30px rgba(7, 9, 145, 0.16);
  --header-h: 72px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: var(--header-h);
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--navy);
  line-height: 1.3;
}

a {
  color: var(--navy);
  text-decoration: none;
}

a:hover {
  color: var(--gold-dark);
}

img {
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   Header / navigation (injected by javascript/navigation.js)
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4%;
  background: linear-gradient(135deg, var(--navy-darker) 0%, var(--navy) 100%);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 12px rgba(3, 4, 71, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand svg {
  width: 38px;
  height: 38px;
  display: block;
}

.brand .brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.brand .brand-name span {
  color: var(--gold);
}

.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  color: #e8e9ff;
  font-weight: 700;
  font-size: 15px;
  transition: background 0.2s ease, color 0.2s ease;
}

.main-nav a:hover {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}

.main-nav a.active {
  color: var(--navy-darker);
  background: var(--gold);
}

.auth-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.welcome-message {
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

/* Avatar dropdown menu */
.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 3px 12px 3px 3px;
  cursor: pointer;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 190px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: none;
}

.user-menu-dropdown.open {
  display: block;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: var(--navy-soft);
  color: var(--navy);
}

.user-menu-dropdown .logout-item {
  color: var(--danger);
  border-bottom: none;
}

/* Mobile nav */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 28px;
  cursor: pointer;
  padding: 4px 8px;
}

.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 82%;
  max-width: 320px;
  height: 100vh;
  background: linear-gradient(180deg, var(--navy-darker), var(--navy-dark));
  z-index: 1900;
  padding: 24px 20px;
  transform: translateX(-105%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-nav.open {
  transform: translateX(0);
  box-shadow: var(--shadow-lg);
}

.mobile-nav ul {
  list-style: none;
  margin-top: 20px;
}

.mobile-nav ul a {
  display: block;
  padding: 13px 10px;
  color: #e8e9ff;
  font-weight: 700;
  font-size: 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav ul a.active {
  color: var(--gold);
}

.mobile-auth-nav {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 71, 0.55);
  z-index: 1800;
  display: none;
}

.nav-overlay.open {
  display: block;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 4% 60px;
}

.layout-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 34px 0 16px;
}

.section-title h2 {
  font-size: 24px;
  position: relative;
  padding-left: 14px;
}

.section-title h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 5px;
  border-radius: 4px;
  background: var(--gold);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 40px;
  background: linear-gradient(135deg, var(--navy-darker), var(--navy));
  border-top: 3px solid var(--gold);
  color: #d8daf5;
  padding: 36px 4%;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
  align-items: flex-start;
}

.site-footer h3 {
  color: var(--gold);
  margin-bottom: 10px;
  font-size: 17px;
}

.site-footer a {
  color: #fff;
}

.site-footer a:hover {
  color: var(--gold);
}

.site-footer ul {
  list-style: none;
}

.site-footer li {
  margin-bottom: 7px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 26px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  text-align: center;
  color: #b9bce8;
}

/* --------------------------------------------------------------------------
   Accessibility & responsive
   -------------------------------------------------------------------------- */
.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1024px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .main-nav,
  .auth-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }
}
