/*
Theme Name: BNI Progresa
Description: Directorio de miembros de BNI AST Progresa. Tema propio, sin constructores.
Author: Álvaro Poggi
Author URI: https://alvaropoggi.com
Version: 1.1.2
Requires PHP: 8.0
Text Domain: bni-progresa
*/

@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --bni: #c81c2d;
  --bni-dark: #9e1322;
  --ink: #17151a;
  --muted: #6b6670;
  --paper: #f6f3ef;
  --line: #e4dfd8;
  --wrap: 72rem;
  --gutter: 1rem;
}

@media (min-width: 640px) {
  :root { --gutter: 1.5rem; }
}

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

:where(body, h1, h2, p, ul, figure) { margin: 0; padding: 0; }
:where(ul) { list-style: none; }
:where(a) { color: inherit; text-decoration: none; }
:where(img) { display: block; max-width: 100%; height: auto; }
:where(button, input) { font: inherit; color: inherit; }

html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.display {
  font-stretch: 78%;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.92;
  text-transform: uppercase;
}

.icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

/* ---------- Cabecera y pie ---------- */

.cabecera { display: flex; align-items: center; justify-content: space-between; padding-block: 1.25rem; }
.marca { display: flex; align-items: center; gap: 0.75rem; }
.marca img { height: 1.75rem; width: auto; }
.marca__barra { width: 1px; height: 1.75rem; background: rgb(23 21 26 / 0.25); transform: rotate(20deg); }
.marca__texto { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.025em; line-height: 1.25; }
.marca__texto span { font-weight: 400; color: var(--muted); }
.cabecera__lugar { display: none; font-size: 0.875rem; color: var(--muted); }
@media (min-width: 640px) { .cabecera__lugar { display: block; } }

.pie {
  margin-top: 6rem; border-top: 1px solid var(--line);
  padding-block: 2rem; font-size: 0.875rem; color: var(--muted);
}
.pie__fila { display: flex; flex-direction: column; justify-content: space-between; gap: 0.5rem; }
.pie a { color: var(--ink); text-underline-offset: 4px; }
.pie a:hover { text-decoration: underline; }
@media (min-width: 640px) { .pie__fila { flex-direction: row; } }

/* ---------- Portada ---------- */

.hero { padding-top: 1.5rem; padding-bottom: 2.5rem; }
@media (min-width: 640px) { .hero { padding-top: 3rem; padding-bottom: 3.5rem; } }

.pastilla {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;
  border-radius: 999px; background: rgb(200 28 45 / 0.1); padding: 0.25rem 0.75rem;
  font-size: 13px; font-weight: 600; color: var(--bni);
}
.pastilla::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--bni); }

.hero h1 { max-width: 56rem; font-size: clamp(2.6rem, 8vw, 5.6rem); }
.hero h1 em { font-style: normal; color: var(--bni); }
.hero p { margin-top: 1.25rem; max-width: 36rem; font-size: 1.125rem; line-height: 1.625; color: var(--muted); }

