/**
 * CookieShift Infographics Library — editorial visual knowledge hub
 * Brand tokens aligned with blog chrome: #0f172a · #2562ff · #f8fafc · DM Sans / Plus Jakarta Sans
 */

body.cs-infographics-library {
  background: #f4f7fb;
}

body.cs-infographics-library .cs-wp-site-main .wp-site-blocks {
  max-width: 1180px;
  padding-top: 12px;
  padding-bottom: 72px;
}

body.cs-infographics-library .cs-wp-site-main .entry-content,
body.cs-infographics-library .cs-wp-site-main .wp-block-post-content {
  max-width: none;
}

/* Break out of TT5 constrained content (645px) for editorial library width */
body.cs-infographics-library .wp-block-post-content.is-layout-constrained > .cs-ig,
body.cs-infographics-library .is-layout-constrained > .cs-ig {
  max-width: min(1180px, 100%) !important;
  width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.cs-infographics-library .wp-block-post-content.is-layout-constrained {
  max-width: none !important;
  padding-left: 0;
  padding-right: 0;
}

body.cs-infographics-library .cs-wp-site-main .wp-site-blocks > .wp-block-group.is-layout-constrained > .wp-block-post-content {
  max-width: none !important;
}


body.cs-infographics-library .wp-block-post-title,
body.cs-infographics-library .cs-wp-site-main > .wp-site-blocks > .wp-block-group > .wp-block-heading {
  /* page-no-title usually hides this; belt-and-suspenders */
}

.cs-ig {
  --cs-ig-ink: #0f172a;
  --cs-ig-muted: #64748b;
  --cs-ig-line: #e2e8f0;
  --cs-ig-surface: #ffffff;
  --cs-ig-soft: #f1f5f9;
  --cs-ig-accent: #2562ff;
  --cs-ig-accent-deep: #1d4ed8;
  --cs-ig-navy: #0b1b33;
  --cs-ig-radius: 14px;
  --cs-ig-font-display: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
  --cs-ig-font-body: "DM Sans", system-ui, sans-serif;
  color: var(--cs-ig-ink);
  font-family: var(--cs-ig-font-body);
}

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

/* ── Hero (editorial split — not centered CookieYes-style) ── */
.cs-ig-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
  padding: clamp(28px, 4vw, 48px) 0 clamp(36px, 5vw, 56px);
  border-bottom: 1px solid var(--cs-ig-line);
  margin-bottom: 28px;
  position: relative;
}

.cs-ig-hero::before {
  content: "";
  position: absolute;
  inset: -12px -4% auto;
  height: 72%;
  background:
    radial-gradient(ellipse 55% 70% at 12% 20%, rgba(37, 98, 255, 0.1), transparent 70%),
    radial-gradient(ellipse 40% 50% at 88% 30%, rgba(15, 23, 42, 0.05), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.cs-ig-hero__copy,
.cs-ig-hero__visual {
  position: relative;
  z-index: 1;
}

.cs-ig-hero__eyebrow {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cs-ig-accent);
}

.cs-ig-hero__title {
  margin: 0 0 16px;
  font-family: var(--cs-ig-font-display);
  font-size: clamp(2rem, 4.2vw, 3.35rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--cs-ig-ink);
  max-width: 14ch;
  overflow-wrap: anywhere;
  hyphens: manual;
}

.cs-ig-hero__lede {
  margin: 0;
  max-width: 36rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--cs-ig-muted);
}

/* Abstract privacy composition */
.cs-ig-hero__visual {
  position: relative;
  min-height: 260px;
  display: grid;
  place-items: center;
}

.cs-ig-hero__orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(37, 98, 255, 0.18);
  pointer-events: none;
}

.cs-ig-hero__orbit--a {
  width: 220px;
  height: 220px;
  animation: cs-ig-spin 28s linear infinite;
}

.cs-ig-hero__orbit--b {
  width: 300px;
  height: 300px;
  border-style: dashed;
  border-color: rgba(15, 23, 42, 0.1);
  animation: cs-ig-spin 42s linear infinite reverse;
}

.cs-ig-hero__stack {
  position: relative;
  width: min(100%, 280px);
  height: 220px;
}

.cs-ig-hero__panel {
  position: absolute;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(6px);
}

