/* ================================================================
   LA OFICINA — Voluntariat Esportiu de València · Brand Book 2026
   page-la-oficina.php
   ================================================================ */

:root {
  --of-bar-h: 46px;
}

html:has(.of-anchors) {
  scroll-padding-top: calc(var(--of-bar-h, 46px) + 1rem);
}
@media (max-width: 1024px) {
  html:has(.of-anchors) {
    scroll-padding-top: calc(58px + var(--of-bar-h, 46px) + 1rem);
  }
}


/* ================================================================
   BARRA DE ANCLAS — sticky bajo el nav principal
   ================================================================ */

.of-anchors {
  position: sticky;
  top: 0;
  z-index: 80;
  background: white;
  border-bottom: 0.5px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
}

.of-anchors__inner {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}
.of-anchors__inner::-webkit-scrollbar { display: none; }

.of-anchors__link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
  padding: 0 1rem;
  height: var(--of-bar-h, 46px);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color 150ms, border-color 150ms;
}
.of-anchors__link i {
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 150ms;
}
.of-anchors__link:hover { color: var(--text); }
.of-anchors__link:hover i { opacity: 1; }
.of-anchors__link.is-active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}
.of-anchors__link.is-active i { opacity: 1; }

@media (max-width: 1024px) {
  .of-anchors { top: 58px; }
}


/* ================================================================
   LAYOUT PRINCIPAL — contenido + aside
   ================================================================ */

.of-layout {
  display: grid;
  grid-template-columns: 1fr 252px;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.of-content {
  min-width: 0;
  padding-bottom: 4rem;
}


/* ================================================================
   ASIDE — "En esta página"
   ================================================================ */

.of-aside {
  position: sticky;
  top: calc(var(--topbar-h, 54px) + var(--of-bar-h, 46px) + 2rem);
  background: var(--light);
  border-radius: 14px;
  padding: 1.5rem;
  margin-top: 3rem;
}

.of-aside__label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.of-aside__nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.of-aside__link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 150ms, color 150ms;
  border-left: 2px solid transparent;
}
.of-aside__link:hover {
  background: var(--bg-secondary);
  color: var(--text);
}
.of-aside__link.is-active {
  background: rgba(245, 161, 0, 0.1);
  color: var(--orange);
  border-left-color: var(--orange);
  font-weight: 600;
}
.of-aside__link i {
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}
.of-aside__link.is-active i { opacity: 1; }

.of-aside-contact {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 0.5px solid var(--border);
}

.of-aside-contact__label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.of-aside-contact__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color 150ms;
  word-break: break-all;
}
.of-aside-contact__item:hover { color: var(--brand); }
.of-aside-contact__item i { font-size: 14px; flex-shrink: 0; }


/* ================================================================
   SECCIONES DE CONTENIDO
   ================================================================ */

.of-section {
  padding: 3.5rem 0;
  border-bottom: 0.5px solid var(--border);
}
.of-section--last,
.of-section:last-child { border-bottom: none; }

.of-section__label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--orange);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.of-section__label::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--orange);
  flex-shrink: 0;
}

.of-section__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

/* Prosa (texto enriquecido) */
.of-prose {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.75;
}
.of-prose p { margin: 0 0 1em; }
.of-prose p:last-child { margin-bottom: 0; }
.of-prose strong { color: var(--text); font-weight: 600; }
.of-prose a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}


/* ================================================================
   MISIÓN — tarjeta oscura destacada
   ================================================================ */

.of-mision-card {
  background: var(--dark);
  border-radius: 20px;
  padding: 0;
  position: relative;
  overflow: hidden;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
}
.of-mision-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 100% at 0% 100%, rgba(201, 35, 29, 0.28) 0%, transparent 60%);
  pointer-events: none;
}