/* Buscador */
.buscador { display: flex; align-items: center; gap: 0.5rem; }
@media (min-width: 640px) { .buscador { gap: 0.75rem; } }
.buscador label { position: relative; flex: 1; min-width: 0; }
.buscador label .icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.buscador input {
  width: 100%; height: 3.25rem; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; padding: 0 1.25rem 0 3rem; font-size: 1rem; outline: none;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.buscador input:focus { border-color: rgb(23 21 26 / 0.4); box-shadow: 0 0 0 4px rgb(200 28 45 / 0.1); }
.boton-barajar {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; flex-shrink: 0;
  width: 3.25rem; height: 3.25rem; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.boton-barajar .icon { width: 1rem; height: 1rem; }
.boton-barajar span { display: none; }
.boton-barajar:hover { border-color: rgb(23 21 26 / 0.4); }
.boton-barajar:active { transform: scale(0.98); }
@media (min-width: 640px) {
  .boton-barajar { width: auto; padding-inline: 1.25rem; }
  .boton-barajar span { display: inline; }
}

/* Rejilla de logos */
.rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-top: 2rem; }
@media (min-width: 640px) { .rejilla { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } }
@media (min-width: 1024px) { .rejilla { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Sin JS se ve todo; con JS se oculta hasta barajar para que no salte el orden */
.js .rejilla:not(.lista) { opacity: 0; }

.tarjeta { display: block; border-radius: 1rem; outline: none; }
.tarjeta:focus-visible { box-shadow: 0 0 0 4px rgb(200 28 45 / 0.3); }
.tarjeta__logo {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3; overflow: hidden; border-radius: 1rem;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.04), 0 8px 24px -12px rgb(0 0 0 / 0.18), 0 0 0 1px rgb(0 0 0 / 0.05);
  transition: transform .3s, box-shadow .3s;
}
.tarjeta__logo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 12%;
  transition: transform .3s;
}
.tarjeta__logo::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: var(--bni);
  transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.tarjeta:hover .tarjeta__logo {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -16px rgb(0 0 0 / 0.35), 0 0 0 1px rgb(0 0 0 / 0.05);
}
.tarjeta:hover .tarjeta__logo img { transform: scale(1.04); }
.tarjeta:hover .tarjeta__logo::after { transform: scaleX(1); }
.tarjeta__nombre { padding: 0.75rem 0.25rem 0; font-size: 15px; font-weight: 600; line-height: 1.25; }
.tarjeta__esp { margin-top: 2px; padding-inline: 0.25rem; font-size: 13px; line-height: 1.375; color: var(--muted); }

.sin-resultados { margin-top: 2.5rem; text-align: center; color: var(--muted); }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.rise { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }

/* ---------- Ficha de miembro ---------- */

.volver {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 1.25rem;
  font-size: 0.875rem; color: var(--muted); transition: color .15s;
}
.volver .icon { width: 1rem; height: 1rem; }
.volver:hover { color: var(--ink); }

.ficha {
  display: grid; overflow: hidden; border-radius: 1.5rem; background: #fff;
  box-shadow: 0 30px 80px -40px rgb(0 0 0 / 0.35), 0 0 0 1px rgb(0 0 0 / 0.05);
}
@media (min-width: 768px) { .ficha { grid-template-columns: 1fr 1.1fr; } }

.stripes {
  background:
    repeating-linear-gradient(-55deg, transparent 0 70px, rgb(255 255 255 / 0.07) 70px 140px),
    linear-gradient(160deg, var(--bni) 0%, var(--bni-dark) 100%);
}

.ficha__foto {
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  min-height: 340px; overflow: hidden; padding-top: 2.5rem;
}
.ficha__fondo {
  position: absolute; left: -0.5rem; top: 1rem; color: rgb(255 255 255 / 0.1);
  font-size: clamp(5rem, 16vw, 10rem); pointer-events: none; user-select: none; white-space: nowrap;
}
.ficha__cargo {
  position: absolute; left: 1.25rem; top: 1.25rem; z-index: 1; border-radius: 999px; background: #fff;
  padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.025em; color: var(--bni);
}
.ficha__foto img {
  position: relative; height: 320px; width: auto; max-width: 92%; object-fit: contain; object-position: bottom;
  filter: drop-shadow(0 20px 30px rgb(0 0 0 / 0.35));
}
.ficha__foto img.apaisada { max-width: none; flex-shrink: 0; }
@media (min-width: 768px) {
  .ficha__foto { min-height: 560px; }
  .ficha__foto img { height: 520px; }
}

.ficha__datos { display: flex; flex-direction: column; padding: 1.5rem; }
@media (min-width: 640px) { .ficha__datos { padding: 2.5rem; } }
.ficha__esp { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bni); }
.ficha__datos h1 { margin-top: 0.75rem; font-size: clamp(2.4rem, 6vw, 4rem); overflow-wrap: anywhere; }

