/*
Theme Name: Mubit
Description: Tema del blog de Mubit — replica el diseño del sitio principal.
Version: 1.0
*/

/* ── Fonts ───────────────────────────────────────────────── */
@font-face {
  font-family: 'Gotham';
  src: url('https://mubit.co/fonts/gotham/GothamBook.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gotham';
  src: url('https://mubit.co/fonts/gotham/GothamBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Gotham';
  src: url('https://mubit.co/fonts/gotham/GothamBlack.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ── Variables ───────────────────────────────────────────── */
:root {
  --color-primary:      #0c4388;
  --color-primary-dark: #0a3572;
  --color-accent:       #ee9440;
  --color-border:       #d6dfe8;
  --color-surface:      #f4f6f9;
  --color-bg:           #f0f2f5;
  --color-ink:          #1c2333;
  --color-ink-soft:     #5a6478;
  --color-text:         #2c3041;
  --color-text-soft:    #5a6478;
  --gutter:             clamp(1rem, 4vw, 2.5rem);
  --radius-lg:          14px;
  --radius-sm:          8px;
}

/* ── Reset / Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Gotham', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  color: var(--color-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }

/* ── Layout ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border: 1.5px solid transparent;
  padding: 0.65rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: #d97f2e; }
.btn-secondary {
  background: transparent;
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-accent {
  background: var(--color-accent);
  color: #fff;
}
.btn-accent:hover { background: #d97f2e; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(8px);
  background: rgba(12, 67, 136, 0.96);
}
.nav-wrap {
  width: 100%;
  max-width: 100%;
  padding-inline: var(--gutter);
  box-sizing: border-box;
  min-height: 84px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 1.25rem;
}
.brand { display: inline-flex; align-items: center; flex-shrink: 0; grid-column: 1; }
.brand-logo { width: auto; height: 3.05rem; display: block; }
.nav-content {
  grid-column: 2 / span 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem;
  min-width: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  font-size: 1.2rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  border-radius: 999px;
  padding: 0.52rem 0.84rem;
  transition: color 180ms ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--color-accent); }
.nav-actions { display: inline-flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }
.nav-cta, .nav-login { padding-inline: 1.45rem; font-size: 0.98rem; white-space: nowrap; }

@media (max-width: 1120px) {
  .nav-wrap {
    grid-template-columns: minmax(0, 1fr);
    min-height: unset;
    padding: 0.9rem 0 1rem;
    justify-items: center;
  }
  .brand, .nav-content { grid-column: 1; }
  .nav-content { width: 100%; flex-direction: column; }
  .nav-links { justify-content: center; }
  .nav-actions { align-self: center; flex-wrap: wrap; }
  .brand-logo { height: 2.45rem; }
}
@media (max-width: 680px) {
  .nav-links a { font-size: 0.82rem; padding: 0.42rem 0.66rem; }
  .nav-actions { width: 100%; justify-content: center; padding-inline: var(--gutter); }
  .nav-cta, .nav-login { flex: 1; padding-inline: 0.8rem; font-size: 0.86rem; min-height: 44px; }
}

/* ── Blog Hero ───────────────────────────────────────────── */
.blog-hero {
  position: relative;
  min-height: clamp(180px, 20vw, 220px);
  display: grid;
  place-items: center;
  background-color: #edf1f5;
  background-image: url('https://mubit.co/images/blog/bg_header_blog.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
}
.blog-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2rem var(--gutter);
}
.blog-hero-eyebrow {
  margin: 0;
  color: #ee9440;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1;
}
.blog-hero h1 {
  max-width: 55ch;
  margin: 0;
  color: #17498c;
  font-size: clamp(1.15rem, 2.05vw, 1.78rem);
  line-height: 1.22;
  font-weight: 500;
}
@media (max-width: 780px) {
  .blog-hero { min-height: 160px; }
  .blog-hero h1 { font-size: clamp(0.9rem, 4.3vw, 1.18rem); }
}

/* ── Topics ─────────────────────────────────────────────── */
.blog-topics {
  padding: 0.95rem 0 1.25rem;
  background: #edf1f5;
}
.blog-topics .container { max-width: 1020px; }
.blog-topics-inner {
  border-top: 2px solid rgba(12, 67, 136, 0.82);
  padding: 1.15rem 0 0;
  display: grid;
  gap: 0.95rem;
  justify-items: center;
}
.topics-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.95rem 2rem;
  justify-content: center;
}
.topic-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.92rem;
  padding: 0.26rem 1.3rem;
  border-radius: 999px;
  border: 2px solid rgba(238, 148, 64, 0.96);
  color: #17498c;
  font-weight: 700;
  font-size: 1.04rem;
  background: #fff;
  transition: background 170ms ease, color 170ms ease, border-color 170ms ease;
  text-decoration: none;
}
.topic-chip:hover, .topic-chip.is-active {
  background: #ee9440;
  color: #fff;
  border-color: #ee9440;
}
@media (max-width: 780px) {
  .blog-topics { padding: 0.7rem 0 0.95rem; }
  .topics-list { gap: 0.5rem 0.68rem; }
  .topic-chip { font-size: 0.95rem; padding-inline: 1rem; }
}

/* ── Post Grid ───────────────────────────────────────────── */
.blog-feed { padding-top: 1.85rem; padding-bottom: 3rem; }
.posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.8rem;
}
.post-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.9rem;
  background: #fff;
  border: 1px solid #d7dde8;
  border-radius: 14px;
  padding: 0.72rem 0.72rem 0.8rem;
  box-shadow: 0 2px 9px rgba(10, 42, 89, 0.14);
}
.post-media {
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: #e9eff8;
}
.post-media img { width: 100%; height: 100%; object-fit: cover; }
.post-media-fallback {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #dce8f8, #ecf3ff);
}
.post-body {
  display: grid;
  align-content: space-between;
  gap: 0.92rem;
  padding: 0.3rem 0.55rem 0.35rem;
}
.post-body h2 { margin: 0; }
.post-body h2 a {
  color: #17498c;
  font-size: clamp(1.05rem, 1.3vw, 1.4rem);
  font-weight: 700;
  line-height: 1.17;
  text-align: center;
  display: block;
  transition: color 170ms ease;
}
.post-body h2 a:hover { color: #0f4ca9; }
.post-meta {
  border-top: 2px solid #89a9de;
  padding-top: 0.62rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem 0.75rem;
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.post-tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.1rem 0.7rem;
  border-radius: 999px;
  border: 1.5px solid #ee9440;
  color: #17498c;
  font-size: 0.84rem;
  font-weight: 700;
}
.post-link {
  grid-column: 2;
  justify-self: end;
  color: #ee9440;
  font-weight: 700;
  font-size: 0.92rem;
}
@media (max-width: 780px) {
  .blog-feed { padding-top: 1.3rem; }
  .posts { gap: 1rem; }
  .post-card { border-radius: 12px; padding: 0.66rem; gap: 0.82rem; }
  .post-body h2 a { font-size: 1.06rem; }
}
@media (max-width: 580px) {
  .post-meta { grid-template-columns: 1fr; }
  .post-link { grid-column: 1; }
}

/* ── Pagination ──────────────────────────────────────────── */
.blog-pagination {
  margin-top: 2.8rem;
  display: flex;
  justify-content: center;
}
.blog-pagination .nav-links {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: center;
}
.blog-pagination .page-numbers {
  min-width: 1.9rem;
  min-height: 1.9rem;
  border-radius: 6px;
  border: 1.5px solid transparent;
  background: transparent;
  color: #17498c;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.5rem;
  transition: background 170ms ease, border-color 170ms ease;
  text-decoration: none;
}
.blog-pagination .page-numbers:hover { color: #0f4ca9; }
.blog-pagination .page-numbers.current { border-color: #ee9440; background: #fff; }
.blog-pagination .page-numbers.dots { color: #7a8ead; }

/* ── Single Post ─────────────────────────────────────────── */
.single-post-section { padding: 2.5rem 0 3.5rem; }
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #0f4ca9;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.post-back:hover { color: var(--color-accent); }
.post-article {
  background: #fff;
  border: 1px solid #dbe7fb;
  border-radius: 16px;
  padding: 2rem 2.5rem;
  max-width: 800px;
  margin-inline: auto;
}
.post-article h1 {
  margin: 0 0 0.5rem;
  color: #0d2d58;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1.2;
}
.post-date {
  color: var(--color-ink-soft);
  font-size: 0.88rem;
  display: block;
  margin-bottom: 1.5rem;
}
.post-featured-image {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 1.75rem;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.post-content { color: var(--color-text); line-height: 1.75; }
.post-content h2 { color: #0d2d58; margin: 1.5rem 0 0.5rem; font-size: 1.35rem; }
.post-content h3 { color: #0d2d58; margin: 1.25rem 0 0.5rem; font-size: 1.15rem; }
.post-content p { margin-bottom: 1rem; }
.post-content img { border-radius: 8px; margin: 1rem 0; max-width: 100%; }
.post-content a { color: var(--color-accent); text-decoration: underline; }
.post-content ul, .post-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.post-content li { margin-bottom: 0.4rem; }
@media (max-width: 680px) {
  .post-article { padding: 1.25rem 1rem; border-radius: 12px; }
}

/* ── Footer banner ───────────────────────────────────────── */
.ayuda-banner { position: relative; background: #fff; }
.ayuda-bg { width: 100%; display: block; }
.ayuda-content {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1;
  padding: 3rem var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  max-width: 42%;
}
.ayuda-content h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.76rem, 3.2vw, 2.56rem);
  font-weight: 900;
  line-height: 1.15;
}
.ayuda-content p { margin: 0; color: rgba(255,255,255,0.88); font-size: 1.04rem; line-height: 1.55; }
@media (max-width: 760px) {
  .ayuda-content { position: absolute; top: 0; bottom: auto; max-width: 100%; padding: 2rem var(--gutter); }
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { padding: 4.9rem 0 2.1rem; background: #fff; color: #1f2430; }
.footer-main {
  width: 100%;
  max-width: 100%;
  padding-inline: var(--gutter);
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 1.9rem;
  align-items: start;
}
.footer-main > * { flex: 1 1 0; text-align: left; }
.footer-main > .footer-brand { flex: 0 0 auto; }
.footer-brand img { width: clamp(8.6rem, 10.8vw, 10.2rem); height: auto; }
.footer-links h3, .footer-contact h3, .footer-social h3 {
  margin: 0 0 1.12rem;
  color: var(--color-primary);
  font-size: 1.02rem;
  font-weight: 700;
}
.footer-links ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
  row-gap: 0.75rem;
}
.footer-links a, .footer-legal a { color: #181b24; font-size: 1.05rem; font-weight: 500; }
.footer-actions { display: grid; gap: 1.2rem; }
.highlight-link { color: var(--color-primary); font-weight: 700; font-size: 1.05rem; }
.footer-contact { display: grid; gap: 1.08rem; }
.contact-item {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.contact-icon { width: 1.05rem; height: 1.05rem; display: inline-flex; }
.contact-icon img { width: 100%; height: 100%; object-fit: contain; }
.footer-social { display: grid; gap: 1.1rem; }
.social-links { display: flex; gap: 0.78rem; align-items: center; }
.social { width: 1.68rem; height: 1.68rem; display: inline-flex; }
.social img { width: 100%; height: 100%; object-fit: contain; }
.footer-legal {
  width: 100%;
  padding-inline: var(--gutter);
  margin-top: 2.85rem;
  border-top: 1px solid #ccc;
  padding-top: 1.35rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: #11141b;
  font-size: 0.78rem;
}
.footer-legal .separator { color: #7b7f86; }
.footer-legal .copy { margin-left: auto; }
@media (max-width: 1120px) {
  .footer-main { flex-wrap: wrap; gap: 2rem 1.6rem; }
  .footer-main > * { flex: 1 1 240px; }
  .footer-main > .footer-brand { flex-basis: 100%; }
}
@media (max-width: 760px) {
  .site-footer { padding-top: 3.3rem; }
  .footer-main { flex-direction: column; gap: 1.4rem; }
  .footer-links ul { display: flex; flex-direction: column; gap: 0.65rem; }
  .footer-legal .copy { margin-left: 0; width: 100%; }
}

/* ── Notice ──────────────────────────────────────────────── */
.notice {
  padding: 1rem;
  border: 1px solid #f1c06e;
  background: #fffbeb;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

/* ── Archive header ─────────────────────────────────────── */
.archive-header {
  padding: 2rem 0 0;
  text-align: center;
}
.archive-header h1 {
  color: var(--color-primary);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  margin: 0 0 0.25rem;
}
.archive-header p { color: var(--color-ink-soft); font-size: 1rem; }