/* Cabecera de la tarjeta con icono + etiqueta */
.of-mision-card__header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1.25rem 2rem 0;
  position: relative;
  z-index: 1;
}
.of-mision-card__header-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(201, 35, 29, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.of-mision-card__header-icon i {
  font-size: 17px;
  color: var(--orange);
}
.of-mision-card__header-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* Divisor decorativo */
.of-mision-card__divider {
  height: 0.5px;
  background: rgba(255, 255, 255, 0.1);
  margin: 1rem 2rem 0;
  position: relative;
  z-index: 1;
}
.of-mision-card__divider::after {
  content: '';
  position: absolute;
  left: 0;
  top: -0.5px;
  width: 48px;
  height: 2px;
  background: var(--orange);
  border-radius: 2px;
}

.of-mision-card__wm {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(7rem, 14vw, 9rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.045);
  user-select: none;
  pointer-events: none;
  letter-spacing: -0.03em;
}

.of-mision-card__inner {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.5;
  color: white;
  letter-spacing: -0.01em;
  padding: 1.375rem 2rem 2.25rem;
}
.of-mision-card__inner p { margin: 0; }


/* ================================================================
   FUNCIONES — grid de tarjetas con icono y título
   ================================================================ */

.of-funciones-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
  margin-top: 0.5rem;
}

.of-funcion-card {
  background: var(--light);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  transition: border-color 150ms, background 150ms, transform 150ms;
}
.of-funcion-card:hover {
  border-color: var(--brand);
  background: white;
  transform: translateY(-2px);
}

.of-funcion-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(201, 35, 29, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 0.375rem;
}
.of-funcion-card__icon i {
  font-size: 20px;
  color: var(--brand);
}

.of-funcion-card__title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin: 0;
}

.of-funcion-card__text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}


/* ================================================================
   COLABORADORES — strip horizontal bajo el origen
   ================================================================ */

.of-colabs {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 0.5px solid var(--border);
}

.of-colabs__title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.of-colabs__strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
}

.of-colab-link {
  display: block;
  transition: opacity 150ms;
}
.of-colab-link:hover { opacity: 0.72; }

.of-colab-logo {
  display: block;
  max-height: 40px;
  width: auto;
  object-fit: contain;
  filter: grayscale(20%);
}

.of-colab-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}


/* ================================================================
   DÓNDE ESTAMOS — grid info + mapa
   ================================================================ */

.of-contacto-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 1.75rem;
  align-items: stretch;
  margin-top: 0.5rem;
}

.of-contacto-list {
  list-style: none;
  margin: 0;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--light);
  border-radius: 16px;
  border: 0.5px solid var(--border);
}

.of-contacto-item {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}

.of-contacto-item__icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(201, 35, 29, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.of-contacto-item__icon i {
  font-size: 16px;
  color: var(--brand);
}

.of-contacto-item__text {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.6;
  padding-top: 6px;
}

.of-contacto-link {
  font-size: 0.9375rem;
  color: var(--brand);
  text-decoration: none;
  padding-top: 6px;
  display: inline-block;
  font-weight: 500;
  transition: opacity 150ms;
}
.of-contacto-link:hover { opacity: 0.75; }

.of-mapa {
  border-radius: 16px;
  overflow: hidden;
  border: 0.5px solid var(--border);
  height: 100%;
  min-height: 320px;
}
.of-mapa__iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: none;
}
.of-mapa-placeholder {
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 320px;
}
.of-mapa-placeholder svg {
  width: 160px;
  height: auto;
}


/* ================================================================
   CTA FINAL — sección de conversión oscura
   ================================================================ */

.of-cta {
  padding: 6rem clamp(1.5rem, 8vw, 7rem);
  background: var(--dark);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.of-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 80% at 50% 120%, rgba(201, 35, 29, 0.3) 0%, transparent 65%),
    radial-gradient(ellipse 40% 50% at 80% 20%, rgba(27, 87, 160, 0.18) 0%, transparent 60%);
  pointer-events: none;
}

.of-cta__inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.of-cta__label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.of-cta__label::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.of-cta__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: white;
  margin: 0;
}

.of-cta__desc {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  max-width: 52ch;
  margin: 0;
}

