/**
 * Mister Rubber Berlin - Main Stylesheet
 * 
 * This stylesheet contains all custom styling for the Mister Rubber Berlin website.
 * It implements a light theme with WCAG 2.2 AA accessibility compliance and supports
 * multiple languages (DE, EN, ES, FR).
 * 
 * Key Features:
 * - Light theme with custom color variables (white background, black text, red accents)
 * - Responsive design with mobile-first approach
 * - Accessibility features (WCAG 2.2 AA compliant)
 * - Multi-language support
 * - Fixed header/footer layout with scrollable main content
 * - Static site optimized for Cloudflare Pages
 * 
 * Structure:
 * 1. Font definitions
 * 2. CSS custom properties (variables)
 * 3. Base styles (typography, layout)
 * 4. Component styles (navbar, footer, cards, etc.)
 * 5. Page-specific styles
 * 6. Responsive breakpoints
 * 7. Accessibility enhancements
 * 8. Print styles
 * 
 * @version 1.0
 * @author Mister Rubber Berlin
 */

/* ==========================================================================
   FONT DEFINITIONS
   ========================================================================== */

/* Using system default fonts for optimal performance and GDPR compliance.
 * No custom font files required. Font stack defined in base styles. */

/* ==========================================================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ========================================================================== */

:root {
  /* Background colors */
  --bg-black: #ffffff;
  --bg-black-true: #f8f9fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f0;
  --border-color: #dee2e6;
  
  /* Text colors */
  --text-on-dark: #000000; /* Primary text color - black */
  --text-muted: #6c757d; /* Muted text color */
  --muted: #6c757d;
  
  /* Brand colors */
  --brand-gold: #dc3545; /* Legacy variable - now uses red instead of gold */
  --brand-gold-hover: #c82333;
  --brand-gold-contrast: #ffffff; /* Text color on red background */
  --brand-red: #dc3545; /* Primary accent color - red */
  --brand-red-hover: #c82333;
  
  /* Accessibility */
  --focus: #dc3545; /* Focus ring color - red for visibility */
  --focus-ring: 3px solid var(--focus);
  
  /* Shadows */
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
  --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

html,
body {
  background: var(--bg-black);
  color: var(--text-on-dark);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    Cantarell, Noto Sans, Arial, sans-serif;
  line-height: 1.6;
  height: 100%;
  overflow: hidden; /* Prevent body scroll - only main content scrolls */
}

body {
  display: flex;
  flex-direction: column; /* Flexbox layout for fixed header/footer */
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-on-dark);
  font-weight: 700;
  line-height: 1.2;
}

.lead {
  color: var(--text-muted);
  font-size: 1.125rem;
}

/* Card styling */
.card {
  background-color: var(--bg-card);
  color: var(--text-on-dark);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-red);
}

.card-img-top {
  border-bottom: 1px solid var(--border-color);
}

/* Brand colors */
.text-gold {
  color: var(--brand-red) !important; /* Changed to red for accent - kept class name for backward compatibility */
}

/* Alias for consistency */
.text-red {
  color: var(--brand-red) !important;
}

.text-red {
  color: var(--brand-red) !important;
}

.bg-black-true {
  background-color: var(--bg-black-true) !important;
}

