:root {
  --brand-50: #eef6ff;
  --brand-100: #d9ebff;
  --brand-200: #bcdcff;
  --brand-300: #8ec6ff;
  --brand-400: #59a6ff;
  --brand-500: #3382fc;
  --brand-600: #1d60f1;
  --brand-700: #154bde;
  --brand-800: #173db4;
  --brand-900: #193a8d;
  --brand-950: #142556;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --font-sans: "Arial", "Helvetica Neue", Helvetica, sans-serif;
}

[data-theme="dark"] {
  --gray-50: #0f172a;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-400: #94a3b8;
  --gray-500: #cbd5e1;
  --gray-600: #e2e8f0;
  --gray-700: #f1f5f9;
  --gray-800: #f8fafc;
  --gray-900: #ffffff;
  --surface: #1e293b;
  --surface-hover: #334155;
}

:root {
  --surface: #fff;
  --surface-hover: #f9fafb;
}

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

[hidden] {
  display: none !important;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: var(--gray-50);
  color: var(--gray-800);
  font-family: var(--font-sans);
  transition: background 0.2s, color 0.2s;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--gray-200);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.header-inner {
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-700);
}

.logo-img {
  height: 34px;
  width: auto;
}

.logo span {
  color: var(--brand-500);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  transition: background 0.15s, color 0.15s;
}

.main-nav a:hover {
  background: var(--gray-100);
  color: var(--brand-700);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--surface);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.theme-toggle:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.btn-link {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  transition: background 0.15s;
}

.btn-link:hover {
  background: var(--gray-100);
}

.btn-brand {
  display: inline-block;
  padding: 11px 20px;
  border: none;
  border-radius: 12px;
  background: var(--brand-700);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(29, 96, 241, 0.25);
}

.btn-brand:hover {
  background: var(--brand-800);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(29, 96, 241, 0.35);
}

.btn-brand-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-brand-lg {
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 16px;
}

.btn-brand-block {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 40px;
  border-radius: 14px;
}

@media (max-width: 820px) {
  .main-nav,
  .btn-link.hide-mobile {
    display: none;
  }
}

/* ---------- Hero ---------- */

.hero {
  background-image: linear-gradient(180deg, rgba(21, 75, 222, 0.85), rgba(20, 37, 86, 0.92)), url("../banner.webp");
  background-size: cover;
  background-position: center;
  padding: 64px 0 56px;
  text-align: center;
}

/* En móvil no tiene sentido bajar la versión de 1920 px. */
@media (max-width: 768px) {
  .hero {
    background-image: linear-gradient(180deg, rgba(21, 75, 222, 0.85), rgba(20, 37, 86, 0.92)), url("../banner-1440.webp");
  }
}

.hero h1 {
  max-width: 640px;
  margin: 0 auto;
  color: #fff;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
}

.hero p {
  max-width: 560px;
  margin: 12px auto 0;
  color: var(--brand-100);
  font-size: 16px;
}

.search-wrap {
  width: 100%;
  max-width: 720px;
  margin: 32px auto 0;
  text-align: left;
}

/* ---------- Search form ---------- */

.search-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-form.light {
  border-color: var(--gray-200);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-form input[type="search"],
.search-form select {
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-50);
  font-size: 15px;
  font-family: inherit;
  color: var(--gray-900);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

[data-theme="dark"] .search-form input[type="search"],
[data-theme="dark"] .search-form select {
  background: var(--gray-100);
  color: var(--gray-900);
}

[data-theme="dark"] .search-form select option {
  background: var(--gray-100);
  color: var(--gray-900);
}

[data-theme="dark"] .form-field select option {
  background: var(--gray-100);
  color: var(--gray-900);
}

.search-form input[type="search"]:focus,
.search-form select:focus {
  border-color: var(--brand-500);
  background: #fff;
  box-shadow: 0 0 0 3px var(--brand-100);
}

.search-form input[type="search"] {
  width: 100%;
}

.search-form input[type="search"]::placeholder {
  color: var(--gray-400);
}

.search-form select {
  color: var(--gray-700);
  cursor: pointer;
}

.search-form .btn-brand {
  height: 48px;
  border-radius: 10px;
  padding-left: 28px;
  padding-right: 28px;
  font-size: 15px;
  white-space: nowrap;
}

/* ---------- Hero con búsqueda y filtros separados ---------- */

.search-form.hero-split {
  display: grid;
  grid-template-columns: 1fr;
}

.search-form.hero-split .hero-q {
  order: 1;
}

.search-form.hero-split .hero-btn {
  order: 2;
  width: 100%;
}

.search-form.hero-split .hero-f {
  order: 3;
}

@media (min-width: 700px) {
  .search-form.hero-split {
    grid-template-columns: 1fr 1fr 1fr auto;
  }

  .search-form.hero-split .hero-q {
    grid-column: 1 / 4;
    grid-row: 1;
  }

  .search-form.hero-split .hero-btn {
    grid-column: 4;
    grid-row: 1;
    width: auto;
  }

  .search-form.hero-split .hero-f {
    grid-row: 2;
  }
}

@media (min-width: 700px) {
  .search-form {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(125px, auto)) auto;
    gap: 8px;
    padding: 8px;
  }

  .search-form input[type="search"] {
    flex: 1 1 260px;
  }

  .search-form .btn-brand {
    align-self: stretch;
    justify-self: stretch;
  }
}

