/**
 * 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 (exceeds AA with AAA contrast ratios) 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
 * - Standard page layout with scrollable 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; /* Light theme background (legacy name from dark theme) */
  --bg-black-true: #EEEEEE;
  --bg-card: #EEEEEE;
  --bg-card-hover: #e0e0e0;
  --border-color: #dee2e6;
  
  /* Text colors */
  --text-primary: #000000; /* Primary text color */
  --text-on-dark: #000000; /* Primary text color - black */
  --text-muted: #545454; /* Muted text - WCAG AAA compliant (7:1 on white) */
  --muted: #545454;

  /* Brand colors - WCAG AAA compliant (7:1 contrast on white) */
  --brand-gold: #a71d2a; /* Legacy variable - darker red for AAA */
  --brand-gold-hover: #8b1621;
  --brand-gold-contrast: #ffffff; /* Text color on red background */
  --brand-red: #a71d2a; /* Primary accent color - darker red for AAA (7:1) */
  --brand-red-hover: #8b1621;
  
  /* Accessibility */
  --focus: #a71d2a; /* Focus ring color - darker red for AAA 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;
  min-height: 100vh;
}

/* 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-red {
  color: var(--brand-red) !important;
}

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

/* Footer Instagram link - darker red for WCAG AAA contrast on light background */
footer.bg-black-true .text-red {
  color: var(--brand-red) !important;
}

footer.bg-black-true .text-red:hover,
footer.bg-black-true .text-red:focus-visible {
  color: var(--brand-red-hover) !important;
}

.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 */
header {
  z-index: 1030; /* Above content, below modals */
  /* Account for iOS safe area insets */
  padding-top: env(safe-area-inset-top, 0);
}

/* 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-top: 0.75rem;
    padding-bottom: 0.875rem;
  }
  
  /* Remove extra padding when navbar is expanded */
  .navbar .navbar-collapse.show {
    margin-bottom: -1rem;
    padding-bottom: 0.75rem;
  }
  
  .navbar .navbar-collapse.collapsing {
    margin-bottom: -1rem;
  }
  
  .navbar-collapse:not(.show):not(.collapsing) {
    margin-bottom: 0.5rem;
  }
  
  /* Reduce nav-link padding on mobile */
  .navbar .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
  }
  
  /* Slightly reduce navbar logo size on mobile */
  .navbar-logo {
    width: 50px;
    height: 50px;
  }
  
  footer .container {
    padding-top: 0.875rem !important;
    padding-bottom: max(1rem, calc(env(safe-area-inset-bottom, 0) + 0.75rem)) !important;
  }
}

.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;
}

/* Logo styling for navbar and hero */
/* Navbar logo - rectangular, minimal whitespace in SVG */
.navbar-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

/* Hero logo - round, minimal whitespace in SVG */
.hero-section > div:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  margin: 0 auto 2rem auto;
  /* No overflow hidden - SVG is already tightly cropped */
}

.hero-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 50%;
  object-fit: contain;
  object-position: center;
  background: transparent;
  /* SVG is already tightly cropped, so border-radius just ensures perfect circle */
}

.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 padding when collapse is hidden */
  .navbar-collapse:not(.show):not(.collapsing) {
    margin-bottom: 1rem;
  }
  
  /* 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 */
main {
  background-color: #ffffff; /* Ensure white background */
}

/* Ensure container has white background */
main.container {
  background-color: #ffffff;
}

/* Footer styling */
footer {
  border-top: 1px solid var(--border-color);
  z-index: 1020; /* Above content */
  /* Account for iOS safe area insets at bottom with minimum padding */
  padding-bottom: max(env(safe-area-inset-bottom, 0), 1rem);
}

.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 */
  margin-bottom: 0.25rem; /* Add vertical spacing when links wrap */
}

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

