/* CG Consejos — atmospheric sleep editorial */

:root {
  --cg-ink: #14101c;
  --cg-ink-soft: #4a4458;
  --cg-paper: #f4f0ea;
  --cg-paper-deep: #e8e1d6;
  --cg-night: #1a1428;
  --cg-night-mid: #2a2140;
  --cg-brand: #654a94;
  --cg-brand-soft: #8b73b5;
  --cg-gold: #c9a227;
  --cg-white: #fff;
  --cg-max: 1180px;
  --cg-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}

body.cg-consejos {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(101, 74, 148, 0.12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(201, 162, 39, 0.08), transparent 55%),
    var(--cg-paper);
  color: var(--cg-ink);
  font-family: "Outfit", "Segoe UI", sans-serif;
}

body.cg-consejos ::selection {
  background: rgba(101, 74, 148, 0.22);
}

/* —— Header / logo bar (white to match logo background) —— */
.cg-site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #ffffff;
  border-bottom: 1px solid rgba(20, 16, 28, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.cg-site-header .cg-header-inner {
  max-width: var(--cg-max);
  margin: 0 auto;
  min-height: 92px;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #ffffff;
}

.cg-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none !important;
  background: #ffffff;
  padding: 0.15rem 0;
}

.cg-brand-lockup .cg-logo {
  display: block;
  width: min(250px, 58vw);
  height: auto;
  max-height: 72px;
  object-fit: contain;
  object-position: left center;
  background: #ffffff;
}

.cg-brand-lockup .cg-brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cg-brand);
  border-left: 1px solid rgba(101, 74, 148, 0.22);
  padding-left: 0.85rem;
  line-height: 1.2;
  white-space: nowrap;
}

.cg-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cg-nav .wp-block-navigation-item__content {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--cg-ink-soft) !important;
}

.cg-nav .wp-block-navigation-item__content:hover {
  color: var(--cg-brand) !important;
}

.cg-pill-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  background: var(--cg-night);
  color: var(--cg-white) !important;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: transform 0.35s var(--cg-ease), background 0.35s var(--cg-ease);
}

.cg-pill-cta:hover {
  background: var(--cg-brand);
  transform: translateY(-2px);
  color: var(--cg-white) !important;
}

/* —— Hero (full-bleed, trust-first) —— */
.cg-hero {
  position: relative;
  isolation: isolate;
  min-height: min(88vh, 760px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: var(--cg-white);
  background: #1a1428;
}

.cg-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.cg-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.04);
  animation: cg-hero-ken 18s var(--cg-ease) infinite alternate;
}

@keyframes cg-hero-ken {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(-1.5%, -1%, 0); }
}

.cg-hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      rgba(16, 12, 24, 0.92) 0%,
      rgba(26, 20, 40, 0.78) 42%,
      rgba(26, 20, 40, 0.35) 70%,
      rgba(26, 20, 40, 0.2) 100%
    ),
    linear-gradient(180deg, rgba(16, 12, 24, 0.25) 0%, rgba(16, 12, 24, 0.55) 55%, rgba(16, 12, 24, 0.88) 100%);
}

.cg-hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--cg-max);
  width: 100%;
  margin: 0 auto;
  padding: 7rem 1.25rem 3.75rem;
}

.cg-hero-kicker {
  margin: 0 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cg-gold) !important;
}

.cg-hero-brand {
  font-family: "Fraunces", serif;
  font-size: clamp(2.7rem, 1.4rem + 5vw, 5.1rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 0.96;
  margin: 0 0 0.85rem;
  max-width: 12ch;
  color: var(--cg-white) !important;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.cg-hero-headline {
  margin: 0 0 0.95rem;
  max-width: 22ch;
  font-family: "Fraunces", serif;
  font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.7rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.25;
  color: #f0e6ff !important;
}

.cg-hero-lead {
  max-width: 38ch;
  font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.18rem);
  font-weight: 350;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86) !important;
  margin: 0 0 1.55rem;
}

.cg-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.cg-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.92rem 1.4rem;
  border-radius: 8px;
  background: var(--cg-gold);
  color: var(--cg-night) !important;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none !important;
  box-shadow: 0 12px 36px rgba(201, 162, 39, 0.26);
  transition: transform 0.4s var(--cg-ease), box-shadow 0.4s var(--cg-ease);
}

