/* Tipografías propias (licencia OFL en resources/), las mismas que servía Google Fonts: fuentes variables, subconjunto latino */
@font-face { font-family: 'Big Shoulders Display'; font-weight: 600 800; font-style: normal; font-display: swap; src: url('../resources/fonts/big-shoulders-display.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400 600; font-style: normal; font-display: swap; src: url('../resources/fonts/ibm-plex-sans.woff2') format('woff2'); }

/* ==========================================================================
   Base: variables, reinicio y tipografía
   ========================================================================== */
:root {
  --dark: #141414;
  --dark-2: #1D1D1D;
  --dark-3: #232323;
  --dark-line: #333333;
  --on-dark: #F4F4F2;
  --on-dark-muted: #A8A8A3;
  --on-dark-faint: #75736B;
  --accent: #DA862F;

  /* Fondo de los huecos de foto y vídeo mientras no hay material real */
  --placeholder-bg: linear-gradient(160deg, #2A2A2A, #101010);
  --fade-clear: #14141400;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--dark);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: var(--on-dark);
}

h1, h2, h3 {
  font-family: 'Big Shoulders Display', system-ui, sans-serif;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

/* Escala única de títulos de sección */
h2, .section-head h1 { font-size: 36px; }

a { color: inherit; text-decoration: none; }

.kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.kicker--accent { color: var(--accent); }
.kicker--faint { color: var(--on-dark-faint); }

/* ==========================================================================
   Estructura de página y botones
   ========================================================================== */
.wrap { width: 100%; min-height: 100vh; display: flex; flex-direction: column; background: var(--dark); }
.section { padding: 100px 56px 0; }
.section:last-of-type { padding-bottom: 120px; }
.section--top { padding-top: 64px; }

/* Título de sección con línea naranja debajo; puede llevar un texto de apoyo a la derecha o debajo */
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px;
  padding-bottom: 20px; margin-bottom: 36px; border-bottom: 2px solid var(--accent);
}
.section-head__text { flex-basis: 100%; margin: 0; font-size: 15px; color: var(--on-dark-muted); }

.accent-bar { width: 44px; height: 6px; background: var(--accent); }

/* Introducción de cada página: título a la izquierda y texto a la derecha */
.intro { display: flex; gap: 64px; }
.intro__title { flex: 1; }
.intro__title .accent-bar { margin-bottom: 16px; }
.intro__text { flex: 1.4; display: flex; flex-direction: column; gap: 18px; }
.intro__text p { margin: 0; font-size: 16px; line-height: 1.7; color: var(--on-dark-muted); }
.intro__text a, .article a, .faq a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.intro__text a:hover, .article a:hover, .faq a:hover { color: var(--on-dark); }

/* ==========================================================================
   Blog: listado y artículo
   ========================================================================== */
/* Listado: tarjeta con foto, categoría, título y extracto; comparte borde y resalte con las demás tarjetas */
.post-card__img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card__body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 22px 24px 26px; }
.post-card h3 { font-size: 24px; line-height: 1.1; }
.post-card p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--on-dark-muted); }
.post-card__cta { margin-top: auto; padding-top: 6px; color: var(--accent); }

.article { max-width: 800px; margin: 0 auto; }
.article h1 { margin: 12px 0 28px; font-size: clamp(36px, 5vw, 56px); font-weight: 800; line-height: 1.08; }
.article__cover { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 36px; }
.article h2 { margin: 44px 0 14px; font-size: 28px; }
.article p, .article li { font-size: 17px; line-height: 1.7; color: var(--on-dark-muted); }
.article p { margin: 0 0 16px; }
.article ul { margin: 0 0 16px; padding-left: 22px; }
.article li { margin-bottom: 6px; }
.summary { margin: 28px 0 0; padding: 24px 28px; background: var(--dark-2); border-left: 3px solid var(--accent); }
.article table { width: 100%; margin: 0 0 16px; border-collapse: collapse; font-size: 15px; color: var(--on-dark-muted); }
.article th, .article td { padding: 10px 12px; border: 1px solid var(--dark-line); text-align: left; vertical-align: top; }
.article th { color: var(--on-dark); }
.summary ul { margin: 12px 0 0; }
.summary li { color: var(--on-dark); }

.btn-accent, .btn-line { padding: 10px 20px; border-radius: 2px; font-weight: 700; cursor: pointer; transition: filter 0.2s ease, background-color 0.2s ease, color 0.2s ease; }
.btn-accent { background: var(--accent); color: var(--dark); border: none; }
.btn-accent:hover { filter: brightness(1.12); }
.btn-line { background: transparent; color: var(--on-dark); border: 1px solid var(--accent); }
.btn-line:hover { background: var(--accent); color: var(--dark); }
.btn-lg { align-self: flex-start; padding: 14px 26px; font-size: 15px; }

