/* ==========================================================================
   Viabbly Help Center - Core Styles
   v1.0
   ========================================================================== */

/* 1. VARIABLES & THEME
   ========================================================================== */
:root {
  /* Brand Palette - Viabbly Corporate Colors */
  --primary: #00303c;
  /* Viabbly Navy - Used for titles and important text */
  --accent: #00A179;
  /* Viabbly Green - Used for icons, buttons, and accents */

  /* Neutrals */
  --bg: #F7F9FA;
  --card: #FFFFFF;
  --text: #1F2933;
  --muted: #6B7280;
  --border: #E5E7EB;

  /* Semantic */
  --info: #2563EB;
  --success: #16A34A;
  --warning: #D97706;

  /* Typography */
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

  /* Layout */
  --max-width: 1120px;
  --header-height: 70px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --card: #1F2937;
    --text: #F9FAFB;
    --muted: #9CA3AF;
    --border: #374151;
    --primary: #E5E7EB;
    /* Lighter text for headers in dark mode */
  }
}

/* 2. RESET & BASE
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-stack);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--primary);
  line-height: 1.25;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.25rem;
  font-weight: 800;
}

h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2rem;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

/* 3. LAYOUT UTILITIES
   ========================================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 4. COMPONENTS: HEADER
   ========================================================================== */
.site-header {
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
}

.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  color: #00303c;
  /* Always Navy for logo brand consistency */
  letter-spacing: -0.025em;
  text-decoration: none !important;
  display: flex;
  align-items: center;
}

.logo img {
  height: 40px;
  width: auto;
}

@media (prefers-color-scheme: dark) {
  .logo {
    color: #fff;
  }
}

.nav-links {
  display: none;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: var(--accent);
  color: white !important;
  text-decoration: none !important;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* Mobile Menu (Checkbox Hack) */
.menu-toggle {
  display: none;
}

.menu-icon {
  display: block;
  cursor: pointer;
  padding: 0.5rem;
}

@media (min-width: 768px) {
  .menu-icon {
    display: none;
  }
}

#menu-check {
  display: none;
}

#menu-check:checked~.mobile-menu {
  display: block;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: var(--header-height);
  left: 0;
  width: 100%;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.mobile-menu a:last-child {
  border-bottom: none;
}

/* 5. COMPONENTS: CARDS
   ========================================================================== */
.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-5px);
  border-color: var(--accent);
}

/* Category Card Variant (Larger, bolder) */
.card--category {
  padding: 2rem;
  border-top: 4px solid transparent;
}

.card--category:hover {
  border-top-color: var(--accent);
  /* Green hover border */
}

.card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--accent);
  background: rgba(0, 161, 121, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

/* Article Card Variant (Compact) */
.card--article {
  padding: 1.25rem;
  font-size: 0.95rem;
  background-color: var(--bg);
  /* Slightly darker/different than white card */
  border: 1px solid var(--border);
}

.card--article:hover {
  background-color: var(--card);
  /* Pop to white on hover */
}

.card__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #00A179;
  background-color: rgba(0, 161, 121, 0.15);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.card__title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #00303C;
}

.card__desc {
  color: var(--muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

.card__meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 1rem;
  display: block;
}

/* 6. COMPONENTS: HERO & SEARCH
   ========================================================================== */
.hero {
  background-color: var(--primary);
  color: white;
  padding: 4rem 1.5rem;
  text-align: center;
}

.hero h1 {
  color: white;
  margin-bottom: 0.5rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.125rem;
}

.search-box {
  margin: 2rem auto 0;
  max-width: 600px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 50px;
  border: none;
  font-size: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 7. COMPONENTS: ARTICLE LAYOUT
   ========================================================================== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-top: 3rem;
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: 3fr 1fr;
  }
}

.breadcrumbs {
  margin: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.article-content {
  font-size: 1.05rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

/* TOC */
.toc {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  font-size: 0.9rem;
}

.toc__title {
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.toc ul {
  list-style: none;
  padding: 0;
  border-left: 2px solid var(--border);
}

.toc li a {
  display: block;
  padding: 0.4rem 0 0.4rem 1rem;
  color: var(--muted);
  text-decoration: none;
}

.toc li a:hover {
  color: var(--accent);
  border-left: 2px solid var(--accent);
  margin-left: -2px;
}

/* 8. CALLOUTS
   ========================================================================== */
.callout {
  padding: 1.25rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.callout--key {
  background-color: rgba(37, 99, 235, 0.08);
  /* --info tint */
  border-color: var(--info);
}

.callout--key::before {
  content: "💡 Idea Clave";
  font-weight: 700;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--info);
}

.callout--warning {
  background-color: rgba(217, 119, 6, 0.08);
  /* --warning tint */
  border-color: var(--warning);
}

.callout--warning::before {
  content: "⚠️ Error Habitual";
  font-weight: 700;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--warning);
}

.callout--tip {
  background-color: rgba(22, 163, 74, 0.08);
  /* --success tint */
  border-color: var(--success);
}

.callout--tip::before {
  content: "✅ Recomendación";
  font-weight: 700;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--success);
}

/* 9. FOOTER
   ========================================================================== */
.site-footer {
  margin-top: 4rem;
  padding: 3rem 0;
  border-top: none;
  background: var(--primary);
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

.site-footer .footer-logo {
  margin-bottom: 1.5rem;
}

.site-footer .footer-logo img {
  height: 36px;
  width: auto;
  margin: 0 auto;
}

.footer-links {
  margin-bottom: 1.5rem;
}

.footer-links a {
  margin: 0 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: rgba(255, 255, 255, 1);
  text-decoration: underline;
}

.disclaimer {
  font-size: 0.85rem;
  opacity: 0.7;
  color: rgba(255, 255, 255, 0.6);
}