/* ==========================================================================
   Club 306 - Site Integration CSS
   Shared header/footer matching the Next.js web design.
   Self-contained (no Tailwind dependency).
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --c306-surface-900: #111827;
  --c306-surface-800: #1f2937;
  --c306-surface-700: #4b5563;
  --c306-surface-600: #6b7280;
  --c306-surface-300: #e2e5ea;
  --c306-surface-200: #f0f2f5;
  --c306-surface-100: #f8f9fb;
  --c306-chrome: #6b7280;
  --c306-chrome-light: #4b5563;
  --c306-chrome-dark: #9ca3af;
  --c306-text-primary: #1f2937;
  --c306-peugeot-red: #c8102e;
  --c306-peugeot-red-400: #e7475f;
  --c306-peugeot-red-700: #780a1b;
  --c306-peugeot-blue: #002f6c;
  --c306-white: #ffffff;
  --c306-red-gradient: linear-gradient(135deg, #780a1b 0%, #c8102e 50%, #e7475f 100%);
  --c306-font-heading: 'Exo 2', sans-serif;
  --c306-font-body: 'Source Sans 3', sans-serif;
}

/* ---------- Body offset for fixed header ---------- */
body#phpbb {
  padding-top: 59px; /* 3px accent + 56px nav */
}

/* ==========================================================================
   SITE HEADER
   ========================================================================== */

#c306-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c306-surface-300);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-family: var(--c306-font-body);
  line-height: 1.5;
}

/* Red accent bar */
#c306-site-header .c306-accent-bar {
  height: 3px;
  background: var(--c306-red-gradient);
}

/* Nav container */
#c306-site-header .c306-nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

/* Logo */
#c306-site-header .c306-logo {
  text-decoration: none;
  font-family: var(--c306-font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
}

#c306-site-header .c306-logo .c306-logo-club {
  color: var(--c306-text-primary);
}

#c306-site-header .c306-logo .c306-logo-306 {
  color: var(--c306-peugeot-red);
  margin-left: 0.25rem;
}

/* Desktop nav links */
#c306-site-header .c306-desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

#c306-site-header .c306-nav-item {
  position: relative;
}

#c306-site-header .c306-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c306-chrome);
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: var(--c306-font-body);
  white-space: nowrap;
}

#c306-site-header .c306-nav-link:hover {
  color: var(--c306-text-primary);
  background: var(--c306-surface-200);
}

#c306-site-header .c306-nav-link.c306-active {
  color: var(--c306-text-primary);
  background: var(--c306-surface-200);
}

/* Dropdown arrow SVG */
#c306-site-header .c306-nav-link svg {
  width: 0.875rem;
  height: 0.875rem;
  margin-left: 0.25rem;
  transition: transform 0.2s ease;
}

/* Dropdown submenu */
#c306-site-header .c306-submenu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  width: 12rem;
  background: #fff;
  border: 1px solid var(--c306-surface-300);
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 0.25rem 0;
  z-index: 10001;
  animation: c306-slide-down 0.2s ease-out;
}

#c306-site-header .c306-nav-item:hover .c306-submenu {
  display: block;
}

#c306-site-header .c306-nav-item:hover .c306-nav-link svg {
  transform: rotate(180deg);
}

#c306-site-header .c306-submenu a {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: var(--c306-chrome-light);
  text-decoration: none;
  transition: all 0.15s ease;
  font-family: var(--c306-font-body);
}

#c306-site-header .c306-submenu a:hover {
  color: var(--c306-text-primary);
  background: var(--c306-surface-200);
}

/* Animation */
@keyframes c306-slide-down {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Mobile menu button ---------- */
#c306-site-header .c306-mobile-btn {
  display: none;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--c306-chrome);
  cursor: pointer;
  transition: color 0.2s ease;
}

#c306-site-header .c306-mobile-btn:hover {
  color: var(--c306-text-primary);
}

#c306-site-header .c306-mobile-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* ---------- Mobile menu ---------- */
#c306-site-header .c306-mobile-menu {
  display: none;
  padding-bottom: 1rem;
  border-top: 1px solid var(--c306-surface-300);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  animation: c306-slide-down 0.2s ease-out;
  background: #fff;
}