.popular-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--brand-100);
}

.chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: var(--brand-700);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s;
}

a.chip:hover {
  background: var(--brand-600);
}

button.chip {
  font-family: inherit;
  cursor: pointer;
}

.job-card .excerpt {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-600);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chip.light {
  border-color: transparent;
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 500;
}

a.chip.light:hover {
  background: var(--gray-200);
}

.chip.active {
  background: var(--brand-700);
  color: #fff;
}

/* ---------- Sections ---------- */

.section {
  padding: 56px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
}

.section-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-700);
}

.section-link:hover {
  text-decoration: underline;
}

/* ---------- Categories grid ---------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
}

@media (min-width: 640px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.category-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--surface);
  transition: box-shadow 0.15s;
}

.category-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.category-card .icon {
  font-size: 26px;
}

.category-card .name {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
}

.category-card .count {
  margin-top: 2px;
  font-size: 12px;
  color: var(--gray-500);
}

/* ---------- Job grid & cards ---------- */

.job-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 24px;
  align-items: start;
}

@media (min-width: 768px) {
  .job-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .job-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.job-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.job-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  border-color: var(--brand-300);
}

.job-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.job-card h3 {
  color: var(--brand-700);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.job-card:hover h3 {
  text-decoration: underline;
}

.job-card .company {
  margin-top: 4px;
  font-size: 14px;
  color: var(--gray-600);
}

.job-card .location {
  margin-top: 4px;
  font-size: 14px;
  color: var(--gray-500);
}

.job-logo {
  display: flex;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(29, 96, 241, 0.15);
}

.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
}

.tag {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-weight: 500;
}

.tag.brand {
  background: var(--brand-50);
  color: var(--brand-700);
}

.job-card .posted {
  margin-top: 12px;
  font-size: 13px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .job-card .posted {
  color: #a5b4cb;
}

[data-theme="dark"] .job-card .company {
  color: #e2e8f0;
}

[data-theme="dark"] .job-card .location {
  color: #94a3b8;
}

.job-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 82%;
  max-width: 260px;
  height: auto;
  transform: translate(-50%, -50%) rotate(-8deg);
  opacity: 0.92;
  pointer-events: none;
}

/* ---------- Empleos page ---------- */

.list-header {
  border-bottom: 1px solid var(--gray-200);
  background: var(--surface);
  padding: 32px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.list-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
}

.list-header .search-form {
  margin-top: 16px;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.results-info {
  margin-top: 40px;
  font-size: 14px;
  color: var(--gray-600);
}

.empty-state {
  margin-top: 24px;
  padding: 48px 24px;
  border: 1px dashed var(--gray-300);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.empty-state h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
}

.empty-state p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--gray-600);
}

.empty-state .btn-brand {
  margin-top: 16px;
}

/* ---------- Detalle ---------- */

.detail-page {
  max-width: 864px;
  margin: 0 auto;
  padding: 32px 16px;
}

.back-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-700);
}

.back-link:hover {
  text-decoration: underline;
}

.job-detail {
  position: relative;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--surface);
}

