/**
 * ✦ Handcrafted CSS for Demo Team Andermatt ✦
 * --------------------------------------------
 * This file contains consolidated and cleaned styles for the site,
 * ensuring a seamless integration with the HTML structure.
 * It supports the responsive header, preloader, and modals.
 */

/* -----------------------------------------------
 * ✦ Base & Typography
 * --------------------------------------------- */
body {
  background-color: #111111;
  color: #F1F1F1;
  font-family: 'Inter', sans-serif;
}

input[type="date"] {
  color-scheme: dark;
  color: #F1F1F1;
  background-color: rgba(255, 255, 255, 0.1);
  min-height: 44px;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

input[type="date"]::placeholder {
  color: rgba(241, 241, 241, 0.75);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}


.orange-first-letter::first-letter {
  color: #f97316;
  font-weight: 600;
}

h1::first-letter,
h2::first-letter,
h3::first-letter,
h4::first-letter {
  color: #f97316;
  font-weight: 600;
}

/* -----------------------------------------------
 * ✦ Header & Navigation
 * --------------------------------------------- */

/* This ensures the main content is not hidden behind the fixed header */
main {
    padding-top: 130px; 
}

/* Style for the header when the user scrolls down */
.header-scrolled {
    background-color: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-theme-light {
  color: #111111;
}

.header-theme-light a {
  color: inherit;
}

.header-theme-light .hamburger-line {
  background-color: #111111;
}

.header-theme-light #mobile-menu {
  color: #111111;
}

.header-theme-light.header-scrolled {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.header-theme-dark {
  color: #f1f1f1;
}

.header-theme-dark .hamburger-line {
  background-color: #f1f1f1;
}

/* General transition for smooth animations on various elements */
.transition-all-300 {
    transition: all 0.3s ease-in-out;
}

/* -----------------------------------------------
 * ✦ Mobile Menu (Hamburger)
 * --------------------------------------------- */
.hamburger {
    cursor: pointer;
    padding: 15px;
    display: inline-block;
}

.hamburger-line {
    width: 30px;
    height: 2px;
    background-color: #F1F1F1;
    display: block;
    margin: 6px 0;
    transition: 0.4s;
}

/* Animation for the hamburger icon turning into an 'X' */
.hamburger.is-active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-7px, 6px);
}

.hamburger.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.is-active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-7px, -6px);
}


/* -----------------------------------------------
 * ✦ Hero Section Video
 * --------------------------------------------- */
.hero-video {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* -----------------------------------------------
 * ✦ Modals & Lightbox
 * --------------------------------------------- */
.modal, .lightbox {
  transition: opacity 0.3s ease-in-out;
}

.modal-content {
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  transform: scale(0.95);
  opacity: 0;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

/* -----------------------------------------------
 * ✦ Preloader
 * --------------------------------------------- */
#preloader {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 999;
    width: 100%;
    height: 100%;
    overflow: visible;
    background: #000; /* Changed to black */
    display: flex;
    justify-content: center;
    align-items: center;
  }

#preloader.loaded {
  opacity: 0;
  pointer-events: none; /* Allows clicks to pass through after fading */
}

#preloader svg {
    width: 150px; /* You can adjust the size */
    height: 150px; /* You can adjust the size */
    -webkit-animation: spin 5s linear infinite; /* Safari */
    animation: spin 5s linear infinite; /* Slower spin for the logo */
}

/* The spin animation keyframes can remain the same */
@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



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

/* -----------------------------------------------
 * ✦ Journal Horizontal Scroller
 * --------------------------------------------- */
#journal-scroll-container {
    /* Hide the default scrollbar */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
#journal-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.journal-card {
    /* Define card width for different screen sizes */
    flex: 0 0 90%; /* Mobile: 90% width */
    max-width: 90%;
    scroll-snap-align: start; /* Snap to the start of the card */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

 .partner-logo svg { width: 100%; height: 100%; }