#c306-site-header .c306-mobile-menu.c306-open {
  display: block;
}

#c306-site-header .c306-mobile-menu a {
  display: block;
  padding: 0.625rem 1rem;
  color: var(--c306-chrome-light);
  text-decoration: none;
  border-radius: 0.375rem;
  transition: all 0.15s ease;
  font-size: 0.875rem;
  font-family: var(--c306-font-body);
}

#c306-site-header .c306-mobile-menu a:hover {
  color: var(--c306-text-primary);
  background: var(--c306-surface-200);
}

#c306-site-header .c306-mobile-menu a.c306-active {
  color: var(--c306-text-primary);
  background: var(--c306-surface-200);
}

#c306-site-header .c306-mobile-submenu {
  padding-left: 1rem;
  margin-left: 1rem;
  border-left: 2px solid var(--c306-surface-300);
}

#c306-site-header .c306-mobile-submenu a {
  font-size: 0.8125rem;
  color: var(--c306-chrome);
  padding: 0.5rem 1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  #c306-site-header .c306-desktop-nav {
    display: none;
  }

  #c306-site-header .c306-mobile-btn {
    display: block;
  }
}

@media (min-width: 769px) {
  #c306-site-header .c306-mobile-menu {
    display: none !important;
  }
}

/* ==========================================================================
   HIDE PHPBB HEADERBAR (logo/search) — site header handles navigation
   ========================================================================== */

#page-header .headerbar {
  display: none !important;
}

/* ==========================================================================
   PHPBB NAVBAR REDESIGN — subtle toolbar matching light theme
   ========================================================================== */

/* Container: compact, clean border */
.navbar-header {
  border-top: none !important;
  border-bottom: 1px solid var(--c306-surface-300) !important;
  box-shadow: none !important;
}

.navbar {
  background: var(--c306-white) !important;
  padding: 6px 16px !important;
}

/* All navbar links: muted gray, lighter weight */
.navbar > .inner > ul > li > a {
  font-weight: 500 !important;
  font-size: 0.8125rem;
  color: var(--c306-chrome) !important;
  transition: color 0.15s ease;
}

.navbar > .inner > ul > li > a:hover {
  color: var(--c306-text-primary) !important;
}

/* Override Absolution orange icons → gray */
.navbar > .inner > ul > li > a > i {
  color: var(--c306-chrome-dark) !important;
  transition: color 0.15s ease;
}

.navbar > .inner > ul > li > a:hover > i {
  color: var(--c306-peugeot-blue) !important;
}

/* User avatar link */
a.header-avatar,
a.header-avatar:hover {
  color: var(--c306-chrome) !important;
  font-size: 0.8125rem;
  font-weight: 500;
}

a.header-avatar:hover {
  color: var(--c306-text-primary) !important;
}

a.header-avatar img {
  border-radius: 50%;
  border: 1px solid var(--c306-surface-300);
}

/* Bullet separators between nav items */
ul.linklist.bulletin > li:before {
  color: var(--c306-surface-300) !important;
}

/* Breadcrumbs row */
#nav-breadcrumbs {
  padding: 6px 16px !important;
  border-bottom: 1px solid var(--c306-surface-300);
  background: var(--c306-surface-100);
}

.breadcrumbs .crumb {
  font-weight: 500 !important;
  font-size: 0.8125rem;
}

.breadcrumbs .crumb a {
  color: var(--c306-chrome) !important;
  transition: color 0.15s ease;
}

.breadcrumbs .crumb a:hover {
  color: var(--c306-peugeot-blue) !important;
}

/* Breadcrumb separator arrow */
.breadcrumbs .crumb:before {
  color: var(--c306-chrome-dark) !important;
}

/* Breadcrumb home icon — override Absolution orange */
ul#nav-breadcrumbs > li.breadcrumbs > span.crumb > a > i {
  color: var(--c306-chrome-dark) !important;
}