.cg-hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(201, 162, 39, 0.34);
  color: var(--cg-night) !important;
}

.cg-hero-cta-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.9rem 1.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: var(--cg-white) !important;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none !important;
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.07);
  transition: background 0.35s var(--cg-ease), border-color 0.35s var(--cg-ease), transform 0.35s var(--cg-ease);
}

.cg-hero-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-2px);
  color: var(--cg-white) !important;
}

.cg-hero-trust {
  margin: 0;
  max-width: 48ch;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62) !important;
}

.cg-hero-reveal {
  opacity: 0;
  transform: translateY(28px);
  animation: cg-rise 0.9s var(--cg-ease) forwards;
}

.cg-hero-reveal.d2 { animation-delay: 0.12s; }
.cg-hero-reveal.d3 { animation-delay: 0.24s; }
.cg-hero-reveal.d4 { animation-delay: 0.36s; }

@keyframes cg-rise {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .cg-hero {
    min-height: min(78vh, 640px);
    align-items: end;
  }

  .cg-hero-inner {
    padding: 5.5rem 1.1rem 2.75rem;
  }

  .cg-hero-brand {
    max-width: 11ch;
  }

  .cg-hero-media img {
    object-position: 58% center;
    animation: none;
    transform: scale(1.08);
  }
}

/* —— Section shell —— */
.cg-section {
  max-width: var(--cg-max);
  margin: 0 auto;
  padding: 4rem 1.25rem;
}

.cg-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.cg-section-head h2 {
  font-family: "Fraunces", serif;
  font-size: clamp(1.8rem, 1.3rem + 1.5vw, 2.6rem);
  margin: 0;
  letter-spacing: -0.02em;
}

.cg-section-head p {
  margin: 0.35rem 0 0;
  color: var(--cg-ink-soft);
  max-width: 42ch;
}

.cg-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cg-brand);
  margin-bottom: 0.55rem;
}

/* —— Post grid (query loop) —— */
.cg-posts .wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.cg-posts .wp-block-post {
  margin: 0 !important;
}

.cg-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(20, 16, 28, 0.06);
  border-radius: 1.25rem;
  overflow: hidden;
  transition: transform 0.45s var(--cg-ease), box-shadow 0.45s var(--cg-ease), border-color 0.45s var(--cg-ease);
}

.cg-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 50px rgba(26, 20, 40, 0.12);
  border-color: rgba(101, 74, 148, 0.25);
}

.cg-card .wp-block-post-featured-image {
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cg-night-mid), var(--cg-brand));
}

.cg-card .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--cg-ease);
}

.cg-card:hover .wp-block-post-featured-image img {
  transform: scale(1.06);
}

.cg-card-body {
  padding: 1.25rem 1.3rem 1.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.cg-card .wp-block-post-date {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cg-ink-soft);
}

.cg-card .wp-block-post-title {
  font-family: "Fraunces", serif;
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0;
}

.cg-card .wp-block-post-title a {
  color: var(--cg-ink) !important;
  text-decoration: none !important;
}

.cg-card .wp-block-post-excerpt {
  color: var(--cg-ink-soft);
  font-size: 0.95rem;
  margin: 0;
}

.cg-card .wp-block-post-excerpt p {
  margin: 0;
}

.cg-card-link {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--cg-brand) !important;
  text-decoration: none !important;
}

/* Scroll reveal */
.cg-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--cg-ease), transform 0.7s var(--cg-ease);
}

.cg-reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* —— Single post —— */
.cg-single-hero {
  background: linear-gradient(180deg, var(--cg-night) 0%, var(--cg-night-mid) 100%);
  color: var(--cg-white);
  padding: 4.5rem 1.25rem 3rem;
}

.cg-single-hero-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.cg-single-hero .wp-block-post-title {
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 1.3rem + 2.5vw, 3.4rem);
  color: var(--cg-white);
  margin: 0.5rem 0 1rem;
  letter-spacing: -0.025em;
}

.cg-single-hero .wp-block-post-date,
.cg-single-hero .wp-block-post-author-name {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.cg-single-content {
  max-width: 960px;
  margin: -2rem auto 0;
  padding: 2.5rem 1.25rem 4rem;
  position: relative;
  z-index: 2;
}

.cg-single-content.wp-block-group.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
.cg-single-content > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 960px !important;
}