.footer-links .footer-link {
  color: #3d3d3d; /* Darker gray for WCAG AAA contrast (7:1) on light background */
  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;
    /* Ensure adequate bottom padding for wrapped links on mobile */
    padding-bottom: max(1rem, calc(env(safe-area-inset-bottom, 0) + 0.75rem)) !important;
  }
  
  .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;
    /* Add bottom margin for wrapped links */
    margin-bottom: 0.5rem;
  }
  
  /* Ensure footer has adequate bottom padding on mobile */
  footer {
    padding-bottom: max(env(safe-area-inset-bottom, 0), 1.25rem);
  }
}

/* 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;
  }
  
  /* Ensure footer links column is visible on mobile */
  footer.mt-auto.border-top.bg-black-true .container .row .col-md-6:last-child {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 0.75rem !important;
    display: block !important;
    text-align: center !important;
  }
  
  /* Reduce footer spacing on mobile */
  footer .container .row {
    margin-bottom: 0;
  }
  
  /* 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.25rem !important;
  }
  
  /* Reduce spacing between footer elements */
  footer.mt-auto.border-top.bg-black-true .container .row .col-md-6:first-child {
    margin-bottom: 0;
  }
  
  /* 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;
}

/* Responsive adjustments for terms download button on mobile */
@media (max-width: 768px) {
  .terms-download {
    padding: 1rem;
  }
  
  .terms-download .btn {
    width: 100%;
    display: flex;
    white-space: normal;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    text-align: center;
    word-wrap: break-word;
    hyphens: auto;
  }
  
  .terms-download .btn svg {
    width: 18px;
    height: 18px;
  }
}

/* Further adjustments for smallest screens */
@media (max-width: 576px) {
  .terms-download {
    padding: 0.875rem;
  }
  
  .terms-download h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .terms-download p {
    font-size: 0.9375rem;
    margin-bottom: 0.75rem;
  }
  
  .terms-download .btn {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.4;
  }
  
  .terms-download .btn svg {
    width: 16px;
    height: 16px;
  }
}

/* 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;
}


/* 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: 1.5rem 0;
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden; /* Clip content to section bounds */
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Center content vertically */
  align-items: center; /* Center content horizontally */
  min-height: 0; /* Allow flexbox children to shrink */
  /* Background image without fade - show full image scaled appropriately */
  background-color: #000000; /* Black background for any extra space when image is scaled */
  background-image: url('/images/hero_bg.jpg');
  background-image: image-set(
    url('/images/hero_bg.avif') type('image/avif'),
    url('/images/hero_bg.webp') type('image/webp'),
    url('/images/hero_bg.jpg') type('image/jpeg')
  );
  background-size: cover; /* Fill container width, crop height */
  background-position: center top; /* Anchor top so cropping happens at the bottom */
  background-repeat: no-repeat;
  background-attachment: scroll;
  background-origin: border-box;
  background-clip: border-box;
}

/* Hide about-section-below on desktop (shown via media query at <=1536px) */
.about-section-below {
  display: none;
}