.of-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--brand);
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background 150ms, transform 150ms, box-shadow 150ms;
  margin-top: 0.5rem;
}
.of-cta__btn:hover {
  background: var(--brand-dark, #9E1B16);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201, 35, 29, 0.4);
}
.of-cta__btn i { font-size: 1.1em; }


/* ================================================================
   SCROLL REVEAL — compartido con homepage
   ================================================================ */

.hp-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0, 0, 0.2, 1), transform 0.5s cubic-bezier(0, 0, 0.2, 1);
}
.hp-reveal.hp-visible {
  opacity: 1;
  transform: translateY(0);
}
.hp-reveal[data-delay="1"] { transition-delay: 80ms; }
.hp-reveal[data-delay="2"] { transition-delay: 160ms; }
.hp-reveal[data-delay="3"] { transition-delay: 240ms; }
.hp-reveal[data-delay="4"] { transition-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  .hp-reveal { opacity: 1; transform: none; transition: none; }
}


/* ================================================================
   RESPONSIVE
   ================================================================ */

/* ── ≤ 1024px — colapsar aside, ajustar nav sticky ───────────── */
@media (max-width: 1024px) {
  .of-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .of-aside { display: none; }
  .of-content { padding-bottom: 3rem; }

  /* La navbar sticky mide ~58px en tablet/móvil */
  .of-anchors { top: 58px; }
  html:has(.of-anchors) {
    scroll-padding-top: calc(58px + var(--of-bar-h, 46px) + 1rem);
  }
}

/* ── ≤ 768px ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .of-section { padding: 2.5rem 0; }
  .of-content { padding-bottom: 2rem; }

  /* Anclas: reducir algo para que quepan los 5 items */
  .of-anchors__link {
    padding: 0 0.75rem;
    font-size: 11px;
  }

  /* Contacto: apilar info + mapa en columna */
  .of-contacto-grid {
    grid-template-columns: 1fr;
    align-items: start;
  }

  /* Mapa: altura fija al ocupar ancho completo */
  .of-mapa { height: auto; min-height: 0; }
  .of-mapa__iframe,
  .of-mapa-placeholder { height: 280px; min-height: 0; }

  /* Touch targets para los links de contacto (min 44px) */
  .of-contacto-item {
    align-items: center;
    min-height: 44px;
  }
  .of-contacto-item__text { padding-top: 0; }
  .of-contacto-link {
    padding-top: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Colaboradores: logotipos más compactos */
  .of-colab-logo { max-height: 34px; }
}

/* ── ≤ 600px — funciones a columna única ──────────────────────── */
@media (max-width: 600px) {
  .of-funciones-grid { grid-template-columns: 1fr; }

  /* Tarjeta horizontal: icono a la izquierda, título + texto a la derecha */
  .of-funcion-card {
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.875rem;
    row-gap: 0.2rem;
  }
  .of-funcion-card__icon {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: start;
    margin-bottom: 0;
  }
  .of-funcion-card__title {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }
  .of-funcion-card__text {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }
}

/* ── ≤ 480px ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .of-section { padding: 2rem 0; }
  .of-section__title { font-size: 1.5rem; margin-bottom: 1.125rem; }

  /* Misión card */
  .of-mision-card { padding: 1.75rem 1.25rem; }
  .of-mision-card__wm { font-size: 5rem; right: 0.5rem; }
  .of-mision-card__inner { font-size: 1.05rem; }

  /* Anclas: comprimir al máximo para 5 items en 360px */
  .of-anchors__link {
    padding: 0 0.5rem;
    font-size: 10.5px;
    gap: 0.2rem;
  }
  .of-anchors__link i { font-size: 13px; }

  /* CTA */
  .of-cta { padding: 4rem 1.5rem; }
  .of-cta__btn {
    align-self: stretch;
    justify-content: center;
  }

  /* Colaboradores */
  .of-colabs__strip { gap: 1rem 1.5rem; }

  /* Mapa en móvil pequeño */
  .of-mapa__iframe,
  .of-mapa-placeholder { height: 240px; }

  /* Contacto: links con borde separador como ins */
  .of-contacto-list { gap: 0; padding: 1.25rem; }
  .of-contacto-item {
    border-bottom: 0.5px solid var(--border);
    padding: 0.25rem 0;
  }
  .of-contacto-item:last-child { border-bottom: none; }
}