/* Button styles - gold classes updated to red for consistency */
.btn-gold {
  color: #fff;
  background-color: var(--brand-red);
  border: 1px solid var(--brand-red);
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.btn-gold:hover,
.btn-gold:focus-visible {
  background-color: var(--brand-red-hover);
  border-color: var(--brand-red-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn-gold:active {
  transform: translateY(0);
}

.btn-outline-gold {
  color: var(--brand-red);
  background: transparent;
  border: 1px solid var(--brand-red);
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-outline-gold:hover,
.btn-outline-gold:focus-visible {
  color: #fff;
  background: var(--brand-red);
  border-color: var(--brand-red);
}

.btn-outline-red {
  color: var(--brand-red);
  background: transparent;
  border: 1px solid var(--brand-red);
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-outline-red:hover,
.btn-outline-red:focus-visible {
  color: #fff;
  background: var(--brand-red);
  border-color: var(--brand-red);
}

.btn-outline-white {
  color: #ffffff;
  background: transparent;
  border: 1px solid #ffffff;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-outline-white:hover,
.btn-outline-white:focus-visible {
  color: var(--brand-red);
  background: #ffffff;
  border-color: #ffffff;
}

.btn-red {
  color: #fff;
  background-color: var(--brand-red);
  border: 1px solid var(--brand-red);
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-red:hover,
.btn-red:focus-visible {
  background-color: var(--brand-red-hover);
  border-color: var(--brand-red-hover);
  color: #fff;
}

/* Header styling - always visible at top */
header {
  flex-shrink: 0; /* Don't shrink */
  position: sticky;
  top: 0;
  z-index: 1030; /* Above content, below modals */
}

/* Navbar styling */
.navbar {
  background-color: var(--bg-black) !important;
  border-bottom: 1px solid var(--border-color);
}

/* Add bottom padding to navbar when collapsed on mobile */
@media (max-width: 991.98px) {
  .navbar {
    padding-bottom: 1.5rem;
  }
  
  /* Remove extra padding when navbar is expanded */
  .navbar .navbar-collapse.show {
    margin-bottom: -1.5rem;
    padding-bottom: 1rem;
  }
  
  .navbar .navbar-collapse.collapsing {
    margin-bottom: -1.5rem;
  }
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  transition: opacity 0.2s ease;
  /* Prevent logo overflow from blocking divider and crop whitespace */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-brand img {
  width: 150px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Circular logo styling for navbar and hero */
/* Navbar logo - rectangular, tight crop to minimize whitespace */
/* Container crops whitespace, image fills container */

.navbar-logo {
  width: 60px;
  height: 60px;
  object-fit: cover;
  object-position: center;
  background: transparent;
  /* Reduced scale to prevent cropping letters on the right */
  transform: scale(1.2);
  transform-origin: center;
}

/* Hero logo - round, tight crop to minimize whitespace */
/* Simple approach: container creates circle, image fills with object-fit */
.hero-section > div:first-child {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  margin: 0 auto 2rem auto;
  /* Perfect circle */
  border-radius: 50%;
  aspect-ratio: 1 / 1;
}

.hero-logo {
  width: 100%;
  height: 100%;
  /* Perfect circle */
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: transparent;
  /* No transform - let object-fit: cover handle the cropping */
}

.navbar-brand:hover,
.navbar-brand:focus-visible {
  opacity: 0.8;
}

.navbar-toggler {
  border-color: var(--border-color);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28220, 53, 69, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar .nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 0.625rem 1.25rem;
  transition: color 0.2s ease;
  font-weight: 500;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus-visible {
  color: var(--text-on-dark);
  text-decoration: none;
}

.navbar .nav-link.active,
.navbar .nav-link[aria-current="page"] {
  color: var(--brand-red);
  font-weight: 700;
  text-decoration: none;
}

/* Make navbar horizontal when collapsed/expanded on mobile */
@media (max-width: 991.98px) {
  /* Add bottom padding to navbar when collapsed (menu not showing) */
  .navbar:has(.navbar-collapse:not(.show):not(.collapsing)) {
    padding-bottom: 1.5rem;
  }
  
  /* Better approach: add padding when collapse is hidden */
  .navbar-collapse:not(.show):not(.collapsing) {
    margin-bottom: 1.5rem;
  }
  
  /* Override Bootstrap's justify-content-end class */
  .navbar-collapse.justify-content-end {
    justify-content: center !important;
  }
  
  /* Apply horizontal layout immediately to prevent flash */
  .navbar-collapse:not(.collapsing) {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center !important;
    align-items: center;
    gap: 0.5rem;
    text-align: center !important;
  }
  
  .navbar-collapse.show,
  .navbar-collapse.collapsing {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center !important;
    align-items: center;
    gap: 0.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    width: 100% !important;
    text-align: center !important;
  }
  
  .navbar-collapse.show.justify-content-end,
  .navbar-collapse.collapsing.justify-content-end {
    justify-content: center !important;
  }
  
  .navbar-collapse.show .navbar-nav,
  .navbar-collapse.collapsing .navbar-nav {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center !important;
    align-items: center;
    margin: 0 auto !important;
    width: auto;
    text-align: center !important;
  }
  
  .navbar-collapse.show .navbar-nav .nav-item,
  .navbar-collapse.collapsing .navbar-nav .nav-item {
    margin: 0 0.25rem;
    text-align: center !important;
  }
  
  .navbar-collapse.show .navbar-nav .nav-link,
  .navbar-collapse.collapsing .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
    text-align: center !important;
  }
  
  .navbar-collapse.show > .ms-lg-3,
  .navbar-collapse.collapsing > .ms-lg-3 {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    text-align: center !important;
  }
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */

/* Main content area - scrollable (only this area scrolls, header/footer stay fixed) */
main {
  flex: 1 1 auto; /* Take remaining space and grow */
  overflow-y: auto; /* Allow scrolling */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Footer styling - always visible at bottom (sticky positioning) */
footer {
  border-top: 1px solid var(--border-color);
  flex-shrink: 0; /* Don't shrink */
  position: sticky;
  bottom: 0;
  z-index: 1020; /* Above content */
}

.footer-links {
  font-size: 0.8125rem; /* 13px - WCAG compliant for secondary/non-essential text */
}

.footer-links .list-inline-item {
  margin-right: 0.5rem; /* Slightly reduce spacing between links */
}

.footer-links .list-inline-item:last-child {
  margin-right: 0;
}

.footer-links .footer-link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease;
  white-space: nowrap; /* Prevent individual links from wrapping */
}

.footer-links .footer-link:hover,
.footer-links .footer-link:focus-visible {
  color: var(--brand-red);
}

/* Center footer content at smallest breakpoints */
@media (max-width: 991.98px) {
  .footer .container {
    text-align: center;
  }
  
  .footer .row {
    justify-content: center;
    text-align: center !important;
  }
  
  .footer .col-md-6 {
    text-align: center !important;
  }
  
  .footer-links {
    justify-content: center !important;
    display: flex;
    flex-wrap: wrap;
  }
}

/* Center copyright and Instagram at smallest breakpoint */
@media screen and (max-width: 767.98px) {
  footer.mt-auto.border-top.bg-black-true .container .row {
    justify-content: center !important;
    text-align: center !important;
  }
  
  footer.mt-auto.border-top.bg-black-true .container .row .col-md-6:first-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Center copyright text - override inline display */
  footer.mt-auto.border-top.bg-black-true .container .row .col-md-6:first-child > small.text-body-secondary.d-block {
    text-align: center !important;
    display: block !important;
    width: fit-content !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  
  /* Center Instagram container - override width */
  footer.mt-auto.border-top.bg-black-true .container .row .col-md-6:first-child > div.mt-2 {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: fit-content !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 0.5rem !important;
  }
  
  /* Center Instagram link */
  footer.mt-auto.border-top.bg-black-true .container .row .col-md-6:first-child > div.mt-2 > a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
   PAGE-SPECIFIC STYLES
   ========================================================================== */

/* Terms page styling */
.terms-content {
  max-width: 75ch;
  margin: 0 auto;
}

.terms-content section {
  margin-bottom: 2.5rem;
}

.terms-content h2 {
  color: var(--brand-red);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.terms-content h3 {
  color: var(--text-on-dark);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.terms-content p {
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: 1rem;
  color: var(--text-on-dark);
}

.terms-content ul,
.terms-content ol {
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-on-dark);
}

.terms-content li {
  margin-bottom: 0.5rem;
}

.terms-content strong {
  color: var(--brand-red);
  font-weight: 600;
}

.terms-content a:not(.btn) {
  color: var(--brand-red);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease;
}

.terms-content a:not(.btn):hover,
.terms-content a:not(.btn):focus-visible {
  color: var(--brand-red-hover);
}

.terms-download {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 2px solid var(--brand-red);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.terms-download h3 {
  color: var(--brand-red);
  font-weight: 600;
  margin-bottom: 1rem;
}

.terms-download .btn {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.875rem 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  color: #fff !important;
  background-color: var(--brand-red) !important;
  border-color: var(--brand-red) !important;
  text-decoration: none !important;
  min-width: auto;
  white-space: nowrap;
}

.terms-download .btn svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.terms-download .btn:hover,
.terms-download .btn:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: #fff !important;
  background-color: var(--brand-red-hover) !important;
  border-color: var(--brand-red-hover) !important;
}

/* Print styles for PDF generation */
@media print {
  .terms-content {
    max-width: 100%;
  }
  
  .terms-content section {
    page-break-inside: avoid;
    margin-bottom: 1.5rem;
  }
  
  .terms-content h2 {
    page-break-after: avoid;
  }
}

/* ==========================================================================
   COMPONENT STYLES
   ========================================================================== */

/* Language Picker Styles */
.language-picker {
  position: relative;
}

.language-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.625rem;
  background: transparent;
  border: 1px solid var(--brand-red);
  color: var(--brand-red);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  width: 3.75rem;
  height: 2.5rem;
  line-height: 1;
  box-sizing: border-box;
  gap: 0.375rem;
  position: relative;
}

.language-picker-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  text-align: center;
  overflow: visible;
}

.language-picker-btn:hover,
.language-picker-btn:focus {
  background: var(--brand-red);
  color: #fff;
  text-decoration: none;
}

.language-picker-btn::after {
  content: '▼';
  font-size: 0.625rem;
  transition: transform 0.2s ease;
  line-height: 1;
  flex-shrink: 0;
  display: inline-block;
  width: 0.625rem;
  text-align: center;
}

.language-picker-btn[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.language-picker-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  box-shadow: var(--shadow-md);
  min-width: 180px;
  z-index: 1000;
  display: none;
  overflow: hidden;
}

.language-picker-dropdown.show {
  display: block;
}

.language-picker-dropdown a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-on-dark) !important;
  text-decoration: none !important;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
  white-space: nowrap;
}

.language-picker-dropdown a:last-child {
  border-bottom: none;
}

.language-picker-dropdown a:hover,
.language-picker-dropdown a:focus {
  background: var(--bg-card-hover);
  color: var(--text-on-dark) !important;
  text-decoration: none !important;
}

.language-picker-dropdown a.active {
  background: var(--bg-card-hover);
  color: var(--brand-red) !important;
  font-weight: 600;
  text-decoration: none !important;
}

.language-picker-dropdown a.active::after {
  content: ' ✓';
  margin-left: 0.5rem;
  color: var(--brand-red);
  font-weight: 700;
  display: inline;
}

.language-flag {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1.125rem;
  line-height: 1;
}

@media (max-width: 991.98px) {
  .language-picker-dropdown {
    right: auto;
    left: 0;
    max-width: calc(100vw - 2rem);
  }
}

/* Prevent language picker overflow on smallest breakpoint */
@media (max-width: 767.98px) {
  .language-picker {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  
  .language-picker-dropdown {
    right: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: calc(100vw - 2rem);
    min-width: 180px;
  }
  
  /* Ensure language picker container doesn't overflow */
  .navbar-collapse.show .ms-lg-3,
  .navbar-collapse.collapsing .ms-lg-3 {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-left: 0 !important;
    margin-top: 0.5rem;
  }
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
}

.skip-link:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  background: var(--brand-gold);
  color: var(--brand-gold-contrast);
  border-radius: 0.25rem;
  text-decoration: none;
  font-weight: 600;
  z-index: 9999;
}

/* Focus styles for accessibility (WCAG 2.2 AA compliant) */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Cookie Consent Banner */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border-top: 2px solid var(--brand-red);
  padding: 1.5rem;
  z-index: 1050;
  box-shadow: 0 -0.5rem 1rem rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: block; /* Ensure banner is always in the DOM flow */
}

.cookie-consent.show {
  transform: translateY(0);
}

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
}

.cookie-consent p {
  margin-bottom: 1rem;
  color: var(--text-on-dark);
}

.cookie-consent .btn-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Language switcher */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switcher .btn {
  min-width: 3rem;
}

/* Improved spacing and layout */
section {
  margin-bottom: 2rem;
}

/* ==========================================================================
   LANDING PAGE COMPONENTS
   ========================================================================== */

/* Hero Section */
.hero-section {
  padding: 2rem 0;
  position: relative;
  border-radius: 0.5rem;
  overflow: visible;
  margin-bottom: 0;
  /* Background image with gradient overlay */
  background-image: 
    linear-gradient(to bottom, 
      rgba(255, 255, 255, 0.3) 0%, 
      rgba(255, 255, 255, 0.5) 30%, 
      rgba(255, 255, 255, 0.7) 60%, 
      var(--bg-black) 100%),
    url('/images/hero_bg.jpg');
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  /* Extend background below the section */
  padding-bottom: 400px;
  margin-bottom: -350px; /* Reduced negative margin to decrease spacing */
}

.hero-section > * {
  position: relative;
  z-index: 2;
}

/* About section is now inside hero, so it overlays the image */
.hero-section .about-section {
  position: relative;
  z-index: 2;
  background: transparent;
  margin-bottom: 0; /* Remove bottom margin since it's inside hero */
}

/* Ensure sections below hero appear above the overflow */
.feature-cards,
.presenters-section,
.sponsors-section {
  position: relative;
  z-index: 3;
  background-color: var(--bg-black);
}


/* Hide hero logo on smaller breakpoints and vertically center content */
@media (max-width: 991.98px) {
  .hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 300px; /* Ensure enough height for vertical centering */
  }
  
  .hero-section .hero-logo,
  .hero-section > div:first-child {
    display: none;
  }
}

.hero-section h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

/* All landing pages: Remove top fadeout, keep bottom fade, use white text */
/* Hero image fades to white completely by bottom of about section text */
/* Fade completes at 70% since hero section extends 400px below content */
html[lang="de"] .hero-section,
html[lang="en"] .hero-section,
html[lang="es"] .hero-section,
html[lang="fr"] .hero-section {
  background-image: 
    linear-gradient(to bottom, 
      transparent 0%, 
      transparent 30%, 
      rgba(255, 255, 255, 0.15) 50%,
      rgba(255, 255, 255, 0.35) 60%,
      rgba(255, 255, 255, 0.55) 65%,
      rgba(255, 255, 255, 0.75) 68%,
      rgba(255, 255, 255, 0.9) 69%,
      var(--bg-black) 70%,
      var(--bg-black) 100%),
    url('/images/hero_bg.jpg');
}

html[lang="de"] .hero-section h1,
html[lang="de"] .hero-section .text-gold,
html[lang="de"] .hero-section h2,
html[lang="de"] .hero-section .about-section h2,
html[lang="de"] .hero-section .about-section p,
html[lang="en"] .hero-section h1,
html[lang="en"] .hero-section .text-gold,
html[lang="en"] .hero-section h2,
html[lang="en"] .hero-section .about-section h2,
html[lang="en"] .hero-section .about-section p,
html[lang="es"] .hero-section h1,
html[lang="es"] .hero-section .text-gold,
html[lang="es"] .hero-section h2,
html[lang="es"] .hero-section .about-section h2,
html[lang="es"] .hero-section .about-section p,
html[lang="fr"] .hero-section h1,
html[lang="fr"] .hero-section .text-gold,
html[lang="fr"] .hero-section h2,
html[lang="fr"] .hero-section .about-section h2,
html[lang="fr"] .hero-section .about-section p {
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

html[lang="de"] .hero-section .hero-divider,
html[lang="en"] .hero-section .hero-divider,
html[lang="es"] .hero-section .hero-divider,
html[lang="fr"] .hero-section .hero-divider {
  background: linear-gradient(90deg, transparent, var(--brand-red), transparent);
}

/* Add semi-transparent black background behind text content for readability */
html[lang="de"] .hero-section > div:first-child,
html[lang="de"] .hero-section > h1,
html[lang="de"] .hero-section > p.lead,
html[lang="de"] .hero-section > .hero-divider,
html[lang="en"] .hero-section > div:first-child,
html[lang="en"] .hero-section > h1,
html[lang="en"] .hero-section > p.lead,
html[lang="en"] .hero-section > .hero-divider,
html[lang="es"] .hero-section > div:first-child,
html[lang="es"] .hero-section > h1,
html[lang="es"] .hero-section > p.lead,
html[lang="es"] .hero-section > .hero-divider,
html[lang="fr"] .hero-section > div:first-child,
html[lang="fr"] .hero-section > h1,
html[lang="fr"] .hero-section > p.lead,
html[lang="fr"] .hero-section > .hero-divider {
  position: relative;
  padding: 1rem 1.5rem;
  margin-left: auto;
  margin-right: auto;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 0.5rem;
  backdrop-filter: blur(1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

html[lang="de"] .hero-section > div:first-child,
html[lang="en"] .hero-section > div:first-child,
html[lang="es"] .hero-section > div:first-child,
html[lang="fr"] .hero-section > div:first-child {
  display: inline-block;
  padding: 1.5rem;
}

html[lang="de"] .hero-section > h1,
html[lang="en"] .hero-section > h1,
html[lang="es"] .hero-section > h1,
html[lang="fr"] .hero-section > h1 {
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

html[lang="de"] .hero-section > p.lead,
html[lang="en"] .hero-section > p.lead,
html[lang="es"] .hero-section > p.lead,
html[lang="fr"] .hero-section > p.lead {
  max-width: 600px;
}

html[lang="de"] .hero-section > .hero-divider,
html[lang="en"] .hero-section > .hero-divider,
html[lang="es"] .hero-section > .hero-divider,
html[lang="fr"] .hero-section > .hero-divider {
  width: 80px;
  padding: 0.5rem 0;
  background: linear-gradient(90deg, transparent, var(--brand-red), transparent);
}

/* About section backdrop with gradient fade at bottom */
/* Keeps backdrop dark longer for text readability, then fades to white to match background */
html[lang="de"] .hero-section .about-section,
html[lang="en"] .hero-section .about-section,
html[lang="es"] .hero-section .about-section,
html[lang="fr"] .hero-section .about-section {
  background: linear-gradient(to bottom, 
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.5) 85%,
    rgba(0, 0, 0, 0.4) 90%,
    rgba(0, 0, 0, 0.3) 93%,
    rgba(0, 0, 0, 0.2) 95%,
    rgba(255, 255, 255, 0.1) 97%,
    rgba(255, 255, 255, 0.3) 99%,
    rgba(255, 255, 255, 0.5) 100%);
  padding: 2rem;
  padding-bottom: 3rem;
  border-radius: 0.5rem;
  backdrop-filter: blur(1px);
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.15);
  margin-top: 2rem;
  position: relative;
}

html[lang="de"] .hero-section .about-section::after,
html[lang="en"] .hero-section .about-section::after,
html[lang="es"] .hero-section .about-section::after,
html[lang="fr"] .hero-section .about-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2rem;
  background: linear-gradient(to bottom, 
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0.6) 100%);
  pointer-events: none;
  border-radius: 0 0 0.5rem 0.5rem;
}

.hero-divider {
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--brand-red), transparent);
  margin: 0 auto;
  border-radius: 2px;
}

/* Feature Cards */
.feature-card {
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-red);
}

/* White background feature card (default style) */
.feature-card-white {
  background-color: #ffffff;
  border-color: var(--border-color);
}

.feature-card-white .card-title {
  color: var(--brand-red);
}

.feature-card-white .card-text {
  color: var(--text-on-dark);
}

.feature-card-white .feature-icon {
  color: var(--brand-red);
  background: rgba(220, 53, 69, 0.1);
}

.feature-card-white:hover {
  border-color: var(--brand-red);
}

/* Red background feature card (middle) */
.feature-card-red {
  background-color: var(--brand-red);
  border-color: var(--brand-red);
}

.feature-card-red .card-title,
.feature-card-red .card-text {
  color: #ffffff;
}

.feature-card-red .feature-icon {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

.feature-card-red:hover {
  border-color: var(--brand-red-hover);
  background-color: var(--brand-red-hover);
}

/* Bordered feature card with red border */
.feature-card-bordered {
  background-color: #ffffff;
  border: 2px solid var(--brand-red);
}

.feature-card-bordered .card-title {
  color: var(--brand-red);
}

.feature-card-bordered .card-text {
  color: var(--text-on-dark);
}

.feature-card-bordered .feature-icon {
  color: var(--brand-red);
  background: rgba(220, 53, 69, 0.1);
}

.feature-card-bordered:hover {
  border-color: var(--brand-red-hover);
  box-shadow: 0 0.5rem 1rem rgba(220, 53, 69, 0.2);
}

.feature-icon {
  color: var(--brand-red);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(220, 53, 69, 0.1);
  border-radius: 50%;
  margin-bottom: 1rem;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

/* Call to Action Section */
.cta-section {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.05) 0%, rgba(201, 162, 39, 0.02) 100%);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  margin-top: 3rem;
}

.cta-content h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

/* Judges Page Styles */
.judge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  height: 100%;
}

.judge-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-red);
}