.cs-ig-hero__panel--back {
  inset: 24px 8px 8px 48px;
  background: linear-gradient(145deg, #1e3a5f, #0b1b33);
}

.cs-ig-hero__panel--mid {
  inset: 8px 36px 40px 8px;
  background: linear-gradient(160deg, #2562ff, #1d4ed8);
  color: #fff;
  display: grid;
  place-items: center;
  transform: rotate(-6deg);
}

.cs-ig-hero__panel--front {
  inset: 56px 0 0 56px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  transform: rotate(3deg);
}

.cs-ig-hero__bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100%;
  padding: 28px 22px;
}

.cs-ig-hero__bars i {
  display: block;
  width: 10px;
  border-radius: 4px 4px 0 0;
  background: rgba(255, 255, 255, 0.35);
}

.cs-ig-hero__bars i:nth-child(1) { height: 28%; }
.cs-ig-hero__bars i:nth-child(2) { height: 52%; background: rgba(37, 98, 255, 0.7); }
.cs-ig-hero__bars i:nth-child(3) { height: 40%; }
.cs-ig-hero__bars i:nth-child(4) { height: 68%; background: rgba(255, 255, 255, 0.55); }

.cs-ig-hero__cookie {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #f8fafc 0 18%, transparent 19%),
    radial-gradient(circle at 70% 42%, #f8fafc 0 12%, transparent 13%),
    radial-gradient(circle at 42% 70%, #f8fafc 0 10%, transparent 11%),
    #2562ff;
  flex-shrink: 0;
}

.cs-ig-hero__lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.cs-ig-hero__lines i {
  display: block;
  height: 7px;
  border-radius: 99px;
  background: var(--cs-ig-soft);
}

.cs-ig-hero__lines i:nth-child(1) { width: 88%; }
.cs-ig-hero__lines i:nth-child(2) { width: 64%; }
.cs-ig-hero__lines i:nth-child(3) { width: 76%; background: rgba(37, 98, 255, 0.2); }

@keyframes cs-ig-spin {
  to { transform: rotate(360deg); }
}

/* ── Controls ── */
.cs-ig-controls {
  display: grid;
  gap: 22px;
  margin-bottom: 28px;
}

.cs-ig-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cs-ig-surface);
  border: 1px solid var(--cs-ig-line);
  border-radius: 12px;
  padding: 4px 6px 4px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.cs-ig-search:focus-within {
  border-color: rgba(37, 98, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 98, 255, 0.15);
}

.cs-ig-search__icon {
  color: var(--cs-ig-muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.cs-ig-search__input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--cs-ig-ink);
  padding: 12px 4px;
  min-width: 0;
}

.cs-ig-search__input::placeholder {
  color: #94a3b8;
}

.cs-ig-search__clear {
  border: 0;
  background: var(--cs-ig-soft);
  color: var(--cs-ig-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.cs-ig-search__clear:hover {
  color: var(--cs-ig-ink);
}

.cs-ig-rail__label {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cs-ig-muted);
}

.cs-ig-filters {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--cs-ig-line);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.cs-ig-filter {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cs-ig-muted);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 10px 14px 12px;
  margin: 0;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  border-radius: 8px 8px 0 0;
  transition: color 0.18s ease, background 0.18s ease;
  text-decoration: none;
  display: inline-block;
}

.cs-ig-filter::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: transparent;
  border-radius: 2px 2px 0 0;
  transition: background 0.18s ease;
}

.cs-ig-filter:hover {
  color: var(--cs-ig-ink);
  background: rgba(37, 98, 255, 0.04);
}

.cs-ig-filter.is-active {
  color: var(--cs-ig-accent);
}

.cs-ig-filter.is-active::after {
  background: var(--cs-ig-accent);
}

.cs-ig-filter:focus-visible {
  outline: 2px solid var(--cs-ig-accent);
  outline-offset: 2px;
}

.cs-ig-status {
  min-height: 0;
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--cs-ig-muted);
}

.cs-ig-status:empty {
  display: none;
}

.cs-ig-grid-section {
  margin: 8px 0 56px;
}

/* ── Equal-card editorial grid ── */
.cs-ig-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 24px;
  align-items: stretch;
}

.cs-ig-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--cs-ig-surface);
  border: 1px solid var(--cs-ig-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.cs-ig-card:hover {
  border-color: rgba(37, 98, 255, 0.25);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.cs-ig-card__media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--cs-ig-line);
  padding: 0;
}

.cs-ig-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  background: transparent;
  transition: transform 0.35s ease;
}

.cs-ig-card:hover .cs-ig-card__media img {
  transform: scale(1.02);
}

.cs-ig-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 18px 20px;
  flex: 1;
  min-height: 9.5rem;
}

.cs-ig-card__cat {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cs-ig-accent);
}