/* On mobile/tablet: Move about section below hero section with black text */
/* Extended to 1536px to catch most tablet landscape sizes */
/* JavaScript will handle larger tablet sizes (like 12.9" iPad Pro at 2048px) */
@media (max-width: 1536px) {
  /* Keep hero section with just welcome text (logo, h1, tagline, divider) */
  .hero-section {
    /* Remove max-height constraint to allow full image to display */
    max-height: none;
    min-height: 40vh; /* Minimum height for welcome text - will be overridden by JS if needed */
    margin-bottom: 2rem;
    background-color: #000000 !important; /* Black background for any extra space */
    /* Ensure image scales properly - force contain for iOS Safari */
    background-size: contain !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    overflow: visible; /* Allow content to extend if needed */
  }
  
  /* Hide about section inside hero on mobile - it will be moved below */
  .hero-section .about-section {
    display: none;
  }

  /* About section below hero (visible on mobile/tablet via CSS, hidden on desktop) */
  .about-section-below {
    display: block;
    margin-top: 2rem;
    margin-bottom: 3rem;
    background-color: #ffffff;
    padding: 2rem 0;
  }
  
  .about-section-below header {
    text-align: center;
    margin-bottom: 2rem;
  }
  
  .about-section-below h2 {
    color: var(--brand-red) !important;
    text-shadow: none !important;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 1.5rem;
    font-weight: 700;
  }
  
  .about-section-below .about-content {
    max-width: 75ch;
    margin-left: auto;
    margin-right: auto;
  }
  
  .about-section-below .about-content p {
    color: var(--text-on-dark) !important;
    text-shadow: none !important;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.75;
    margin-bottom: 1.5rem;
  }
  
  /* Remove backdrop boxes when below hero */
  .about-section-below header,
  .about-section-below .about-content {
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}

.hero-section > * {
  position: relative;
  z-index: 2;
  text-align: center; /* Center text content */
}

/* 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;
  padding: 1.5rem;
  padding-bottom: 1.5rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  flex: 0 1 auto; /* Allow shrinking if needed */
  min-height: 0; /* Critical for flexbox to allow shrinking */
  text-align: center; /* Center text content */
  width: 100%; /* Ensure full width for proper centering */
  max-width: 100%; /* Prevent overflow */
}

/* Add backdrop boxes to about-section header and content for readability */
html[lang="de"] .hero-section .about-section header,
html[lang="en"] .hero-section .about-section header,
html[lang="es"] .hero-section .about-section header,
html[lang="fr"] .hero-section .about-section header {
  position: relative;
  padding: 0.75rem 1.25rem;
  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);
  display: inline-block;
  max-width: 90%;
  margin-bottom: 1rem;
}

html[lang="de"] .hero-section .about-section .about-content,
html[lang="en"] .hero-section .about-section .about-content,
html[lang="es"] .hero-section .about-section .about-content,
html[lang="fr"] .hero-section .about-section .about-content {
  position: relative;
  padding: 1rem 1.25rem;
  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);
}

/* Ensure sections below hero appear above the overflow */
.feature-cards,
.presenters-section,
.sponsors-section {
  position: relative;
  z-index: 3;
  background-color: #ffffff;
  margin-top: 0; /* Ensure no overlap with hero section */
}


/* Responsive adjustments for hero section */
/* Note: Removed redundant 991.98px breakpoint - about-section is hidden at 1199.98px */

