/*
  Costa Brava Music Events — Static site (2026)
  - Keep this file small: Tailwind does most of the work.
  - Put only brand-specific utilities, effects, and accessibility helpers here.
*/

:root {
  /* Used for subtle noise overlay opacity tweaks */
  --cbme-noise-opacity: 0.08;
}

/* Alpine: hide elements until Alpine is ready */
[x-cloak] {
  display: none !important;
}

/* Smooth scrolling with reduced-motion fallback */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Better default focus ring for keyboard users */
:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.85); /* cyan-400 */
  outline-offset: 3px;
}

/* A subtle animated gradient text utility (used sparingly) */
.cbme-gradient-text {
  background: linear-gradient(90deg, #22d3ee 0%, #60a5fa 30%, #a78bfa 60%, #fb7185 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Soft grain/noise overlay (SVG data URI) */
.cbme-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--cbme-noise-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* Fancy underline for nav links */
.cbme-underline {
  background-image: linear-gradient(90deg, rgba(34, 211, 238, 0.0), rgba(34, 211, 238, 0.9), rgba(34, 211, 238, 0.0));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
}

/* Prevent layout shift when opening mobile menu */
body.cbme-lock {
  overflow: hidden;
}

/* Minimal “glass” effect helper */
.cbme-glass {
  background: rgba(17, 24, 39, 0.35); /* slate-900 */
  border: 1px solid rgba(148, 163, 184, 0.18); /* slate-400 */
  backdrop-filter: blur(10px);
}

/* Hero typography refresh */
.cbme-hero-title {
  font-family: "Sora", "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.cbme-hero-copy {
  font-family: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
}

.cbme-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.6rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  opacity: 0.88;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.cbme-lang-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.cbme-lang-btn.is-active {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.cbme-flag {
  height: 0.65rem;
  width: 0.95rem;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  flex: 0 0 auto;
}

.cbme-flag-es {
  background: linear-gradient(
    to bottom,
    #c8102e 0%,
    #c8102e 25%,
    #ffc400 25%,
    #ffc400 75%,
    #c8102e 75%,
    #c8102e 100%
  );
}

.cbme-flag-ca {
  background: repeating-linear-gradient(
    to bottom,
    #ffed00 0%,
    #ffed00 16.66%,
    #da121a 16.66%,
    #da121a 33.33%
  );
}

.cbme-flag-gb {
  background: linear-gradient(
      90deg,
      transparent 42%,
      #ffffff 42%,
      #ffffff 58%,
      transparent 58%
    ),
    linear-gradient(
      transparent 42%,
      #ffffff 42%,
      #ffffff 58%,
      transparent 58%
    ),
    linear-gradient(
      90deg,
      transparent 46%,
      #c8102e 46%,
      #c8102e 54%,
      transparent 54%
    ),
    linear-gradient(
      transparent 46%,
      #c8102e 46%,
      #c8102e 54%,
      transparent 54%
    ),
    #012169;
}

@media (max-width: 639px) {
  .cbme-lang-switch {
    gap: 0.15rem;
    padding: 0.25rem;
    border-radius: 0.9rem;
  }

  .cbme-lang-btn {
    min-width: 2rem;
    justify-content: center;
    padding: 0.35rem;
  }

  .cbme-lang-btn span:last-child {
    display: none;
  }
}

/* Nice selection color */
::selection {
  background: rgba(34, 211, 238, 0.25);
}
