/* Estilos básicos para la demo */
html {
  scroll-behavior: smooth;
}
:root {
  --accent: #fcc462; /* azul principal */
  --muted: #666;
  --card: #fff;
}
/* Resetear colores y subrayado de todos los enlaces */
a {
  text-decoration: none; /* quita subrayado por defecto */
  color: #000000; /* color negro */
}

/* Al pasar el ratón (hover) se subraya (opcional) */
a:hover {
  text-decoration: underline;
}

/* Al hacer clic (active) se vuelve naranja brevemente */

/* Para enlaces ya visitados, también los dejamos negros */
a:visited {
  color: #000000;
}
body {
  --accent-2: #3b82f6; /* azul para enlaces */
  --max-width: 1400px;
}
header {
  /* margin-bottom: 20px; */
}
nav a {
  margin-right: 8px;
}
.articles {
  list-style: none;
  padding: 0;
}
.articles li {
  background: #fff;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 4px;
}
.meta {
  color: #666;
  font-size: 0.9em;
}
form label {
  display: block;
  margin: 8px 0;
}
.error {
  color: #b00;
}

.articles li.card {
  display: flex;
  gap: 18px;
  align-items: stretch;
}

.card-media {
  flex: 0 0 320px;
  display: block;
}
.card-media .thumb {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-body h3 {
  margin: 0 0 8px 0;
}
.card-body .excerpt {
  margin: 0 0 12px;
  color: var(--muted);
}
.card-body .meta {
  font-size: 0.9rem;
  color: var(--muted);
}
.card-body .read-more {
  margin-top: 12px;
  align-self: flex-end;
  display: inline-block;
}

* {
  box-sizing: border-box;
}
html,
body {
  max-width: 100%;
  /* overflow-x: hidden; */
}

body {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
  line-height: 1.6;
  margin: 0;
  background: linear-gradient(180deg, #f5f7fb 0%, #ffffff 100%);
  color: #0b1220;
}

.site-wrap {
  width: 80%;
  max-width: var(--max-width);
  margin: 100px auto;
  padding: 0 28px;
}

/* Full-bleed hero wrapper */
.hero-hero {
  width: 100%;
  height: 100vh;
  background-image: url("../img/hero.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hero-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 20, 36, 0.25),
    rgba(255, 255, 255, 0.02)
  );
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 2;
  width: 80%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px;
  color: #fff;
  text-align: center;
}
.hero-content h1 {
  font-size: clamp(28px, 5vw, 56px);
  margin: 0 0 8px;
  color: #fff;
  text-shadow: 0 6px 24px rgba(11, 17, 32, 0.38);
}
.hero-content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  margin: 0 0 12px;
}
.hero-search {
  max-width: 720px;
  margin: 16px auto 0;
  display: flex;
  gap: 8px;
}
.hero-search input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 0;
}
.hero-search button {
  padding: 12px 16px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent), #ffb56b);
  border: 0;
  color: black;
  font-weight: 800;
}

.header-inner {
  width: 80%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 28px;
}

header.site-header {
  /* full-bleed fixed header: 100vw and white background, always visible on scroll */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(11, 17, 32, 0.06);
  z-index: 1000;
}
.site-title {
  display: flex;
  gap: 14px;
  align-items: center;
}
.logo {
  width: 20%;
  height: 100%;
}
.site-title h1 {
  font-size: 20px;
  margin: 0;
}
.site-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

nav.main-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}
nav.main-nav a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}
nav.main-nav a.lang {
  background: #eef2ff;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--accent-2);
  font-weight: 700;
}

/* Language switch */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.lang-switch .switch {
  display: inline-block;
  position: relative;
}
.lang-switch input {
  display: none;
}
.lang-switch .track {
  width: 56px;
  height: 28px;
  background: #eef2ff;
  border-radius: 999px;
  display: inline-block;
  position: relative;
  transition: background 180ms ease;
}
.lang-switch .thumb {
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 4px 10px rgba(11, 17, 32, 0.12);
  transition: transform 180ms cubic-bezier(0.2, 0.9, 0.2, 1);
}
.lang-switch input:checked + .track {
  background: linear-gradient(90deg, var(--accent), #ffb56b);
}
.lang-switch input:checked + .track .thumb {
  transform: translateX(28px);
}
.lang-switch .labels {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
}
.lang-switch .labels span {
  opacity: 0.85;
}
.lang-switch .labels .active {
  color: var(--accent-2);
}

.hero {
  background: linear-gradient(
    90deg,
    rgba(59, 130, 246, 0.06),
    rgba(255, 122, 24, 0.04)
  );
  padding: 18px;
  border-radius: 12px;
  margin: 14px 0;
}
.hero p {
  margin: 0;
  color: var(--muted);
}

main.content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 18px;
}
main.content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 18px;
}

