/**
 * Crédito Nación — folha global premium (homologação)
 * Prefixo: cn- | mobile-first | complementa o tema existente sem !important em massa
 */
:root {
  --cn-navy: #0a1628;
  --cn-navy-2: #132238;
  --cn-teal: #0d9488;
  --cn-teal-glow: rgba(13, 148, 136, 0.35);
  --cn-gold: #c9a227;
  --cn-white: #fafbfc;
  --cn-gray-100: #eef1f5;
  --cn-gray-500: #64748b;
  --cn-graphite: #1e293b;
  --cn-shadow: 0 8px 32px rgba(10, 22, 40, 0.12);
  --cn-shadow-hover: 0 20px 50px rgba(10, 22, 40, 0.16), 0 0 1px rgba(13, 148, 136, 0.2);
  --cn-radius: 16px;
  --cn-radius-sm: 12px;
  --cn-font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --cn-glow-teal: rgba(13, 148, 136, 0.22);
  --cn-glow-gold: rgba(201, 162, 39, 0.18);
  --cn-glow-navy: rgba(10, 22, 40, 0.35);
  --cn-border-subtle: rgba(15, 23, 42, 0.08);
  --cn-card-bg: linear-gradient(165deg, #ffffff 0%, #f8fafc 48%, #f1f5f9 100%);
}

@keyframes cnGlowPulse {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(1);
  }
  50% {
    opacity: 0.72;
    transform: scale(1.015);
  }
}

@keyframes cnShimmerSoft {
  0%,
  100% {
    opacity: 0.25;
    transform: translateX(-8%);
  }
  50% {
    opacity: 0.45;
    transform: translateX(8%);
  }
}

@keyframes cnCardLift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-5px);
  }
}

html.cn-root {
  scroll-behavior: smooth;
}

body.cn-body {
  font-family: var(--cn-font);
  background: radial-gradient(1200px 600px at 10% -10%, var(--cn-teal-glow), transparent 55%),
    linear-gradient(180deg, var(--cn-gray-100) 0%, #fff 28%);
  color: var(--cn-graphite);
}

.cn-section {
  max-width: 1200px;
  margin-inline: auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 3vw, 1.5rem);
}

.cn-hero {
  position: relative;
  border-radius: var(--cn-radius);
  background: linear-gradient(135deg, var(--cn-navy) 0%, var(--cn-navy-2) 55%, #0f766e 120%);
  color: var(--cn-white);
  padding: clamp(1.75rem, 5vw, 3rem);
  box-shadow: var(--cn-shadow);
  overflow: hidden;
}
.cn-hero::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 70% 30%, var(--cn-teal-glow), transparent 50%);
  pointer-events: none;
}

.cn-grid,
.cn-card-grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

/* --- Cards premium (classes cn- + listagens WordPress .post-card) --- */
.cn-card,
.cn-card-featured,
html.cn-root body.cn-body article.post-card {
  position: relative;
  isolation: isolate;
  background: var(--cn-card-bg);
  border-radius: var(--cn-radius);
  box-shadow: var(--cn-shadow);
  border: 1px solid var(--cn-border-subtle);
  overflow: hidden;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s ease,
    border-color 0.35s ease;
}

.cn-card::before,
.cn-card-featured::before,
html.cn-root body.cn-body article.post-card::before {
  content: "";
  position: absolute;
  inset: -35% -20% auto -20%;
  height: 70%;
  background: radial-gradient(ellipse 55% 70% at 50% 0%, var(--cn-glow-teal), transparent 72%),
    radial-gradient(ellipse 40% 55% at 85% 20%, var(--cn-glow-gold), transparent 68%);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  animation: cnGlowPulse 5.5s ease-in-out infinite;
}

.cn-card::after,
html.cn-root body.cn-body article.post-card:not(.post-card--featured)::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  pointer-events: none;
  z-index: 1;
}

.cn-card > *,
.cn-card-featured > *,
html.cn-root body.cn-body article.post-card > * {
  position: relative;
  z-index: 2;
}

.cn-card:hover,
html.cn-root body.cn-body article.post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--cn-shadow-hover);
  border-color: rgba(13, 148, 136, 0.22);
}

.cn-card-featured,
html.cn-root body.cn-body article.post-card.post-card--featured {
  border: 1px solid rgba(13, 148, 136, 0.28);
  box-shadow:
    var(--cn-shadow),
    0 0 0 1px rgba(201, 162, 39, 0.12),
    0 12px 48px rgba(13, 148, 136, 0.08);
}

.cn-card-featured::before,
html.cn-root body.cn-body article.post-card.post-card--featured::before {
  background: radial-gradient(ellipse 60% 75% at 45% 0%, rgba(13, 148, 136, 0.35), transparent 70%),
    radial-gradient(ellipse 50% 60% at 92% 25%, var(--cn-glow-gold), transparent 65%),
    radial-gradient(ellipse 45% 50% at 8% 40%, rgba(10, 22, 40, 0.2), transparent 60%);
  animation: cnGlowPulse 4.2s ease-in-out infinite;
}

