/* GREMAB — members portal, "Mis destacados" stars, login, affiliation form.
 * Loaded on the front end and in the editor (inc/setup.php).
 */

:root {
  --gremab-navy: var(--wp--preset--color--primary, #001525);
  --gremab-navy-2: var(--wp--preset--color--primary-container, #012a44);
  --gremab-yellow: var(--wp--preset--color--secondary-container, #fdae03);
  --gremab-gold: var(--wp--preset--color--secondary, #805600);
  --gremab-muted: var(--wp--preset--color--on-surface-variant, #42474d);
  --gremab-line: var(--wp--preset--color--outline-variant, #c2c7ce);
}

/* ── ★ "Mis destacados" button (on card images and lists) ── */
.wp-block-post-featured-image {
  position: relative;
}

.gremab-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--gremab-navy);
  box-shadow: 0 2px 8px rgba(0, 21, 37, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.wp-block-post-featured-image .gremab-fav {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
}

.gremab-fav .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: 'FILL' 0;
}

.gremab-fav:hover {
  transform: scale(1.08);
}

.gremab-fav.is-active {
  background: var(--gremab-yellow);
}

.gremab-fav.is-active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

.gremab-fav.has-error {
  box-shadow: 0 0 0 2px #ba1a1a;
}

.gremab-fav[disabled] {
  opacity: 0.6;
}

.gremab-mis-destacados {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gremab-mis-destacados li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--gremab-line);
}

.gremab-mis-destacados li .gremab-fav {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  box-shadow: none;
  border: 1px solid var(--gremab-line);
}

.gremab-mis-destacados a {
  color: var(--gremab-navy);
  font-weight: 700;
  text-decoration: none;
}

.gremab-mis-destacados a:hover {
  text-decoration: underline;
}

.gremab-mis-destacados__vacio,
.gremab-mis-destacados__todos {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--gremab-muted);
}

.gremab-mis-destacados__vacio .material-symbols-outlined {
  font-size: 18px;
  vertical-align: middle;
  color: var(--gremab-gold);
}

/* ── Portal menu bar (under the site header on portal pages) ── */
.gremab-portal-barra {
  background: var(--gremab-navy-2);
  color: #ffffff;
}

.gremab-portal-barra__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
}

.gremab-portal-barra ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gremab-portal-barra ul a {
  display: inline-block;
  padding: 0.35rem 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.gremab-portal-barra ul a:hover,
.gremab-portal-barra ul a[aria-current='page'] {
  color: #ffffff;
  border-bottom-color: var(--gremab-yellow);
}

.gremab-portal-barra__sesion {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gremab-portal-barra__texto {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.85rem;
  line-height: 1.25;
}

.gremab-portal-barra__texto small {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gremab-yellow);
}

.gremab-portal-barra__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gremab-yellow);
  color: var(--gremab-navy);
  font-weight: 900;
  font-size: 0.85rem;
}

.gremab-portal-barra__salir {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

.gremab-portal-barra__salir:hover {
  color: #ffffff;
}

/* ── Dashboard (bento grid, from the Stitch "Acceso Socios" design) ── */
.gremab-dash {
  padding: 3rem 2rem 5rem;
}

.gremab-bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(180px, auto);
  gap: 1.5rem;
}

.gremab-bento > * {
  margin: 0 !important;
}

.gremab-bento__card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.75rem;
  border: 1px solid rgba(194, 199, 206, 0.45);
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.gremab-bento__card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(1, 42, 68, 0.08);
}

.gremab-bento__card h3 {
  margin: 0 0 0.4rem;
}

.gremab-bento__card p {
  margin: 0;
}

.gremab-bento__icon .material-symbols-outlined {
  font-size: 36px;
  color: var(--gremab-navy);
}

