/*
 * Home (front-page) – split hero video + welcome overlay + flipping coins grid
 */

/* Prevent any accidental horizontal scrolling on home */
body.home, html{
  overflow-x: clip;
}

/* --- Split hero: full-bleed slices with welcome block in the middle --- */
.fcsd-hero-split{
  /* full bleed */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  position: relative;
}

/* --- Hero banner (estil “Vodafone”) --- */
.fcsd-hero-split.fcsd-hero-banner{
  background: var(--bg);
  padding: clamp(18px, 3vw, 34px) 0;
  overflow: clip;
}

.fcsd-hero-banner__inner{
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(16px, 2.2vw, 26px);
  align-items: stretch;
}

.fcsd-hero-banner__copy{
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 18px;
  padding: clamp(18px, 2.6vw, 30px);
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
}
.theme-dark .fcsd-hero-banner__copy {
  /*
   * IMPORTANT:
   * In this theme we invert --bg-contrast in dark mode (it becomes light)
   * to keep pills readable. The home hero copy block needs the opposite:
   * a dark panel so the text remains legible.
   */
  background: var(--panel);
  border-color: var(--panel-border-strong);
}
.fcsd-hero-banner__title{
  margin: 0;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.02em;
  font-size: clamp(28px, 3.3vw, 46px);
}

.fcsd-hero-banner__lead{
  margin: 14px 0 0;
  max-width: 70ch;
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.45;
  color: rgba(0,0,0,.82);
}
.theme-dark .fcsd-hero-banner__lead{ color: rgba(255,255,255,.86); }
.theme-dark .fcsd-hero-banner__title{
  color: var(--text);
}

.fcsd-hero-banner__actions{
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fcsd-hero-banner__paths{
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fcsd-hero-banner__path{
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  padding: 12px 12px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.72);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.theme-dark .fcsd-hero-banner__path{
  background: rgba(0,0,0,.18);
  border-color: rgba(255,255,255,.14);
}

.fcsd-hero-banner__path:hover,
.fcsd-hero-banner__path:focus-visible{
  transform: translateY(-1px);
  border-color: rgba(0,0,0,.22);
  background: rgba(255,255,255,.92);
}
.theme-dark .fcsd-hero-banner__path:hover,
.theme-dark .fcsd-hero-banner__path:focus-visible{
  border-color: rgba(255,255,255,.22);
  background: rgba(0,0,0,.26);
}

.fcsd-hero-banner__path-title{
  display: block;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
}
.fcsd-hero-banner__path-sub{
  display: block;
  margin-top: 4px;
  font-size: 13px;
  opacity: .9;
  line-height: 1.25;
}

.fcsd-hero-banner__media{
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  /* vermell amb una mica de volum (sense “card” fixa) */
  background: radial-gradient(120% 140% at 30% 20%, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 45%),
              linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 55%, var(--accent) 100%);
}

/* “stripes” suaus, per recordar el recurs gràfic del bàner de la captura */
.fcsd-hero-banner__media::before{
  content: "";
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 180%;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,.10) 0,
    rgba(255,255,255,.10) 12px,
    rgba(255,255,255,0) 12px,
    rgba(255,255,255,0) 28px
  );
  opacity: .28;
  transform: rotate(-6deg);
  pointer-events: none;
}

.fcsd-hero-banner__media-inner{
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: clamp(240px, 28vw, 380px);
  padding: clamp(2px, 0.35vw, 3px);
}

.fcsd-hero-banner__media-inner iframe{
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 14px;
  background: #000;
}

@media (max-width: 991.98px){
  .fcsd-hero-banner__inner{ grid-template-columns: 1fr; }
  .fcsd-hero-banner__media-inner{ min-height: 220px; }
  .fcsd-hero-banner__paths{ grid-template-columns: 1fr; }
}

/* --- (Legacy) split hero video --- */
.fcsd-hero-split:not(.fcsd-hero-banner){
  background: #000;
  /* Mantén una proporció 16:9 perquè el vídeo es vegi sencer (sense retallar).
     El reproductor de YouTube ja farà el "letterbox" necessari. */
  aspect-ratio: 16 / 9;
  height: auto;
  overflow: hidden;
}