.judge-photo {
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 3/4;
  border-radius: 0.5rem;
  object-fit: cover;
  object-position: top center;
  margin: 0 auto 1.5rem;
  display: block;
  border: 3px solid var(--brand-red);
}

/* Presenter photos - larger and portrait-oriented */
.presenters-section .judge-photo {
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 3/4;
  border-radius: 0.5rem;
  object-fit: cover;
  object-position: top center;
  border: 3px solid var(--brand-red);
  margin: 0 auto 1rem;
}

/* Tighter spacing for presenter cards */
.presenters-section .judge-card {
  padding: 1rem;
}

.presenters-section .judge-name {
  margin-bottom: 0.25rem;
}

.presenters-section .judge-title {
  margin-bottom: 0;
}

.judge-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-red);
  margin-bottom: 0.5rem;
  text-align: center;
}

/* Coming Soon Placeholder - REMOVED: Not used, judges use .judge-card-coming-soon instead */

/* Back Button for Regulatory Pages */
.back-button-nav {
  margin-bottom: 2rem;
}

.back-button-nav .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.back-button-nav .btn:hover {
  transform: translateX(-2px);
}

.judge-title {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 500;
}

.judge-info {
  color: var(--text-on-dark);
  line-height: 1.6;
  text-align: left;
}