.hero-section h1 {
  font-size: clamp(1.75rem, 4vw, 3.5rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

/* All landing pages: Background image without fade - show full image */
html[lang="de"] .hero-section,
html[lang="en"] .hero-section,
html[lang="es"] .hero-section,
html[lang="fr"] .hero-section {
  background-image: url('/images/hero_bg.jpg');
  background-image: image-set(
    url('/images/hero_bg.avif') type('image/avif'),
    url('/images/hero_bg.webp') type('image/webp'),
    url('/images/hero_bg.jpg') type('image/jpeg')
  );
  background-size: cover;
  background-position: center top;
}

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

/* Dynamic font sizing for about section to fit within hero */
html[lang="de"] .hero-section .about-section h2,
html[lang="en"] .hero-section .about-section h2,
html[lang="es"] .hero-section .about-section h2,
html[lang="fr"] .hero-section .about-section h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

html[lang="de"] .hero-section .about-section p,
html[lang="en"] .hero-section .about-section p,
html[lang="es"] .hero-section .about-section p,
html[lang="fr"] .hero-section .about-section p {
  font-size: clamp(0.9375rem, 1.8vw, 1.125rem);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}


/* 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: 0.75rem 1.25rem;
  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: 1rem;
  flex: 0 0 auto;
}

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;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

/* About section language-specific overrides (if needed) */

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

/* Election Date Badge */
.election-date-badge {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: rgba(220, 53, 69, 0.95);
  color: #ffffff;
  border-radius: 50px;
  font-weight: 600;
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.2);
  margin: 1rem auto;
  text-align: center;
  line-height: 1.4;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.election-date-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.election-date-badge strong {
  display: block;
  font-size: clamp(0.9375rem, 1.6vw, 1.0625rem);
  margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
  .election-date-badge {
    padding: 0.625rem 1.25rem;
    margin: 0.75rem auto;
  }
}

/* Event card padding */
[aria-labelledby="upcoming"] .card-body {
  padding: 1.75rem;
}

/* Event date/time emphasis */
.event-datetime {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand-red);
}

.event-venue-split {
  list-style: none;
  padding: 0;
  margin: 0;
}

.event-venue-split li {
  padding: 0.4rem 0;
}

.event-venue-split li + li {
  border-top: 1px solid var(--border-color);
}

.event-venue-name {
  font-weight: 600;
  display: block;
}

.event-venue-address {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.event-badge-warning {
  display: inline-block;
  background: var(--brand-red);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

.event-badge-info {
  display: inline-block;
  background: #FFD700;
  color: #000;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

.event-hosts {
  border-top: 1px solid var(--border-color);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.event-hosts-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.event-hosts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.event-host-tag {
  display: inline-block;
  background: #000;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 1rem;
  text-decoration: none;
}

a.event-host-tag:hover {
  background: #333;
  color: #fff;
  text-decoration: none;
}

/* Event pill buttons (matching cabaret button style) */
.btn-event-red {
  background: var(--brand-red);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.625rem 1.25rem;
  border: 2px solid var(--brand-red);
  border-radius: 50px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-event-red:hover,
.btn-event-red:focus {
  background: var(--brand-red-hover);
  border-color: var(--brand-red-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-event-outline-red {
  background: transparent;
  color: var(--brand-red);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.625rem 1.25rem;
  border: 2px solid var(--brand-red);
  border-radius: 50px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-event-outline-red:hover,
.btn-event-outline-red:focus {
  background: var(--brand-red);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Event card spacer - pushes buttons to bottom with centered divider */
.event-card-spacer {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.75rem 0;
}

.event-card-spacer hr {
  width: 100%;
  margin: 0;
}

/* Cabaret preview image on card */
.cabaret-preview-img {
  max-height: 225px;
  width: auto;
  border-radius: 0.5rem;
  border: 2px solid #e6c200;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cabaret-preview-img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
}

/* Event card contestant thumbnails */
.event-contestant-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.event-contestant-thumb:hover {
  color: var(--brand-red);
}

.event-contestant-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--brand-red);
  display: block;
}

.event-contestant-img-wrapper {
  position: relative;
  line-height: 0;
}

.event-contestant-img-placeholder {
  border-style: dashed;
  opacity: 0.7;
}

.event-contestant-badge {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffc107;
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 50px;
  white-space: nowrap;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.05em;
}

/* Cabaret "Featuring" button */
.btn-cabaret {
  background: #FFD700;
  color: #000000;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.625rem 1.25rem;
  border: 2px solid #e6c200;
  border-radius: 50px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: cabaret-glow 2s ease-in-out infinite;
  cursor: pointer;
}

.btn-cabaret:hover,
.btn-cabaret:focus {
  background: #e6c200;
  color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.5);
  animation: none;
}

.btn-cabaret .btn-cabaret-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.btn-cabaret:hover .btn-cabaret-arrow {
  transform: translateX(4px);
}

@keyframes cabaret-glow {
  0%, 100% { box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3); }
  50% { box-shadow: 0 4px 20px rgba(255, 215, 0, 0.6); }
}

/* Dashed border utility for placeholder cards */
.border-dashed {
  border-style: dashed !important;
  border-color: var(--border-color) !important;
}

/* Cabaret Date Badge */
.cabaret-date-badge {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 215, 0, 0.95);
  color: #000000;
  border-radius: 50px;
  font-weight: 600;
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.2);
  margin: 1rem auto 0.5rem;
  text-align: center;
  line-height: 1.4;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cabaret-date-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.3);
  color: #000000;
}

.cabaret-date-badge strong {
  display: block;
  font-size: clamp(0.9375rem, 1.6vw, 1.0625rem);
  margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
  .cabaret-date-badge {
    padding: 0.625rem 1.25rem;
    margin: 0.75rem auto 0.25rem;
  }
}

/* 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: var(--bg-card);
  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: var(--bg-card);
  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;
  padding-top: 2rem;
  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;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.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 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;
}

.judge-card-coming-soon-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0;
  letter-spacing: 0.1em;
}

/* Contestant profile - full-width inline layout */
.contestant-profile {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
}

.contestant-profile:last-child {
  border-bottom: none;
}

.contestant-profile-photo-link {
  display: block;
  max-width: 300px;
  border-radius: 0.5rem;
  overflow: hidden;
}

.contestant-profile-photo-link .contestant-profile-photo {
  transition: transform 0.3s ease, filter 0.3s ease;
}

.contestant-profile-photo-link:hover .contestant-profile-photo {
  transform: scale(1.08) translateY(2%);
  filter: brightness(1.1);
}

.contestant-profile-photo-link.hover-shift-up:hover .contestant-profile-photo {
  transform: scale(1.08) translateY(-2%);
}

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

.contestant-profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-red);
  margin-bottom: 0.75rem;
}

.contestant-profile-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.contestant-profile-pronouns {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.contestant-profile-social {
  margin-top: 1rem;
}

.contestant-profile-social a {
  color: var(--brand-red);
  text-decoration: none;
  font-weight: 500;
}

.contestant-profile-social a:hover {
  text-decoration: underline;
}

.contestant-profile-bio {
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.contestant-profile-bio:last-child {
  margin-bottom: 0;
}

/* Coming soon photo placeholder for contestant profiles */
.contestant-profile-photo-placeholder {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 3/4;
  border-radius: 0.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;
}

.contestant-profile-coming-soon .contestant-profile-name {
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.contestant-profile-coming-soon .contestant-profile-bio {
  color: var(--text-muted);
  font-weight: 500;
}

.contestant-profile-badge-pending {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
  background-color: #ffc107;
  color: #000;
}

/* 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: 0.5rem 0;
    overflow: visible; /* Allow image to extend if needed */
    margin-bottom: 2rem;
  }
  
  /* Background image - use smaller variant on mobile */
  html[lang="de"] .hero-section,
  html[lang="en"] .hero-section,
  html[lang="es"] .hero-section,
  html[lang="fr"] .hero-section {
    background-color: #000000 !important;
    background-image: url('/images/hero_bg-768w.jpg') !important;
    background-image: image-set(
      url('/images/hero_bg-768w.avif') type('image/avif'),
      url('/images/hero_bg-768w.webp') type('image/webp'),
      url('/images/hero_bg-768w.jpg') type('image/jpeg')
    ) !important;
    background-size: contain !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
  }
  
  .hero-section h1 {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
    line-height: 1.15;
    margin-bottom: 0.5rem;
  }
  
  /* Ensure logo displays properly on small screens */
  .hero-section > div:first-child {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem auto;
    padding: 0.75rem;
  }
  
  /* Reduce padding on top elements */
  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 {
    padding: 0.75rem;
  }
  
  html[lang="de"] .hero-section > h1,
  html[lang="en"] .hero-section > h1,
  html[lang="es"] .hero-section > h1,
  html[lang="fr"] .hero-section > h1 {
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
  }
  
  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 {
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    font-size: clamp(0.9375rem, 2.5vw, 1.125rem);
  }
  
  .feature-icon {
    width: 44px;
    height: 44px;
  }
  
  .feature-icon svg {
    width: 20px;
    height: 20px;
  }
  
  .cta-section {
    margin-top: 2rem;
    padding: 2rem 1rem !important;
  }
}

/* Adjust hero background image at smallest breakpoint */
@media (max-width: 576px) {
  .hero-section {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    min-height: 30vh; /* Minimum height for welcome text - will be overridden by JS if needed */
  }
  
  .hero-section > div:first-child {
    width: 100px;
    height: 100px;
    margin: 0 auto 0.75rem auto;
  }
  
  /* Reduce header/navbar padding on smallest screens */
  .navbar {
    padding-top: 0.25rem;
    padding-bottom: 0.5rem;
  }
  
  .navbar-collapse:not(.show):not(.collapsing) {
    margin-bottom: 0.5rem;
  }
  
  /* Further reduce nav-link padding on smallest screens */
  .navbar .nav-link {
    padding: 0.375rem 0.625rem;
    font-size: 0.9375rem;
  }
  
  /* Smaller navbar logo on smallest screens */
  .navbar-logo {
    width: 45px;
    height: 45px;
  }
  
  /* Reduce footer padding on smallest screens but ensure enough space for wrapped links */
  footer {
    padding-bottom: max(env(safe-area-inset-bottom, 0), 1rem);
  }
  
  footer .container {
    padding-top: 0.5rem !important;
    padding-bottom: max(1rem, calc(env(safe-area-inset-bottom, 0) + 0.75rem)) !important;
  }
  
  /* Ensure footer links column is visible and properly displayed */
  footer.mt-auto.border-top.bg-black-true .container .row .col-md-6:last-child {
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 0.5rem !important;
    display: block !important;
    text-align: center !important;
  }
  
  footer.mt-auto.border-top.bg-black-true .container .row .col-md-6:last-child .footer-links {
    justify-content: center !important;
    text-align: center !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  
  footer.mt-auto.border-top.bg-black-true .container .row .col-md-6:last-child .footer-links .list-inline-item {
    margin-right: 0.5rem !important;
    margin-left: 0.5rem !important;
  }
  
  /* Reduce footer font size slightly on smallest screens */
  .footer-links {
    font-size: 0.75rem;
  }
  
  footer small {
    font-size: 0.8125rem;
  }
  
}

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) {
  /* Reduce header/navbar padding at 768px breakpoint */
  .navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
  }
  
  .navbar-collapse:not(.show):not(.collapsing) {
    margin-bottom: 0.5rem;
  }
  
  /* Reduce nav-link padding at 768px breakpoint */
  .navbar .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
  }
  
  /* Slightly smaller navbar logo at 768px breakpoint */
  .navbar-logo {
    width: 50px;
    height: 50px;
  }
  
  footer .container {
    padding-top: 0.75rem !important;
    padding-bottom: max(1rem, calc(env(safe-area-inset-bottom, 0) + 0.75rem)) !important;
  }
}

