/*
Theme Name: DaveFX
Theme URI: https://davefx.com
Author: David Marín Carreño
Author URI: https://davefx.com
Description: Tema de bloques (FSE) para davefx.com. Robusto, técnico y rápido: sin dependencias externas, sin constructor, sin jQuery.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.1
Version: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: davefx
Tags: blog, portfolio, block-patterns, full-site-editing, translation-ready
*/

/* Solo lo que theme.json no puede expresar. Todo lo demás vive en theme.json. */

:where(a):focus-visible,
:where(button):focus-visible,
:where(input):focus-visible,
:where(textarea):focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 2px;
}

.dfx-skip-link:focus {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 999999;
  padding: 0.75rem 1rem;
  background: var(--wp--preset--color--ink);
  color: var(--wp--preset--color--base);
  font-family: var(--wp--preset--font-family--mono);
  font-size: 0.8125rem;
}

/* Rejilla técnica de 64 px del hero */
.dfx-grid-bg {
  background-image:
    linear-gradient(var(--wp--preset--color--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--wp--preset--color--rule) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
}

/* Metadatos en monoespaciada versalita */
.dfx-meta {
  font-family: var(--wp--preset--font-family--mono);
  font-size: var(--wp--preset--font-size--x-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--accent);
}

/* Tarjetas a hueso: rejilla de 1px en lugar de sombras */
.dfx-hairline-grid {
  gap: 1px !important;
  background: var(--wp--preset--color--border);
  border: 1px solid var(--wp--preset--color--border);
}
.dfx-hairline-grid > * {
  background: var(--wp--preset--color--surface);
  margin: 0;
}

/* Enlaces de cuerpo de texto */
.entry-content a:where(:not(.wp-element-button)) {
  color: var(--wp--preset--color--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--wp--preset--color--accent) 35%, transparent);
}
.entry-content a:where(:not(.wp-element-button)):hover {
  border-bottom-color: var(--wp--preset--color--accent);
}

/* Barra de progreso de lectura (sin JS: se anima con scroll-timeline donde exista) */
.dfx-progress {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 4px;
  background: var(--wp--preset--color--rule);
}
.dfx-progress > span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  background: var(--wp--preset--color--accent);
  animation: dfx-progress linear both;
  animation-timeline: scroll(root block);
}
@keyframes dfx-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@supports not (animation-timeline: scroll()) { .dfx-progress { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Tags tecnológicos del hero (pastillas a hueso, mono) */
.dfx-tags { align-items: center; }
.dfx-tag {
  font-family: var(--wp--preset--font-family--mono);
  font-size: var(--wp--preset--font-size--x-small);
  letter-spacing: 0.04em;
  color: var(--wp--preset--color--muted);
  border: 1px solid var(--wp--preset--color--border);
  padding: 0.35rem 0.6rem;
  margin: 0;
  line-height: 1;
}

/* Conmutador de idioma segmentado ES / EN en la cabecera */
.dfx-langswitcher {
  list-style: none;
  display: inline-flex;
  margin: 0;
  padding: 0;
  border: 1px solid var(--wp--preset--color--border);
  font-family: var(--wp--preset--font-family--mono);
  font-size: var(--wp--preset--font-size--x-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dfx-langswitcher li { margin: 0; }
.dfx-langswitcher li + li { border-left: 1px solid var(--wp--preset--color--border); }
.dfx-langswitcher a,
.dfx-langswitcher span {
  display: block;
  padding: 0.35rem 0.6rem;
  color: var(--wp--preset--color--muted);
  text-decoration: none;
}
.dfx-langswitcher a:hover { color: var(--wp--preset--color--contrast); }
.dfx-langswitcher .current-lang > a,
.dfx-langswitcher .current-lang > span {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

/* Badge oficial de Toptal — reproducción fiel del widget original (hexágono,
   gradientes cian, botón azul). Sin TypeKit: proxima-nova cae a Arial. */
.dfx-toptal-badge {
  --dfx-h: polygon(50% 0, 100% 24%, 100% 76%, 50% 100%, 0 76%, 0 24%);
  font-family: proxima-nova, Arial, sans-serif;
  display: flex;
  justify-content: center;
}
.dfx-toptal-badge__frame {
  display: inline-block;
  background: #25a9ef;
  padding: 4.5px;
  clip-path: var(--dfx-h);
}
.dfx-toptal-badge__inner {
  width: 150px;
  padding: 18px 0 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #204ecf;
  text-align: center;
  background:
    radial-gradient(circle at 20% -10%, #00c3ff -80%, #fff 30%),
    radial-gradient(circle at -20% 20%, #00c3ff -80%, #fff 30%),
    radial-gradient(circle at 70% 100%, #00c3ff -80%, #fff 30%),
    radial-gradient(circle at 120% 80%, #00c3ff -80%, #fff 30%);
  background-blend-mode: multiply;
  clip-path: var(--dfx-h);
  box-shadow: 0 21px 37.5px rgba(6, 30, 96, 0.35);
}
.dfx-toptal-badge__top3 {
  margin: 0;
  font-size: 14.25px;
  font-weight: 700;
  line-height: 1;
}
.dfx-toptal-badge__rule {
  width: 90px;
  height: 1px;
  background: #25a9ef;
}
.dfx-toptal-badge__vetted {
  font-size: 12px;
  margin-bottom: -4.5px;
}
.dfx-toptal-badge__hire {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 15px;
  border-radius: 4.5px;
  background: #296bff;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

/* Grid de "Proyectos propios": columnCount:3 fijo no colapsa en móvil.
   Forzamos 2 columnas en tablet y 1 en pantallas estrechas. */
@media (max-width: 900px) {
  .dfx-projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 600px) {
  .dfx-projects-grid { grid-template-columns: 1fr !important; }
}

/* Ribbon "Fork me on GitHub": el offset inline top:116px clareaba la cabecera
   fija de Astra; con el tema DaveFX (cabecera en flujo) va pegado arriba. */
img[alt="Fork me on GitHub"] {
  top: 0 !important;
}

/* Merriweather autoalojada (variable), solo para citas */
@font-face {
  font-family: "Merriweather";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("assets/fonts/Merriweather.woff2") format("woff2");
}

/* Blockquote editorial: Merriweather a tamaño visualmente similar a la Plex,
   fondo cálido amarillento y comilla doble grande de fondo. El borde-izq
   granate lo aporta theme.json (core/quote). Doble clase para ganar en cascada. */
.wp-block-quote.wp-block-quote,
blockquote {
  position: relative;
  overflow: hidden;
  font-family: "Merriweather", Georgia, "Times New Roman", serif;
  font-size: var(--wp--preset--font-size--medium);
  line-height: 1.65;
  font-weight: 400;
  color: var(--wp--preset--color--contrast);
  background: #fbf6e3;
  padding: 1.6rem 1.9rem;
}
.wp-block-quote.wp-block-quote::before,
blockquote::before {
  content: "\201C";
  position: absolute;
  top: -0.05em;
  left: 0.06em;
  z-index: 0;
  font-family: "Merriweather", Georgia, serif;
  font-weight: 700;
  font-size: 7rem;
  line-height: 1;
  color: rgba(138, 31, 36, 0.10);
  pointer-events: none;
}
.wp-block-quote.wp-block-quote > *,
blockquote > * {
  position: relative;
  z-index: 1;
}
.wp-block-quote.wp-block-quote cite,
.wp-block-quote.wp-block-quote .wp-block-quote__citation,
blockquote cite {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--wp--preset--font-family--mono);
  font-style: normal;
  font-size: var(--wp--preset--font-size--x-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wp--preset--color--muted);
}
