/* EmpleoWeb.com — Production Stylesheet v2 (Fast, Accessible, Zero-CLS) */
:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --subtle: #f2f1ec;
  --glass: rgba(250, 249, 246, 0.9);
  --text: #141923;
  --text-2: #444f62;
  --muted: #68748a;
  --border: rgba(20, 25, 35, 0.09);
  --border-strong: rgba(20, 25, 35, 0.17);
  --brand: #0f766e;
  --brand-soft: rgba(15, 118, 110, 0.11);
  --brand-2: #1d4ed8;
  --brand-2-soft: rgba(29, 78, 216, 0.1);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.07);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #0b1018;
  --surface: #121824;
  --subtle: #192233;
  --glass: rgba(11, 16, 24, 0.9);
  --text: #f1f5f9;
  --text-2: #b8c4d8;
  --muted: #8494ad;
  --border: rgba(241, 245, 249, 0.09);
  --border-strong: rgba(241, 245, 249, 0.18);
  --brand: #2dd4bf;
  --brand-soft: rgba(45, 212, 191, 0.14);
  --brand-2: #60a5fa;
  --brand-2-soft: rgba(96, 165, 250, 0.14);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.36);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; transition: opacity 0.2s ease, color 0.2s ease; }
a:hover { opacity: 0.85; }
.container { max-width: 1220px; margin: 0 auto; padding: 0 1.35rem; }

.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  z-index: 120;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 80;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  color: var(--text); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-family: var(--font-serif); font-weight: 700; font-size: 1.05rem;
  display: grid; place-items: center;
}
.nav-links { display: flex; align-items: center; gap: 1.15rem; flex-wrap: wrap; }
.nav-links a { color: var(--text-2); font-size: 0.86rem; font-weight: 600; }
.nav-links a:hover, .nav-links a.active { color: var(--brand); opacity: 1; }
.header-controls { display: flex; align-items: center; gap: 0.6rem; }
.icon-btn {
  appearance: none; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); width: 38px; height: 38px; border-radius: 999px;
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { border-color: var(--brand); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-btn { display: none; }

.mobile-nav { display: none; padding: 0.75rem 0 1rem; border-top: 1px solid var(--border); }
.mobile-nav.open { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.mobile-nav a {
  padding: 0.42rem 0.82rem; border-radius: 999px; background: var(--subtle);
  color: var(--text); font-size: 0.84rem; font-weight: 600;
}

.breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem;
  font-size: 0.83rem; color: var(--muted); padding: 1.4rem 0 0.6rem;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); }

/* Hero */
.hero-home { padding: 2.3rem 0 1.6rem; }
.hero-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(1.7rem, 4vw, 3rem);
  box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.hero-box::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.kicker {
  display: inline-block; padding: 0.3rem 0.8rem; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 0.85rem;
}
.hero-box h1 {
  font-family: var(--font-serif); font-size: clamp(1.95rem, 4.1vw, 3.1rem);
  line-height: 1.12; letter-spacing: -0.025em; margin-bottom: 0.9rem; max-width: 24ch;
}
.hero-box p { font-size: 1.03rem; color: var(--text-2); max-width: 62ch; margin-bottom: 1.35rem; }
.hero-search { display: flex; flex-wrap: wrap; gap: 0.65rem; max-width: 560px; }
.search-input {
  flex: 1 1 240px; padding: 0.78rem 1rem; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: 0.94rem; outline: none;
}
.search-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* Category Hub Strip on Homepage */
.cat-hub { padding: 0.4rem 0 2.2rem; }
.cat-hub-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem;
}
.cat-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.4rem; color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.cat-tile:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-md); opacity: 1; }
.cat-tile-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.cat-tile-name { font-family: var(--font-serif); font-size: 1.12rem; font-weight: 600; }
.cat-tile-count {
  font-size: 0.74rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
}
.cat-tile p { font-size: 0.85rem; color: var(--text-2); line-height: 1.5; }