/* ==========================================================================
   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;
  }
}

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

/* Screen reader only / visually hidden */
.sr-only,
.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;
}

/* Honeypot field for spam protection - visually hidden but not display:none */
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  z-index: -1;
}

#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;
  position: relative;
  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%;
  overflow: hidden;
}

/* All pages: 45-degree gradient for SVG sponsor logos */
.sponsor-logo:has(img[src$=".svg"]),
.sponsor-logo:has(.sponsor-svg) {
  background: linear-gradient(135deg, #333 0%, #000 100%);
  border-radius: 1.5rem; /* More oval/rounded appearance */
}

/* 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);
  transform: translateY(-2px);
  box-shadow: -5px -5px 20px rgba(0, 0, 0, 0.3);
}

/* Maintain 45-degree gradient on hover for SVG logos */
.sponsor-logo:has(img[src$=".svg"]):hover,
.sponsor-logo:has(.sponsor-svg):hover {
  background: linear-gradient(135deg, #444 0%, #111 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;
}

/* Center <picture> elements within sponsor cards */
.sponsor-logo picture {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bitmap logos on dark cards (e.g. Recon) */
.sponsor-logo-dark {
  background: linear-gradient(135deg, #333 0%, #000 100%);
  border-radius: 1.5rem;
}

.sponsor-logo-dark img {
  mix-blend-mode: screen;
  filter: none;
  opacity: 1;
  height: 80px;
  width: auto;
  max-width: 90%;
  object-fit: contain;
  transition: filter 0.3s ease;
}

.sponsor-logo-dark:hover {
  background: linear-gradient(135deg, #444 0%, #111 100%);
}

.sponsor-logo-dark:hover img {
  filter: brightness(1.2) drop-shadow(0 0 8px rgba(255, 255, 255, 0.25));
}

/* Low-contrast SVG logos on dark cards (e.g. Butcherei) */
.sponsor-logo-bright img[src$=".svg"] {
  filter: brightness(1.4) drop-shadow(0 0 6px rgba(255, 80, 80, 0.3)) !important;
}

.sponsor-logo-bright:hover img[src$=".svg"] {
  filter: brightness(1.7) drop-shadow(0 0 10px rgba(255, 80, 80, 0.5)) !important;
}

/* Colorful logos on dark cards (e.g. Invictus Flugtechnik) — muted at rest, pops on hover */
.sponsor-logo-vivid img[src$=".svg"] {
  opacity: 0.9 !important;
  filter: brightness(0.95) !important;
  transition: all 0.3s ease !important;
}

.sponsor-logo-vivid:hover img[src$=".svg"] {
  opacity: 1 !important;
  filter: brightness(1.15) drop-shadow(0 0 8px rgba(255, 255, 255, 0.2)) !important;
}

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

/* Sponsor logos – tablet breakpoint */
@media (max-width: 767.98px) {
  .sponsor-logo {
    height: 120px;
    padding: 1rem;
  }

  .sponsor-logo img[src$=".svg"] {
    height: 85px !important;
  }

  .sponsor-logo-dark img {
    height: 65px;
  }
}

/* Sponsor logos – small mobile breakpoint */
@media (max-width: 575.98px) {
  .sponsor-logo {
    height: 100px;
    padding: 0.75rem;
  }

  .sponsor-logo img[src$=".svg"] {
    height: 65px !important;
    max-width: 85% !important;
  }

  .sponsor-logo-dark img {
    height: 55px;
  }

  .sponsor-logo img[style*="scale"] {
    transform: scale(1.1) !important;
  }

  .sponsor-logo picture {
    max-width: 90%;
    max-height: 90%;
  }
}

/* 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;
}

#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 */
/* 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 */
}

/* Contestant Modal Styles */
#contestantModal .modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
}

#contestantModal .modal-header {
  border-bottom-color: var(--border-color);
}

#contestantModal .modal-footer {
  border-top-color: var(--border-color);
}

#contestantModal .contestant-modal-photo {
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top center;
  border: 3px solid var(--brand-red);
  border-radius: 0.5rem;
}

