/*
Theme Name: Wareferry
Theme URI: https://wareferry.com
Author: David Marín Carreño
Author URI: https://davefx.com
Description: Block theme for wareferry.com. Derived from the DaveFX theme (same type, grid and components) with a navy palette.
Requires at least: 6.5
Tested up to: 7.1
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: wareferry
Tags: 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;
}

.wfy-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 */
.wfy-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 */
.wfy-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 */
.wfy-hairline-grid,
.is-style-wfy-hairline-grid {
  gap: 1px !important;
  background: var(--wp--preset--color--border);
  border: 1px solid var(--wp--preset--color--border);
}
.wfy-hairline-grid > *,
.is-style-wfy-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) */
.wfy-progress {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 4px;
  background: var(--wp--preset--color--rule);
}
.wfy-progress > span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  background: var(--wp--preset--color--accent);
  animation: wfy-progress linear both;
  animation-timeline: scroll(root block);
}
@keyframes wfy-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@supports not (animation-timeline: scroll()) { .wfy-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) */
.wfy-tags { align-items: center; }
.wfy-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 */
.wfy-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;
}
.wfy-langswitcher li { margin: 0; }
.wfy-langswitcher li + li { border-left: 1px solid var(--wp--preset--color--border); }
.wfy-langswitcher a,
.wfy-langswitcher span {
  display: block;
  padding: 0.35rem 0.6rem;
  color: var(--wp--preset--color--muted);
  text-decoration: none;
}
.wfy-langswitcher a:hover { color: var(--wp--preset--color--contrast); }
.wfy-langswitcher .current-lang > a,
.wfy-langswitcher .current-lang > span {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

/* Marca: cuadrado con la inicial, como el logo de davefx.com */
.wfy-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 0;
  background: var(--wp--preset--color--ink);
  color: var(--wp--preset--color--base);
  font-family: var(--wp--preset--font-family--mono);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
}
.wfy-mark a { color: inherit; text-decoration: none; }

/* Punto final de color en los titulares */
.wfy-dot { color: var(--wp--preset--color--accent); }

/* Selección legible sobre fondo oscuro */
::selection { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--base); }

/* Author box at the end of posts */
.wfy-author {
  box-sizing: border-box;
  max-width: var(--wp--style--global--content-size, 46rem);
  margin: var(--wp--preset--spacing--60) auto 0;
  padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
  border: 1px solid var(--wp--preset--color--border);
  border-left: 3px solid var(--wp--preset--color--accent, currentColor);
}
.wfy-author p { margin: 0 0 0.5em; }
.wfy-author p:last-child { margin-bottom: 0; }
.wfy-author-link { font-size: 0.9rem; }