/* Section headers & grids */
.section-bar {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.1rem;
}
.section-title {
  font-family: var(--font-serif); font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 600; letter-spacing: -0.02em;
}
.section-sub { font-size: 0.86rem; color: var(--muted); }
.cards-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.35rem;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand); }
.card-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--subtle); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card-thumb img { transform: scale(1.04); }
.card-body { padding: 1.15rem 1.25rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.card-cat {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--brand);
}
.card-title {
  font-family: var(--font-serif); font-size: 1.13rem; font-weight: 600; line-height: 1.28;
  color: var(--text);
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--brand); opacity: 1; }
.card-desc {
  font-size: 0.88rem; color: var(--text-2); line-height: 1.58;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot {
  margin-top: auto; padding-top: 0.8rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.79rem; color: var(--muted);
}

/* Pagination */
.pagination {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.45rem; margin: 2.4rem 0 1rem;
}
.page-link {
  min-width: 40px; height: 40px; padding: 0 0.85rem; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font-size: 0.88rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.page-link:hover { border-color: var(--brand); color: var(--brand); opacity: 1; }
.page-link.current { background: var(--brand); border-color: var(--brand); color: #fff; pointer-events: none; }

/* Article Layout */
.article-hero { padding: 0.5rem 0 1.8rem; max-width: 880px; }
.article-hero h1 {
  font-family: var(--font-serif); font-size: clamp(1.95rem, 4vw, 3rem);
  line-height: 1.13; letter-spacing: -0.025em; margin: 0.65rem 0 1rem;
}
.article-lead { font-size: 1.1rem; color: var(--text-2); line-height: 1.66; margin-bottom: 1.15rem; }
.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  font-size: 0.85rem; color: var(--muted);
}
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }

.article-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 310px;
  gap: 2.75rem; align-items: start; padding-bottom: 3.5rem;
}
.article-main {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(1.5rem, 3.8vw, 3rem);
  box-shadow: var(--shadow-md);
}
.cover-figure {
  margin-bottom: 2rem; border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border); background: var(--subtle);
}
.cover-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.prose p { font-size: 1.05rem; color: var(--text-2); margin-bottom: 1.35rem; line-height: 1.84; }
.prose > p:first-of-type { font-size: 1.11rem; color: var(--text); }
.prose strong { color: var(--text); font-weight: 700; }
.prose a.internal-link {
  color: var(--brand); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--brand-soft);
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.prose a.internal-link:hover { text-decoration-color: var(--brand); opacity: 1; }
.prose h2 {
  font-family: var(--font-serif); font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  line-height: 1.22; margin: 2.4rem 0 1rem; padding-top: 1.8rem;
  border-top: 1px solid var(--border); scroll-margin-top: 5.2rem;
}
.prose h3 { font-family: var(--font-serif); font-size: 1.2rem; margin: 1.4rem 0 0.65rem; }
.prose ul, .prose ol { margin: 0.8rem 0 1.4rem 1.4rem; color: var(--text-2); }
.prose li { margin-bottom: 0.45rem; }

/* Inline "Lee también" internal link callout */
.inline-related {
  margin: 1.85rem 0; padding: 1.1rem 1.3rem;
  border-radius: var(--radius-md); border-left: 3px solid var(--brand);
  background: var(--subtle); display: flex; flex-direction: column; gap: 0.25rem;
}
.inline-related-label {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand);
}
.inline-related a {
  font-family: var(--font-serif); font-size: 1.08rem; font-weight: 600; color: var(--text);
}
.inline-related a:hover { color: var(--brand); opacity: 1; }

.inline-figure {
  margin: 1.9rem 0; border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border); background: var(--subtle);
}
.inline-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.inline-figure figcaption {
  padding: 0.75rem 1rem; font-size: 0.83rem; color: var(--muted);
  border-top: 1px solid var(--border);
}

.sources-box { margin-top: 2.4rem; padding-top: 1.7rem; border-top: 1px solid var(--border); }
.sources-box h2 { margin-top: 0; padding-top: 0; border-top: none; font-size: 1.22rem; }
.sources-box ul { list-style: none; margin: 0.8rem 0 0; display: grid; gap: 0.55rem; }
.sources-box li { padding: 0.7rem 0.95rem; border-radius: var(--radius-sm); background: var(--subtle); font-size: 0.88rem; margin: 0; }

/* Sidebar */
.sidebar { position: sticky; top: 5.2rem; display: grid; gap: 1.2rem; }
.side-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.3rem; box-shadow: var(--shadow-sm);
}
.side-heading {
  font-size: 0.76rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.9rem;
}
.toc-list, .cat-list { list-style: none; display: grid; gap: 0.3rem; }
.toc-list a, .cat-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.45rem 0.7rem; border-radius: 8px; font-size: 0.86rem;
  color: var(--text-2); border-left: 2px solid transparent;
}
.toc-list a:hover, .cat-list a:hover { background: var(--subtle); color: var(--text); opacity: 1; }
.toc-list a.active { background: var(--brand-soft); color: var(--brand); border-left-color: var(--brand); font-weight: 600; }