.cs-ig-card__time {
  display: none;
}

.cs-ig-card__title {
  margin: 0;
  font-family: var(--cs-ig-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.cs-ig-card__title a {
  color: var(--cs-ig-ink);
  text-decoration: none;
}

.cs-ig-card__title a:hover {
  color: var(--cs-ig-accent);
}

.cs-ig-card__excerpt {
  margin: 0;
  color: var(--cs-ig-muted);
  font-size: 0.875rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.cs-ig-card__cta {
  margin-top: auto;
  padding-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--cs-ig-accent);
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: none;
}

.cs-ig-card__cta-arrow {
  transition: transform 0.18s ease;
}

.cs-ig-card:hover .cs-ig-card__cta-arrow {
  transform: translateX(3px);
}

/* ── Empty / load more ── */
.cs-ig-empty {
  grid-column: 1 / -1;
  text-align: left;
  padding: 40px 28px;
  border: 1px dashed var(--cs-ig-line);
  border-radius: var(--cs-ig-radius);
  background: rgba(255, 255, 255, 0.7);
}

.cs-ig-empty h3 {
  margin: 0 0 8px;
  font-family: var(--cs-ig-font-display);
  font-size: 1.25rem;
}

.cs-ig-empty p {
  margin: 0 0 16px;
  color: var(--cs-ig-muted);
}

.cs-ig-empty__reset {
  appearance: none;
  border: 1px solid var(--cs-ig-line);
  background: #fff;
  color: var(--cs-ig-ink);
  font: inherit;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}

.cs-ig-empty__reset:hover {
  border-color: var(--cs-ig-accent);
  color: var(--cs-ig-accent);
}

.cs-ig-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}

.cs-ig-more-wrap[hidden] {
  display: none !important;
}

.cs-ig-more {
  appearance: none;
  border: 1px solid var(--cs-ig-line);
  background: var(--cs-ig-surface);
  color: var(--cs-ig-ink);
  font: inherit;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.cs-ig-more:hover {
  border-color: var(--cs-ig-accent);
  color: var(--cs-ig-accent);
}

.cs-ig-more[aria-busy="true"] {
  opacity: 0.65;
  cursor: wait;
}

.cs-ig-more:focus-visible,
.cs-ig-search__clear:focus-visible,
.cs-ig-empty__reset:focus-visible,
.cs-ig-card__cta:focus-visible,
.cs-ig-card__title a:focus-visible {
  outline: 2px solid var(--cs-ig-accent);
  outline-offset: 2px;
}

/* ── Responsive ── */


@media (max-width: 1024px) {
  .cs-ig-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .cs-ig-hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .cs-ig-hero__title {
    max-width: none;
    font-size: clamp(1.85rem, 8vw, 2.4rem);
  }
  .cs-ig-hero__visual {
    min-height: 220px;
    order: -1;
  }
}

@media (max-width: 680px) {
  .cs-ig-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cs-ig-card__media {
    aspect-ratio: 4 / 3;
    padding: 10px 10px 0;
  }
  .cs-ig-card__body {
    padding: 12px 12px 14px;
    gap: 5px;
  }
  .cs-ig-card__excerpt {
    -webkit-line-clamp: 2;
  }
  .cs-ig-hero {
    padding-top: 18px;
  }
  .cs-ig-filters {
    gap: 2px;
  }
  .cs-ig-filter {
    padding: 10px 12px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-ig-hero__orbit--a,
  .cs-ig-hero__orbit--b,
  .cs-ig-card,
  .cs-ig-card__media img,
  .cs-ig-card:hover,
  .cs-ig-card:hover .cs-ig-card__media img,
}

/* ── Single infographic: content image keeps natural aspect ratio ───── */
/* Featured Image is suppressed in PHP; these rules protect the content image. */

body.single-infographic .wp-block-post-featured-image,
body.cs-infographic-single .wp-block-post-featured-image {
  display: none !important;
}

body.single-infographic .wp-block-post-content .wp-block-image,
body.cs-infographic-single .wp-block-post-content .wp-block-image,
body.single-infographic .wp-block-post-content .wp-block-image img,
body.cs-infographic-single .wp-block-post-content .wp-block-image img {
  aspect-ratio: auto !important;
  height: auto !important;
  max-width: 100%;
  object-fit: unset !important;
  object-position: unset !important;
}

body.single-infographic .wp-block-post-content .wp-block-image img,
body.cs-infographic-single .wp-block-post-content .wp-block-image img {
  width: 100%;
  display: block;
}
