/* Subpáginas de cjdevelopment.es (blog, artículos, eventos).
   La home mantiene su CSS inline; este archivo es compartido por las páginas
   secundarias para no duplicar estilos. Si cambia el contenido, subir ?v=N en
   las páginas que lo enlazan (caché de 1 mes en .htaccess). */

@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/assets/fonts/dm-sans-var-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/assets/fonts/dm-sans-var-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/dm-mono-400-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/dm-mono-500-latin.woff2) format('woff2');
}

:root {
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;
  --bg:       #080810;
  --bg-2:     #0c0c18;
  --bg-3:     #14141f;
  --bg-card:  #0e0e1a;
  --border:   rgba(6, 182, 212, 0.08);
  --border-h: rgba(6, 182, 212, 0.22);
  --text:     #e8edf2;
  --text-2:   rgba(232, 237, 242, 0.68);
  --text-3:   rgba(232, 237, 242, 0.60);
  --accent:   #06b6d4;
  --accent-2: #22d3ee;
  --accent-glow: rgba(6, 182, 212, 0.12);
  --accent-node: #eeeaff;
  --radius:   12px;
  --radius-lg: 20px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --px: clamp(1.25rem, 4vw, 3rem);
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-2); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  z-index: 1000;
}
.skip-link:focus { top: 1rem; }

/* Idioma: cada bloque de texto largo existe en ES y EN; se muestra el activo */
html[data-lang="es"] [data-l="en"],
html[data-lang="en"] [data-l="es"] { display: none !important; }

/* ====== HEADER ====== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(8, 8, 16, 0.85);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0.5rem var(--px);
  flex-wrap: wrap;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.logo:hover { color: var(--text); }
.logo-text { display: inline-flex; align-items: baseline; }
.logo-dot { color: var(--accent); margin: 0 1px; }
.logo-mark {
  display: flex;
  width: 38px;
  height: 38px;
  color: var(--accent-node);
  transition: transform 0.3s, color 0.3s;
}
.logo-mark svg { width: 38px; height: 38px; display: block; }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.05); color: var(--accent-2); }

.site-nav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-2);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--accent-glow); }

.lang-switch {
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
  background: var(--bg-3);
  border-radius: 8px;
  padding: 2px;
  border: 1px solid var(--border);
}
.lang-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 500;
  border-radius: 6px;
  color: var(--text-3);
}
.lang-btn[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.lang-btn:hover:not([aria-pressed="true"]) { color: var(--text); }

@media (max-width: 640px) {
  .site-nav a { padding: 0.4rem 0.5rem; font-size: 0.85rem; }
}

/* ====== LAYOUT ====== */
main { flex: 1; width: 100%; }
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--px);
}
.wrap--text { max-width: 760px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  display: block;
}
h1, h2, h3 { font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); margin-bottom: 1.25rem; }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-2); max-width: 680px; }

/* Solo vertical: el padding lateral lo pone .wrap */
.page-head {
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--border); }
.section-title { font-size: clamp(1.5rem, 3.4vw, 2.2rem); margin-bottom: 0.75rem; }
.section-desc { color: var(--text-2); max-width: 640px; margin-bottom: 2rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-2); color: var(--bg); transform: translateY(-2px); box-shadow: 0 8px 40px rgba(6, 182, 212, 0.25); }
.btn-ghost { border: 1px solid var(--border-h); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

/* ====== TARJETAS ====== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 3vw, 2rem);
  transition: border-color 0.3s, transform 0.3s;
}
.card:hover { border-color: var(--border-h); transform: translateY(-3px); }
.card h3 { font-size: 1.1rem; margin-bottom: 0.55rem; }
.card p { color: var(--text-2); font-size: 0.95rem; }
.card-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.9rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.45rem 0.95rem;
  border-radius: 100px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
}

/* ====== GALERÍA ====== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-auto-rows: 200px;
  grid-auto-flow: dense;
  gap: 0.9rem;
}
.gallery figure {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-3);
}
.gallery figure.wide { grid-column: span 2; grid-row: span 2; }
.gallery figure.tall { grid-row: span 2; }
.gallery a { display: block; width: 100%; height: 100%; }
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.6rem 0.9rem 0.7rem;
  font-size: 0.8rem;
  color: var(--text);
  background: linear-gradient(transparent, rgba(8, 8, 16, 0.88));
}
@media (max-width: 600px) {
  .gallery figure.wide { grid-column: auto; grid-row: span 1; }
}
/* Selección corta: 2×2 con fotos grandes en 16:9 */
.gallery--four {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: auto;
  gap: 1.1rem;
}
.gallery--four figure { aspect-ratio: 16 / 9; }
@media (max-width: 700px) {
  .gallery--four { grid-template-columns: 1fr; }
}

/* ====== CTA ====== */
.cta-box {
  margin: 0 auto;
  max-width: 720px;
  text-align: center;
  padding: clamp(2rem, 5vw, 3.25rem);
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.cta-box::before {
  content: '';
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.cta-box > * { position: relative; }
.cta-box h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 0.75rem; }
.cta-box p { color: var(--text-2); }
.cta-box .btn-row { justify-content: center; }

/* ====== BLOG ====== */
.post-list { list-style: none; display: grid; gap: 1.1rem; }
.post-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 3vw, 2rem);
  color: var(--text);
  transition: border-color 0.3s, transform 0.3s;
}
.post-card:hover { color: var(--text); border-color: var(--border-h); transform: translateY(-3px); }
.post-card h2 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); margin-bottom: 0.5rem; }
.post-card p { color: var(--text-2); font-size: 0.95rem; }
.post-card .more { display: inline-block; margin-top: 0.9rem; color: var(--accent); font-weight: 600; font-size: 0.9rem; }

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-3);
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
  display: block;
}

.post-hero {
  margin: 0 0 clamp(2rem, 5vw, 3rem);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-h);
  aspect-ratio: 16 / 9;
  background: var(--bg-3);
}
.post-hero img { width: 100%; height: 100%; object-fit: cover; }

.prose { font-size: 1.05rem; color: var(--text-2); }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 {
  color: var(--text);
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  margin-top: 2.6rem;
}
.prose h3 { color: var(--text); font-size: 1.1rem; margin-top: 1.8rem; }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.5rem; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(6, 182, 212, 0.4); }

.post-foot {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}
.post-foot a { font-weight: 600; font-size: 0.95rem; }

/* ====== FOOTER ====== */
.site-footer {
  margin-top: clamp(3rem, 8vw, 5rem);
  padding: 2rem var(--px);
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-3);
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  row-gap: 0.4rem;
}
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--accent); }
.site-footer .sep { margin: 0 0.5rem; opacity: 0.5; }

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

@media print {
  .site-header, .lang-switch, .site-footer { display: none; }
  body { background: white; color: black; }
}
