/* ============================================================
   everpuzzleV2 — blocks.css
   Custom Gutenberg block frontend styles
   ============================================================ */

/* ----------------------------------------------------------
   Divider between blocks
   ---------------------------------------------------------- */

/* Line splits around a centered puzzle-piece icon.
   Two background-image halves stop before the icon so no bg-color trick needed. */
.pzl-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-block: 2.5rem;
  background-image:
    linear-gradient(var(--border), var(--border)),
    linear-gradient(var(--border), var(--border));
  background-size: calc(50% - 19px) 1px, calc(50% - 19px) 1px;
  background-position: left center, right center;
  background-repeat: no-repeat;
  background-color: transparent;
  height: auto;
}

.pzl-divider::after {
  content: '';
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transform: rotate(45deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath fill='none' stroke='%23E6E2F4' stroke-width='9' stroke-linejoin='round' d='M10,10 L50,10 A10,10 0 0,0 70,10 L110,10 L110,50 A10,10 0 0,1 110,70 L110,110 L70,110 A10,10 0 0,1 50,110 L10,110 L10,70 A10,10 0 0,0 10,50 L10,10 Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* ----------------------------------------------------------
   Product Data
   ---------------------------------------------------------- */

.ep-product-data__title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--ink);
}

.ep-product-data {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.ep-product-data__table { width: 100%; border-collapse: collapse; }

.ep-product-data__table tr:nth-child(even) {
  background: var(--cream);
}

.ep-product-data__key,
.ep-product-data__val {
  padding: .6rem 1rem;
  font-size: .9rem;
  border-bottom: 1px solid var(--border);
}

.ep-product-data__table tr:last-child td { border-bottom: none; }

.ep-product-data__key {
  font-weight: 700;
  color: var(--muted);
  width: 40%;
  white-space: nowrap;
}

.ep-product-data__val { color: var(--ink); }

.ep-product-data__val a {
  color: var(--pur);
  text-decoration: none;
  font-weight: 600;
}

.ep-product-data__val a:hover { color: var(--pur-dk); text-decoration: underline; }

/* ----------------------------------------------------------
   Pro / Contra
   ---------------------------------------------------------- */

.ep-pro-con__title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--ink);
}

.ep-pro-con {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.ep-pro,
.ep-con {
  border-radius: var(--r-lg);
  padding: 1.1rem 1.25rem;
}

.ep-pro {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.ep-con {
  background: #fff7f0;
  border: 1px solid #fed7aa;
}

.ep-pro h4 {
  color: #166534;
  font-size: .85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .65rem;
}

.ep-con h4 {
  color: #9a3412;
  font-size: .85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .65rem;
}

.ep-pro ul,
.ep-con ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.ep-pro ul li,
.ep-con ul li {
  font-size: .88rem;
  line-height: 1.5;
  padding-left: 1.2em;
  position: relative;
}

.ep-pro ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 700;
}

.ep-con ul li::before {
  content: '✕';
  position: absolute;
  left: 0;
  color: #ea580c;
  font-weight: 700;
}

@media (max-width: 640px) {
  .ep-pro-con { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------
   Verdict / Urteil
   ---------------------------------------------------------- */

.ep-verdict {
  background: var(--pur-pale);
  border: 1px solid #d4bdff;
  border-radius: var(--r-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.ep-verdict__score {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--pur);
  line-height: 1;
}

.ep-verdict__heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.ep-verdict__text {
  font-size: .9rem;
  color: var(--muted);
  margin: 0;
}

/* ----------------------------------------------------------
   Affiliate CTA
   ---------------------------------------------------------- */

.ep-cta {
  background:
    radial-gradient(ellipse 55% 70% at 100% 5%,  rgba(124,58,237,.22), transparent 65%),
    radial-gradient(ellipse 35% 50% at 5%  95%,  rgba(157,92,246,.12), transparent 55%),
    radial-gradient(rgba(255,255,255,.065) 1px, transparent 1px),
    var(--dark);
  background-size: auto, auto, 32px 32px, auto;
  border-radius: var(--r-xl);
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: flex-start;
  margin-block: 2rem;
  overflow: hidden;
  position: relative;
}

.ep-cta .ep-cta__heading {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
  margin: 0;
}

.ep-cta__text {
  font-size: .9rem;
  color: rgba(255,255,255,.7);
  margin: 0;
  max-width: 500px;
}

.ep-cta .btn { margin-top: .25rem; }

/* .entry-content a (specificity 0,1,1) overrides .btn--primary (0,1,0).
   White button pops clearly on the dark ep-cta background. */
.ep-cta .btn--primary {
  background: var(--white);
  color: var(--pur-dk);
  border-color: var(--white);
  text-decoration: none;
}
.ep-cta .btn--primary:hover {
  background: var(--pur-lt);
  color: var(--pur-dk);
  border-color: var(--pur-lt);
  text-decoration: none;
}

/* ----------------------------------------------------------
   Intro block
   ---------------------------------------------------------- */

.ep-intro {
  background: var(--pur-pale);
  border-radius: var(--r-xl);
  padding: 2rem;
  margin-block: 2rem;
}

.ep-intro__inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: space-between;
}

.ep-intro__heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: .5rem;
}

.ep-intro__body {
  font-size: .95rem;
  color: var(--muted);
  margin: 0;
}

.ep-intro__stats {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
}

.ep-intro__stat {
  text-align: center;
}

.ep-intro__stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--pur);
}