/* ==========================================================================
   Navegación
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 56px;
  background: rgba(20, 20, 20, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--dark-line);
}
/* Con la barra de administración de WordPress visible (solo editores), el menú fijo baja debajo de ella */
.admin-bar .nav { top: 32px; }
.nav .brand { display: flex; align-items: center; gap: 12px; }
.brand__logo { display: block; height: 36px; width: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.nav .brand-name { font-family: 'Big Shoulders Display', system-ui, sans-serif; font-weight: 700; font-size: 22px; letter-spacing: 0.02em; color: var(--on-dark); }
.nav .brand-tag { font-size: 11px; color: var(--on-dark-muted); letter-spacing: 0.08em; margin-top: 2px; }
.nav .links { display: flex; align-items: center; gap: 32px; font-size: 13px; letter-spacing: 0.03em; color: var(--on-dark-muted); text-transform: uppercase; }
.nav .links a[aria-current="page"] { color: var(--accent); }
.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 0; background: none; cursor: pointer;
  border: 1px solid var(--dark-line); border-radius: 2px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--on-dark); transition: transform 0.2s ease, opacity 0.2s ease; }
.nav.is-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero partido: título a la izquierda fundido con el vídeo o la imagen
   ========================================================================== */
.hero-split { position: relative; overflow: hidden; background: var(--dark); }
.hero-split__media { margin-left: auto; width: 68%; background: #0D0D0D; }
.hero-split__media video, .hero-split__media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-split__text {
  position: absolute; top: 0; bottom: 0; left: 0; z-index: 1; width: 62%; padding: 40px 120px 40px 56px;
  display: flex; flex-direction: column; justify-content: center; gap: 20px;
  background: linear-gradient(90deg, var(--dark) 0%, var(--dark) 55%, var(--fade-clear) 100%);
}
.hero-split__kicker { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.hero-split__kicker::before { content: ''; width: 26px; height: 3px; background: var(--accent); }
.hero-split__text h1 { font-size: clamp(44px, 6.4vw, 92px); font-weight: 800; line-height: 1.08; color: var(--on-dark); }
.hero-split__text h1 span { display: block; }

/* ==========================================================================
   Tarjetas de servicio
   ========================================================================== */
.card-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 20px; }
/* Con menos tarjetas que columnas: centradas y con el mismo ancho que en la rejilla de cuatro */
.card-grid--centered { display: flex; flex-wrap: wrap; justify-content: center; }
.card-grid--centered > * { flex: 0 0 calc((100% - 3 * 20px) / 4); }

.card {
  display: flex; flex-direction: column; gap: 14px; padding: 26px;
  background: var(--dark-2); border-top: 5px solid var(--dark-line);
  transition: border-top-color 0.2s ease;
}
.card:hover { border-top-color: var(--accent); }
.card h3 { font-size: 21px; color: var(--on-dark); }
.card p { font-size: 14px; color: var(--on-dark-muted); line-height: 1.6; margin: 0; }
.card__cta { margin-top: auto; font-size: 13px; font-weight: 700; color: var(--accent); }

/* Resalte exclusivo: la primera tarjeta lleva el color mientras el ratón no está sobre ninguna; al pasarlo, lo toma la señalada */
.card-grid > :first-child { border-top-color: var(--accent); }
.card-grid:has(> :hover) > :not(:hover) { border-top-color: var(--dark-line); }

/* Tarjeta con título sobre una foto atenuada que se ve entera, con su ejemplo, al pasar el ratón */
.reveal-card, .post-card {
  display: flex; flex-direction: column;
  background: var(--dark-2); border-top: 5px solid var(--dark-line); transition: border-top-color 0.2s ease;
}
.reveal-card:hover, .reveal-card:focus-within, .post-card:hover, .post-card:focus-visible { border-top-color: var(--accent); outline: none; }
.reveal-card__media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; }
.reveal-card__title {
  position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 24px; font-size: 28px; color: var(--on-dark); text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
  transition: opacity 0.3s ease;
}
.reveal-card__photo {
  position: absolute; inset: 0; opacity: 0.3; transition: opacity 0.3s ease;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--placeholder-bg); color: var(--on-dark-faint); font-size: 12px;
}
.reveal-card__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reveal-card__caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 20px 18px; text-align: left;
  background: linear-gradient(180deg, var(--fade-clear) 0%, #141414F2 100%); color: var(--on-dark); font-size: 14px; line-height: 1.4;
  opacity: 0; transition: opacity 0.3s ease;
}
.reveal-card__caption .kicker { display: block; color: var(--accent); margin-bottom: 4px; }
.reveal-card__text { margin: 0; padding: 22px 24px 26px; font-size: 14px; line-height: 1.6; color: var(--on-dark-muted); }
.reveal-card:hover .reveal-card__photo, .reveal-card:focus-within .reveal-card__photo,
.reveal-card:hover .reveal-card__caption, .reveal-card:focus-within .reveal-card__caption { opacity: 1; }
.reveal-card:hover .reveal-card__title, .reveal-card:focus-within .reveal-card__title { opacity: 0; }