.related-section { padding: 0.5rem 0 4rem; }

/* Legal & Static Pages */
.page-shell {
  max-width: 860px; margin: 1.5rem auto 4.5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: clamp(1.75rem, 4vw, 3.2rem);
  box-shadow: var(--shadow-md);
}
.page-shell h1 { font-family: var(--font-serif); font-size: clamp(1.9rem, 3.6vw, 2.7rem); margin-bottom: 1rem; line-height: 1.15; }
.page-shell h2 { font-family: var(--font-serif); font-size: 1.38rem; margin: 2rem 0 0.75rem; }
.page-shell p, .page-shell li { color: var(--text-2); margin-bottom: 0.9rem; font-size: 1rem; }
.page-shell ul { margin: 0.6rem 0 1.2rem 1.35rem; }
.contact-form {
  display: grid; gap: 1rem; margin: 1.5rem 0 2rem;
  padding: 1.5rem; border-radius: var(--radius-md);
  background: var(--subtle); border: 1px solid var(--border);
}
.contact-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.contact-field { display: grid; gap: 0.35rem; font-size: 0.88rem; font-weight: 600; color: var(--text); }
.contact-field input, .contact-field select, .contact-field textarea {
  width: 100%; padding: 0.78rem 0.95rem; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-family: var(--font-sans); font-size: 0.94rem; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.contact-field input:focus, .contact-field select:focus, .contact-field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-status {
  display: none; padding: 0.9rem 1.1rem; border-radius: 10px; font-size: 0.9rem; font-weight: 600;
}
.form-status.ok { display: block; background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand); }
.form-status.err { display: block; background: rgba(220, 38, 38, 0.1); color: #dc2626; border: 1px solid rgba(220, 38, 38, 0.35); }
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.btn-primary {
  appearance: none; border: none; background: var(--brand); color: #fff;
  padding: 0.78rem 1.4rem; border-radius: 10px; font-weight: 700; font-size: 0.92rem;
  cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; width: fit-content;
}
.btn-primary:hover { opacity: 0.92; color: #fff; }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 2.8rem 0 2rem; margin-top: 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem;
  padding-bottom: 2rem; border-bottom: 1px solid var(--border);
}
.footer-heading {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.85rem;
}
.footer-col ul { list-style: none; display: grid; gap: 0.45rem; }
.footer-col a { font-size: 0.88rem; color: var(--text-2); }
.footer-col a:hover { color: var(--brand); }
.footer-about { font-size: 0.9rem; color: var(--text-2); margin-top: 0.75rem; max-width: 42ch; }
.footer-bottom {
  padding-top: 1.35rem; display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: 0.8rem; font-size: 0.83rem; color: var(--muted);
}

/* Cookie Banner */
.cookie-banner {
  position: fixed; bottom: 1rem; left: 1rem; right: 1rem; max-width: 680px; margin: 0 auto;
  z-index: 110; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-md);
  display: none; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.cookie-banner.show { display: flex; }
.cookie-banner p { font-size: 0.84rem; color: var(--text-2); flex: 1 1 280px; line-height: 1.5; }
.cookie-actions { display: flex; gap: 0.5rem; }
.cookie-btn {
  appearance: none; border: 1px solid var(--border-strong); background: var(--subtle);
  color: var(--text); padding: 0.48rem 0.95rem; border-radius: 8px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.cookie-btn.accept { background: var(--brand); border-color: var(--brand); color: #fff; }

.search-results-wrap { display: none; padding: 0 0 2.5rem; }
.search-results-wrap.show { display: block; }
.empty-msg {
  display: none; text-align: center; padding: 2.5rem 1rem;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-md); color: var(--muted);
}
.empty-msg.show { display: block; }

@media (max-width: 1020px) {
  .cards-grid, .cat-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .nav-links { display: none; }
  .menu-btn { display: grid; }
}
@media (max-width: 680px) {
  .cards-grid, .cat-hub-grid, .footer-grid, .contact-row { grid-template-columns: 1fr; }
}
