/* ===== WORKATIONS SANABRIA - SITE STYLES ===== */

:root {
  /* Colors - Nature palette */
  --green-900: #1a3c2a;
  --green-700: #2d6a4f;
  --green-500: #40916c;
  --green-300: #95d5b2;
  --green-100: #d8f3dc;

  --blue-900: #0b2b3d;
  --blue-700: #1b6094;
  --blue-500: #2d9cdb;
  --blue-300: #7ec8e3;
  --blue-100: #d4f1f9;

  --earth-700: #8b5a2b;
  --earth-500: #c8955a;
  --earth-300: #e8c896;

  --white: #ffffff;
  --gray-50: #f8faf9;
  --gray-100: #f0f4f3;
  --gray-200: #e2e8e6;
  --gray-300: #cbd5d0;
  --gray-500: #6b7c73;
  --gray-700: #3a4a41;
  --gray-900: #1a2a22;

  /* Layout */
  --max-width: 1100px;
  --header-height: 64px;
  --nav-width: 280px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: var(--blue-700); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--blue-500); }

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

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--green-900);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--white);
  text-decoration: none;
}

.header-brand:hover { color: var(--green-300); }

.header-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--green-500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.header-subtitle {
  font-size: 0.75rem;
  color: var(--green-300);
  display: block;
  font-weight: 400;
}

/* ===== HAMBURGER BUTTON ===== */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: relative;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s ease;
  margin: 3px 0;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== SIDEBAR NAVIGATION ===== */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: calc(-1 * var(--nav-width));
  width: var(--nav-width);
  height: calc(100vh - var(--header-height));
  background: var(--white);
  box-shadow: 2px 0 12px rgba(0,0,0,0.1);
  transition: left 0.35s ease;
  z-index: 999;
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar.open { left: 0; }

.sidebar-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray-500);
  padding: 0.75rem 1.25rem 0.35rem;
  font-weight: 600;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  color: var(--gray-700);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: var(--green-100);
  color: var(--green-900);
  border-left-color: var(--green-500);
}

.sidebar-nav li a .nav-icon {
  width: 22px;
  text-align: center;
  font-size: 1rem;
}

/* ===== MAIN CONTENT ===== */
.main {
  margin-top: var(--header-height);
  padding: 0;
  transition: margin-left 0.35s ease;
  min-height: calc(100vh - var(--header-height));
}

.page-hero {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 50%, var(--blue-900) 100%);
  color: var(--white);
  padding: 3rem 1.5rem;
  text-align: center;
}

.page-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.page-hero p {
  font-size: 1.05rem;
  color: var(--green-300);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.6;
}

.page-hero .hero-meta {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--blue-300);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ===== CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

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

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

.card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--gray-200);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--green-900);
}

.card p {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green-700);
}

.card .card-link:hover { color: var(--green-500); }

/* ===== TABLE OF CONTENTS ===== */
.toc {
  background: var(--white);
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border: 1px solid var(--gray-200);
}

.toc h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--green-900);
}

.toc ol {
  list-style: none;
  counter-reset: toc-counter;
}

.toc ol li {
  counter-increment: toc-counter;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.toc ol li:last-child { border-bottom: none; }

.toc ol li a {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.95rem;
}

.toc ol li a::before {
  content: counter(toc-counter);
  width: 26px;
  height: 26px;
  background: var(--green-700);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== SECTION ===== */
.section {
  margin-bottom: 2.5rem;
}

.section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-900);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--green-300);
}

.section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 1.5rem 0 0.75rem;
}

.section p {
  margin-bottom: 0.9rem;
  color: var(--gray-700);
  line-height: 1.7;
}

.section ul, .section ol {
  margin: 0.5rem 0 1rem 1.4rem;
  color: var(--gray-700);
}

.section li { margin-bottom: 0.4rem; }

/* ===== TABLES ===== */
.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  background: var(--green-900);
  color: var(--white);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:nth-child(even) td { background: var(--gray-50); }
tr:hover td { background: var(--green-100); }

/* ===== STATS BAR ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

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

.stat {
  background: var(--white);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  border: 1px solid var(--gray-200);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--green-700);
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.25rem;
  display: block;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  padding: 0.75rem 1.5rem;
  background: var(--gray-100);
  font-size: 0.82rem;
}

.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--green-700); }
.breadcrumb .current { color: var(--gray-700); font-weight: 600; }
.breadcrumb .sep { color: var(--gray-300); margin: 0 0.4rem; }

/* ===== CALLOUT BOX ===== */
.callout {
  background: var(--green-100);
  border-left: 4px solid var(--green-500);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
}

.callout.info {
  background: var(--blue-100);
  border-left-color: var(--blue-500);
}

.callout h4 {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.callout p { font-size: 0.88rem; margin: 0; color: var(--gray-700); }

/* ===== FOOTER ===== */
.footer {
  background: var(--green-900);
  color: var(--green-300);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
  margin-top: 3rem;
}

.footer a { color: var(--green-300); }
.footer a:hover { color: var(--white); }

/* ===== HIGHLIGHT ===== */
.highlight {
  background: var(--green-100);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .page-hero { padding: 4rem 2rem; }
  .page-hero h1 { font-size: 2.5rem; }
  .container { padding: 2.5rem 2rem; }
}

@media (min-width: 1024px) {
  .page-hero h1 { font-size: 3rem; }
  .container { padding: 3rem 2rem; }
}

/* ===== PRINT ===== */
@media print {
  .header, .sidebar, .sidebar-overlay, .hamburger, .footer { display: none; }
  .main { margin-top: 0; }
  .page-hero { padding: 2rem; }
}

/* ===== KEYFRAMES ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin: 1.5rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--green-300);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.6rem;
  top: 1.25rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green-500);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--green-500);
}

.timeline-item h4 {
  font-size: 0.95rem;
  color: var(--green-900);
  margin-bottom: 0.3rem;
}

.timeline-item .period {
  font-size: 0.8rem;
  color: var(--green-500);
  font-weight: 600;
}

.timeline-item p { font-size: 0.88rem; color: var(--gray-500); margin: 0; }

/* ===== TAGS ===== */
.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-green { background: var(--green-100); color: var(--green-900); }
.tag-blue { background: var(--blue-100); color: var(--blue-900); }
.tag-earth { background: var(--earth-300); color: var(--earth-700); }

/* ===== RISK MATRIX ===== */
.risk-matrix {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}

.risk-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.risk-item .risk-name { font-weight: 600; font-size: 0.9rem; }
.risk-item .risk-prob { font-size: 0.78rem; padding: 0.2rem 0.6rem; border-radius: 4px; }
.risk-item .risk-impact { font-size: 0.78rem; padding: 0.2rem 0.6rem; border-radius: 4px; }

.risk-alta { background: #fde8e8; color: #b91c1c; }
.risk-media { background: #fef3c7; color: #92400e; }
.risk-baja { background: #d1fae5; color: #065f46; }