/* Sin ratón (pantallas táctiles): la foto y el ejemplo se ven siempre, con el título arriba */
@media (hover: none) {
  .reveal-card__photo, .reveal-card__caption { opacity: 1; }
  .reveal-card__title {
    inset: 0 0 auto 0; justify-content: flex-start; text-align: left; padding: 16px 20px; font-size: 22px;
    background: linear-gradient(180deg, #141414E6 0%, var(--fade-clear) 100%);
  }
}

/* ==========================================================================
   Equipo
   ========================================================================== */
.team-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.team-photo {
  width: 100%; aspect-ratio: 1; overflow: hidden; background: var(--dark-2);
  border-bottom: 4px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--on-dark-faint); font-size: 13px;
}
.team-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.team-member { display: flex; flex-direction: column; gap: 14px; }
.team-name { font-weight: 600; font-size: 15px; }
.team-role { font-size: 13px; color: var(--on-dark-muted); }

/* ==========================================================================
   Contacto y formulario
   ========================================================================== */
.contact, .cta-band { background: var(--dark-2); margin-top: 100px; border-top: 2px solid var(--accent); }
.contact { padding: 100px 56px; }
/* Cierre breve de las páginas de servicio, con la misma banda que el contacto de la home */
.cta-band { padding: 72px 56px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px 40px; }
.cta-band p { margin: 12px 0 0; font-size: 15px; line-height: 1.6; color: var(--on-dark-muted); }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 16px; }
.contact-info { display: flex; flex-direction: column; gap: 24px; }
.contact-info__intro { max-width: 420px; font-size: 15px; line-height: 1.6; color: var(--on-dark-muted); }
.contact-list { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; font-size: 15px; }
.contact-list__item { display: flex; align-items: center; gap: 12px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.contact form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--on-dark-muted); }
/* Formulario de WordPress (Contact Form 7): envuelve cada campo y añade sus propios avisos */
.field .wpcf7-form-control-wrap { display: block; }
.field--check { font-size: 13px; color: var(--on-dark-muted); }
.field--check a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.field--check .wpcf7-list-item { margin: 0; }
.form-info { margin: 0; font-size: 12px; line-height: 1.5; color: var(--on-dark-muted); }
.wpcf7-not-valid-tip { margin-top: 4px; font-size: 12px; color: var(--accent); }
.wpcf7-response-output { margin: 0 !important; padding: 12px 14px !important; border: 1px solid var(--accent) !important; font-size: 13px; color: var(--on-dark); }
.field input:not([type=checkbox]), .field textarea {
  width: 100%;
  background: var(--dark); border: 1px solid var(--dark-line); border-radius: 2px;
  padding: 12px 14px; color: var(--on-dark); font-size: 14px; font-family: inherit;
}

/* ==========================================================================
   Preguntas frecuentes
   ========================================================================== */
.faq { max-width: 800px; }
.faq h2 { margin-bottom: 28px; }
.faq details { padding: 22px 0; border-top: 1px solid var(--dark-line); }
.faq details:last-child { border-bottom: 1px solid var(--dark-line); }
.faq summary { cursor: pointer; font-size: 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; color: var(--on-dark); transition: color 0.2s ease; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent); }
.faq summary .plus { color: var(--accent); font-weight: 700; }
.faq p { font-size: 14px; color: var(--on-dark-muted); line-height: 1.6; margin-top: 12px; }

/* ==========================================================================
   Página de error
   ========================================================================== */
.error-page { flex: 1; max-width: 720px; margin: 0 auto; text-align: center; }
.error-page h1 { margin-top: 12px; font-size: clamp(44px, 8vw, 92px); font-weight: 800; line-height: 1.08; }
.error-page p { margin: 20px 0 32px; font-size: 17px; line-height: 1.7; color: var(--on-dark-muted); }
.error-page__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }

/* ==========================================================================
   Pie
   ========================================================================== */
.footer { padding: 40px 56px; background: var(--dark-2); border-top: 1px solid var(--dark-line); display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--on-dark-muted); }
.footer .social, .footer__legal { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer a:hover { color: var(--accent); }

/* ==========================================================================
   Pantallas estrechas
   ========================================================================== */
@media (max-width: 900px) {
  .nav { padding: 14px 24px; }
  .admin-bar .nav { top: 46px; }
  .nav-toggle { display: flex; }
  .nav .links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 24px 24px;
    background: var(--dark); border-bottom: 1px solid var(--dark-line);
  }
  .nav.is-open .links { display: flex; }
  .nav .links a { width: 100%; padding: 14px 0; }
  .nav .links .btn-accent { width: auto; margin-top: 12px; padding: 12px 20px; }
  .section { padding-left: 24px; padding-right: 24px; }
  .cta-band, .contact { padding-left: 24px; padding-right: 24px; }
  .intro { flex-direction: column; gap: 28px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 16px; padding: 32px 24px; }
  /* Tarjetas y equipo: una por fila en móvil y dos en tabletas, sin tamaños fijos por pantalla */
  .card-grid, .team-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
  .card-grid--centered > * { flex: 0 1 min(100%, 340px); }
  .hero-split { display: flex; flex-direction: column; }
  .hero-split__text { position: static; width: 100%; padding: 40px 24px; background: var(--dark); }
  .hero-split__text h1 { font-size: 52px; }
  .hero-split__media { width: 100%; }
  .contact-grid { grid-template-columns: 1fr; }
}