/* (Legacy) split-slice styles were used when the hero was built from two
   stacked slices. Keep them harmless, but the current front-page uses a
   single full-bleed media wrapper. */
.fcsd-hero-split__slice{ position: relative; overflow: hidden; }
.fcsd-hero-split__slice--top{ height: 100%; position: relative; }


/* media wrapper keeps iframe large enough to cover slice */

.fcsd-hero-split__media{
  position: absolute;
  inset: 0;
  z-index: 0;
}

.fcsd-hero-split__media iframe{
  /* Mostrar el vídeo complet (sense "cover" que el retalli). */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* If you ever re-enable the old split-slice version, these transforms would
   crop each slice. Disabled for the single-iframe hero. */
/*
.fcsd-hero-split__slice--top .fcsd-hero-split__media iframe{ transform: translate(-50%, -42%); }
.fcsd-hero-split__slice--bottom .fcsd-hero-split__media iframe{ transform: translate(-50%, -58%); }
*/


/* --- Welcome block (ara va sota el vídeo, no a sobre) --- */
.fcsd-home-welcome-block{
  padding: 22px 0 8px;
}

.fcsd-home-welcome__panel{
  position: relative;
  border-radius: 18px;
  padding: clamp(18px, 2.8vw, 28px);
  color: #111;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(0,0,0,.08);
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.fcsd-home-welcome__panel:hover,
.fcsd-home-welcome__panel:focus,
.fcsd-home-welcome__panel:active,
.fcsd-home-welcome__panel.is-pressed{
  background: rgba(255,255,255,1);
  color: #111;
  border-color: rgba(0,0,0,.12);
  transform: translateY(-1px);
}

.fcsd-home-welcome__kicker{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-size: 12px;
  opacity: .95;
}

.fcsd-home-welcome__kicker h1 {
  margin: 10px 0 0;
  font-weight: 800;
  line-height: 1.05;
  font-size: clamp(20px, 2vw, 36px);
}

.fcsd-home-welcome__lead{
  margin: 12px 0 0;
  max-width: 70ch;
  font-size: clamp(16px, 1.6vw, 20px);
  opacity: .95;
}

.fcsd-home-welcome__actions{
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fcsd-home-welcome__hint{
  margin: 14px 0 0;
  font-size: 13px;
  opacity: .9;
}

/* Make outline-light readable when panel is NOT pressed */
.fcsd-home-welcome__panel .btn-outline-light{
  border-color: rgba(255,255,255,.65);
  color: #fff;
}
.fcsd-home-welcome__panel:hover .btn-outline-light,
.fcsd-home-welcome__panel.is-pressed .btn-outline-light,
.fcsd-home-welcome__panel:active .btn-outline-light{
  border-color: rgba(0,0,0,.25);
  color: #111;
}

/* On very small screens, remove the “hint” to reduce clutter */
@media (max-width: 420px){
  .fcsd-home-welcome__hint{ display:none; }
}

/* --- Àmbits grid (front-page cards) --- */
.fcsd-ambits{
  padding-top: 2.25rem;
}

/* Decorative accent underline for the section title */
.fcsd-ambits > h2{
  display: inline-block;
  position: relative;
}
.fcsd-ambits > h2::after{
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--accent);
}

.fcsd-ambits__grid{
  display: grid;
  /* Mobile first: 2 columns */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* More vertical separation so rows are clearly distinct */
  gap: clamp(18px, 2.2vw, 30px);
}

/* Tablet */
@media (min-width: 768px){
  .fcsd-ambits__grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Desktop */
@media (min-width: 1200px){
  .fcsd-ambits__grid{ grid-template-columns: repeat(5, minmax(0, 1fr)); }
}


.fcsd-ambits__intro{
  margin: 0 0 18px;
  max-width: 80ch;
  opacity: .9;
}

.fcsd-ambit-card{
  /* Variables are set inline in the template per ambit */
  --ambit-primary: var(--accent);
  --ambit-secondary: color-mix(in srgb, var(--ambit-primary) 22%, #fff);
  --ambit-pattern: none;

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 18px 18px 20px;
  height: 100%;
  border-radius: 18px;
  border: 1.5px solid rgba(0,0,0,.14);
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 22px rgba(0,0,0,.05);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;

  /* The whole card is an <a>. Avoid underlining all text by default. */
  text-decoration: none;
  color: inherit;
}

.theme-dark .fcsd-ambit-card{
  background: rgba(0,0,0,.18);
  border-color: rgba(255,255,255,.14);
}

.fcsd-ambit-card:hover,
.fcsd-ambit-card:focus-visible{
  transform: translateY(-2px);
  /* On hover the border must use the *primary* color of the ambit */
  border-color: color-mix(in srgb, var(--ambit-primary) 75%, rgba(0,0,0,.25));
  box-shadow: 0 14px 28px rgba(0,0,0,.08);
  outline: none;
}
.theme-dark .fcsd-ambit-card:hover,
.theme-dark .fcsd-ambit-card:focus-visible{
  border-color: rgba(255,255,255,.20);
}

.fcsd-ambit-card__circle{
  width: clamp(110px, 9vw, 160px);
  height: clamp(110px, 9vw, 160px);
  border-radius: 999px;
  position: relative;
  perspective: 800px;
  box-shadow:
    0 12px 26px rgba(0,0,0,.16),
    inset 0 0 0 2px rgba(255,255,255,.28);
}

.fcsd-ambit-card__circle::before,
.fcsd-ambit-card__circle::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:999px;
  backface-visibility:hidden;
  transform-style:preserve-3d;
  transition: transform .6s ease;
}

/* Front: solid face */
.fcsd-ambit-card__circle::before{
  /* Default circle must be ONLY the primary color */
  background: var(--ambit-primary, var(--accent));
  transform: rotateY(0deg);
}

/* Back: SVG pattern */
.fcsd-ambit-card__circle::after{
  background-image: var(--ambit-pattern);
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
  transform: rotateY(180deg);
}

.fcsd-ambit-card:hover .fcsd-ambit-card__circle::before,
.fcsd-ambit-card:focus-visible .fcsd-ambit-card__circle::before{
  transform: rotateY(180deg);
}

.fcsd-ambit-card:hover .fcsd-ambit-card__circle::after,
.fcsd-ambit-card:focus-visible .fcsd-ambit-card__circle::after{
  transform: rotateY(360deg);
}

.fcsd-ambit-card__body{
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 8px;
  flex: 1;
}


.fcsd-ambit-card__title{
  display: block;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.1;
}

.fcsd-ambit-card__desc{
  display: block;
  margin-top: 0;
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.15;
  font-weight: 700;
  opacity: .95;
  max-width: 28ch;
}

.fcsd-ambit-card__count{
  display: block;
  margin-top: 0;
  font-size: 14px;
  opacity: .9;
}

.fcsd-ambit-card__cta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  padding: 10px 18px;
  margin-top: auto;
  padding-top: 12px;
  font-weight: 800;
  font-size: clamp(14px, 1.1vw, 18px);
  border-radius: 12px;
  border: 2px solid var(--accent);
  color: var(--text, #111);
  background: transparent;

  /* Ensure CTA isn't underlined either */
  text-decoration: none;
}


/* Keep 2 columns on mobile (no single-column breakpoint here). */

.fcsd-ambits--dark{
  position: relative;
  /* deja aire para que el “corte” no se coma el título */
  padding-top: clamp(3rem, 4vw, 5rem);
}

/* La pieza se dibuja por encima del inicio de la sección oscura */
.fcsd-wave-cut{
  --wave-h: 64px;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: var(--wave-h);
  transform: translateY(calc(-1 * var(--wave-h)));
  pointer-events: none;
  z-index: 2;
}

.fcsd-wave-cut svg{
  display: block;
  width: 100%;
  height: 100%;
}

.fcsd-wave-cut__fill{
  /* Never hardcode: it must adapt to contrast / dark mode */
  fill: var(--bg);
}
/* Trazo en accent */
.fcsd-wave-cut__stroke{
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

@media (max-width: 768px){
  .fcsd-wave-cut{ --wave-h: 48px; }
}

.fcsd-ambit-card:hover .fcsd-ambit-card__title,
.fcsd-ambit-card:focus-visible .fcsd-ambit-card__title{
  color: var(--ambit-primary, var(--accent));
}
