/* ── TopTrabajos Blog – Design System ─────────────────────────────────────── */
/* Standalone CSS for static blog pages, matching v2 app design tokens       */

/* ── Reset & Base ─────────────────────────────────────────────────────────── */

:root {
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

  /* Colors */
  --color-bg: #f8f9fb;
  --color-surface: #ffffff;
  --color-surface-2: #f1f3f9;
  --color-surface-3: #e8ebf2;
  --color-text: #1a1d26;
  --color-text-2: #5b6178;
  --color-text-3: #9499b3;
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-primary-light: #eef2ff;
  --color-primary-soft: #c7d2fe;
  --color-green: #22c55e;
  --color-green-bg: #f0fdf4;
  --color-amber: #f59e0b;
  --color-amber-bg: #fffbeb;
  --color-rose: #f43f5e;
  --color-rose-bg: #fff1f2;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.10);

  /* Radius */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-full: 9999px;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  color: var(--color-primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Navigation ───────────────────────────────────────────────────────────── */

.tt-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.tt-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 64px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tt-nav-logo {
  flex-shrink: 0;
}
.tt-nav-logo img {
  height: 28px;
}

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

.tt-nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-2);
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  transition: all 0.15s;
  text-decoration: none;
}
.tt-nav-link:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}
.tt-nav-link.active {
  color: var(--color-text);
  background: var(--color-surface-2);
}

.tt-nav-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.tt-nav-login {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-2);
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  transition: all 0.15s;
  text-decoration: none;
}
.tt-nav-login:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

.tt-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  text-decoration: none;
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}
.tt-btn-primary:hover {
  background: var(--color-primary-hover);
  color: white;
}

.tt-btn-sm {
  padding: 6px 16px;
  font-size: 0.875rem;
}
.tt-btn-md {
  padding: 10px 20px;
  font-size: 0.875rem;
}

/* Mobile hamburger */
.tt-nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
}
.tt-nav-hamburger:hover {
  background: var(--color-surface-2);
}
.tt-nav-hamburger svg {
  width: 22px;
  height: 22px;
  stroke: var(--color-text);
  stroke-width: 2;
  fill: none;
}

/* Mobile nav overlay + panel */
.tt-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0, 0, 0, 0.2);
  z-index: 40;
}
.tt-nav-mobile {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: white;
  box-shadow: var(--shadow-md);
  z-index: 50;
}
.tt-nav-mobile-inner {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 4px;
}
.tt-nav-mobile-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-2);
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  transition: all 0.15s;
  text-decoration: none;
}
.tt-nav-mobile-link:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}
.tt-nav-mobile-divider {
  border-top: 1px solid var(--color-surface-3);
  margin: 8px 0;
}
.tt-nav-mobile-login {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-2);
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  transition: all 0.15s;
  text-decoration: none;
}
.tt-nav-mobile-login:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

@media (max-width: 900px) {
  .tt-nav-links,
  .tt-nav-auth {
    display: none;
  }
  .tt-nav-hamburger {
    display: flex;
  }
  .tt-nav-inner {
    padding: 0 16px;
  }
}

@media (max-width: 600px) {
  .tt-nav-inner {
    padding: 0 16px;
  }
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.tt-footer {
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tt-footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
}

.tt-footer-brand p {
  font-size: 0.82em;
  color: rgba(255, 255, 255, 0.4);
  max-width: 280px;
  line-height: 1.6;
}
.tt-footer-brand a {
  display: block;
  margin-bottom: 12px;
}
.tt-footer-brand img {
  height: 28px;
  filter: brightness(0) invert(1);
}

.tt-footer-col h4 {
  text-transform: uppercase;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
}

.tt-footer-col a {
  display: flex;
  align-items: center;
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.4);
  padding: 4px 0;
  min-height: 36px;
  text-decoration: none;
  transition: color 0.15s;
}
.tt-footer-col a:hover {
  color: rgba(255, 255, 255, 0.8);
}

.tt-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.tt-footer-bottom-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  font-size: 0.78em;
  color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 900px) {
  .tt-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}