.empresa { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.empresa__logo {
  position: relative; width: 7rem; height: 4rem; flex-shrink: 0; overflow: hidden; border-radius: 0.75rem;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.05);
}
.empresa__logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 0.4rem; }
.empresa p { font-size: 1.125rem; font-weight: 500; line-height: 1.375; }

.acciones { display: grid; gap: 0.75rem; margin-top: 2rem; }
@media (min-width: 640px) {
  .acciones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accion--ancha { grid-column: span 2; }
}
.accion {
  display: flex; align-items: center; gap: 1rem; min-width: 0; border-radius: 1rem;
  border: 1px solid var(--line); background: #fff; padding: 0.875rem 1rem;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.accion:hover { border-color: rgb(23 21 26 / 0.3); box-shadow: 0 1px 2px rgb(0 0 0 / 0.05); }
.accion:active { transform: scale(0.99); }
.accion__icono {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; flex-shrink: 0; border-radius: 999px;
  background: var(--paper); color: var(--bni); transition: background .15s, color .15s;
}
.accion:hover .accion__icono { background: var(--bni); color: #fff; }
.accion__texto { min-width: 0; }
.accion__texto small { display: block; font-size: 13px; color: var(--muted); }
.accion__texto strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.redes { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.75rem; }
.red {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-width: 0;
  height: 3rem; border-radius: 1rem; border: 1px solid var(--line); background: #fff;
  font-size: 0.875rem; font-weight: 500; transition: border-color .15s, color .15s, background .15s;
}
.red .icon { color: var(--bni); transition: color .15s; }
.red:hover { border-color: var(--bni); background: var(--bni); color: #fff; }
.red:hover .icon { color: #fff; }
@media (max-width: 380px) { .red { font-size: 0; gap: 0; } }

.botones { display: flex; flex-direction: column; gap: 0.75rem; margin-top: auto; padding-top: 2rem; }
/* En columna (móvil) cada botón mantiene su alto; en fila se reparten el ancho */
@media (min-width: 640px) {
  .botones { flex-direction: row; }
  .botones .boton { flex: 1; }
}
.boton {
  display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 0.5rem;
  height: 3.25rem; border-radius: 999px; padding-inline: 1.5rem; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.boton:active { transform: scale(0.99); }
.boton--rojo { background: var(--bni); color: #fff; border: 0; box-shadow: 0 10px 24px -10px var(--bni); }
.boton--rojo:hover { background: var(--bni-dark); }
.boton--borde { background: transparent; border: 1px solid rgb(23 21 26 / 0.15); }
.boton--borde:hover { border-color: rgb(23 21 26 / 0.4); }

.otros { margin-top: 4rem; }
.otros h2 { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.otros .rejilla { margin-top: 1rem; }
@media (min-width: 640px) { .otros .rejilla { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Barra fija en móvil con lo más usado */
.barra-movil {
  position: fixed; inset: auto 0 0 0; z-index: 10; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
  border-top: 1px solid var(--line); background: rgb(255 255 255 / 0.9); padding: 0.75rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.barra-movil a {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem; border-radius: 0.75rem;
  padding-block: 0.375rem; font-size: 0.75rem; font-weight: 500;
}
.barra-movil a:last-child { background: var(--bni); color: #fff; font-weight: 600; }
.con-barra main { padding-bottom: 7rem; }
@media (min-width: 768px) {
  .barra-movil { display: none; }
  .con-barra main { padding-bottom: 0; }
}

/* ---------- Páginas sueltas (aviso legal, etc.) ---------- */

.texto { max-width: 46rem; }
.texto h1 { font-size: clamp(2.2rem, 6vw, 3.5rem); margin-bottom: 1.5rem; }
.texto :where(p, ul, ol, h2, h3) { margin-bottom: 1rem; }
.texto :where(h2, h3) { margin-top: 2rem; line-height: 1.2; }
.texto a { color: var(--bni); text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  *, *::before, *::after { transition: none !important; }
}
