/* ========================================
   MANGUITO PORTAL - Global Styles
   ======================================== */

/* Variables & Theme */
:root {
  --primary: #1a73e8;
  --primary-light: #4285f4;
  --secondary: #34a853;
  --accent: #ea4335;
  --dark: #1f1f1f;
  --dark-card: #2d2d2d;
  --dark-surface: #383838;
  --light: #ffffff;
  --light-card: #ffffff;
  --light-surface: #f8f9fa;
  --text-dark: #e8eaed;
  --text-light: #202124;
  --text-muted: #5f6368;
  --border-dark: #3c4043;
  --border-light: #dadce0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 2px 8px rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --max-width: 1280px;
  --header-height: 64px;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Section colors - softer tones */
  --videojuegos: #4285f4;
  --cocina: #ea8c55;
  --musica: #34a853;
  --libros: #f9ab00;
  --tecnologia: #1a73e8;
  --deportes: #ea4335;
  --viajes: #00bcd4;
  --salud: #0d904f;
  --cine: #ab47bc;
  --moda: #7c4dff;
}

/* Dark mode (default) */
[data-theme="dark"] {
  --bg: var(--dark);
  --bg-card: var(--dark-card);
  --bg-surface: var(--dark-surface);
  --text: var(--text-dark);
  --border: var(--border-dark);
}

/* Light mode */
[data-theme="light"] {
  --bg: var(--light);
  --bg-card: var(--light-card);
  --bg-surface: var(--light-surface);
  --text: var(--text-light);
  --border: var(--border-light);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

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

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

ul, ol {
  list-style: none;
}

/* ========================================
   HEADER / NAVBAR
   ======================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  height: var(--header-height);
}

.navbar .container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar__logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

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

.navbar__link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.navbar__link:hover {
  background: var(--bg-surface);
  color: var(--primary);
}

.navbar__link--active {
  background: rgba(26,115,232,0.1);
  color: var(--primary);
  font-weight: 600;
}

.navbar__search {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 14px;
  gap: 8px;
  max-width: 220px;
}

.navbar__search input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  width: 100%;
}

.navbar__search svg {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  flex-shrink: 0;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: all var(--transition);
  font-size: 1.1rem;
}

/* Google Translate */
.translate-wrap {
  position: relative;
}

.translate-wrap .goog-te-gadget {
  font-size: 0 !important;
}

.translate-wrap .goog-te-gadget .goog-te-combo {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  outline: none;
}

.skiptranslate {
  display: none !important;
}

body {
  top: 0 !important;
}

.theme-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  position: absolute;
  left: 0;
  transition: all var(--transition);
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger span:nth-child(3) { bottom: 0; }

.hamburger.active span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* ========================================
   AD BANNERS
   ======================================== */
.ad-banner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 15px 20px;
  text-align: center;
}

.ad-placeholder {
  background: var(--bg-surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ad-placeholder--inline {
  margin: 30px 0;
}

.ad-placeholder--sidebar {
  margin-bottom: 20px;
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

/* ========================================
   HERO SECTION (HOME)
   ======================================== */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 20px;
  text-align: center;
}

.hero__title {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text);
}

.hero__subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ========================================
   SECTIONS GRID (HOME)
   ======================================== */
.sections-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 60px;
}

.sections-grid__title {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text);
}

.sections-grid__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.section-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.section-card__banner {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.section-card__banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 30%, var(--bg-card));
}

.section-card__body {
  padding: 16px;
}

.section-card__name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-card__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.section-card__count {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 50px;
  font-weight: 600;
}

/* ========================================
   FEATURED ARTICLES (HOME)
   ======================================== */
.featured {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 60px;
}

.featured__title {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text);
}

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

/* ========================================
   ARTICLE CARD (shared)
   ======================================== */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.article-card__image {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
}

.article-card__body {
  padding: 18px;
}

.article-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.article-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================================
   SECTION PAGE LAYOUT
   ======================================== */
.section-hero {
  padding: 50px 20px;
  text-align: center;
  position: relative;
}

.section-hero__title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.section-hero__desc {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  max-width: 500px;
  margin: 0 auto;
}

.section-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
}

.section-content__main {
  min-width: 0;
}

.section-content__sidebar {
  min-width: 0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ========================================
   ARTICLE PAGE LAYOUT
   ======================================== */
.article-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
}

.article-page__content {
  min-width: 0;
}

.article-page__header {
  margin-bottom: 30px;
}

.article-page__tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 14px;
}

.article-page__title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
}

.article-page__meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.article-page__meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-page__cover {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 30px;
  background: var(--bg-surface);
}

.article-page__body {
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-page__body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 35px 0 15px;
}

.article-page__body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 25px 0 10px;
}

.article-page__body p {
  margin-bottom: 18px;
}

.article-page__body blockquote {
  border-left: 4px solid var(--primary);
  padding: 15px 20px;
  margin: 25px 0;
  background: var(--bg-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

.article-page__body ul,
.article-page__body ol {
  margin: 15px 0;
  padding-left: 25px;
  list-style: disc;
}

.article-page__body li {
  margin-bottom: 8px;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar__section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

.sidebar__list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

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

.sidebar__list a:hover {
  color: var(--primary);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

.footer .container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 50px 20px 30px;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer__col h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--primary-light);
}

.footer__col li {
  margin-bottom: 8px;
}

.footer__col a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer__col a:hover {
  color: var(--primary);
}

.footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer__social {
  display: flex;
  gap: 12px;
}

.footer__social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.footer__social a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ========================================
   BREADCRUMB
   ======================================== */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb__separator {
  opacity: 0.4;
}

/* ========================================
   BACK TO TOP
   ======================================== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  box-shadow: var(--shadow);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--primary-light);
  transform: translateY(-3px);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
  .section-content,
  .article-page {
    grid-template-columns: 1fr;
  }

  .section-content__sidebar,
  .article-page__sidebar {
    order: -1;
  }

  .ad-placeholder--sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .navbar__nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 80px 20px 20px;
    gap: 4px;
    transition: right var(--transition);
    border-left: 1px solid var(--border);
    z-index: 1000;
    overflow-y: auto;
  }

  .navbar__nav.open {
    right: 0;
  }

  .hamburger {
    display: block;
  }

  .hero__title {
    font-size: 2rem;
  }

  .sections-grid__cards {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .featured__grid {
    grid-template-columns: 1fr;
  }

  .article-page__title {
    font-size: 1.6rem;
  }

  .article-page__cover {
    height: 220px;
  }

  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .sections-grid__cards {
    grid-template-columns: 1fr 1fr;
  }

  .section-card__banner {
    height: 80px;
    font-size: 2rem;
  }
}

/* Mobile nav overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ========================================
   UTILITIES
   ======================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

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