/**
 * HyperFrames Catalog — page-scoped styles
 * Faithful adaptation of mockup-hyperframes-catalogo.html
 * Loaded via wp_enqueue_style() only on the catalog page template.
 */

/* ---- ROOT VARIABLES (alias → presets de theme.json, mismos valores) ---- */
.hf-catalogo {
  --hfc-bg: var(--wp--preset--color--bg);
  --hfc-bg-card: var(--wp--preset--color--bg-card);
  --hfc-border: var(--wp--preset--color--border);
  --hfc-cyan: var(--wp--preset--color--cyan);
  --hfc-pink: var(--wp--preset--color--pink);
  --hfc-text: var(--wp--preset--color--text);
  --hfc-muted: var(--wp--preset--color--text-muted);
  --hfc-dim: var(--wp--preset--color--text-dim);
  --hfc-head: "Inter Tight", sans-serif;
  --hfc-body: "Inter", sans-serif;
  --hfc-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  position: relative;
  font-family: var(--hfc-body);
  color: var(--hfc-text);
  background: var(--hfc-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 1px;
}
.hf-catalogo *, .hf-catalogo *::before, .hf-catalogo *::after { box-sizing: border-box; }
.hf-catalogo h1, .hf-catalogo h2, .hf-catalogo h3, .hf-catalogo h4, .hf-catalogo p { margin: 0; }
.hf-catalogo a { color: inherit; text-decoration: none; }

/* Full-width breakout */
.alignfull.hf-catalogo {
  width: 100vw; max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: 0; padding-right: 0;
}

/* ---- BACKGROUND GRID + GLOWS ---- */
.hf-catalogo .hfc-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(ellipse 50% 38% at 10% 2%, rgba(57,228,228,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 54% 46% at 90% 12%, rgba(239,28,134,0.13) 0%, transparent 70%),
    radial-gradient(ellipse 50% 44% at 50% 98%, rgba(239,28,134,0.10) 0%, transparent 70%),
    radial-gradient(rgba(57,228,228,0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 26px 26px;
}
.hf-catalogo .hfc-inner {
  position: relative; z-index: 1;
  max-width: 1140px; margin: 0 auto; padding: 0 2rem;
}

/* ---- HERO ---- */
.hf-catalogo .hfc-hero { padding: 5.5rem 0 3rem; text-align: center; }
.hf-catalogo .hfc-eyebrow {
  font-family: var(--hfc-mono); font-size: 0.78rem;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--hfc-pink); margin-bottom: 1.1rem;
}
.hf-catalogo .hfc-h1 {
  font-family: var(--hfc-head); font-weight: 900;
  font-size: clamp(2.4rem, 5.5vw, 4rem); line-height: 1.08;
  letter-spacing: -0.03em; margin-bottom: 1.1rem;
}
.hf-catalogo .hfc-h1 .hfc-grad {
  background: linear-gradient(100deg, var(--hfc-pink) 0%, var(--hfc-cyan) 50%, var(--hfc-pink) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hf-catalogo .hfc-sub {
  font-size: 1.125rem; color: var(--hfc-muted);
  max-width: 60ch; margin: 0 auto 2.2rem;
}

/* ---- DISCLAIMER ---- */
.hf-catalogo .hfc-disclaimer {
  font-size: 0.8rem;
  color: var(--hfc-dim);
  max-width: 52ch;
  margin: 0 auto 2rem;
  font-style: italic;
  line-height: 1.5;
  padding: 0.75rem 1.2rem;
  border-left: 2px solid var(--hfc-border);
}

/* ---- STATS ROW ---- */
.hf-catalogo .hfc-stats {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.6rem;
}
.hf-catalogo .hfc-stat {
  flex: 0 0 auto;
}
.hf-catalogo .hfc-stat .hfc-v {
  font-family: var(--hfc-head); font-weight: 800; font-size: 1.7rem;
  letter-spacing: -0.02em; color: var(--hfc-text);
}
.hf-catalogo .hfc-stat .hfc-v em { font-style: normal; color: var(--hfc-pink); }
.hf-catalogo .hfc-stat .hfc-l {
  font-family: var(--hfc-mono); font-size: 0.7rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--hfc-dim);
}

/* ---- INSTALL TERMINAL CARD ---- */
.hf-catalogo .hfc-install {
  margin: 2.6rem auto 0; max-width: 680px;
  background: var(--hfc-bg-card); border: 1px solid var(--hfc-border);
  border-radius: 12px; overflow: hidden; text-align: left;
}
.hf-catalogo .hfc-install-head {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--hfc-border);
}
.hf-catalogo .hfc-install-head .hfc-d { width: 11px; height: 11px; border-radius: 50%; background: #21262d; }
.hf-catalogo .hfc-install-head .hfc-t {
  margin-left: auto; font-family: var(--hfc-mono);
  font-size: 0.72rem; color: var(--hfc-dim);
}
.hf-catalogo .hfc-install-body {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.1rem; font-family: var(--hfc-mono); font-size: 0.82rem;
}
.hf-catalogo .hfc-install-body code { color: var(--hfc-text); word-break: break-all; flex: 1; }
.hf-catalogo .hfc-install-body code .hfc-c { color: var(--hfc-cyan); }
.hf-catalogo .hfc-copymini {
  flex: 0 0 auto; cursor: pointer;
  background: rgba(57,228,228,0.10); border: 1px solid rgba(57,228,228,0.28);
  color: var(--hfc-cyan); border-radius: 8px;
  font-family: var(--hfc-mono); font-size: 0.72rem; font-weight: 500;
  padding: 0.45rem 0.8rem; transition: all 0.18s ease;
}
.hf-catalogo .hfc-copymini:hover { background: rgba(57,228,228,0.2); }
.hf-catalogo .hfc-copymini.hfc-ok { color: #86efac; border-color: rgba(74,222,128,0.4); background: rgba(74,222,128,0.12); }

/* ---- STEP CARDS (1-2-3) ---- */
.hf-catalogo .hfc-steps {
  display: flex;
  flex-direction: row;
  gap: 0.9rem;
  max-width: 680px; margin: 1.4rem auto 0;
}
.hf-catalogo .hfc-step {
  flex: 1;
  background: var(--hfc-bg-card); border: 1px solid var(--hfc-border);
  border-radius: 12px; padding: 1.05rem 1.1rem; text-align: left;
}
.hf-catalogo .hfc-sn {
  font-family: var(--hfc-mono); font-weight: 600; font-size: 0.8rem;
  width: 1.75rem; height: 1.75rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(239,28,134,0.14); color: var(--hfc-pink);
  border: 1px solid rgba(239,28,134,0.38);
  margin-bottom: 0.65rem;
}
.hf-catalogo .hfc-step h4 {
  font-family: var(--hfc-head); font-weight: 700; font-size: 0.95rem;
  margin-bottom: 0.3rem; color: var(--hfc-text);
}
.hf-catalogo .hfc-step p {
  font-size: 0.8rem; color: var(--hfc-muted); line-height: 1.5;
}
.hf-catalogo .hfc-step code {
  font-family: var(--hfc-mono); color: var(--hfc-cyan); font-size: 0.75rem;
}

/* ---- DIVIDER ---- */
.hf-catalogo .hfc-divider {
  border: 0; height: 1px; margin: 3.5rem 0 0;
  background: linear-gradient(90deg, transparent, var(--hfc-cyan), var(--hfc-pink), var(--hfc-cyan), transparent);
  opacity: 0.55;
}

/* ---- FILTER CONTROLS ---- */
.hf-catalogo .hfc-controls {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding: 2rem 0 0.6rem;
}
.hf-catalogo .hfc-search {
  flex: 1; min-width: 230px;
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--hfc-bg-card); border: 1px solid var(--hfc-border);
  border-radius: 8px; padding: 0.6rem 1rem;
  transition: border-color 0.2s ease; cursor: text;
}
.hf-catalogo .hfc-search:focus-within { border-color: rgba(57,228,228,0.5); }
.hf-catalogo .hfc-search svg { flex: 0 0 auto; opacity: 0.5; }
.hf-catalogo .hfc-search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--hfc-text); font-family: var(--hfc-body); font-size: 0.92rem;
}
.hf-catalogo .hfc-search input::placeholder { color: var(--hfc-dim); }
.hf-catalogo .hfc-pills { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.hf-catalogo .hfc-pill {
  cursor: pointer; user-select: none;
  background: var(--hfc-bg-card); border: 1px solid var(--hfc-border);
  border-radius: 8px; color: var(--hfc-muted);
  font-family: var(--hfc-body); font-size: 0.82rem; font-weight: 500;
  padding: 0.5rem 0.95rem; transition: all 0.18s ease;
}
.hf-catalogo .hfc-pill:hover { color: var(--hfc-text); border-color: #444c56; }
.hf-catalogo .hfc-pill.hfc-active {
  background: var(--hfc-cyan); border-color: var(--hfc-cyan);
  color: var(--hfc-bg); font-weight: 600;
}
.hf-catalogo .hfc-pill .hfc-n { opacity: 0.6; margin-left: 0.35rem; font-family: var(--hfc-mono); font-size: 0.72rem; }
.hf-catalogo .hfc-pill.hfc-active .hfc-n { opacity: 0.7; }
/* Secondary filters (type + format) */
.hf-catalogo .hfc-filters {
  display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center;
  padding: 0.7rem 0 0;
}
.hf-catalogo .hfc-pill-sm {
  font-size: 0.74rem; padding: 0.36rem 0.7rem;
}
.hf-catalogo .hfc-filter-sep {
  width: 1px; height: 1.1rem;
  background: var(--hfc-border); margin: 0 0.35rem;
}

.hf-catalogo .hfc-count {
  font-family: var(--hfc-mono); font-size: 0.74rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--hfc-dim); padding: 1.2rem 0 0.4rem;
}

/* ---- EFFECT CARD GRID ---- */
.hf-catalogo .hfc-grid {
  display: grid; gap: 1.4rem; padding: 1rem 0 2rem;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.hf-catalogo .hfc-card {
  display: flex; flex-direction: column;
  background: var(--hfc-bg-card); border: 1px solid var(--hfc-border);
  border-radius: 12px; overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.hf-catalogo .hfc-card:hover {
  transform: translateY(-3px);
  border-color: rgba(57,228,228,0.45);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 28px rgba(57,228,228,0.08);
}
.hf-catalogo .hfc-thumb {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  background:
    radial-gradient(ellipse 80% 80% at 50% 0%, rgba(57,228,228,0.07), transparent 70%),
    linear-gradient(160deg, #1a212b 0%, #0c1014 100%);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--hfc-border);
}
.hf-catalogo .hfc-glyph {
  position: absolute; right: -0.2em; bottom: -0.32em;
  font-family: var(--hfc-head); font-weight: 900; font-size: 7rem;
  line-height: 1; opacity: 0.07; user-select: none;
}
.hf-catalogo .hfc-id {
  position: relative; z-index: 1;
  font-family: var(--hfc-mono); font-weight: 500;
  font-size: 1.05rem; letter-spacing: -0.01em;
  color: var(--hfc-cyan); text-shadow: 0 0 22px rgba(57,228,228,0.35);
  padding: 0 1rem; text-align: center;
}

/* Pink accent cards */
.hf-catalogo .hfc-card[data-accent="pink"] .hfc-thumb {
  background:
    radial-gradient(ellipse 80% 80% at 50% 0%, rgba(239,28,134,0.07), transparent 70%),
    linear-gradient(160deg, #1a212b 0%, #0c1014 100%);
}
.hf-catalogo .hfc-card[data-accent="pink"] .hfc-glyph { color: var(--hfc-pink); }
.hf-catalogo .hfc-card[data-accent="pink"] .hfc-id {
  color: var(--hfc-pink); text-shadow: 0 0 22px rgba(239,28,134,0.32);
}
.hf-catalogo .hfc-card[data-accent="pink"]:hover {
  border-color: rgba(239,28,134,0.45);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 28px rgba(239,28,134,0.08);
}

/* Card chips */
.hf-catalogo .hfc-chips {
  position: absolute; top: 0.6rem; left: 0.6rem; right: 0.6rem;
  display: flex; justify-content: space-between; z-index: 2;
}
.hf-catalogo .hfc-chip {
  font-family: var(--hfc-mono); font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: rgba(13,17,23,0.82); backdrop-filter: blur(6px);
  border: 1px solid var(--hfc-border); border-radius: 999px;
  padding: 0.26rem 0.6rem; color: var(--hfc-muted);
}
.hf-catalogo .hfc-chip.hfc-cat { color: var(--hfc-cyan); border-color: rgba(57,228,228,0.3); }
.hf-catalogo .hfc-card[data-accent="pink"] .hfc-chip.hfc-cat { color: var(--hfc-pink); border-color: rgba(239,28,134,0.3); }
.hf-catalogo .hfc-chiprow { position: absolute; bottom: 0.6rem; left: 0.6rem; z-index: 2; display: flex; gap: 0.35rem; }
.hf-catalogo .hfc-chip.hfc-type-block { color: var(--hfc-cyan); border-color: rgba(57,228,228,0.3); }
.hf-catalogo .hfc-chip.hfc-type-component { color: #f59e0b; border-color: rgba(245,158,11,0.3); }

/* Video preview */
.hf-catalogo .hfc-vid {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1; opacity: 0;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Vertical videos: contain instead of cover so the full frame shows */
.hf-catalogo .hfc-vert .hfc-vid { object-fit: contain; }

/* Static poster thumbnail (real JPG, always visible) */
.hf-catalogo .hfc-poster-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
  transition: opacity 0.3s ease;
}
.hf-catalogo .hfc-vert .hfc-poster-img { object-fit: contain; }
.hf-catalogo .hfc-playing .hfc-poster-img { opacity: 0; }

/* Hide decorative text when poster image is visible */
.hf-catalogo .hfc-has-vid .hfc-glyph,
.hf-catalogo .hfc-has-vid .hfc-id { opacity: 0; }

/* Playing state: full brightness on hover */
.hf-catalogo .hfc-playing .hfc-vid { opacity: 1; filter: brightness(1); }
.hf-catalogo .hfc-playing .hfc-glyph,
.hf-catalogo .hfc-playing .hfc-id { opacity: 0; transition: opacity 0.3s ease; }
.hf-catalogo .hfc-has-vid { cursor: pointer; }

/* Expand / fullscreen icon (bottom-right of thumbnail) */
.hf-catalogo .hfc-expand {
  position: absolute; bottom: 0.6rem; right: 0.6rem; z-index: 3;
  width: 2.1rem; height: 2.1rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,17,23,0.78); backdrop-filter: blur(6px);
  border: 1px solid var(--hfc-border); border-radius: 8px;
  color: var(--hfc-muted); cursor: pointer;
  transition: all 0.22s ease; opacity: 0;
}
.hf-catalogo .hfc-has-vid .hfc-expand { opacity: 0.7; }
.hf-catalogo .hfc-has-vid:hover .hfc-expand { opacity: 1; }
.hf-catalogo .hfc-expand:hover {
  color: var(--hfc-cyan); border-color: rgba(57,228,228,0.45);
  background: rgba(57,228,228,0.15);
}
.hf-catalogo .hfc-card[data-accent="pink"] .hfc-expand:hover {
  color: var(--hfc-pink); border-color: rgba(239,28,134,0.45);
  background: rgba(239,28,134,0.15);
}

/* ---- LIGHTBOX (fullscreen video preview) ---- */
.hfc-lightbox {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.hfc-lightbox.hfc-lb-open { opacity: 1; visibility: visible; }
.hfc-lb-close {
  position: absolute; top: 1.2rem; right: 1.2rem; z-index: 1;
  width: 2.6rem; height: 2.6rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%; color: #fff; font-size: 1.4rem; line-height: 1;
  cursor: pointer; transition: background 0.2s ease;
  font-family: system-ui, sans-serif;
}
.hfc-lb-close:hover { background: rgba(255,255,255,0.18); }
.hfc-lb-vid {
  max-width: 90vw; max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  outline: none;
}
@media (max-width: 768px) {
  .hfc-lb-vid { max-width: 96vw; max-height: 80vh; border-radius: 8px; }
  .hfc-lb-close { top: 0.6rem; right: 0.6rem; }
}

/* Card body */
.hf-catalogo .hfc-body { padding: 1.05rem 1.15rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.hf-catalogo .hfc-title {
  font-family: var(--hfc-head); font-weight: 700; font-size: 1.1rem;
  letter-spacing: -0.01em; line-height: 1.3;
}
.hf-catalogo .hfc-slug {
  font-family: var(--hfc-mono); font-size: 0.68rem;
  color: var(--hfc-dim); margin-top: 0.2rem; word-break: break-all;
}
.hf-catalogo .hfc-desc { font-size: 0.875rem; color: var(--hfc-muted); margin-top: 0.55rem; flex: 1; }
.hf-catalogo .hfc-copy {
  margin-top: 1rem; cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: transparent; border: 1px solid var(--hfc-border);
  border-radius: 8px; color: var(--hfc-muted);
  font-family: var(--hfc-mono); font-size: 0.74rem; font-weight: 500;
  padding: 0.62rem 0.8rem; transition: all 0.18s ease;
}
.hf-catalogo .hfc-copy:hover { border-color: rgba(57,228,228,0.45); color: var(--hfc-cyan); }
.hf-catalogo .hfc-copy.hfc-ok { border-color: rgba(74,222,128,0.45); color: #86efac; }
.hf-catalogo .hfc-copy svg { flex: 0 0 auto; }

/* Empty state */
.hf-catalogo .hfc-empty {
  grid-column: 1/-1; text-align: center; padding: 5rem 1rem;
  color: var(--hfc-dim); border: 1px dashed var(--hfc-border); border-radius: 12px;
}
.hf-catalogo .hfc-empty b {
  display: block; color: var(--hfc-text); font-family: var(--hfc-head);
  font-size: 1.3rem; margin-bottom: 0.4rem;
}

/* WP block resets */
.hf-catalogo .wp-block-group { margin: 0; }
.hf-catalogo .wp-block-heading { margin: 0; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .hf-catalogo .hfc-inner { padding: 0 1.25rem; }
  .hf-catalogo .hfc-hero { padding: 3.5rem 0 2rem; }
  .hf-catalogo .hfc-grid { grid-template-columns: 1fr; }
  .hf-catalogo .hfc-stats { gap: 1.6rem; }
  .hf-catalogo .hfc-steps { flex-direction: column; }
  .hf-catalogo .hfc-controls { flex-direction: column; align-items: stretch; }
}