@media (max-width: 600px) {
  .tt-footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px 16px;
  }
  .tt-footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: 4px;
    padding: 20px 16px;
  }
  .tt-footer-blog {
    padding: 24px 16px 24px;
  }
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

.tt-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
  width: 100%;
}

.tt-article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .tt-article-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .tt-main {
    padding: 24px 16px;
  }
}

/* ── Breadcrumbs ──────────────────────────────────────────────────────────── */

.tt-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--color-text-3);
  margin-bottom: 24px;
}
.tt-breadcrumbs a {
  color: var(--color-text-3);
  text-decoration: none;
  transition: color 0.15s;
}
.tt-breadcrumbs a:hover {
  color: var(--color-primary);
}
.tt-breadcrumbs .separator {
  color: var(--color-text-3);
}

/* ── Article Header ───────────────────────────────────────────────────────── */

.tt-article-header {
  margin-bottom: 32px;
}

.tt-category-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  text-decoration: none;
}
.tt-category-badge:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
}

.tt-article-header h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: 12px;
}

.tt-article-meta {
  font-size: 0.82rem;
  color: var(--color-text-3);
}

/* ── Prose (article body) ─────────────────────────────────────────────────── */

.tt-prose {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
}

.tt-prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.tt-prose h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.tt-prose h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.tt-prose p {
  margin-bottom: 1.25rem;
}

.tt-prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--color-primary-soft);
}
.tt-prose a:hover {
  color: var(--color-primary-hover);
  text-decoration-color: var(--color-primary-hover);
}

.tt-prose strong {
  font-weight: 700;
}
.tt-prose em {
  font-style: italic;
}

.tt-prose ul,
.tt-prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.tt-prose ul {
  list-style: disc;
}
.tt-prose ol {
  list-style: decimal;
}
.tt-prose li {
  margin-bottom: 0.375rem;
}
.tt-prose li > ul,
.tt-prose li > ol {
  margin-top: 0.375rem;
  margin-bottom: 0;
}

.tt-prose blockquote {
  border-left: 4px solid var(--color-primary-soft);
  padding: 12px 20px;
  margin: 1.5rem 0;
  background: var(--color-primary-light);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  color: var(--color-text-2);
}
.tt-prose blockquote p:last-child {
  margin-bottom: 0;
}

.tt-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.tt-prose th {
  background: var(--color-surface-2);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--color-surface-3);
}
.tt-prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-surface-3);
}
.tt-prose tr:last-child td {
  border-bottom: none;
}

.tt-prose img {
  border-radius: var(--radius-xs);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.tt-prose hr {
  border: none;
  border-top: 1px solid var(--color-surface-3);
  margin: 2rem 0;
}

.tt-prose code {
  background: var(--color-surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
}
.tt-prose pre {
  background: var(--color-text);
  color: #e2e8f0;
  padding: 16px 20px;
  border-radius: var(--radius-xs);
  overflow-x: auto;
  margin: 1.5rem 0;
}
.tt-prose pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

/* ── Tags ─────────────────────────────────────────────────────────────────── */

.tt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-surface-3);
}
.tt-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-2);
  background: var(--color-surface-2);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.15s;
}
.tt-tag:hover {
  background: var(--color-surface-3);
  color: var(--color-text);
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */

.tt-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 96px;
}

.tt-sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-3);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.tt-sidebar-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.tt-sidebar-card p {
  font-size: 0.82rem;
  color: var(--color-text-2);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ── Cards (category listing, blog index) ─────────────────────────────────── */

.tt-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.tt-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-3);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.tt-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--color-primary-soft);
  transform: translateY(-2px);
}
.tt-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--color-text);
}
.tt-card p {
  font-size: 0.85rem;
  color: var(--color-text-2);
  line-height: 1.5;
  flex: 1;
}
.tt-card-meta {
  font-size: 0.75rem;
  color: var(--color-text-3);
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Blog Index ───────────────────────────────────────────────────────────── */

.tt-blog-hero {
  text-align: center;
  padding: 48px 0 40px;
}
.tt-blog-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.tt-blog-hero p {
  font-size: 1.05rem;
  color: var(--color-text-2);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Browse Bar (country dropdown + topic pills) ─────────────────────────── */

.tt-browse-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.tt-country-select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tt-country-select-wrap label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-2);
  white-space: nowrap;
}