.ep-intro__stat-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

@media (max-width: 640px) {
  .ep-intro__inner { flex-direction: column; }
  .ep-intro__stats { justify-content: center; }
}

/* ----------------------------------------------------------
   Category Slider
   ---------------------------------------------------------- */

.ep-cat-slider-section {
  background: var(--dark2);
  padding-block: var(--sp-xl);
  overflow: hidden;
}

.ep-cat-slider-header { margin-bottom: var(--sp-lg); }

.ep-cat-slider-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ep-cat-slider-header .section-title { color: var(--white); }

.ep-cat-arrows { display: flex; gap: .5rem; }

.ep-cat-prev,
.ep-cat-next {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-dark);
  background:var(--pur);
  color: rgba(255,255,255,.7);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.ep-cat-prev:hover,
.ep-cat-next:hover { background: var(--pur-dk); color: var(--white); border-color: var(--pur-mid); }

.ep-cat-track-wrap {
  overflow: hidden;
  padding-inline: var(--pad);
  max-width: var(--fw);
  margin-inline: auto;
}

.ep-cat-track {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}

.ep-cat-card { flex: 0 0 200px; }

.ep-cat-card__link {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  transition: transform var(--transition);
}

.ep-cat-card__link:hover { transform: translateY(-3px); }

.ep-cat-card__bg {
  height: 120px;
  position: relative;
  overflow: hidden;
}

.ep-cat-card__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ep-cat-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25);
}

.ep-cat-card__body {
  padding: .65rem .85rem;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border-dark);
  border-top: none;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.ep-cat-card__name {
  font-size: .85rem;
  font-weight: 700;
  color: var(--white);
}

.ep-cat-card__count {
  font-size: .72rem;
  color: rgba(255,255,255,.55);
}

/* ----------------------------------------------------------
   Featured block
   ---------------------------------------------------------- */

.ep-featured { padding-block: var(--sp-xl); }

.ep-featured__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-xl);
  align-items: center;
}

.ep-featured__img-wrap {
  display: block;
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 4/3;
}

.ep-featured__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.ep-featured__img-wrap:hover img { transform: scale(1.03); }

.ep-featured__body { display: flex; flex-direction: column; gap: .75rem; }

.ep-featured__label {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .2rem .7rem;
  border-radius: 20px;
  color: var(--white);
  width: fit-content;
}

.ep-featured__cat {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ep-featured__title {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-family: var(--font-serif);
}

.ep-featured__title a { color: var(--ink); }
.ep-featured__title a:hover { color: var(--pur); }

.ep-featured__excerpt { font-size: .92rem; color: var(--muted); }

/* ----------------------------------------------------------
   About block
   ---------------------------------------------------------- */

.ep-about { background: var(--pur-pale); padding-block: var(--sp-xl); }

.ep-about__inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--sp-xl);
  align-items: center;
}

.ep-about__img-wrap {
  border-radius: 50%;
  overflow: hidden;
  width: 220px;
  height: 220px;
  border: 5px solid var(--pur-lt);
}

.ep-about__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ep-about__body { display: flex; flex-direction: column; gap: .75rem; }

.ep-about__eyebrow {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--pur-mid);
}

.ep-about__heading {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--ink);
  line-height: 1.2;
}

.ep-about__text { font-size: .92rem; color: var(--muted); line-height: 1.7; }

/* ----------------------------------------------------------
   Last Solved block
   ---------------------------------------------------------- */

.ep-last-solved { padding-block: var(--sp-xl); }

.ep-last-solved__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-xl);
  align-items: center;
}

.ep-last-solved__eyebrow {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  display: block;
  margin-bottom: .3rem;
}

.ep-last-solved__cat {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  text-decoration: none;
  transition: opacity var(--transition);
}

.ep-last-solved__cat:hover { opacity: .75; }

.ep-last-solved__title {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-family: var(--font-serif);
}

.ep-last-solved__title a { color: var(--ink); }
.ep-last-solved__title a:hover { color: var(--pur); }

.ep-last-solved__meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  font-size: .82rem;
}