.articles {
  display: grid;
  grid-template-columns: 1fr; /* one article per row */
  gap: 22px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.content-article {
  width: 70%;
  margin: 0 auto;
  display: grid;
  /* grid-template-columns: 2fr; */
  gap: 20px;
  margin-top: 90px;
  grid-auto-flow: column;
}
.card {
  background: var(--card);
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 20, 36, 0.06);
  border: 1px solid rgba(11, 17, 32, 0.03);
}
.articles ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: block;
}
.articles li.card {
  background: var(--card);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  gap: 0;
  align-items: stretch;
  box-shadow: 0 6px 18px rgba(15, 20, 36, 0.06);
  border: 1px solid rgba(11, 17, 32, 0.03);
}
.card-media {
  flex: 0 0 40%;
  max-width: 40%;
  display: block;
}
.card-media .thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 4/3;
}
.card-body {
  flex: 1 1 60%;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.card-body h3 {
  margin: 0 0 8px;
  font-size: 1.18rem;
}
.card-body .excerpt {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.98rem;
}
.card-body .meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.card-body .read-more {
  align-self: self-end;
  padding: 8px 12px;
  background: linear-gradient(90deg, var(--accent), #ffb56b);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 760px) {
  .articles li.card {
    display: block;
  }
  .card-media {
    width: 100%;
    max-width: 100%;
  }
  .card-media .thumb {
    height: 220px;
    border-radius: 8px;
  }
  .card-body {
    padding: 14px;
  }
  .site-wrap {
    width: 94%;
  }
}
.card h3 {
  margin: 0 0 8px 0;
  font-size: 1.05rem;
}
.card p {
  margin: 0;
  color: var(--muted);
}
.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

.card a.read-more {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 12px;
  background: linear-gradient(90deg, var(--accent), #ffb56b);
  color: black;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}

/* Thumbnails and excerpts */
.thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}
.excerpt {
  color: var(--muted);
  margin-top: 8px;
}

/* Sidebar */
.sidebar {
  display: block;
}
.sidebar .card {
  margin-bottom: 14px;
}
.search-box input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e6eef8;
  width: 100%;
}
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.category-list li {
  margin: 6px 0;
}
.category-list a {
  text-decoration: none;
  color: var(--accent-2);
}
.recent-posts {
  list-style: none;
  padding: 0;
  margin: 0;
}
.recent-posts li {
  margin: 8px 0;
}
.recent-posts a {
  text-decoration: none;
  color: #0b1220;
}

/* Share buttons */
.share-buttons a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 700;
}

/* Article view */
.article-container {
  background: var(--card);
  padding: 26px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(11, 17, 32, 0.06);
}
.article-container h1 {
  margin-top: 0;
}
.article-container .content {
  margin-top: 14px;
  color: #102030;
}

/* Form y admin */
form {
  background: transparent;
}
input[type="text"],
textarea,
select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e6eef8;
  background: #fbfdff;
}
button {
  background: var(--accent);
  color: black;
  padding: 10px 14px;
  border-radius: 8px;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}
button.secondary {
  background: #eef2ff;
  color: var(--accent-2);
}

footer.site-footer {
  margin: 26px 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Responsive */
@media (min-width: 760px) {
  main.content {
    grid-template-columns: 2fr 420px;
    gap: 28px;
  }
}

/* Category chips */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #dce9ff;
  background: #fff;
  color: var(--accent-2);
  cursor: pointer;
  font-weight: 600;
}
.chip.active {
  background: linear-gradient(90deg, var(--accent), #ffb56b);
  color: black;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.12);
}

/* Hover and motion */
.card,
.article-container {
  transition:
    transform 240ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 240ms ease,
    opacity 300ms ease;
  will-change: transform, opacity;
  opacity: 1;
  transform: translateY(10px);
  -webkit-font-smoothing: antialiased;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
}
.card.in-view,
.article-container.in-view {
  opacity: 1;
  /* transform: translateY(0); */
}
.card:hover {
  /* Avoid scaling text (causes blurriness on some browsers) */
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(11, 17, 32, 0.12);
}

/* header is handled as sticky above; no JS-dependent scrolled state required */

/* Inner centered container for header content (80% centered) */
.header-inner {
  width: 80%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

/* Make sidebar follow on scroll (modern browsers) */
.sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
}