.tt-country-select-wrap select {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-surface-3);
  border-radius: var(--radius-lg);
  padding: 8px 36px 8px 14px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6178' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 200px;
}

.tt-country-select-wrap select:hover {
  border-color: var(--color-primary-soft);
}

.tt-country-select-wrap select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.tt-topic-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tt-topic-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary-soft);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.15s;
}

.tt-topic-pill:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

@media (max-width: 600px) {
  .tt-browse-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .tt-country-select-wrap select {
    width: 100%;
    min-width: 0;
  }
  .tt-topic-pills {
    justify-content: center;
  }
}

/* ── Footer Blog Links ───────────────────────────────────────────────────── */

.tt-footer-blog {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 32px;
}

.tt-footer-blog h4 {
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 16px;
}

.tt-footer-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px 24px;
  margin-bottom: 20px;
}

.tt-footer-blog-grid a {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  padding: 3px 0;
  transition: color 0.15s;
}

.tt-footer-blog-grid a:hover {
  color: white;
}

.tt-footer-blog-topics {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tt-footer-blog-topics a {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.15s;
}

.tt-footer-blog-topics a:hover {
  color: white;
}

/* ── Category Page ────────────────────────────────────────────────────────── */

.tt-category-header {
  margin-bottom: 32px;
}
.tt-category-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.tt-category-header p {
  font-size: 0.95rem;
  color: var(--color-text-2);
}

/* ── Legal pages (full-width, compact) ────────────────────────────────────── */

.tt-legal-layout {
  grid-template-columns: 1fr;
  max-width: 780px;
}

.tt-legal-layout .tt-sidebar {
  display: none;
}

.tt-legal-layout .tt-prose h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.375rem;
}

.tt-legal-layout .tt-prose p {
  margin-bottom: 0.875rem;
}

.tt-legal-layout .tt-prose ul,
.tt-legal-layout .tt-prose ol {
  margin-bottom: 0.875rem;
}

/* ── Calculator placeholder ───────────────────────────────────────────────── */

.tt-calculator-placeholder {
  background: var(--color-primary-light);
  border: 2px dashed var(--color-primary-soft);
  border-radius: var(--radius);
  padding: 32px;
  margin: 24px 0;
  text-align: center;
  color: var(--color-text-2);
}

/* ── Pagination ───────────────────────────────────────────────────────────── */

.tt-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--color-surface-3);
  flex-wrap: wrap;
}

.tt-pagination a,
.tt-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-xs);
  text-decoration: none;
  transition: all 0.15s;
}

.tt-pagination a {
  color: var(--color-text-2);
  background: var(--color-surface);
  border: 1px solid var(--color-surface-3);
}
.tt-pagination a:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-soft);
  color: var(--color-primary);
}

.tt-pagination .current {
  background: var(--color-primary);
  color: white;
  font-weight: 600;
  border: 1px solid var(--color-primary);
}

.tt-pagination .dots {
  color: var(--color-text-3);
  border: none;
  background: none;
  min-width: 24px;
  padding: 0;
}

.tt-pagination .prev,
.tt-pagination .next {
  font-weight: 600;
  gap: 4px;
}

/* ── AdSense Ad Units ─────────────────────────────────────────────────────── */

.tt-ad {
  margin: 2rem 0;
  text-align: center;
  overflow: hidden;
  clear: both;
}

.tt-ad-in-content {
  margin: 1.5rem 0 2rem;
}

.tt-ad-after-article {
  margin: 2.5rem 0 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-surface-3);
}

.tt-ad ins {
  display: block;
}

@media (max-width: 600px) {
  .tt-article-header h1 {
    font-size: 1.5rem;
  }
  .tt-blog-hero h1 {
    font-size: 1.75rem;
  }
  .tt-blog-hero {
    padding: 32px 0 24px;
  }
  .tt-pagination {
    gap: 4px;
    margin-top: 32px;
  }
  .tt-pagination a,
  .tt-pagination span {
    min-width: 36px;
    height: 36px;
    font-size: 0.82rem;
  }
}
