/* --- GLOBAL VARIABLES --- */
    :root {
      --primary: #0A4D68;
      --primary-dark: #06384d;
      --accent: #047857;
      --secondary: #D97706;

      --bg-body: #FAFAF9;
      --bg-card: #FFFFFF;

      --bg-calc-item: #FFFFFF;
      --bg-calc-item-hover: #FAFAF9;
      --border-calc: #E7E5E4;

      --text-main: #1C1917;
      --text-muted: #57534E;

      --border-subtle: #E7E5E4;

      --container-width: 1200px;
      --header-height: 90px;
    }

    /* Modo Oscuro */
    [data-theme="dark"] {
      --bg-body: #0C0A09;
      --bg-card: #1C1917;
      --bg-calc-item: #292524;
      --bg-calc-item-hover: #44403C;
      --border-calc: #44403C;
      --text-main: #F5F5F4;
      --text-muted: #A8A29E;
      --primary: #38BDF8;
      --accent: #34D399;
      --border-subtle: #292524;
    }

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

    body {
      font-family: 'Source Sans 3', sans-serif;
      background-color: var(--bg-body);
      color: var(--text-main);
      line-height: 1.7;
      -webkit-font-smoothing: antialiased;
      transition: background-color 0.5s ease, color 0.5s ease;
    }

    h1, h2, h3, h4, h5, h6 {
      font-family: 'Playfair Display', serif;
      font-weight: 700;
      color: var(--primary);
      letter-spacing: -0.02em;
    }

    a { text-decoration: none; color: inherit; transition: 0.3s ease; }
    ul { list-style: none; }
    img { max-width: 100%; display: block; }

    /* Screen-reader only */
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    /* A11y: visible focus */
    a:focus-visible, button:focus-visible, select:focus-visible {
      outline: 3px solid rgba(217,119,6,0.6);
      outline-offset: 3px;
      border-radius: 4px;
    }

    /* Skip link */
    .skip-link {
      position: absolute;
      left: -999px;
      top: 10px;
      background: #fff;
      color: #000;
      padding: 10px 14px;
      z-index: 2000;
      border-radius: 6px;
      box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    }
    .skip-link:focus { left: 10px; }

    /* --- ANIMATIONS --- */
    @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(20px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @keyframes rotate-scale {
      0% { transform: rotate(0) scale(1); }
      50% { transform: rotate(180deg) scale(1.2); }
      100% { transform: rotate(360deg) scale(1); }
    }
    .animate-fade-in { animation: fadeInUp 0.8s ease-out forwards; }
    .animate-theme-switch i, .animate-theme-switch svg { animation: rotate-scale 0.5s ease-in-out; }

    @media (prefers-reduced-motion: reduce) {
      .animate-fade-in { animation: none; }
      .animate-theme-switch i, .animate-theme-switch svg { animation: none; }
      html:focus-within { scroll-behavior: auto; }
    }

    /* --- LAYOUT --- */
    .container {
      max-width: var(--container-width);
      margin: 0 auto;
      padding: 0 24px;
    }

    /* --- HEADER & NAV --- */
    .top-bar {
      background-color: #0A4D68;
      color: #fff;
      padding: 8px 0;
      font-size: 0.85rem;
      position: relative;
      z-index: 1002;
    }
    .top-bar .container {
      display: flex;
      justify-content: flex-end;
      gap: 20px;
      padding-right: 20px;
      align-items: center;
    }

    .main-header {
      position: absolute;
      top: 40px;
      width: 100%;
      z-index: 1000;
      height: var(--header-height);
      border-bottom: 1px solid rgba(255,255,255,0.15);
      background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
    }
    .main-header .container {
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 100%;
      margin: 0;
      max-width: 100%;
      padding-left: 40px;
      padding-right: 40px;
    }

    .logo {
      font-family: 'Playfair Display', serif;
      font-size: 2rem;
      font-weight: 700;
      color: #fff;
      display: flex;
      align-items: center;
      gap: 12px;
      letter-spacing: -0.03em;
    }

    .nav-menu { display: flex; gap: 32px; }
    .nav-link {
      font-family: 'Source Sans 3', sans-serif;
      font-weight: 600;
      color: rgba(255, 255, 255, 0.9);
      font-size: 1rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      position: relative;
    }
    .nav-link::after {
      content: '';
      position: absolute;
      width: 0;
      height: 2px;
      bottom: -4px;
      left: 0;
      background-color: var(--secondary);
      transition: width 0.3s;
    }
    .nav-link:hover::after { width: 100%; }
    .nav-link:hover { color: #fff; }

    .btn-outline-white {
      border: 1px solid rgba(255,255,255,0.4);
      color: #fff;
      padding: 8px 24px;
      border-radius: 2px;
      text-transform: uppercase;
      font-size: 0.85rem;
      font-weight: 600;
      letter-spacing: 0.05em;
    }
    .btn-outline-white:hover {
      background-color: #fff;
      color: var(--primary);
      border-color: #fff;
    }

    /* --- ARTICLE HERO --- */
    .article-hero {
      height: 60vh;
      min-height: 520px;
      background-image:
        linear-gradient(to right,
          rgba(10, 77, 104, 0.95) 0%,
          rgba(10, 77, 104, 0.8) 50%,
          rgba(0,0,0,0.4) 100%
        ),
        url("../../img/cabecario.webp");
      background-size: cover;
      background-position: center;
      background-attachment: fixed;
      display: flex;
      align-items: center;
      position: relative;
      padding-top: 80px;
      color: #fff;
    }

    .article-hero-content {
      max-width: 860px;
      padding-left: 20px;
    }

    .article-tag {
      background-color: var(--secondary);
      color: #fff;
      padding: 4px 12px;
      text-transform: uppercase;
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.1em;
      border-radius: 2px;
      display: inline-block;
      margin-bottom: 20px;
    }

    .article-hero h1 {
      font-size: 3.2rem;
      color: #fff;
      line-height: 1.1;
      margin-bottom: 18px;
    }

    .article-subtitle {
      font-size: 1.1rem;
      color: rgba(255,255,255,0.88);
      max-width: 52rem;
    }

    .article-meta {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 18px;
      font-size: 0.92rem;
      color: rgba(255,255,255,0.82);
      font-family: 'Source Sans 3', sans-serif;
      margin-top: 22px;
    }

    .meta-item {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* --- ARTICLE LAYOUT --- */
    .article-container {
      max-width: 980px;
      margin: 60px auto;
      padding: 0 24px;
      display: block;
    }

    .article-body {
      font-size: 1.15rem;
      color: var(--text-main);
      line-height: 1.85;
    }

    .article-body p {
      margin-bottom: 1.55em;
      text-align: justify;
    }

    .article-body h2 {
      font-size: 2.05rem;
      margin-top: 2.3em;
      margin-bottom: 0.8em;
      color: var(--primary);
      text-align: center;
      border-bottom: 2px solid var(--accent);
      padding-bottom: 10px;
      display: inline-block;
      width: 100%;
      scroll-margin-top: 120px;
    }

    .article-body h3 {
      font-size: 1.55rem;
      margin-top: 2.0em;
      margin-bottom: 0.8em;
      color: var(--text-main);
      scroll-margin-top: 120px;
    }

    .article-body ul, .article-body ol {
      margin-bottom: 1.9em;
      padding-left: 20px;
      max-width: 92%;
      margin-left: auto;
      margin-right: auto;
      list-style: disc;
    }

    .article-body ol { list-style: decimal; }

    .article-body li {
      margin-bottom: 0.75em;
      padding-left: 6px;
      position: relative;
    }

    .article-body ul li::marker { color: var(--accent); }

    .article-body strong {
      color: var(--primary);
      font-weight: 700;
    }

    /* Health disclaimer (YMYL) */
    .medical-disclaimer {
      background-color: rgba(217, 119, 6, 0.08);
      border-left: 4px solid var(--secondary);
      padding: 18px 20px;
      border-radius: 6px;
      margin: 0 0 28px;
      font-size: 0.98rem;
      color: var(--text-main);
    }
    .medical-disclaimer strong { color: var(--text-main); }

    /* Highlights & Boxes */
    .clinical-pearl {
      background-color: rgba(4, 120, 87, 0.05);
      border-left: 4px solid var(--accent);
      padding: 26px;
      margin: 44px auto;
      border-radius: 6px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    }

    .clinical-pearl h4 {
      color: var(--accent);
      font-family: 'Source Sans 3', sans-serif;
      text-transform: uppercase;
      font-size: 0.85rem;
      letter-spacing: 0.1em;
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* Key Takeaways */
    .key-takeaways {
      background-color: var(--bg-card);
      border: 1px solid var(--border-subtle);
      border-top: 4px solid var(--primary);
      padding: 22px;
      margin-bottom: 24px;
      border-radius: 8px;
      box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    }
    .key-takeaways h4 {
      font-size: 1.1rem;
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      color: var(--primary);
    }
    .key-takeaways ul { list-style: none; padding-left: 0; max-width: 100%; }
    .key-takeaways ul li {
      font-size: 1rem;
      margin-bottom: 10px;
      position: relative;
      padding-left: 26px;
    }
    .key-takeaways ul li::before {
      content: '✓';
      position: absolute;
      left: 0;
      top: 0;
      color: var(--accent);
      font-weight: 700;
    }
    [data-theme="dark"] .key-takeaways { background-color: #1a1a1a; }

    /* Internal Link Card */
    .internal-link-card {
      background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
      color: white;
      padding: 20px 26px;
      border-radius: 10px;
      margin: 38px 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      text-decoration: none !important;
      transition: transform 0.2s, box-shadow 0.2s;
    }
    .internal-link-card:hover {
      transform: translateY(-3px);
      box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }
    .internal-link-text h5 {
      color: #fff;
      margin-bottom: 5px;
      font-size: 1.15rem;
    }
    .internal-link-text p {
      margin-bottom: 0;
      font-size: 0.95rem;
      opacity: 0.92;
      text-align: left;
    }
    .internal-link-icon {
      background: rgba(255,255,255,0.2);
      padding: 10px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      min-width: 44px;
      min-height: 44px;
    }

    [data-theme="dark"] .clinical-pearl { background-color: rgba(4, 120, 87, 0.15); }

    /* Quote */
    .scientific-quote {
      font-family: 'Playfair Display', serif;
      font-style: italic;
      font-size: 1.35rem;
      color: var(--text-muted);
      text-align: center;
      margin: 44px 0;
      padding: 0 34px;
      position: relative;
    }
    .scientific-quote::before {
      content: '“';
      font-size: 4rem;
      color: var(--secondary);
      opacity: 0.3;
      display: block;
      line-height: 0.5;
      margin-bottom: 16px;
    }

    /* Tables */
    .scientific-table {
      width: 100%;
      border-collapse: collapse;
      margin: 46px 0;
      font-size: 0.95rem;
      box-shadow: 0 10px 30px rgba(0,0,0,0.05);
      border-radius: 8px;
      overflow: hidden;
    }
    .scientific-table th {
      background-color: var(--primary);
      color: #fff;
      padding: 16px;
      text-align: left;
      font-family: 'Source Sans 3', sans-serif;
      font-weight: 600;
      letter-spacing: 0.05em;
    }
    .scientific-table td {
      border-bottom: 1px solid var(--border-subtle);
      padding: 16px;
      vertical-align: top;
    }
    .scientific-table tr:nth-child(even) { background-color: rgba(0,0,0,0.02); }
    [data-theme="dark"] .scientific-table tr:nth-child(even) { background-color: rgba(255,255,255,0.02); }

    /* TOC */
    .toc-integrated {
      background-color: var(--bg-body);
      border: 1px solid var(--border-subtle);
      border-top: 4px solid var(--secondary);
      padding: 26px;
      margin-bottom: 44px;
      border-radius: 8px;
    }
    .toc-title {
      font-family: 'Playfair Display', serif;
      font-size: 1.25rem;
      margin-bottom: 18px;
      color: var(--text-main);
      font-weight: 700;
      text-align: center;
    }
    .toc-list {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px 26px;
      padding: 0;
    }
    .toc-list li { list-style: none; margin: 0; font-size: 0.98rem; }
    .toc-list a {
      color: var(--primary);
      text-decoration: none;
      border-bottom: 1px dotted transparent;
      transition: all 0.2s;
    }
    .toc-list a:hover {
      color: var(--accent);
      border-bottom-color: var(--accent);
    }

    /* Byline */
    .byline {
      margin: 26px 0 20px;
      padding: 16px 18px;
      border: 1px solid var(--border-subtle);
      border-radius: 10px;
      background: var(--bg-card);
      display: grid;
      gap: 6px;
      font-size: 0.98rem;
    }
    .byline .label { color: var(--text-muted); }
    .byline a { text-decoration: underline; }

    /* FAQ section */
    .faq {
      margin-top: 70px;
      padding: 28px 22px;
      border: 1px solid var(--border-subtle);
      border-radius: 10px;
      background: var(--bg-card);
    }
    .faq h3 {
      margin-top: 0;
      font-size: 1.5rem;
      margin-bottom: 18px;
    }
    .faq details {
      padding: 14px 0;
      border-top: 1px solid var(--border-subtle);
    }
    .faq details:first-of-type { border-top: none; }
    .faq summary {
      cursor: pointer;
      font-weight: 700;
      color: var(--text-main);
      list-style: none;
    }
    .faq summary::-webkit-details-marker { display: none; }
    .faq p { margin: 10px 0 0; text-align: left; }

    /* Referencias */
    .references-section {
      margin-top: 80px;
      padding-top: 50px;
      border-top: 1px solid var(--border-subtle);
      font-size: 0.93rem;
      color: var(--text-muted);
      background-color: transparent;
    }
    .references-section h3 {
      margin-top: 0;
      font-size: 1.5rem;
      margin-bottom: 18px;
      text-align: left;
      border-bottom: none;
      color: var(--text-main);
    }
    .ref-item {
      margin-bottom: 12px;
      word-break: break-word;
      padding-left: 20px;
      text-indent: -20px;
    }
    .ref-item a { text-decoration: underline; }

    /* --- FOOTER --- */
    footer {
      background-color: #1C1917;
      color: #A8A29E;
      padding: 80px 0 0;
      font-size: 0.95rem;
      font-family: 'Source Sans 3', sans-serif;
      border-top: 4px solid var(--accent);
      margin-top: 90px;
    }

    .footer-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 50px;
      padding-bottom: 60px;
    }

    .footer h4 {
      color: #fff;
      font-family: 'Playfair Display', serif;
      font-size: 1.3rem;
      margin-bottom: 25px;
      letter-spacing: 0.05em;
      position: relative;
    }
    .footer h4::after {
      content: '';
      display: block;
      width: 30px;
      height: 2px;
      background-color: var(--accent);
      margin-top: 10px;
    }
    .footer ul li { margin-bottom: 12px; }
    .footer ul li a { color: #A8A29E; transition: 0.2s; display: inline-block; }
    .footer ul li a:hover { color: #fff; transform: translateX(5px); }

    .footer-bottom {
      border-top: 1px solid #333;
      padding: 30px 0;
      text-align: center;
      font-size: 0.85rem;
      background-color: #151312;
    }

    /* RESPONSIVE */
    @media (max-width: 900px) {
      .nav-menu { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
      .article-hero h1 { font-size: 2.2rem; }
      .article-container { padding: 0 20px; }
      .toc-list { grid-template-columns: 1fr; }
      .main-header .container { padding-left: 20px; padding-right: 20px; }
      .scientific-quote { padding: 0; }
      .internal-link-card { flex-direction: column; text-align: center; gap: 15px; }
      .internal-link-text p { text-align: center; }
    }
