/* PuntoRacing — estilo magazine inspirado en ColorMag Pro */

:root {
  --accent: #ef0000;
  --header-bg: #f2f2f2;
  --footer-bg: #2c2e34;
  --text: #333;
  --muted: #666;
  --border: #e5e5e5;
  --inner-width: 1200px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.inner-wrap {
  max-width: var(--inner-width);
  margin: 0 auto;
  padding: 0 16px;
}

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

.site-header { background: var(--header-bg); border-bottom: 3px solid var(--accent); }

.header-inner {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 16px 12px;
  min-height: 96px;
}

.header-logo {
  flex: 0 1 auto;
  text-align: center;
  max-width: min(720px, calc(100% - 200px));
}

.header-social {
  display: flex;
  align-items: center;
}

.header-tools {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
}

.lang-switch-fused {
  display: inline-flex;
  align-items: stretch;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  background: #fff;
}

.lang-switch-half {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  position: relative;
  text-decoration: none;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

a.lang-switch-half:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

.lang-switch-half.is-active {
  box-shadow: inset 0 0 0 2px var(--accent);
  z-index: 1;
}

.lang-switch-half.is-disabled {
  opacity: 0.35;
  filter: grayscale(1);
  cursor: not-allowed;
}

.lang-flag-es,
.lang-flag-en {
  display: block;
  height: 20px;
  width: auto;
  border-radius: 0;
}

.lang-flag-es {
  width: 24px;
}

.lang-flag-en {
  width: 24px;
}

.lang-switch-half.is-es .lang-flag-es {
  border-top-left-radius: 3px;
  border-bottom-left-radius: 3px;
}

.lang-switch-half.is-en .lang-flag-en {
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
}

.post-header .lang-switch {
  justify-content: flex-start;
  margin: 8px 0 4px;
}

.section-intro {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.98rem;
}

.logo-link { display: inline-block; line-height: 0; }

.header-logo img {
  max-height: 88px;
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

@media (max-width: 599px) {
  .header-inner { min-height: 78px; padding: 12px 12px 10px; }
  .header-logo { max-width: calc(100% - 140px); }
  .header-logo img { max-height: 64px; }
  .header-tools { right: 12px; }
  .lang-flag-es { width: 22px; height: 18px; }
  .lang-flag-en { width: 22px; height: 18px; }
}

.social-follow {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.social-follow-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.social-follow-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.social-follow-btn {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  background: #222;
  color: #fff;
  border-radius: 50%;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.social-follow-btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.social-follow-facebook:hover { background: #1877f2; }
.social-follow-instagram:hover {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}
.social-follow-youtube:hover { background: #ff0000; }
.social-follow-tiktok:hover { background: #010101; }

.social-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.footer-social .social-follow {
  align-items: center;
  margin-bottom: 4px;
}

.footer-social .social-follow-label {
  color: #aaa;
}

.footer-social .social-follow-links { justify-content: center; }

.footer-social .social-follow-btn {
  background: #444;
}

@media (max-width: 599px) {
  .social-follow-label { font-size: 0.65rem; }
  .social-follow-btn { width: 34px; height: 34px; }
  .social-icon { width: 16px; height: 16px; }
}

.main-nav { background: #222; color: #fff; }

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}

.nav-home {
  color: #fff;
  font-size: 1.25rem;
  padding: 8px 12px;
  background: var(--accent);
  border-radius: 3px;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid #666;
  color: #fff;
  padding: 6px 10px;
  cursor: pointer;
}

.nav-menu-wrap { flex: 1; }

.nav-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: block;
  padding: 10px 14px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.nav-menu > li > a:hover { background: var(--accent); }

.nav-menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #333;
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.nav-menu li:hover > .sub-menu { display: block; }
.sub-menu a { display: block; padding: 8px 14px; color: #eee; font-size: 0.85rem; text-decoration: none; }
.sub-menu a:hover { background: var(--accent); color: #fff; }

.nav-search { display: flex; margin-left: auto; }
.nav-search input { border: none; padding: 8px 10px; min-width: 120px; }
.nav-search button { border: none; background: var(--accent); color: #fff; padding: 8px 12px; cursor: pointer; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-menu-wrap { display: none; width: 100%; }
  .nav-menu-wrap.is-open { display: block; }
  .nav-menu { flex-direction: column; }
  .nav-menu .sub-menu { position: static; box-shadow: none; }
}

.hero-highlights { padding: 24px 0; background: #fafafa; }

.popular-posts {
  padding: 28px 0 8px;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  border-bottom: 1px solid var(--border);
}
.popular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.popular-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.popular-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.popular-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}
.popular-card .card-body { padding: 12px 12px 14px; }
.popular-card h3 { margin: 0; font-size: 0.95rem; line-height: 1.35; }
.popular-card h3 a { color: #111; text-decoration: none; }
.popular-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.section-label {
  margin: 0 0 16px;
  font-size: 1.1rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.highlight-card { background: #fff; border: 1px solid var(--border); overflow: hidden; }
.highlight-card img { width: 100%; aspect-ratio: 392/272; object-fit: cover; display: block; }
.highlight-card .card-body { padding: 12px; }
.highlight-card h3 { margin: 8px 0 0; font-size: 1rem; line-height: 1.35; }
.highlight-card h3 a { color: #111; text-decoration: none; }

.cat-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  border-radius: 2px;
  margin-right: 4px;
}

.post-meta-small { font-size: 0.8rem; color: var(--muted); margin-top: 8px; }

.home-blocks { padding: 8px 0 32px; }

.featured-block { margin-bottom: 32px; }
.featured-block .block-title {
  margin: 0 0 16px;
  border-bottom: 2px solid var(--cat-color, var(--accent));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.featured-block .block-title span {
  background: var(--cat-color, var(--accent));
  color: #fff;
  padding: 6px 12px;
  font-size: 0.95rem;
  font-weight: 800;
}
.featured-block .view-all { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }

.featured-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) {
  .featured-layout { grid-template-columns: 1.2fr 1fr; }
}

.featured-main { border: 1px solid var(--border); overflow: hidden; }
.featured-main img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.featured-main .card-body { padding: 14px; }
.featured-main h3 { margin: 8px 0; font-size: 1.15rem; }
.featured-main .excerpt { color: var(--muted); font-size: 0.95rem; margin: 0; }

.featured-list { display: flex; flex-direction: column; gap: 12px; }
.featured-mini {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.featured-mini img { width: 130px; height: 90px; object-fit: cover; }
.featured-mini h4 { margin: 4px 0 0; font-size: 0.92rem; line-height: 1.3; }
.featured-mini h4 a { color: #111; text-decoration: none; }

.post-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 24px 16px 48px;
}
@media (min-width: 960px) {
  .post-layout { grid-template-columns: 1fr 280px; }
}

.post-title { margin: 12px 0; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.25; color: #111; }
.post-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }
.post-hero { margin-bottom: 20px; }

.prose { font-size: 1.05rem; }
.prose h2, .prose h3 { margin-top: 1.5em; color: #111; }
.prose p { margin: 1em 0; }
.prose img { margin: 1em 0; }
.prose iframe { max-width: 100%; }

.prose .wp-block-embed__wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1.25em 0;
}

.prose .wp-block-embed__wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

.prose figure.wp-caption {
  margin: 1.25em 0;
  text-align: center;
}

.prose figure.wp-caption img {
  margin: 0 auto;
}

.prose figure.wp-caption figcaption {
  margin-top: 0.5em;
  font-size: 0.9rem;
  color: var(--muted);
}

.prose .wp-gallery .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 1.25em 0;
}

.prose .wp-gallery .gallery-grid figure {
  margin: 0;
}

.prose .wp-gallery .gallery-grid img {
  width: 100%;
  height: auto;
  margin: 0;
}

.post-sidebar .widget-title span {
  background: var(--accent);
  color: #fff;
  padding: 4px 10px;
  font-size: 0.85rem;
}

.post-sidebar .social-follow-links {
  justify-content: flex-start;
  margin-top: 10px;
}

.post-share {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--border);
  background: #fafafa;
}

.post-share-title {
  margin: 0 0 14px;
  font-size: 1rem;
  color: #111;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.share-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.share-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.share-btn:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

.share-whatsapp { background: #25d366; }
.share-facebook { background: #1877f2; }
.share-x { background: #111; }
.share-instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}
.share-tiktok { background: #010101; }

.share-copy-feedback {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.share-copy-feedback.is-visible { display: block; }

.related-posts { margin-top: 32px; padding-top: 24px; border-top: 2px solid var(--border); }
.related-posts ul { list-style: none; padding: 0; margin: 0; }
.related-posts li { padding: 6px 0; border-bottom: 1px solid var(--border); }

.category-header { padding: 24px 0 16px; border-bottom: 3px solid var(--cat-color, var(--accent)); margin-bottom: 24px; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }

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

.card-article { border: 1px solid var(--border); overflow: hidden; background: #fff; }
.card-article img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.card-article .card-body { padding: 14px; }
.card-article h2 { margin: 8px 0 0; font-size: 1.05rem; }
.card-article h2 a { color: #111; text-decoration: none; }

.static-page { padding: 24px 0 48px; }
.page-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 3px solid var(--accent); }
.page-header h1 { margin: 12px 0 0; font-size: clamp(1.5rem, 3vw, 2rem); color: #111; }

.site-footer { background: var(--footer-bg); color: #ccc; padding: 24px 0; margin-top: 24px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 20px; margin: 16px 0; }
.footer-nav a { color: #ddd; font-size: 0.85rem; }
.copyright { font-size: 0.8rem; color: #999; margin: 16px 0 0; line-height: 1.5; }

.scroll-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  text-decoration: none;
  font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  z-index: 100;
}