.gremab-bento__desc {
  color: var(--gremab-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.gremab-bento--reportes { grid-column: span 8; grid-row: span 2; }
.gremab-bento--eventos { grid-column: span 4; grid-row: span 2; background: var(--gremab-navy-2); border-color: var(--gremab-navy-2); color: #ffffff; }
.gremab-bento--beneficios { grid-column: span 6; background: var(--wp--preset--color--surface-container-low, #eff4ff); }
.gremab-bento--comites { grid-column: span 3; grid-row: span 2; }
.gremab-bento--boletin { grid-column: span 3; grid-row: span 2; }
.gremab-bento--memoria { grid-column: span 6; background: var(--wp--preset--color--surface-container, #e5eeff); }
.gremab-bento--favs { grid-column: span 12; }

.gremab-bento--reportes::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(1, 42, 68, 0.05);
  filter: blur(40px);
  pointer-events: none;
}

.gremab-bento--eventos h3,
.gremab-bento--eventos a,
.gremab-bento--eventos .wp-block-post-title a {
  color: #ffffff;
}

.gremab-bento--eventos .gremab-bento__icon .material-symbols-outlined {
  color: var(--gremab-yellow);
}

.gremab-bento--eventos .wp-block-post-template {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.gremab-bento--eventos .wp-block-post-template li {
  padding-left: 0.75rem;
  border-left: 3px solid var(--gremab-yellow);
}

.gremab-bento--eventos .wp-block-post-title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
}

.gremab-bento--eventos .wp-block-post-title a {
  text-decoration: none;
}

.gremab-bento--eventos .gremab-card__label .gremab-term {
  color: var(--gremab-yellow);
}

.gremab-bento--eventos .wp-block-button__link {
  width: 100%;
  background: var(--gremab-yellow);
  color: var(--gremab-navy);
  font-weight: 700;
}

.gremab-bento--beneficios,
.gremab-bento--memoria {
  flex-direction: row;
  align-items: center;
}

.gremab-bento__link {
  font-weight: 700;
  font-size: 0.9rem;
}

.gremab-bento__link a {
  color: var(--gremab-navy);
  text-decoration: none;
}

.gremab-bento__link a:hover {
  color: var(--gremab-gold);
}

.gremab-bento__lista {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}

.gremab-bento__lista li {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(194, 199, 206, 0.35);
}

.gremab-bento__lista li:last-child {
  border-bottom: 0;
}

/* "Latest" boletín / memoria with download */
.gremab-ultimo {
  padding: 1rem;
  border-radius: 8px;
  background: var(--wp--preset--color--surface-container-low, #eff4ff);
}

.gremab-ultimo__titulo {
  margin: 0;
  font-weight: 700;
  color: var(--gremab-navy);
}

.gremab-ultimo__fecha {
  margin: 0.2rem 0 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gremab-muted);
}

.gremab-ultimo__acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0;
}

.gremab-ultimo__descargar {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--gremab-navy);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.gremab-ultimo__descargar .material-symbols-outlined {
  font-size: 18px;
}

.gremab-ultimo__todos {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gremab-navy);
}

.gremab-ultimo--vacio p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--gremab-muted);
}

@media (max-width: 1024px) {
  .gremab-bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .gremab-bento--reportes,
  .gremab-bento--eventos,
  .gremab-bento--beneficios,
  .gremab-bento--memoria,
  .gremab-bento--comites,
  .gremab-bento--boletin { grid-column: span 3; }
  .gremab-bento--favs { grid-column: span 6; }
}

@media (max-width: 680px) {
  .gremab-bento { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .gremab-bento > * { grid-column: auto !important; grid-row: auto !important; }
  .gremab-bento--beneficios,
  .gremab-bento--memoria { flex-direction: column; align-items: flex-start; }
  .gremab-dash { padding: 2rem 1rem 3rem; }
  .gremab-portal-barra__inner { padding: 0.75rem 1rem; }
}

/* ── Comités (members page) ── */
.gremab-comites-grid {
  gap: 1.5rem;
}

.gremab-comite {
  height: 100%;
}

.gremab-comite .wp-block-image img {
  max-height: 70px;
  width: auto;
  object-fit: contain;
}

/* ── Login (/login) ── */
.gremab-login form {
  display: grid;
  gap: 1rem;
}

.gremab-login form p {
  margin: 0;
}

.gremab-login label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gremab-muted);
}

.gremab-login input[type='text'],
.gremab-login input[type='password'] {
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  border: 1px solid var(--gremab-line);
  border-radius: 8px;
  font: inherit;
  box-sizing: border-box;
}

.gremab-login input:focus,
.gremab-afiliacion input:focus {
  outline: 2px solid var(--gremab-yellow);
  outline-offset: 1px;
}

.gremab-login .login-remember label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
}

.gremab-login .button-primary,
.gremab-login input[type='submit'] {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--gremab-yellow);
  color: var(--gremab-navy);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.gremab-login__error {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #ffdad6;
  color: #93000a;
  font-weight: 700;
}

.gremab-login__lost,
.gremab-login__help,
.gremab-login__ok {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--gremab-muted);
}

.gremab-login__lost a,
.gremab-login__help a,
.gremab-login__ok a {
  color: var(--gremab-navy);
  font-weight: 700;
}

/* ── Affiliation form (Únete) ── */
.gremab-afiliacion__campos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.gremab-afiliacion__campo {
  margin: 0;
}

