/* ===========================================================
   Anaedo · Media, Cards & Lightbox
   =========================================================== */

/* ---------- Image width scaling ---------- */
:root { --anaedo-image-scale: 100%; }

.entry-content img,
.wp-block-post-content img,
.wp-block-image img {
  width: var(--anaedo-image-scale);
  max-width: 100%;
  height: auto;
}
.wp-block-image.alignfull img,
.wp-block-image.alignwide img { width: 100%; }

/* Allow images > content width to overflow without scrollbars */
body[class*="anaedo-width-"] .entry-content .wp-block-image,
body[class*="anaedo-width-"] .wp-block-post-content .wp-block-image {
  margin-left: auto; margin-right: auto;
}

/* ---------- Card title toggle ---------- */
body.anaedo-card-titles-off .asc-card :is(h1,h2,h3,h4,h5,.asc-card__title),
body.anaedo-card-titles-off .wp-block-post-template .wp-block-post-title {
  display: none !important;
}

/* ---------- Card animations ---------- */
.asc-card, .wp-block-post-template > li {
  transition: transform .35s ease, box-shadow .35s ease, opacity .5s ease;
  will-change: transform, opacity;
}

/* Fade-in on scroll */
body.anaedo-card-anim-fade .asc-card,
body.anaedo-card-anim-fade .wp-block-post-template > li { opacity: 0; transform: translateY(14px); }
body.anaedo-card-anim-fade .asc-card.is-visible,
body.anaedo-card-anim-fade .wp-block-post-template > li.is-visible { opacity: 1; transform: none; }

/* Lift on hover */
body.anaedo-card-anim-lift .asc-card:hover,
body.anaedo-card-anim-lift .wp-block-post-template > li:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(0,0,0,.18); }

/* Zoom on hover */
body.anaedo-card-anim-zoom .asc-card:hover,
body.anaedo-card-anim-zoom .wp-block-post-template > li:hover { transform: scale(1.03); box-shadow: 0 12px 28px rgba(0,0,0,.18); }

/* Flip on hover (subtle 3D tilt) */
body.anaedo-card-anim-flip .asc-card,
body.anaedo-card-anim-flip .wp-block-post-template > li { transform-style: preserve-3d; perspective: 900px; }
body.anaedo-card-anim-flip .asc-card:hover,
body.anaedo-card-anim-flip .wp-block-post-template > li:hover { transform: rotateY(6deg) rotateX(-3deg) translateY(-4px); }

@media (prefers-reduced-motion: reduce) {
  .asc-card, .wp-block-post-template > li { transition: none !important; transform: none !important; }
}

/* ---------- Gallery / grid row limits ---------- */
.anaedo-row-hidden { display: none !important; }
.anaedo-rows-more {
  display: inline-block; margin: 1.25rem auto 0; padding: .65rem 1.25rem;
  font: inherit; cursor: pointer; border-radius: 999px;
  border: 1px solid currentColor; background: transparent; color: inherit;
  transition: background .2s ease, color .2s ease;
}
.anaedo-rows-more:hover { background: currentColor; color: #fff; }

/* ---------- Dialog lightbox ---------- */
dialog.anaedo-lightbox {
  border: 0; padding: 0; max-width: 96vw; max-height: 96vh;
  background: transparent; color: #fff; overflow: hidden;
}
dialog.anaedo-lightbox::backdrop { background: rgba(5,10,30,.88); backdrop-filter: blur(6px); }
.anaedo-lb__inner {
  position: relative; display: flex; flex-direction: column; align-items: center;
  background: #0c1430; border-radius: 14px; padding: 1rem 1rem 1.25rem;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  max-width: 96vw; max-height: 96vh;
}
.anaedo-lb__close {
  position: absolute; top: .35rem; right: .5rem; width: 2.25rem; height: 2.25rem;
  border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff; font-size: 1.6rem; line-height: 1;
}
.anaedo-lb__close:hover { background: rgba(255,255,255,.22); }
.anaedo-lb__figure { margin: 0; overflow: auto; max-width: 92vw; max-height: 78vh; display: flex; align-items: center; justify-content: center; }
.anaedo-lb__img { display: block; max-width: 90vw; max-height: 76vh; transform-origin: center center; transition: transform .15s ease; }
.anaedo-lb__caption { color: rgba(255,255,255,.8); font-size: .9rem; margin-top: .5rem; text-align: center; }
.anaedo-lb__controls {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center;
  margin-top: .75rem;
}
.anaedo-lb__controls button,
.anaedo-lb__download {
  background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 999px;
  padding: .45rem .9rem; font: inherit; cursor: pointer; text-decoration: none;
}
.anaedo-lb__controls button:hover,
.anaedo-lb__download:hover { background: rgba(255,255,255,.22); }
.anaedo-lb__range { display: inline-flex; align-items: center; gap: .5rem; color: #fff; }
.anaedo-lb__range input[type=range] { accent-color: #d4b46a; width: 180px; max-width: 40vw; }
.anaedo-lb__pct { font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }

@media (max-width: 540px) {
  .anaedo-lb__range input[type=range] { width: 140px; }
  .anaedo-lb__controls { gap: .35rem; }
}