.cn-card-featured::after,
html.cn-root body.cn-body article.post-card.post-card--featured::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, transparent 42%, rgba(201, 162, 39, 0.06) 100%);
  pointer-events: none;
  z-index: 1;
  animation: cnShimmerSoft 6s ease-in-out infinite;
}

.cn-card-featured:hover,
html.cn-root body.cn-body article.post-card.post-card--featured:hover {
  transform: translateY(-6px);
  box-shadow:
    0 22px 56px rgba(10, 22, 40, 0.18),
    0 0 0 1px rgba(201, 162, 39, 0.22),
    0 0 48px rgba(13, 148, 136, 0.12);
}

/* Wrapper de card na home / arquivo — glow exterior suave */
html.cn-root body.cn-body .post-card-wrapper.news-contents-section__block {
  position: relative;
  padding: 2px;
  border-radius: calc(var(--cn-radius) + 2px);
  background: linear-gradient(145deg, rgba(13, 148, 136, 0.12), rgba(10, 22, 40, 0.04) 45%, rgba(201, 162, 39, 0.1));
  transition: filter 0.4s ease, transform 0.4s ease;
}

html.cn-root body.cn-body .post-card-wrapper.news-contents-section__block:hover {
  filter: saturate(1.05);
}

html.cn-root body.cn-body .news-contents-section__blocks--columns3,
html.cn-root body.cn-body .news-contents-section__blocks--wide {
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: stretch;
}

/* Mídia + imagem */
.cn-card-image,
html.cn-root body.cn-body article.post-card .image-effect-scale {
  position: relative;
  overflow: hidden;
  border-radius: var(--cn-radius-sm) var(--cn-radius-sm) 0 0;
  background: linear-gradient(180deg, #e2e8f0, #f1f5f9);
}

.cn-card-image img,
html.cn-root body.cn-body article.post-card .image-effect-scale img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  margin-inline: auto;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.33, 1, 0.68, 1), filter 0.45s ease;
  transform-origin: center center;
  filter: saturate(0.98) contrast(1.02);
}

html.cn-root body.cn-body article.post-card:hover .image-effect-scale img,
html.cn-root body.cn-body article.post-card:focus-within .image-effect-scale img,
.cn-card:hover .cn-card-image img {
  transform: scale(1.045);
  filter: saturate(1.06) brightness(1.03);
}

/* Título e corpo */
.cn-card-title,
html.cn-root body.cn-body article.post-card .post-card__title {
  letter-spacing: -0.02em;
  line-height: 1.28;
  margin: 0.35rem 0 0.25rem;
  color: var(--cn-navy);
  transition: color 0.25s ease;
}

html.cn-root body.cn-body article.post-card:hover .post-card__title,
html.cn-root body.cn-body article.post-card:focus-within .post-card__title {
  color: var(--cn-teal);
}

html.cn-root body.cn-body article.post-card .post-card__body {
  padding: 0.85rem 1rem 1.1rem;
}

html.cn-root body.cn-body article.post-card .post-card__excerpt {
  color: var(--cn-gray-500);
  font-weight: 500;
  line-height: 1.45;
}

.cn-category-card {
  position: relative;
  isolation: isolate;
  background: var(--cn-card-bg);
  border-radius: var(--cn-radius);
  box-shadow: var(--cn-shadow);
  border: 1px solid var(--cn-border-subtle);
  min-height: 120px;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease, border-color 0.35s ease;
}

.cn-category-card::before {
  content: "";
  position: absolute;
  inset: -30% -15% auto;
  height: 65%;
  background: radial-gradient(ellipse 50% 70% at 50% 0%, var(--cn-glow-teal), transparent 70%);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  animation: cnGlowPulse 6s ease-in-out infinite;
}

.cn-category-card > * {
  position: relative;
  z-index: 1;
}

.cn-category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--cn-shadow-hover);
  border-color: rgba(13, 148, 136, 0.2);
}

/* Botões */
.cn-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.68rem 1.45rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(13, 148, 136, 0.28);
  transition:
    transform 0.22s ease,
    box-shadow 0.28s ease,
    filter 0.22s ease,
    background 0.28s ease,
    color 0.22s ease,
    border-color 0.22s ease;
}

.cn-button-primary,
.cn-button:not([class*="ghost"]):not(.cn-button-ghost) {
  background: linear-gradient(135deg, #0f766e 0%, var(--cn-teal) 55%, #0d9488 100%);
  color: #fff;
}

.cn-button-primary:hover,
.cn-button:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(13, 148, 136, 0.38), 0 0 20px rgba(201, 162, 39, 0.12);
}

.cn-button.cn-button-ghost:hover {
  filter: none;
  transform: translateY(-2px);
}

.cn-button-ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--cn-navy);
  border-color: rgba(13, 148, 136, 0.35);
  box-shadow: 0 2px 12px rgba(10, 22, 40, 0.06);
}

.cn-button-ghost:hover {
  background: #fff;
  border-color: var(--cn-teal);
  color: var(--cn-teal);
  box-shadow: 0 6px 22px rgba(13, 148, 136, 0.15);
}