.cg-single-content .entry-content,
.cg-single-content .wp-block-post-content {
  background: var(--cg-white);
  border-radius: 1.5rem;
  padding: 2rem 1.5rem;
  box-shadow: 0 18px 50px rgba(26, 20, 40, 0.08);
  border: 1px solid rgba(20, 16, 28, 0.05);
  max-width: 100% !important;
}

@media (min-width: 768px) {
  .cg-single-content .wp-block-post-content {
    padding: 2.75rem 3.25rem;
  }
}

@media (min-width: 1100px) {
  .cg-single-content {
    max-width: 1040px;
  }

  .cg-single-content.wp-block-group.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
  .cg-single-content > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    max-width: 1040px !important;
  }

  .cg-single-content .wp-block-post-content {
    padding: 3rem 3.75rem;
  }
}

.cg-single-content .wp-block-post-content .cg-lead {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--cg-ink-soft);
}

.cg-single-content .wp-block-post-content h2 {
  margin-top: 1.85em;
}

.cg-single-content .wp-block-post-content h3 {
  margin-top: 1.35em;
  font-size: 1.2rem;
}

.cg-single-content .wp-block-post-content ul,
.cg-single-content .wp-block-post-content ol {
  padding-left: 1.2em;
}

.cg-single-content .wp-block-post-content a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.cg-single-content .wp-block-post-featured-image {
  margin: 0 0 1.75rem;
  border-radius: 1rem;
  overflow: hidden;
  width: 100%;
  background: linear-gradient(135deg, var(--cg-night-mid), var(--cg-brand));
}

.cg-single-content .wp-block-post-featured-image img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-height: 420px;
  object-fit: cover;
  object-position: center;
  margin: 0;
}

/* Also show featured image on home/archive cards */
.cg-card .wp-block-post-featured-image {
  min-height: 160px;
}

.cg-card .wp-block-post-featured-image:empty,
.cg-card .wp-block-post-featured-image:not(:has(img)) {
  background: linear-gradient(135deg, var(--cg-night-mid), var(--cg-brand));
}

/* —— Footer —— */
.cg-site-footer {
  background: var(--cg-night);
  color: rgba(255, 255, 255, 0.78);
  padding: 3.5rem 1.25rem 2.5rem;
  margin-top: 2rem;
}

.cg-footer-inner {
  max-width: var(--cg-max);
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}

.cg-footer-brand {
  font-family: "Fraunces", serif;
  font-size: 1.6rem;
  color: var(--cg-white);
  margin: 0 0 0.4rem;
}

.cg-footer-meta {
  font-size: 0.9rem;
  max-width: 40ch;
}

.cg-footer-meta a {
  color: var(--cg-gold) !important;
}

.cg-footer-legal {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
}

.cg-footer-legal a {
  color: rgba(255, 255, 255, 0.78) !important;
  text-decoration: none;
}

.cg-footer-legal a:hover {
  color: var(--cg-gold) !important;
}

.cg-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.25rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

/* —— Pagination —— */
.cg-posts .wp-block-query-pagination {
  margin-top: 2.5rem;
  gap: 0.75rem;
}

.cg-posts .wp-block-query-pagination a {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--cg-white);
  border: 1px solid rgba(20, 16, 28, 0.08);
  text-decoration: none !important;
  color: var(--cg-ink) !important;
  font-weight: 600;
  font-size: 0.85rem;
}

/* —— Responsive —— */
@media (max-width: 960px) {
  .cg-posts .wp-block-post-template {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cg-posts .wp-block-post-template {
    grid-template-columns: 1fr;
  }

  .cg-header-actions .cg-pill-cta span.hide-sm {
    display: none;
  }

  .cg-brand-lockup .cg-brand-tag {
    display: none;
  }

  .cg-brand-lockup .cg-logo {
    width: min(200px, 62vw);
    max-height: 58px;
  }

  .cg-site-header .cg-header-inner {
    min-height: 76px;
    padding: 0.45rem 1rem;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .cg-hero-media img,
  .cg-hero-reveal,
  .cg-reveal,
  .cg-card,
  .cg-card .wp-block-post-featured-image img {
    animation: none !important;
    transition: none !important;
  }

  .cg-hero-media img {
    transform: none;
  }

  .cg-hero-reveal,
  .cg-reveal {
    opacity: 1;
    transform: none;
  }
}