/* Coming soon photo placeholder */
.judge-photo-coming-soon {
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 3/4;
  border-radius: 0.5rem;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 3px dashed var(--border-color);
  color: var(--text-muted);
  font-size: 3rem;
  transition: all 0.3s ease;
}

.judge-card:hover .judge-photo-coming-soon {
  border-color: var(--brand-red);
  color: var(--brand-red);
}

/* Coming soon judge card */
.judge-card-coming-soon {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: 0.5rem;
  padding: 2rem 1.5rem;
  transition: all 0.3s ease;
  height: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.judge-card-coming-soon:hover {
  border-color: var(--brand-red);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.judge-card-coming-soon-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.7;
  color: var(--text-muted);
}

.judge-card-coming-soon:hover .judge-card-coming-soon-icon {
  color: var(--brand-red);
  opacity: 1;
}

.judge-card-coming-soon-text {
  font-size: 1.125rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Center coming soon cards when there are 3 on top and 2 on bottom (lg breakpoint) */
@media (min-width: 992px) {
  /* Center the 4th card (first coming soon) to center both coming soon cards */
  /* With 3 columns per row, 2 columns = 66.666%, so we need 16.666% left margin */
  section[aria-labelledby="judges-heading"] .row.g-4 > .col-lg-4:nth-child(4),
  section[aria-labelledby^="judges"] .row.g-4 > .col-lg-4:nth-child(4) {
    margin-left: 16.666667%;
  }
}

/* Center coming soon card when there's one orphaned below rows of 2 (md breakpoint) */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Center the orphaned 5th card - with 2 columns per row, center the single card */
  section[aria-labelledby="judges-heading"] .row.g-4 > .col-md-6:nth-child(5),
  section[aria-labelledby^="judges"] .row.g-4 > .col-md-6:nth-child(5) {
    margin-left: auto;
    margin-right: auto;
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Responsive adjustments for landing page */
@media (max-width: 768px) {
  .hero-section {
    padding: 1.5rem 0;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .feature-icon {
    width: 44px;
    height: 44px;
  }
  
  .feature-icon svg {
    width: 20px;
    height: 20px;
  }
  
  .cta-section {
    margin-top: 2rem;
    padding: 2rem 1rem !important;
  }
}

section:last-child {
  margin-bottom: 0;
}

/* Link styling */
a {
  color: var(--brand-red);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease;
}

a:hover,
a:focus-visible {
  color: var(--brand-red-hover);
}

/* List styling */
ul, ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Image accessibility */
img {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Responsive improvements */
@media (max-width: 768px) {
  .cookie-consent {
    padding: 1rem;
  }
  
  .cookie-consent .btn-group {
    flex-direction: column;
  }
  
  .cookie-consent .btn {
    width: 100%;
  }
}

/* ==========================================================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .card:hover {
    transform: none;
  }
  
  .btn-gold:hover,
  .btn-gold:focus-visible {
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-color: #444444;
    --bg-card: #0a0a0a;
  }
  
  .card {
    border-width: 2px;
  }
  
  .btn-outline-gold {
    border-width: 2px;
  }
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


#main {
  transition: opacity 0.2s ease-in;
}

/* Sponsors Section */
.sponsors-section {
  border-top-color: var(--border-color) !important;
}

.sponsor-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  height: 150px; /* Fixed height for consistent card sizes */
  width: 100%;
}

/* Base black background for SVG logos (overridden by fade effect above) */

/* All pages: Fade to white at edges for SVG sponsor logos */
.sponsor-logo:has(img[src$=".svg"]),
.sponsor-logo:has(.sponsor-svg) {
  background: 
    radial-gradient(ellipse at center, 
      #000000 0%,
      #1a1a1a 40%,
      #2a2a2a 60%,
      #4a4a4a 80%,
      #ffffff 100%);
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem; /* More oval/rounded appearance */
}

.sponsor-logo:has(img[src$=".svg"])::before,
.sponsor-logo:has(.sponsor-svg)::before {
  content: '';
  position: absolute;
  top: -8%;
  left: -8%;
  right: -8%;
  bottom: -8%;
  background: 
    radial-gradient(ellipse at center, 
      transparent 45%,
      rgba(255, 255, 255, 0.1) 60%,
      rgba(255, 255, 255, 0.25) 75%,
      rgba(255, 255, 255, 0.45) 88%,
      rgba(255, 255, 255, 0.7) 96%,
      #ffffff 100%);
  pointer-events: none;
  border-radius: 1.5rem;
  z-index: 0;
}

/* Subtle corner fade overlays */
.sponsor-logo:has(img[src$=".svg"])::after,
.sponsor-logo:has(.sponsor-svg)::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 65% 65% at top left, rgba(255, 255, 255, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 65% 65% at top right, rgba(255, 255, 255, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 65% 65% at bottom left, rgba(255, 255, 255, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 65% 65% at bottom right, rgba(255, 255, 255, 0.35) 0%, transparent 50%);
  pointer-events: none;
  border-radius: 1.5rem;
  z-index: 0;
}

.sponsor-logo:has(img[src$=".svg"]) > *,
.sponsor-logo:has(.sponsor-svg) > * {
  position: relative;
  z-index: 1;
}

/* Sponsor placeholder */
.sponsor-logo-placeholder {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sponsor-placeholder-content {
  text-align: center;
  color: var(--text-muted);
}

.sponsor-placeholder-text {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.7;
}

.sponsor-logo-placeholder:hover {
  border-color: var(--brand-red);
  background: var(--bg-card-hover);
}

.sponsor-logo:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand-red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Maintain fade-to-white effect on hover for SVG logos */
.sponsor-logo:has(img[src$=".svg"]):hover,
.sponsor-logo:has(.sponsor-svg):hover {
  background: 
    radial-gradient(ellipse at center, 
      #1a1a1a 0%,
      #2a2a2a 25%,
      #3a3a3a 40%,
      #5a5a5a 60%,
      #ffffff 100%);
}

.sponsor-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%) opacity(0.7);
  transition: filter 0.3s ease;
  display: block;
}

/* SVG files - no filters, ensure they display properly */
.sponsor-logo img[src$=".svg"] {
  filter: none !important;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  display: block !important;
  height: 110px !important;
  width: auto !important;
  max-width: 90% !important;
  object-fit: contain !important;
  margin: 0 auto !important;
}

/* Inline SVG styling for sponsor logos */
.sponsor-logo .sponsor-svg {
  max-width: 100%;
  max-height: 100%; /* Fit within card height */
  width: 100%;
  height: auto;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  display: block;
}

.sponsor-logo:hover img {
  filter: grayscale(0%) opacity(1);
}

.sponsor-logo:hover img[src$=".svg"],
.sponsor-logo:hover .sponsor-svg {
  filter: none !important;
  opacity: 1;
  mix-blend-mode: lighten;
}

@media (prefers-reduced-motion: reduce) {
  .sponsor-logo {
    transition: none;
  }
  
  .sponsor-logo:hover {
    transform: none;
  }
  
  .sponsor-logo img {
    transition: none;
  }
}

/* Contact Form Styles */
#contact-form-element {
  max-width: 600px;
}

#contact-form-element .form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

#contact-form-element .form-control:disabled,
#contact-form-element .form-control[aria-disabled="true"] {
  background-color: var(--bg-card);
  opacity: 0.6;
  cursor: not-allowed;
}

#contact-form-element button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#obfuscated-email {
  background-color: var(--bg-card);
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.9rem;
  user-select: all;
}

#cf-turnstile-widget {
  margin: 1rem 0;
}

#cf-turnstile-widget iframe {
  border-radius: 0.25rem;
}

#contact-form-message {
  max-width: 600px;
}

/* Participate Page Styles */
.participate-content {
  margin: 0 auto;
}

.participate-content p {
  color: var(--text-on-dark);
  /* Ensure WCAG AA contrast (4.5:1 for normal text, 3:1 for large text) */
}

.participate-content section {
  color: var(--text-on-dark);
}

/* Visually hidden but accessible to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* About Section Styles */
.about-section {
  margin-bottom: 3rem;
}

.about-section header {
  position: static !important;
}

.about-section h2 {
  position: static !important;
}

/* Prevent article headers from being sticky on compliance pages */
article header {
  position: static !important;
}

article header h1,
article header h2,
article header h3,
article header p {
  position: static !important;
}

.about-content {
  color: var(--text-on-dark);
}

.about-content p {
  color: var(--text-on-dark);
  /* WCAG AA compliant: 18px text with 1.75 line-height ensures good readability */
}

/* Print styles */
@media print {
  .cookie-consent,
  .navbar,
  footer,
  .skip-link {
    display: none;
  }
}