ul#nav-breadcrumbs > li.breadcrumbs > span.crumb > a:hover > i {
  color: var(--c306-peugeot-blue) !important;
}

/* Responsive search icon in breadcrumbs */
#nav-breadcrumbs .responsive-search a {
  color: var(--c306-chrome) !important;
}

#nav-breadcrumbs .responsive-search a:hover {
  color: var(--c306-peugeot-blue) !important;
}

/* phpBB copyright area links — override Absolution orange */
.copyright a {
  color: var(--c306-chrome) !important;
}

.copyright a:hover {
  color: var(--c306-peugeot-blue) !important;
}

/* Badge (PMs, notifications) — keep Peugeot red */
.badge {
  background-color: var(--c306-peugeot-red) !important;
  font-size: 0.6875rem;
  padding: 1px 5px;
  border-radius: 9px;
}

/* ==========================================================================
   SITE FOOTER
   ========================================================================== */

#c306-site-footer {
  position: relative;
  background-color: var(--c306-surface-900);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.03) 10px,
    rgba(255, 255, 255, 0.03) 20px
  );
  font-family: var(--c306-font-body);
  line-height: 1.5;
  margin-top: 2rem;
}

/* Red accent bar */
#c306-site-footer .c306-accent-bar {
  height: 2px;
  background: var(--c306-red-gradient);
}

/* Footer container */
#c306-site-footer .c306-footer-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

/* Footer grid */
#c306-site-footer .c306-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

/* Footer logo */
#c306-site-footer .c306-footer-logo {
  font-family: var(--c306-font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

#c306-site-footer .c306-footer-logo .c306-logo-club {
  color: var(--c306-white);
}

#c306-site-footer .c306-footer-logo .c306-logo-306 {
  color: var(--c306-peugeot-red);
  margin-left: 0.25rem;
}

/* Footer description */
#c306-site-footer .c306-footer-desc {
  color: var(--c306-chrome);
  font-size: 0.875rem;
  line-height: 1.625;
  margin: 0;
}

/* Footer headings */
#c306-site-footer h3 {
  color: var(--c306-white) !important;
  font-family: var(--c306-font-heading);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
  border: none !important;
}

/* Footer links */
#c306-site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#c306-site-footer ul li {
  margin-bottom: 0.5rem;
  background: none;
  border: none;
  padding: 0;
}

#c306-site-footer ul li a {
  color: var(--c306-chrome);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

#c306-site-footer ul li a:hover {
  color: var(--c306-peugeot-red-400);
}

/* Footer copyright */
#c306-site-footer .c306-footer-copy {
  border-top: 1px solid var(--c306-surface-700);
  margin-top: 2.5rem;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--c306-chrome-dark);
}

#c306-site-footer .c306-footer-copy p {
  margin: 0;
  color: var(--c306-chrome-dark);
}

#c306-site-footer .c306-footer-copy p + p {
  margin-top: 0.5rem;
}

/* Footer responsive */
@media (max-width: 768px) {
  #c306-site-footer .c306-footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  #c306-site-footer .c306-footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   DARK MODE OVERRIDES — Site header, footer, navbar, toggle button
   ========================================================================== */

/* ---------- Theme Toggle Button ---------- */
.c306-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 0.375rem;
  background: none;
  border: none;
  color: var(--c306-chrome);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--c306-font-body);
}

.c306-theme-toggle:hover {
  color: var(--c306-text-primary);
  background: var(--c306-surface-200);
}

.c306-theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Mobile toggle in menu */
.c306-mobile-theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1rem;
  border: none;
  background: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: var(--c306-font-body);
  color: var(--c306-chrome-light);
  cursor: pointer;
  transition: all 0.15s ease;
}

.c306-mobile-theme-toggle:hover {
  color: var(--c306-text-primary);
  background: var(--c306-surface-200);
}

.c306-mobile-theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* ---------- Dark: Site Header ---------- */
html.dark #c306-site-header {
  background: rgba(17, 24, 39, 0.9);
  border-bottom-color: #374151;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html.dark #c306-site-header .c306-logo .c306-logo-club {
  color: #f3f4f6;
}

