.editorial-widgets {
  padding: 52px 0;
}

.editorial-widgets__list {
  display: grid;
  gap: 18px;
}

.editorial-widget {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(68, 52, 33, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 52px rgba(79, 58, 32, 0.1);
}

.editorial-widget--image-left {
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
}

.editorial-widget--image-right {
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
}

.editorial-widget--image-right .editorial-widget__media {
  order: 2;
}

.editorial-widget--image-top,
.editorial-widget--text-only {
  grid-template-columns: 1fr;
}

.editorial-widget__media {
  min-height: 260px;
  margin: 0;
  background: var(--pear-soft, #e9efc7);
}

.editorial-widget__media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.editorial-widget--image-top .editorial-widget__media {
  min-height: 320px;
  max-height: 520px;
}

.editorial-widget__copy {
  align-self: center;
  padding: clamp(24px, 5vw, 48px);
}

.editorial-widget__copy h2 {
  margin: 0 0 16px;
  font-family: var(--font-serif, Georgia, serif);
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  line-height: 1.04;
}

.editorial-widget__content {
  color: var(--muted, #6f6254);
  font-size: 1.03rem;
  line-height: 1.7;
}

.editorial-widget__content > :first-child {
  margin-top: 0;
}

.editorial-widget__content > :last-child {
  margin-bottom: 0;
}

.editorial-widget__content a {
  color: var(--leaf, #315b49);
  font-weight: 750;
}

@media (max-width: 760px) {
  .editorial-widget--image-left,
  .editorial-widget--image-right {
    grid-template-columns: 1fr;
  }

  .editorial-widget--image-right .editorial-widget__media {
    order: 0;
  }

  .editorial-widget__media,
  .editorial-widget__media img {
    min-height: 220px;
    max-height: 360px;
  }
}

/* ===== Gallery Widget ===== */
.editorial-widget--gallery {
  display: block;
}

.widget-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.widget-gallery-item {
  margin: 0;
  border: 1px solid rgba(68, 52, 33, 0.15);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: zoom-in;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.widget-gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.widget-gallery-item img.widget-gallery-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.widget-gallery-item figcaption {
  font-size: 0.85rem;
  padding: 8px 10px;
  color: #5c5044;
  line-height: 1.3;
  background: #f9f4eb;
}

/* Lightbox */
.widget-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-gallery-lightbox .lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 24, 18, 0.92);
}

.widget-gallery-lightbox .lightbox-content {
  position: relative;
  z-index: 2;
  max-width: 92vw;
  max-height: 92vh;
  width: min(1100px, 92vw);
  background: #111;
  border-radius: 10px;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

.widget-gallery-lightbox .lightbox-image-wrap {
  position: relative;
  background: #000;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-gallery-lightbox .lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  display: block;
  margin: 0 auto;
}

.widget-gallery-lightbox .lightbox-caption {
  padding: 14px 18px;
  font-size: 0.95rem;
  background: #1c1814;
  min-height: 42px;
  color: #d9d0c2;
}

.widget-gallery-lightbox .lightbox-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 0;
  width: 42px;
  height: 42px;
  font-size: 28px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  z-index: 3;
}

.widget-gallery-lightbox .lightbox-nav button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 0;
  font-size: 32px;
  width: 48px;
  height: 56px;
  cursor: pointer;
  border-radius: 6px;
}

.widget-gallery-lightbox .lightbox-prev { left: 12px; }
.widget-gallery-lightbox .lightbox-next { right: 12px; }

.widget-gallery-lightbox .lightbox-counter {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 0.8rem;
  opacity: 0.7;
  background: rgba(0,0,0,0.4);
  padding: 2px 9px;
  border-radius: 999px;
}