.cn-button:focus-visible,
.cn-button-primary:focus-visible,
.cn-button-ghost:focus-visible {
  outline: 2px solid var(--cn-teal);
  outline-offset: 3px;
}

.cn-button:active {
  transform: translateY(0);
}

.cn-article {
  background: #fff;
  border-radius: var(--cn-radius);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--cn-shadow);
  border: 1px solid rgba(15, 23, 42, 0.05);
  max-width: 820px;
  margin-inline: auto;
}
.cn-article h1,
.cn-article h2 {
  color: var(--cn-navy);
  letter-spacing: -0.02em;
}

/* --- GPT stack: slots visíveis (rede técnica 23330956039) --- */
.cn-ad-slot {
  position: relative;
  box-sizing: border-box;
  margin: 1rem auto;
  max-width: 100%;
  text-align: center;
  min-height: 250px;
  background: rgba(148, 163, 184, 0.06);
  border-radius: 12px;
  border: 1px dashed rgba(100, 116, 139, 0.28);
  padding: 0.75rem 0.5rem 1.75rem;
  overflow: hidden;
}
.cn-ad-slot::before {
  content: "Publicidad";
  position: absolute;
  top: 0.35rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(100, 116, 139, 0.85);
  pointer-events: none;
}
.cn-ad-top {
  min-height: 90px;
}
@media (min-width: 768px) {
  .cn-ad-top {
    min-height: 90px;
  }
}
.cn-ad-mid {
  min-height: 280px;
}
@media (min-width: 768px) {
  .cn-ad-mid {
    min-height: 280px;
  }
}
.cn-desktop-only {
  display: none;
}
@media (min-width: 768px) {
  .cn-desktop-only {
    display: block;
  }
}
.cn-mobile-only {
  display: block;
}
@media (min-width: 768px) {
  .cn-mobile-only {
    display: none;
  }
}
.cn-gpt-top-wrap,
.cn-gpt-mid-stack {
  max-width: 1200px;
  margin-inline: auto;
}

/* Reserva de altura para reduzir CLS em zonas de anúncio */
.cn-ad-placeholder {
  min-height: 90px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.22), rgba(148, 163, 184, 0.12));
  background-size: 200% 100%;
  animation: cnShimmerSoftSlide 2.2s ease-in-out infinite;
  border-radius: 10px;
  border: 1px dashed rgba(100, 116, 139, 0.35);
}
@keyframes cnShimmerSoftSlide {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

/* Header / footer mais limpos quando o markup expõe estes seletores genéricos */
body.cn-body #menu,
body.cn-body .header,
body.cn-body header {
  backdrop-filter: saturate(140%) blur(8px);
}

body.cn-body .footer,
body.cn-body footer {
  background: linear-gradient(180deg, var(--cn-navy-2), var(--cn-navy));
  color: var(--cn-gray-100);
}

/* Detalhe dourado discreto em links fortes */
body.cn-body a:hover {
  color: var(--cn-teal);
}

@media (prefers-reduced-motion: reduce) {
  .cn-card,
  .cn-card-featured,
  .cn-card-grid,
  .cn-category-card,
  .cn-button,
  .cn-button-primary,
  .cn-button-ghost,
  .cn-ad-placeholder,
  .cn-ad-slot,
  html.cn-root body.cn-body article.post-card,
  html.cn-root body.cn-body .post-card-wrapper.news-contents-section__block {
    animation: none;
    transition-duration: 0.01ms;
  }

  html.cn-root body.cn-body article.post-card::before,
  html.cn-root body.cn-body article.post-card.post-card--featured::after,
  .cn-card::before,
  .cn-card-featured::before,
  .cn-card-featured::after,
  .cn-category-card::before {
    animation: none;
    opacity: 0.38;
    transform: none;
  }
}

@media (hover: none) {
  html.cn-root body.cn-body article.post-card:hover,
  html.cn-root body.cn-body article.post-card.post-card--featured:hover,
  .cn-card:hover,
  .cn-card-featured:hover,
  .cn-category-card:hover {
    transform: none;
  }
}

/* Footer legal — Crédito Nación / 3PWEB */
.cn-footer-legal {
  display: block;
  max-width: 52rem;
  line-height: 1.55;
  font-size: clamp(0.78rem, 1.6vw, 0.88rem);
  color: rgba(248, 250, 252, 0.92);
}
.cn-footer-legal a {
  color: var(--cn-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
.cn-footer-legal a:hover {
  color: var(--cn-gold);
}
.cn-footer-brand-mark img {
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.25));
}

/* Logo kit Crédito Nación — header / footer / loader */
.cn-logo {
  display: block;
  max-width: 100%;
  height: auto;
}

.cn-logo-header {
  width: clamp(180px, 22vw, 320px);
  max-height: 80px;
  object-fit: contain;
}

.cn-logo-footer {
  width: min(240px, 80vw);
  max-height: 70px;
  object-fit: contain;
}

.cn-loader-logo {
  display: block;
  margin: 0 auto 0.75rem;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

@media (max-width: 768px) {
  .cn-logo-header {
    width: clamp(150px, 48vw, 240px);
    max-height: 64px;
  }
}