html.dark #c306-site-header .c306-nav-link {
  color: #9ca3af;
}

html.dark #c306-site-header .c306-nav-link:hover {
  color: #f3f4f6;
  background: rgba(55, 65, 81, 0.5);
}

html.dark #c306-site-header .c306-nav-link.c306-active {
  color: #f3f4f6;
  background: rgba(55, 65, 81, 0.5);
}

html.dark #c306-site-header .c306-submenu {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

html.dark #c306-site-header .c306-submenu a {
  color: #9ca3af;
}

html.dark #c306-site-header .c306-submenu a:hover {
  color: #f3f4f6;
  background: rgba(55, 65, 81, 0.5);
}

html.dark #c306-site-header .c306-mobile-btn {
  color: #9ca3af;
}

html.dark #c306-site-header .c306-mobile-btn:hover {
  color: #f3f4f6;
}

html.dark #c306-site-header .c306-mobile-menu {
  background: #111827;
  border-top-color: #374151;
}

html.dark #c306-site-header .c306-mobile-menu a {
  color: #9ca3af;
}

html.dark #c306-site-header .c306-mobile-menu a:hover {
  color: #f3f4f6;
  background: rgba(55, 65, 81, 0.5);
}

html.dark #c306-site-header .c306-mobile-menu a.c306-active {
  color: #f3f4f6;
  background: rgba(55, 65, 81, 0.5);
}

html.dark #c306-site-header .c306-mobile-submenu {
  border-left-color: #374151;
}

html.dark #c306-site-header .c306-mobile-submenu a {
  color: #6b7280;
}

/* Dark toggle button */
html.dark .c306-theme-toggle {
  color: #9ca3af;
}

html.dark .c306-theme-toggle:hover {
  color: #f3f4f6;
  background: rgba(55, 65, 81, 0.5);
}

html.dark .c306-mobile-theme-toggle {
  color: #9ca3af;
}

html.dark .c306-mobile-theme-toggle:hover {
  color: #f3f4f6;
  background: rgba(55, 65, 81, 0.5);
}

/* ---------- Dark: phpBB Navbar ---------- */
html.dark .navbar {
  background: #1f2937 !important;
}

html.dark .navbar-header {
  border-bottom-color: #374151 !important;
}

html.dark .navbar > .inner > ul > li > a {
  color: #9ca3af !important;
}

html.dark .navbar > .inner > ul > li > a:hover {
  color: #f3f4f6 !important;
}

html.dark .navbar > .inner > ul > li > a > i {
  color: #6b7280 !important;
}

html.dark .navbar > .inner > ul > li > a:hover > i {
  color: #5a9fd9 !important;
}

html.dark a.header-avatar,
html.dark a.header-avatar:hover {
  color: #9ca3af !important;
}

html.dark a.header-avatar:hover {
  color: #f3f4f6 !important;
}

html.dark a.header-avatar img {
  border-color: #374151;
}

html.dark ul.linklist.bulletin > li:before {
  color: #4b5563 !important;
}

/* Dark: Breadcrumbs */
html.dark #nav-breadcrumbs {
  background: #1a2230;
  border-bottom-color: #374151;
}

html.dark .breadcrumbs .crumb a {
  color: #9ca3af !important;
}

html.dark .breadcrumbs .crumb a:hover {
  color: #5a9fd9 !important;
}

html.dark .breadcrumbs .crumb:before {
  color: #4b5563 !important;
}

html.dark ul#nav-breadcrumbs > li.breadcrumbs > span.crumb > a > i {
  color: #6b7280 !important;
}

html.dark ul#nav-breadcrumbs > li.breadcrumbs > span.crumb > a:hover > i {
  color: #5a9fd9 !important;
}

html.dark #nav-breadcrumbs .responsive-search a {
  color: #9ca3af !important;
}

html.dark #nav-breadcrumbs .responsive-search a:hover {
  color: #5a9fd9 !important;
}

/* Dark: Copyright links */
html.dark .copyright a {
  color: #6b7280 !important;
}

html.dark .copyright a:hover {
  color: #5a9fd9 !important;
}