.detail-stamp {
  position: absolute;
  top: 20px;
  left: 50%;
  width: min(320px, 75%);
  height: auto;
  transform: translateX(-50%) rotate(-8deg);
  opacity: 0.94;
  pointer-events: none;
  z-index: 2;
}

.detail-hero {
  padding: 24px;
  background: linear-gradient(90deg, var(--brand-800), var(--brand-950));
  color: #fff;
}

.detail-hero .posted-by {
  font-size: 13px;
  color: var(--brand-200);
}

.detail-hero h1 {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.detail-hero .company {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 500;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.detail-hero .job-logo {
  flex-basis: 64px;
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
}

.detail-hero .job-tags {
  margin-top: 16px;
}

.detail-hero .tag {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.detail-body {
  padding: 24px;
}

.detail-body h2 {
  margin-top: 32px;
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.detail-body h2:first-child {
  margin-top: 0;
}

.detail-body p {
  margin-top: 12px;
  line-height: 1.6;
  color: var(--gray-700);
  white-space: pre-line;
}

.detail-list {
  margin-top: 12px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-list li {
  display: flex;
  gap: 8px;
  color: var(--gray-700);
  line-height: 1.5;
}

.detail-list .mark {
  color: var(--brand-700);
  font-weight: 700;
}

.apply-btn {
  display: block;
  width: 100%;
  margin-top: 32px;
  padding: 14px;
  border: none;
  border-radius: 8px;
  background: var(--brand-700);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}

.apply-btn:hover {
  background: var(--brand-800);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: auto;
  background: var(--brand-950);
  color: var(--gray-300);
}

[data-theme="dark"] .site-footer {
  background: #090e1a;
  color: #94a3b8;
}

[data-theme="dark"] .footer-brand .logo {
  color: #ffffff;
}

[data-theme="dark"] .footer-brand .logo span {
  color: #59a6ff;
}

[data-theme="dark"] .footer-col h3 {
  color: #ffffff;
}

[data-theme="dark"] .footer-col a {
  color: #94a3b8;
}

[data-theme="dark"] .footer-col a:hover {
  color: #ffffff;
}

[data-theme="dark"] .footer-bottom {
  color: #64748b;
  border-top-color: #1e293b;
}

[data-theme="dark"] .footer-bottom a:hover {
  color: #ffffff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 48px 0;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(5, 1fr);
    text-align: left;
  }

  .footer-brand {
    text-align: left;
  }

  .footer-col {
    text-align: left;
  }
}

.footer-brand,
.footer-col {
  text-align: center;
}

.footer-brand {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .footer-brand {
    grid-column: span 2;
  }
}

.footer-brand .logo {
  color: #fff;
}

.footer-brand .logo span {
  color: var(--brand-300);
}

.footer-brand p {
  max-width: 280px;
  margin: 16px auto 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-400);
  text-align: center;
}

.footer-col h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.footer-col ul {
  margin-top: 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  font-size: 14px;
  color: var(--gray-400);
  transition: color 0.15s;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px 0;
  font-size: 12px;
  color: var(--gray-500);
}

[data-theme="dark"] .footer-bottom {
  border-top-color: var(--gray-200);
}

.footer-bottom .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

@media (min-width: 640px) {
  .footer-bottom .container {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-bottom nav {
  display: flex;
  gap: 16px;
}

.footer-bottom a:hover {
  color: var(--gray-300);
}

/* ---------- Publicidad ---------- */

.ad {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border: 2px dashed #eab308;
  border-radius: 12px;
  background: #fef9e7;
  color: var(--gray-600);
  text-align: center;
}

[data-theme="dark"] .ad {
  background: #422006;
  color: var(--gray-300);
}

.ad-label {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 2px 6px;
  border: 1px solid #fde68a;
  border-radius: 4px;
  background: var(--surface);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-400);
}

.ad-icon {
  font-size: 34px;
  line-height: 1;
}

.ad strong {
  font-size: 18px;
  font-weight: 700;
  color: #92400e;
}

[data-theme="dark"] .ad strong {
  color: #fbbf24;
}

.ad p {
  max-width: 320px;
  font-size: 13px;
  line-height: 1.5;
}

.ad .btn-brand {
  margin-top: 4px;
}

.ad-horizontal {
  width: 100%;
  max-width: 100%;
  min-height: 90px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 16px;
  padding: 12px 24px;
  text-align: left;
  box-sizing: border-box;
}

.ad-horizontal .ad-icon {
  font-size: 28px;
}

.ad-horizontal .ad-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ad-horizontal .ad-body strong {
  font-size: 15px;
}

.ad-horizontal p {
  font-size: 12px;
}

.ad-horizontal .btn-brand {
  padding: 6px 12px;
  font-size: 12px;
  margin-top: 0;
  flex-shrink: 0;
}

.ad-square {
  min-height: 200px;
  aspect-ratio: 6 / 5;
  max-width: 300px;
  margin: 0 auto;
}

.ad-rectangle {
  width: 100%;
  max-width: 336px;
  height: 280px;
  margin: 0 auto;
}

.ad-skyscraper {
  width: 100%;
  min-height: 600px;
}

@media (min-width: 1200px) {
  .ad-skyscraper {
    position: sticky;
    top: 84px;
  }
}

@media (max-width: 1199px) {
  .ad-skyscraper {
    min-height: auto;
    max-height: 280px;
    height: auto;
  }
  .ad-skyscraper.ad-custom img {
    max-height: 260px;
  }
}

.ad-custom {
  padding: 8px;
  border-style: solid;
  border-color: #fde68a;
  background: #fffbeb;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

[data-theme="dark"] .ad-custom {
  background: #422006;
  border-color: #92400e;
}

.ad-custom img {
  position: static;
  inset: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.ad-horizontal.ad-custom,
.ad-square.ad-custom,
.ad-rectangle.ad-custom,
.ad-skyscraper.ad-custom {
  display: block;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  max-width: 100%;
}

.ad-horizontal.ad-custom {
  max-width: 728px;
  margin: 0 auto;
  padding: 8px;
}

.ad-square.ad-custom {
  max-width: 300px;
  margin: 0 auto;
}

.ad-rectangle.ad-custom {
  max-width: 336px;
  margin: 0 auto;
}

.ad-skyscraper.ad-custom {
  max-width: 300px;
  margin: 0 auto;
}

.ad-slot {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Zonas publicitarias fuera del contenido de los avisos. */
.ad-band {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

/* ---------- Marquee continuo de marcas / empresas colaboradoras ----------
   Nombres "brand-*" a propósito: evita que filtros cosméticos de bloqueadores
   confundan la tira de marcas con publicidad invasiva. */

.brand-showcase {
  position: relative;
  margin-top: 24px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  padding: 14px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.brand-marquee-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
}

.brand-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: brandMarquee var(--brand-duration, 28s) linear infinite;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* Cada grupo es idéntico y la animación mueve media pista: loop exacto, sin saltos. */
.brand-set {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 36px;
  padding-right: 36px;
}

@keyframes brandMarquee {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

.brand-track.is-offscreen,
.brand-track.is-tab-hidden,
.brand-showcase:hover .brand-track,
.brand-showcase:focus-within .brand-track {
  animation-play-state: paused;
}

.brand-item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--surface);
  transition: transform 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
}

.brand-item:hover {
  transform: translateY(-2px) scale(1.03);
}

.brand-logo {
  height: 42px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  display: block;
}

.brand-empty {
  text-align: center;
  font-size: 14px;
  color: var(--gray-500);
  padding: 16px;
}

/* Preview del generador de sponsors: estático, con las mismas clases del sitio. */
.brand-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 360px;
  margin: 0 auto;
  padding: 18px;
}

.brand-preview .brand-item {
  margin: 0 auto;
}

@media (min-width: 768px) {
  .brand-logo {
    height: 52px;
    max-width: 190px;
  }

  .brand-set {
    gap: 48px;
    padding-right: 48px;
  }
}

@media (hover: none) {
  .brand-showcase:hover .brand-track {
    animation-play-state: running;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-track {
    animation: none !important;
  }

  .brand-marquee-viewport {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .brand-marquee-viewport::-webkit-scrollbar {
    display: none;
  }
}

/* ---------- Layout con riel lateral (solo pantallas anchas) ---------- */

.layout-with-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.layout-main {
  flex: 1;
  min-width: 0;
}

/* El riel no ocupa espacio en mobile/tablet: los avisos van abajo del listado. */
.layout-side {
  display: none;
  flex-shrink: 0;
}

.ad-band-mobile {
  display: block;
}

@media (min-width: 1200px) {
  .layout-with-sidebar {
    flex-direction: row;
  }

  .layout-side {
    display: block;
    width: 300px;
  }

  .ad-band-mobile {
    display: none;
  }
}

/* ---------- Formulario ---------- */

.form-card {
  padding: 24px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--surface);
}

.form-card h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
}

.form-card .intro {
  margin-top: 8px;
  font-size: 14px;
  color: var(--gray-600);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 24px;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
}

.form-field label .req {
  color: var(--brand-700);
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-900);
  outline: none;
  transition: border-color 0.15s;
}

[data-theme="dark"] .form-field input,
[data-theme="dark"] .form-field select,
[data-theme="dark"] .form-field textarea {
  background: var(--gray-100);
  color: var(--gray-900);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--brand-500);
}

.form-field textarea {
  resize: vertical;
}

.form-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--gray-500);
}

.form-success {
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  color: var(--brand-800);
  font-size: 14px;
  font-weight: 500;
}

[data-theme="dark"] .form-success {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--gray-800);
}

.form-success:empty {
  display: none;
}

/* ---------- Panel administración ---------- */

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .admin-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.ads-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--surface);
}