.ep-last-solved__score { font-weight: 700; color: var(--pur); }
.ep-last-solved__pieces, .ep-last-solved__date { color: var(--muted); font-weight: 600; }

.ep-last-solved__excerpt { font-size: .92rem; color: var(--muted); }

.ep-last-solved__img-wrap {
  position: relative;
  display: block;
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 4/3;
}

.ep-last-solved__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.ep-last-solved__img-wrap:hover img { transform: scale(1.03); }

.ep-last-solved__img-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: var(--white);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .2rem .6rem;
  border-radius: 20px;
}

/* Responsive blocks */
@media (max-width: 800px) {
  .ep-pro-con,
  .ep-featured__inner,
  .ep-about__inner,
  .ep-last-solved__inner { grid-template-columns: 1fr; }

  .ep-about__img-wrap { width: 150px; height: 150px; margin-inline: auto; }
}

/* ----------------------------------------------------------
   Gallery (Gutenberg block + WP shortcode)
   ---------------------------------------------------------- */

/* ── WP Block Gallery ──────────────────────────────────── */
.wp-block-gallery {
  gap: var(--wp--style--gallery-gap-default, .75rem) !important;
  margin-block: 1.5rem;
}

.wp-block-gallery figure,
.wp-block-gallery .wp-block-image {
  margin: 0 !important;
}

.wp-block-gallery .wp-block-image,
.wp-block-gallery figure:not(.wp-block-gallery) {
  aspect-ratio: 3/2;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
}

.wp-block-gallery .wp-block-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.wp-block-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r-lg);
}

.wp-block-gallery figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  /* gradient like ed-main-glow: white on near-solid dark = ~15:1, well above AAA (7:1) */
  padding: 3rem 1rem .65rem;
  background:
    linear-gradient(145deg, rgba(124,58,237,.25) 0%, transparent 55%),
    linear-gradient(to bottom, transparent 0%, rgba(13,12,21,.92) 100%);
  color: var(--white) !important;
  font-size: .8rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
  margin: 0;
}

/* ── WP Shortcode Gallery ──────────────────────────────── */
.gallery {
  display: grid;
  gap: .75rem;
  margin-block: 1.5rem;
  padding: 0;
}

/* Anzahl der Bilder pro Zeile — im Editor "Spalten"-Einstellung oder shortcode columns="N" */
.gallery-columns-1 { grid-template-columns: 1fr; }
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.gallery-columns-6 { grid-template-columns: repeat(6, 1fr); }
.gallery-columns-7 { grid-template-columns: repeat(7, 1fr); }
.gallery-columns-8 { grid-template-columns: repeat(8, 1fr); }
.gallery-columns-9 { grid-template-columns: repeat(9, 1fr); }

.gallery-item { margin: 0; position: relative; }

.gallery-icon {
  border-radius: var(--r-lg);
  overflow: hidden;
  display: block;
}

.gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}

.gallery-caption {
  font-size: .75rem;
  color: var(--muted);
  text-align: center;
  margin-top: .3rem;
  line-height: 1.3;
}

/* Responsive: Spalten reduzieren auf kleinen Screens */
@media (max-width: 640px) {
  .gallery-columns-5,
  .gallery-columns-6,
  .gallery-columns-7,
  .gallery-columns-8,
  .gallery-columns-9 { grid-template-columns: repeat(3, 1fr); }
  .gallery-columns-4  { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .gallery-columns-3,
  .gallery-columns-4,
  .gallery-columns-5,
  .gallery-columns-6,
  .gallery-columns-7,
  .gallery-columns-8,
  .gallery-columns-9 { grid-template-columns: repeat(2, 1fr); }
}

/* ----------------------------------------------------------
   Gallery Lightbox (#ep-lightbox)
   ---------------------------------------------------------- */

#ep-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}

#ep-lightbox.is-open { display: flex; }

.ep-lb-img-wrap {
  max-width: min(90vw, 1200px);
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ep-lb-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--r-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  display: block;
}

.ep-lb-close,
.ep-lb-prev,
.ep-lb-next {
  position: fixed;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--white);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background var(--transition);
  backdrop-filter: blur(4px);
  line-height: 1;
}

.ep-lb-close:hover,
.ep-lb-prev:hover,
.ep-lb-next:hover { background: rgba(255,255,255,.22); }

.ep-lb-close { top: 1.25rem; right: 1.25rem; }
.ep-lb-prev  { left: 1.25rem;  top: 50%; transform: translateY(-50%); }
.ep-lb-next  { right: 1.25rem; top: 50%; transform: translateY(-50%); }

.ep-lb-counter {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.65);
  font-size: .82rem;
  background: rgba(0,0,0,.45);
  padding: .25rem .85rem;
  border-radius: 20px;
  pointer-events: none;
}
