/* =========================================================
   deportes.ribadeo.gal – Landing
   Cores corporativas (ribadeo.gal / turismoribadeo.gal)
   ========================================================= */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/open-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/open-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #243A85;      /* primario */
  --sky: #4EB2E5;       /* secundario */
  --aqua: #84DCC6;      /* acento */
  --ink: #141618;
  --white: #ffffff;
  --glass: rgba(255, 255, 255, .10);
  --glass-hover: rgba(255, 255, 255, .18);
  --line: rgba(255, 255, 255, .28);
  --radius: 18px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--navy);
  color: var(--white);
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* ---------- Fondo ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--navy); }

.bg__slides, .slide { position: absolute; inset: 0; }
.slide {
  background: center / cover no-repeat;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.6s ease, transform 9s linear;
}
.slide.is-active { opacity: 1; transform: scale(1); }

.bg__video {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 1.2s ease;
  pointer-events: none;
}
.bg__video.is-playing { opacity: 1; }
/* iframe 16:9 que cobre a pantalla. O tamaño e a escala calcúlaos landing.js
   (en móbil o reprodutor é pequeno e amplíase, para que YouTube sirva menos calidade). */
.bg__video iframe {
  position: absolute; top: 50%; left: 50%;
  width: max(130vw, 231.1vh);
  height: max(130vh, 73.13vw);
  transform: translate(-50%, -50%);
  transform-origin: center center;
  border: 0;
}

.bg__overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% 45%, rgba(20, 22, 24, .15) 0%, rgba(20, 22, 24, .55) 100%),
    linear-gradient(180deg, rgba(36, 58, 133, .55) 0%, rgba(36, 58, 133, .25) 45%, rgba(20, 30, 70, .85) 100%);
}

/* ---------- Estrutura ---------- */
.page {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: max(env(safe-area-inset-top), 16px) var(--gutter) max(env(safe-area-inset-bottom), 16px);
}

.top { display: flex; justify-content: center; padding-top: clamp(4px, 2vh, 24px); }
.top__brand { display: inline-block; border-radius: 12px; }
.top__brand img { width: clamp(160px, 18vw, 230px); height: auto; filter: drop-shadow(0 2px 10px rgba(0,0,0,.35)); }

.hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: clamp(20px, 5vh, 56px) 0;
}
.hero__eyebrow {
  margin: 0 0 .9rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--aqua);
}
.hero__title {
  margin: 0;
  font-size: clamp(2rem, 6.2vw, 4.25rem);
  font-weight: 800; line-height: 1.04; letter-spacing: -.02em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
  text-wrap: balance;
}
.hero__title span { color: var(--sky); }
.hero__lead {
  margin: 1rem 0 clamp(1.75rem, 5vh, 3rem);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: rgba(255, 255, 255, .88);
}

/* ---------- Botóns das carreiras ---------- */
.events {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
  width: min(880px, 100%);
}
.event {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 18px 12px;
  padding: clamp(20px, 2.6vw, 30px);
  text-align: left; text-decoration: none;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
  transition: transform .35s var(--ease), background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
  overflow: hidden;
}
.event::before { /* liña de cor superior */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--sky), var(--aqua));
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.event:hover, .event:focus-visible {
  transform: translateY(-4px);
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, .5);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
.event:hover::before, .event:focus-visible::before { transform: scaleX(1); }
.event:focus-visible { outline: 3px solid var(--aqua); outline-offset: 3px; }

.event__logo { grid-column: 1 / -1; display: flex; align-items: center; height: clamp(48px, 6vw, 64px); }
.event__logo img { max-height: 100%; width: auto; max-width: 100%; }
.event__logo img.is-dark { filter: brightness(0) invert(1); } /* logo negro → branco */
.event__logo img.is-wide { max-height: 62%; }                   /* rótulo longo: equilibrar co outro logo */

.event__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.event__name { font-size: clamp(1.05rem, 1.7vw, 1.3rem); font-weight: 700; line-height: 1.25; }
.event__meta { font-size: .9rem; color: rgba(255, 255, 255, .78); }

.event__arrow {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--white); color: var(--navy);
  transition: transform .35s var(--ease), background-color .35s var(--ease);
}
.event:hover .event__arrow, .event:focus-visible .event__arrow { transform: translateX(4px); background: var(--sky); color: var(--white); }

/* ---------- Pé ---------- */
.foot {
  display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; align-items: center;
  font-size: .82rem; color: rgba(255, 255, 255, .75);
  padding-top: 12px;
}
.foot p { margin: 0; }
.social { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; }
.social a {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--white); text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.social a:hover, .social a:focus-visible {
  background: var(--sky); border-color: var(--sky); transform: translateY(-2px);
}
.social a:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }

/* ---------- Botón pausa ---------- */
.motion-toggle {
  position: fixed; z-index: 2;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: calc(max(env(safe-area-inset-bottom), 16px) + 64px);
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--white); background: rgba(20, 22, 24, .35);
  border: 1px solid var(--line); cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color .2s;
}
.motion-toggle:hover { background: rgba(20, 22, 24, .6); }
.motion-toggle:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; }
.motion-toggle .i-play { display: none; }
.motion-toggle[aria-pressed="true"] .i-play { display: block; }
.motion-toggle[aria-pressed="true"] .i-pause { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  .events { grid-template-columns: 1fr; }
  .event { grid-template-columns: auto 1fr auto; grid-template-rows: auto; gap: 14px; padding: 16px 16px 16px 18px; }
  .event__logo { grid-column: auto; width: 100px; height: 44px; justify-content: center; }
  .event__arrow { width: 40px; height: 40px; }
  .event__meta { font-size: .82rem; }
  .foot { flex-direction: column-reverse; justify-content: center; text-align: center; gap: 12px; }
  .motion-toggle { bottom: auto; top: max(env(safe-area-inset-top), 16px); }
}
@media (max-width: 380px) {
  .event__logo { width: 72px; }
  .event__name { font-size: 1rem; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .top { padding-top: 0; }
  .top__brand img { width: 120px; }
  .hero { padding: 10px 0; }
  .hero__eyebrow { display: none; }
  .hero__title { font-size: clamp(1.5rem, 4.4vw, 2.4rem); }
  .hero__title br { display: none; }
  .hero__lead { margin: .4rem 0 1rem; font-size: .95rem; }
  .events { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event { grid-template-columns: auto 1fr auto; grid-template-rows: auto; gap: 12px; padding: 12px 14px; }
  .event__logo { grid-column: auto; width: 84px; height: 40px; justify-content: center; }
  .event__name { font-size: 1rem; }
  .event__meta { display: none; }
  .event__arrow { width: 36px; height: 36px; }
  .motion-toggle { bottom: auto; top: max(env(safe-area-inset-top), 12px); }
}

@media (prefers-reduced-motion: reduce) {
  .slide { transition: opacity .01s; transform: none !important; }
  .event, .event::before, .event__arrow { transition: none; }
}