.ad-item .thumb {
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--gray-100);
}

.ad-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ad-item .thumb .placeholder-img {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 28px;
}

.ad-item .info {
  flex: 1;
  min-width: 0;
}

.ad-item .info .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
}

.ad-item .info .meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-500);
}

.ad-item .info .link {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--brand-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-item .actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ad-item .toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.ad-item .toggle input {
  display: none;
}

.ad-item .toggle .lever {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--gray-300);
  transition: background 0.15s;
}

.ad-item .toggle .lever::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: 2px;
  border-radius: 50%;
  background: #fff;
  transition: margin 0.15s;
}

.ad-item .toggle input:checked + .lever {
  background: var(--brand-600);
}

.ad-item .toggle input:checked + .lever::after {
  margin-left: 18px;
}

.btn-danger {
  padding: 6px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--surface);
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-danger:hover {
  border-color: var(--brand-700);
  color: var(--brand-700);
}

.btn-edit {
  padding: 6px 12px;
  border: 1px solid var(--brand-200);
  border-radius: 6px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

[data-theme="dark"] .btn-edit {
  background: var(--gray-100);
}

.btn-edit:hover {
  background: var(--brand-100);
}

/* ---------- Tabla de datos (perfiles) ---------- */

.data-tools {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.data-tools input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

[data-theme="dark"] .data-tools input {
  background: var(--gray-100);
  color: var(--gray-900);
}

.data-tools input:focus {
  border-color: var(--brand-500);
}

.data-count {
  margin-top: 12px;
  font-size: 13px;
  color: var(--gray-600);
}

.data-table-wrap {
  margin-top: 12px;
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--gray-100);
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
}

.data-table td {
  color: var(--gray-700);
  max-width: 280px;
  overflow-wrap: anywhere;
}

.file-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--gray-500);
}

