/* ==========================================================================
   FBB Descargas - acordeón de descargas
   Toma los colores del tema (the-league-fbb) con fallback propio.
   ========================================================================== */

.fbb-desc {
  --fbb-blue: var(--color-blue, #26a0da);
  --fbb-cyan: var(--color-cyan, #7acaba);
  --fbb-gray: var(--color-gray, #eaeceb);
  --fbb-ink: #1b1f23;
  --fbb-muted: #6b7480;
  --fbb-border: #dfe3e6;
  --fbb-surface: #fff;
  --fbb-radius: 5px;

  margin: 0 0 30px;
  color: var(--fbb-ink);
}

.fbb-desc *,
.fbb-desc *::before,
.fbb-desc *::after {
  box-sizing: border-box;
}

.fbb-desc .fbb-desc-heading {
  font-family: "Barlow Condensed", "Oswald", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}

/* --------------------------------------------------------- Panel / item */

.fbb-desc-item {
  background: var(--fbb-surface);
  border: 1px solid var(--fbb-border);
  border-radius: var(--fbb-radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.fbb-desc-item.is-open {
  border-color: var(--fbb-blue);
  box-shadow: 0 6px 20px rgba(38, 160, 218, 0.12);
}

/* Especificidad extra: el tema le mete margen a los h3 del contenido. */
.fbb-desc .fbb-desc-item h3.fbb-desc-head {
  margin: 0 !important;
  padding: 0;
  font-size: inherit;
  line-height: normal;
}

.fbb-desc-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  color: var(--fbb-ink);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.fbb-desc-toggle:hover,
.fbb-desc-toggle:focus-visible {
  background: var(--fbb-gray);
  border-left-color: var(--fbb-cyan);
}

.fbb-desc-toggle:focus-visible {
  outline: 2px solid var(--fbb-blue);
  outline-offset: -2px;
}

.fbb-desc-item.is-open .fbb-desc-toggle {
  background: var(--fbb-blue);
  border-left-color: var(--fbb-cyan);
  color: #fff;
}

.fbb-desc-title {
  flex: 1 1 auto;
  font-family: "Barlow Condensed", "Oswald", sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.fbb-desc-count {
  flex: 0 0 auto;
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--fbb-gray);
  color: var(--fbb-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.fbb-desc-item.is-open .fbb-desc-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.fbb-desc-chevron {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  margin-right: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.3s ease;
}

.fbb-desc-item.is-open .fbb-desc-chevron {
  transform: rotate(-135deg) translate(-3px, -3px);
}

/* ------------------------------------------------------ Panel animado */

.fbb-desc-panel {
  overflow: hidden;
  height: auto;
}

/* Sólo con JS activo el panel se anima; sin JS queda siempre visible. */
.fbb-desc.is-js .fbb-desc-panel {
  height: 0;
  transition: height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.fbb-desc.is-js .fbb-desc-item.is-open .fbb-desc-panel {
  height: auto;
}

.fbb-desc-panel[hidden] {
  display: block;
}

.fbb-desc.is-js .fbb-desc-panel[hidden] {
  display: none;
}

.fbb-desc-panel-in {
  padding: 6px 18px 18px;
}

.fbb-desc-cat-desc {
  margin: 8px 0 14px;
  color: var(--fbb-muted);
  font-size: 15px;
}

.fbb-desc-none {
  margin: 10px 0;
  color: var(--fbb-muted);
  font-style: italic;
}

/* ------------------------------------------------------ Lista de archivos */

.fbb-desc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fbb-desc-list li {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.fbb-desc-list li:last-child {
  margin-bottom: 0;
}

.fbb-desc-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--fbb-border);
  border-radius: var(--fbb-radius);
  background: #fff;
  color: var(--fbb-ink);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.fbb-desc-link:hover,
.fbb-desc-link:focus-visible {
  transform: translateX(3px);
  border-color: var(--fbb-blue);
  background: #f7fbfd;
  box-shadow: 0 4px 14px rgba(27, 31, 35, 0.08);
  color: var(--fbb-ink);
  text-decoration: none;
}

.fbb-desc-link:focus-visible {
  outline: 2px solid var(--fbb-blue);
  outline-offset: 2px;
}

/* Ícono del archivo */

.fbb-desc-thumb {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--fbb-radius);
  background: var(--fbb-gray);
  color: var(--fbb-muted);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.fbb-desc-icon {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.fbb-desc-icon-fold {
  opacity: 0.35;
}

.fbb-desc-icon-sheet {
  fill: currentColor;
  opacity: 0.16;
}

.fbb-desc-link:hover .fbb-desc-thumb,
.fbb-desc-link:focus-visible .fbb-desc-thumb {
  background: var(--fbb-blue);
  color: #fff;
}

/* Colores por tipo de archivo */
.fbb-kind-pdf .fbb-desc-thumb { color: #c0392b; }
.fbb-kind-word .fbb-desc-thumb { color: #2b5797; }
.fbb-kind-excel .fbb-desc-thumb { color: #1d7044; }
.fbb-kind-powerpoint .fbb-desc-thumb { color: #c0561a; }
.fbb-kind-zip .fbb-desc-thumb { color: #8a6d1f; }
.fbb-kind-imagen .fbb-desc-thumb { color: #6d3fa0; }
.fbb-kind-video .fbb-desc-thumb { color: #b0246b; }
.fbb-kind-audio .fbb-desc-thumb { color: #17807a; }

/* Texto */

.fbb-desc-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fbb-desc-name {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}

.fbb-desc-excerpt {
  color: var(--fbb-muted);
  font-size: 13px;
  line-height: 1.35;
}

.fbb-desc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--fbb-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fbb-desc-badge {
  padding: 1px 7px;
  border-radius: 3px;
  background: var(--fbb-gray);
  color: #4a5560;
  font-weight: 700;
}

.fbb-desc-filename {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}

/* Flecha de descarga */

.fbb-desc-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--fbb-gray);
  color: var(--fbb-blue);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.fbb-desc-cta svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fbb-desc-link:hover .fbb-desc-cta,
.fbb-desc-link:focus-visible .fbb-desc-cta {
  background: var(--fbb-blue);
  color: #fff;
  transform: translateY(2px);
}

.fbb-desc-empty {
  padding: 14px 16px;
  border: 1px dashed #c9cfd4;
  border-radius: 5px;
  background: #fafbfc;
  color: #6b7480;
}

/* ------------------------------------------------------------- Responsive */

@media screen and (max-width: 600px) {
  .fbb-desc-toggle {
    padding: 14px;
    gap: 8px;
  }

  .fbb-desc-title {
    font-size: 19px;
  }

  .fbb-desc-panel-in {
    padding: 6px 12px 14px;
  }

  .fbb-desc-link {
    gap: 10px;
    padding: 10px;
  }

  .fbb-desc-thumb {
    width: 38px;
    height: 38px;
  }

  .fbb-desc-icon {
    width: 22px;
    height: 22px;
  }

  .fbb-desc-cta {
    width: 28px;
    height: 28px;
  }

  .fbb-desc-excerpt {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fbb-desc *,
  .fbb-desc *::before,
  .fbb-desc *::after {
    transition-duration: 0.01ms !important;
  }
}