#contestantModal .contestant-modal-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brand-red);
  margin-bottom: 1.5rem;
}

#contestantModal .contestant-modal-bio {
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
}

#contestantModal .contestant-modal-bio p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

#contestantModal .contestant-modal-bio p:last-child {
  margin-bottom: 0;
}

#contestantModal .btn-close {
  filter: invert(1);
}

/* Make contestant cards clickable */
[data-contestant-id] {
  cursor: pointer;
  transition: all 0.3s ease;
}

[data-contestant-id]:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

[data-contestant-id]:focus {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

/* Forced colors (Windows High Contrast Mode) */
@media (forced-colors: active) {
  .btn-red,
  .btn-event-red,
  .btn-cabaret,
  .btn-event-outline-red {
    border: 2px solid ButtonText;
  }

  .judge-card,
  .card {
    border: 1px solid ButtonText;
  }

  a:focus-visible,
  button:focus-visible {
    outline: 2px solid Highlight;
  }

  .event-contestant-img {
    border: 2px solid ButtonText;
  }
}

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

  body {
    color: #000;
    background: #fff;
  }

  .container {
    max-width: 100%;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }

  a[href^="#"]::after,
  a[href^="javascript"]::after {
    content: "";
  }

  .card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  img {
    max-width: 100%;
  }
}