/* ---------- Ajustes de Contraste en Modo Oscuro ---------- */
[data-theme="dark"] .job-card h3 {
  color: #59a6ff;
}

[data-theme="dark"] .job-card .company {
  color: #e2e8f0;
}

[data-theme="dark"] .job-card .location {
  color: #94a3b8;
}

[data-theme="dark"] .job-card .excerpt {
  color: #cbd5e1;
}

[data-theme="dark"] .job-logo {
  background: rgba(51, 130, 252, 0.2);
  color: #59a6ff;
}

[data-theme="dark"] .job-detail {
  border-color: #334155;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .detail-hero {
  background: linear-gradient(90deg, #173db4, #0f1a33);
}

[data-theme="dark"] .detail-hero .posted-by {
  color: #93c5fd;
}

[data-theme="dark"] .tag {
  background: #334155;
  color: #e2e8f0;
}

[data-theme="dark"] .tag.brand {
  background: rgba(51, 130, 252, 0.25);
  color: #8ec6ff;
  border: 1px solid rgba(51, 130, 252, 0.4);
}

[data-theme="dark"] .section-link,
[data-theme="dark"] .back-link {
  color: #59a6ff;
}

[data-theme="dark"] .chip.light {
  background: #334155;
  color: #e2e8f0;
}

[data-theme="dark"] .chip.light:hover {
  background: #475569;
}

[data-theme="dark"] .search-form input[type="search"]:focus,
[data-theme="dark"] .search-form select:focus,
[data-theme="dark"] .form-field input:focus,
[data-theme="dark"] .form-field select:focus,
[data-theme="dark"] .form-field textarea:focus {
  background: #1e293b;
  color: #ffffff;
  border-color: #3382fc;
  box-shadow: 0 0 0 3px rgba(51, 130, 252, 0.3);
}

[data-theme="dark"] .empty-state {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .empty-state h2 {
  color: #ffffff;
}

[data-theme="dark"] .empty-state p {
  color: #cbd5e1;
}

[data-theme="dark"] .form-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .form-card h1 {
  color: #ffffff;
}

[data-theme="dark"] .form-card .intro {
  color: #cbd5e1;
}

[data-theme="dark"] .form-field label {
  color: #e2e8f0;
}

[data-theme="dark"] .btn-danger {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}

[data-theme="dark"] .btn-danger:hover {
  border-color: #ef4444;
  color: #f87171;
}

[data-theme="dark"] .btn-edit {
  background: #334155;
  border-color: #475569;
  color: #8ec6ff;
}

[data-theme="dark"] .btn-edit:hover {
  background: #1e293b;
  color: #ffffff;
}

/* ---------- Vista Detalle de Empleo (Modo Oscuro) ---------- */
[data-theme="dark"] .job-detail {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .detail-body h2 {
  color: #ffffff;
}

[data-theme="dark"] .detail-body p,
[data-theme="dark"] .detail-list li {
  color: #e2e8f0;
}

[data-theme="dark"] .detail-list .mark {
  color: #59a6ff;
}

[data-theme="dark"] #apply-msg {
  color: #94a3b8 !important;
}

/* ---------- Herramienta Publicidad (Modo Oscuro) ---------- */
[data-theme="dark"] .format-card {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
}

[data-theme="dark"] .format-card .fdims {
  color: #94a3b8;
}

[data-theme="dark"] .format-card:hover {
  border-color: #59a6ff;
}

[data-theme="dark"] .dropzone {
  border-color: #475569;
  color: #cbd5e1;
}

[data-theme="dark"] .dropzone:hover,
[data-theme="dark"] .dropzone.over {
  border-color: #3382fc;
  background: rgba(51, 130, 252, 0.15);
}

[data-theme="dark"] .compare th,
[data-theme="dark"] .compare td {
  border-bottom-color: #334155;
  color: #e2e8f0;
}

/* ---------- Skeletons de carga ----------
   Se muestran desde el primer paint (están en el HTML) y se reemplazan cuando
   llegan los datos, para que la página se sienta inmediata. */
.skeleton-line,
.skeleton-logo,
.skeleton-tag,
.skeleton-brand {
  position: relative;
  overflow: hidden;
  background: var(--gray-100);
}

.skeleton-line::after,
.skeleton-logo::after,
.skeleton-tag::after,
.skeleton-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: skeletonShimmer 1.4s infinite;
}

[data-theme="dark"] .skeleton-line::after,
[data-theme="dark"] .skeleton-logo::after,
[data-theme="dark"] .skeleton-tag::after,
[data-theme="dark"] .skeleton-brand::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
}

@keyframes skeletonShimmer {
  100% {
    transform: translateX(100%);
  }
}

.job-skeleton .skeleton-line {
  height: 12px;
  margin-top: 8px;
  border-radius: 6px;
}

.job-skeleton .skeleton-line:first-child {
  margin-top: 0;
}

.job-skeleton .skeleton-logo {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.job-skeleton .skeleton-tag {
  width: 64px;
  height: 22px;
  margin-top: 12px;
  border-radius: 6px;
}

.job-skeleton .skeleton-tag + .skeleton-tag {
  margin-left: 8px;
}

/* Tira de marcas en carga: misma altura que la definitiva. */
.brand-skeleton-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  min-height: 70px;
  padding: 0 24px;
}

.skeleton-brand {
  flex: 0 0 auto;
  width: 130px;
  height: 42px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-line::after,
  .skeleton-logo::after,
  .skeleton-tag::after,
  .skeleton-brand::after {
    animation: none;
  }
}