/* Pagination styles */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 20px 0 40px;
  flex-wrap: wrap;
}
.pagination .page {
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--accent-2);
  background: #fff;
  border: 1px solid rgba(11, 17, 32, 0.04);
  font-weight: 700;
}
.pagination .page.active {
  background: linear-gradient(90deg, var(--accent), #ffb56b);
  color: #fff;
  border-color: transparent;
}
.pagination .page.prev,
.pagination .page.next {
  font-weight: 800;
}

/* Small tweaks for article view */
.article-container img.thumb {
  transition: transform 360ms ease;
  height: 460px;
}
.article-container img.thumb:hover {
  transform: scale(1.03);
}

/* Responsive adjustments */
@media (max-width: 760px) {
  header.site-header {
    padding: 8px 0;
  }
  .sidebar {
    position: static;
  }
}

/* ==================== RESPONSIVE STYLES ==================== */

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
  .hero-search .clear-filter {
    display: none;
  }
  /* Header */
  .header-inner {
    width: 95%;
    padding: 0px 12px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  .site-title {
    justify-content: center;
  }
  .site-title h1 {
    font-size: 1.1rem;
  }
  .site-desc {
    font-size: 0.8rem;
  }

  /* Hero */
  .hero-hero {
    height: auto;
    min-height: 60vh;
    padding: 2rem 1rem;
    margin-top: 74px;
  }
  .hero-content {
    width: 100%;
    padding: 0;
  }
  .hero-content h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }
  .hero-content p {
    font-size: 0.9rem;
  }
  .hero-search {
    flex-direction: column;
    gap: 12px;
  }
  .hero-search input,
  .hero-search button {
    width: 100%;
    padding: 12px;
  }

  /* Grid principal (index) */
  main.content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Tarjetas de artículos */
  .articles li.card {
    flex-direction: column;
  }
  .card-media {
    flex: auto;
    max-width: 100%;
  }
  .card-media .thumb {
    height: auto;
    max-height: 200px;
  }
  .card-body {
    padding: 16px;
  }
  .card-body h3 {
    font-size: 1.1rem;
  }
  .card-body .excerpt {
    font-size: 0.9rem;
  }
  .card-body .meta {
    font-size: 0.8rem;
  }
  .card-body .read-more {
    align-self: center;
    width: 100%;
    text-align: center;
  }

  /* Artículo individual */
  .content-article {
    width: 95%;
    margin-top: 80px;
    grid-auto-flow: row;
  }
  .article-container {
    padding: 16px;
  }
  .article-container h1 {
    font-size: 1.8rem;
  }
  .article-container img.thumb {
    height: auto;
    max-height: 250px;
  }
  .article-container .content {
    font-size: 0.95rem;
  }

  /* Sidebar */
  .sidebar .card {
    padding: 14px;
  }
  .category-chips {
    gap: 6px;
  }
  .chip {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* Paginación */
  .pagination {
    gap: 4px;
  }
  .pagination .page {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  /* Footer */
  .site-footer {
    font-size: 0.8rem;
    text-align: center;
    padding: 0 16px;
  }
}

/* Tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .header-inner {
    width: 90%;
    padding: 12px 16px;
  }
  .site-title h1 {
    font-size: 1.3rem;
  }
  .site-desc {
    font-size: 0.85rem;
  }

  .hero-hero {
    min-height: 70vh;
  }
  .hero-content h1 {
    font-size: 2.2rem;
  }
  .hero-content p {
    font-size: 1rem;
  }

  main.content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .articles li.card {
    flex-direction: row;
  }
  .card-media {
    flex: 0 0 35%;
  }
  .card-body {
    padding: 16px;
  }

  .content-article {
    width: 90%;
    grid-auto-flow: row;
  }

  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .sidebar .card {
    margin-bottom: 0;
  }
}

/* Escritorio pequeño (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .header-inner {
    width: 90%;
  }
  .hero-content {
    width: 90%;
  }
  .content-article {
    width: 85%;
  }
  main.content {
    grid-template-columns: 2fr 300px;
    gap: 24px;
  }
  .sidebar .card {
    padding: 14px;
  }
}

@media (max-width: 768px) {
  .card:hover {
    transform: none;
    box-shadow: 0 6px 18px rgba(15, 20, 36, 0.06);
  }
}

/* Logo imagen */
.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.site-title-link {
  display: flex;
  gap: 14px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

/* Header responsivo */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .site-title-link {
    justify-content: center;
  }

  .logo img {
    width: 48px;
    height: 48px;
  }
  .site-title h1 {
    font-size: 1.3rem;
  }
  .site-desc {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .logo img {
    width: 40px;
    height: 40px;
  }
  .site-title h1 {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  nav.main-nav {
    display: none;
  }
  .header-inner {
    justify-content: center; /* centra el contenido */
  }
  .site-title {
    text-align: center; /* opcional: centra texto */
    gap: 60px;
  }
  .logo img {
    width: 48px;
    height: 48px;
  }
  .site-title h1 {
    font-size: 1.2rem;
  }
  .site-desc {
    font-size: 0.8rem;
    display: block; /* asegura que se vea la frase */
  }
}

@media (max-width: 480px) {
  .logo img {
    width: 40px;
    height: 40px;
  }
  .site-title h1 {
    font-size: 1rem;
  }
  .site-desc {
    font-size: 0.7rem;
  }
}