.gremab-afiliacion__campo--correo {
  grid-column: span 2;
}

.gremab-afiliacion label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gremab-muted);
}

.gremab-afiliacion input[type='text'],
.gremab-afiliacion input[type='email'],
.gremab-afiliacion input[type='tel'] {
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  border: 1px solid var(--gremab-line);
  border-radius: 8px;
  background: var(--wp--preset--color--surface, #f8f9ff);
  font: inherit;
  box-sizing: border-box;
}

.gremab-afiliacion__trampa {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gremab-afiliacion__enviar {
  margin: 1.75rem 0 0;
}

.gremab-afiliacion__enviar .gremab-btn {
  width: 100%;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.gremab-afiliacion__legal {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  text-align: center;
  color: var(--gremab-muted);
}

.gremab-afiliacion__aviso {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  font-weight: 700;
}

.gremab-afiliacion__aviso--ok {
  background: #d7f5dc;
  color: #0b5a1c;
}

.gremab-afiliacion__aviso--error {
  background: #ffdad6;
  color: #93000a;
}

@media (max-width: 640px) {
  .gremab-afiliacion__campos { grid-template-columns: minmax(0, 1fr); }
  .gremab-afiliacion__campo--correo { grid-column: auto; }
}

/* ── Members-only notice on exclusive Recursos / Eventos ── */
.gremab-locked {
  margin: 1rem 0;
  padding: 2rem;
  border: 1px solid var(--gremab-line);
  border-left: 4px solid var(--gremab-yellow);
  border-radius: 12px;
  background: #ffffff;
}

.gremab-locked__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--gremab-navy);
}

.gremab-locked p {
  margin: 0 0 0.75rem;
}

/* ── Portal pages: shared heading ── */
.gremab-dash__head {
  margin-bottom: 2.5rem;
}

.gremab-dash__head h1 {
  margin: 0 0 0.5rem;
  font-size: var(--wp--preset--font-size--3-xl, 2.5rem);
}

.gremab-dash__intro {
  max-width: 760px;
  margin: 0;
  font-size: 1.15rem;
  color: var(--gremab-muted);
}

.gremab-bento__top,
.gremab-bento__bottom {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.gremab-bento__bottom .wp-block-buttons {
  margin: 0;
}

/* ── Mis beneficios (portal) and the 13 benefits on Únete ── */
.gremab-beneficio__num {
  margin: 0 0 0.5rem !important;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
  color: var(--gremab-yellow);
}

.gremab-beneficio--portal {
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--gremab-line);
  border-radius: 12px;
  background: #ffffff;
}

.gremab-beneficio h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.4;
}

.gremab-bento--boletin-cta {
  margin-top: 2.5rem !important;
}

/* ── Mesas y Comités ── */
.gremab-comite {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 2rem;
  border: 1px solid var(--gremab-line);
  border-radius: 12px;
  background: #ffffff;
}

.gremab-comite .wp-block-image {
  margin: 0 0 0.75rem;
}

.gremab-comite .wp-block-image img {
  max-height: 64px;
  width: auto;
}

.gremab-comite h2 {
  margin: 0;
  font-size: var(--wp--preset--font-size--xl, 1.5rem);
}

.gremab-comite h4 {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gremab-gold);
}

.gremab-comite p,
.gremab-comite ul {
  margin: 0;
  color: var(--gremab-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.gremab-comite ul {
  padding-left: 1.1rem;
}

.gremab-comites-cta {
  margin-top: 2.5rem !important;
}

@media (max-width: 781px) {
  .gremab-comites-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ── Login page (/login) ── */
.gremab-login-section {
  padding: 5rem 1.5rem;
  background: var(--wp--preset--color--surface-container-low, #eff4ff);
}

.gremab-login-card {
  max-width: 480px !important;
  margin: 0 auto !important;
  padding: 2.5rem;
  border: 1px solid var(--gremab-line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(1, 42, 68, 0.08);
}

.gremab-login-card h1 {
  margin: 0 0 0.5rem;
  font-size: var(--wp--preset--font-size--2-xl, 2rem);
}

.gremab-login-intro {
  margin: 0 0 1.5rem;
  color: var(--gremab-muted);
}

/* ── Sector figures (Únete) ── */
.gremab-cifras-grid {
  gap: 1.5rem 1rem;
  margin: 2rem 0 1rem;
}

.gremab-cifra h3 {
  margin: 0;
}

.gremab-cifra p {
  margin: 0.25rem 0 0;
}

@media (max-width: 900px) {
  .gremab-cifras-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
