@font-face {
  font-family: 'SourceSans';
  src: url('fonts/SourceSansPro-Regular.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'SourceSans';
  src: url('fonts/SourceSansPro-Bold.ttf') format('truetype');
  font-weight: 700;
}
@font-face {
  font-family: 'SourceSans';
  src: url('fonts/SourceSansPro-Black.ttf') format('truetype');
  font-weight: 900;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: 'SourceSans', 'Arial', sans-serif;
  background-color: #05101e;
  background-image: url('bg.png');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #ffffff;
  margin: 0;
  padding: 0;
}

/* ─── PAGE LAYOUT ─── */

.page-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Logo — sempre a dalt */
.site-header {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 0;
}

.logo {
  background-color: #033087;
  padding: 0;
}

.logo img {
  display: block;
  width:180px;
}

/* Text + vídeos — sempre al mig */
.middle-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 1rem 32px;
  min-height: 0;
  width: 100%;
}

/* Títols */
.header-titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
  width: 100%;
}

.header-titles h1 {
  font-size: 3.6rem;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.1;
}

.header-titles h2 {
  font-size: 1.7rem;
  font-weight: 500;
  color: #ffffff;
}

.header-desc {
  font-size: 1.2rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.15rem;
}

/* Grid */
main {
  width: 100%;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem 2rem;
  max-width: 750px;
  margin: 0 auto;
}

/* Targeta */
.video-item {
  background: #BAC2D5;
  border-radius: 10px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-label {
  font-size: 1.15rem;
  font-weight: 500;
  color: #033087;
  letter-spacing: 0.02em;
}

.video-label strong {
  font-weight: 700;
}

/* Vídeo */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 6px;
  overflow: hidden;
}

.video-thumb {
  position: absolute;
  inset: 0;
  background-color: #ffffff;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  cursor: pointer;
  transition: filter 0.2s ease;
  padding: 10px;
}

.video-thumb:hover {
  filter: brightness(0.88);
}

.video-thumb:not([style]) {
  background-color: #002B7F;
}

.play-btn {
  /*display: none;*/
  background-color: #033087;
  aspect-ratio: 1 / 1;
  width: 50px;
  border-radius: 100%;
  height: 50px;
}


.play-btn svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

/* Footer — sempre a baix */
.site-footer {
  flex-shrink: 0;
  background-color: #033087;
  padding: 0;
  display: flex;
  align-items: center;
}

.footer-logo img {
  display: block;
  width:100px;
}

/* ─── LIGHTBOX ─── */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.88);
  animation: lb-fade-in 0.25s ease;
}

.lightbox-container {
  position: relative;
  width: min(90vw, 160vh);
  width: min(90vw, 160dvh);
  z-index: 1;
  animation: lb-scale-in 0.25s ease;
}

.lightbox-iframe-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}

.lightbox-iframe-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.lightbox-close {
  position: absolute;
  top: -42px;
  right: 0;
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.35);
}

@keyframes lb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes lb-scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── TABLET VERTICAL: més espai entre text i vídeos ─── */
@media (orientation: portrait) and (min-width: 601px) {
  .middle-content {
    gap: 3.5rem;
  }
}

/* ─── TABLET PORTRAIT ─── */
@media (orientation: portrait) and (min-width: 601px) {
  .middle-content {
    justify-content: flex-start;
    padding-top: 5rem;
  }
}

/* ─── IPAD 11 ─── */
@media (max-width: 1180px) {
  .video-grid {
    max-width: 630px;
  }

  .header-titles h1 {
    font-size: 3rem;
    line-height: 3rem;
  }
  .play-btn {
    width: 40px;
    height: 40px;
  }
}


/* ─── IPAD mini ─── */
@media (max-width: 1134px) {
  .video-grid {
    max-width: 600px;
  }
  .header-titles h1 {
    font-size: 2.6rem;
    line-height: 2.6rem;
  }
  .play-btn {
    width: 30px;
    height: 30px;
  }
}



/* ─── MOBILE ─── */
@media (max-width: 600px) {
  .site-header {
    padding: 16px 20px 12px;
  }

  .logo {
    padding: 5px 10px;
  }

  .logo span {
    font-size: 1.05rem;
    letter-spacing: 2px;
  }

  .middle-content {
    padding: 0.75rem 20px;
    gap: 1.5rem;
  }

  .header-titles h1 {
    font-size: 1.75rem;
  }

  .header-titles h2 {
    font-size: 1rem;
  }

  .header-desc {
    font-size: 0.8rem;
  }

  .video-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 1rem;
  }

  .video-label {
    font-size: 1rem;
  }

  .site-footer {
    padding: 10px 20px;
  }

  .footer-logo span {
    font-size: 0.95rem;
  }
}