@media (min-width: 640px) {
    .journal-card {
        flex: 0 0 60%;
        max-width: 60%;
    }
}

@media (min-width: 768px) {
    .journal-card {
        flex: 0 0 45%;
        max-width: 45%;
    }
}

@media (min-width: 1024px) {
    .journal-card {
        flex: 0 0 31%;
        max-width: 31%;
    }
}


/* PARTNERS STYLES */
/* Grid item and logo behavior */
.partners-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  padding: 18px;
  transition: transform 200ms ease, opacity 200ms ease;
}
.partners-grid a:hover { transform: translateY(-2px); }

.partner-logo {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.8;
  transition: opacity 200ms ease;
}
.partners-grid a:hover .partner-logo { opacity: 1; }

/* Color treatment per background */
.partners-on-dark .partner-logo svg,
.partners-on-dark .partner-logo img {
  filter: invert(1) brightness(1.05) contrast(1.1);
}

.partners-on-light .partner-logo svg,
.partners-on-light .partner-logo img {
  filter: none;
}

/* Sensible max sizing */
.partners-grid .partner-logo { max-width: 300px; max-height: 200px; }

/* -----------------------------------------------
 * ✦ DTA "Slick" Cookie Toast
 * --------------------------------------------- */
.cookie-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 100%;
    max-width: 380px;
    background: rgba(17, 17, 17, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    transform: translateY(120%);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.cookie-content {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.cookie-icon {
    font-size: 24px;
    line-height: 1;
}

.cookie-btn {
    width: 100%;
    background-color: #f97316;
    color: #fff;
    border: none;
    padding: 10px 0;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.cookie-btn:hover {
    background-color: #ea580c;
}

.cookie-btn:active {
    transform: scale(0.98);
}

.cookie-toast .cookie-text h4,
.cookie-toast .text-white {
    color: #fff;
    font-weight: 700;
    margin: 0;
}

.cookie-toast .cookie-text p,
.cookie-toast .text-gray-400 {
    color: #9ca3af;
    margin: 0;
    font-size: 0.9rem;
}

.cookie-toast .cookie-text a {
    color: #fff;
    text-decoration: underline;
}

.cookie-toast .cookie-text a:hover {
    color: #ffffff;
}

@media (max-width: 640px) {
    .cookie-toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
        width: auto;
        max-width: none;
    }
}

/* --- Fullscreen Sticky Hero --- */
#hero { height: 220vh; }
.hero-sticky { position: sticky; top: 0; height: 100vh; width: 100vw; }
.hero-sticky .hero-video { width: 100%; height: 100%; object-fit: cover; }
@supports (-webkit-touch-callout: none) {
  .hero-sticky { position: -webkit-sticky; }
}
#main-header { z-index: 50; }

/* -----------------------------------------------
 * ✦ Sponsorship Overrides
 * --------------------------------------------- */

.sponsoring-hero {
  position: relative;
}

.video-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.video-foreground {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;
  min-width: 177.77vh;
  min-height: 100vh;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.video-iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.sponsoring-hero iframe {
  filter: brightness(0.9) contrast(1.05) saturate(0.95);
}

.sponsoring-hero iframe::-webkit-media-controls {
  display: none !important;
}

.sponsored-item h3 {
    position: relative;
    z-index: 20;
}

.sponsored-item:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-item-id] {
    cursor: pointer;
}

.sponsored-item {
    overflow: hidden;
}

.sponsored-overlay {
    z-index: 10;
    transition: all 0.3s ease-in-out;
}

.sponsored-item .sponsored-overlay {
    background-color: rgba(17, 18, 23, 0.7);
}

.sponsored-item .sponsored-overlay .partner-logo-overlay svg {
    width: 100%;
    height: 100%;
    max-width: 80%;
    max-height: 80%;
    opacity: 0.15;
    filter: invert(1);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
}

.sponsored-item .sponsored-overlay * {
    color: #fff !important;
}
