/**
 * Featured Posts Gallery Block — style.css
 */

@import url("https://fonts.googleapis.com/css2?family=Libre+Caslon+Display&amp;family=Instrument+Sans:wght@400;500;600&amp;display=swap");

/* ── Utility ──────────────────────────────────────────────────────────────── */
.lx-featured-post-gallery-hidden { display: none !important; }

/* ── Reset ────────────────────────────────────────────────────────────────── */
.lx-featured-post-gallery-section *,
.lx-featured-post-gallery-section *::before,
.lx-featured-post-gallery-section *::after { box-sizing: border-box; }

/* ── Section (padding via CSS custom properties set inline by PHP) ─────────── */
.lx-featured-post-gallery-section {
  font-family: "Instrument Sans", sans-serif;
  padding-top: var(--fpg-pad-top, 64px);
  padding-bottom: var(--fpg-pad-bottom, 64px);
  margin-bottom: 0;
}

.lx-featured-post-gallery-container {
  max-width: 1280px;
  margin: 0 auto;
}

/* ── Header — flex row: title on left, SEE ALL on right ───────────────────── */
.lx-featured-post-gallery-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 40px;
}

.lx-featured-post-gallery-header h2 {
  font-family: "Libre Caslon Display", serif;
  font-size: 48px;
  line-height: 56px;
  font-weight: 400;
  color: #000;
  margin: 0;
  padding: 0;
  flex: 1;
}

/* ── Gallery grid ─────────────────────────────────────────────────────────── */
.lx-featured-post-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.lx-featured-post-gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.lx-featured-post-gallery-item-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.lx-featured-post-gallery-item img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transition: transform 0.3s ease;
}

/* ── Vertical alignment — global ─────────────────────────────────────────── */
.lx-featured-post-gallery-image-top    .lx-featured-post-gallery-item img { object-position: 50% 15%; }
.lx-featured-post-gallery-image-center .lx-featured-post-gallery-item img { object-position: 50% 50%; }
.lx-featured-post-gallery-image-bottom .lx-featured-post-gallery-item img { object-position: 50% 85%; }

.lx-featured-post-gallery-item:hover img { transform: scale(1.05); }

/* ── Mobile controls ──────────────────────────────────────────────────────── */
.lx-featured-post-gallery-mobile-controls {
  display: none;
  flex-direction: column;
  align-items: center;
  margin-top: 32px;
  gap: 32px;
}

.lx-featured-post-gallery-open-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 40px;
  border: none;
  background: transparent;
  font-family: "Instrument Sans", sans-serif;
  font-size: 14px;
  font-weight: normal;
  letter-spacing: 0.1em;
  line-height: 24px;
  text-transform: uppercase;
  cursor: pointer;
  color: #000;
  transition: all 0.3s ease;
  width: 100%;
  text-align: center;
}

.lx-featured-post-gallery-chevron {
  transition: transform 0.3s ease;
  transform: rotate(180deg);
}

.lx-featured-post-gallery-open-btn.lx-featured-post-gallery-is-open .lx-featured-post-gallery-chevron {
  transform: rotate(0deg);
}

.lx-featured-post-gallery-open-btn:hover { background: #000; color: #fff; }

/* ════════════════════════════════════════════════════════════════════════════
   LIGHTBOX
   ════════════════════════════════════════════════════════════════════════════ */

.lx-featured-post-gallery-lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 100000;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.lx-featured-post-gallery-lightbox.lx-featured-post-gallery-active { display: block; }
.lx-featured-post-gallery-lightbox.lx-featured-post-gallery-show   { opacity: 1; }

.lx-featured-post-gallery-lightbox-wrapper {
  position: relative;
  width: 100%; height: 100%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lx-featured-post-gallery-lightbox-slider {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Lightbox content — slides as one unit ────────────────────────────────── */
.lx-featured-post-gallery-lightbox-content {
  display: flex;
  width: 100%;
  max-width: 1500px;
  height: 90%;
  position: relative;
}

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-expanded { max-width: 1280px; }

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-slide-out-to-left {
  transform: translateX(-100%); opacity: 0;
  transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-slide-out-to-right {
  transform: translateX(100%); opacity: 0;
  transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-slide-in-from-right {
  transform: translateX(100%); opacity: 0; transition: none;
}

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-slide-in-from-left {
  transform: translateX(-100%); opacity: 0; transition: none;
}

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-centered {
  transform: translateX(0); opacity: 1;
  transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-expanded.lx-featured-post-gallery-centered {
  transform: translateX(0); opacity: 1;
}

@keyframes lx-featured-post-gallery-expand-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-expanding,
.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-minimizing {
  animation: lx-featured-post-gallery-expand-pulse 0.25s ease-in-out;
}

/* ── Left panel ───────────────────────────────────────────────────────────── */
.lx-featured-post-gallery-lightbox-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-expanded .lx-featured-post-gallery-lightbox-left {
  background: #000;
}

.lx-featured-post-gallery-lightbox-image-container {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lx-featured-post-gallery-lightbox-image { width: 100%; height: 100%; object-fit: cover; }

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-expanded .lx-featured-post-gallery-lightbox-image {
  object-fit: contain;
}

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-expanding .lx-featured-post-gallery-lightbox-image,
.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-minimizing .lx-featured-post-gallery-lightbox-image {
  opacity: 0;
}

/* ── Right panel ──────────────────────────────────────────────────────────── */
.lx-featured-post-gallery-lightbox-right {
  width: 400px;
  background: #fff;
  padding: 48px 32px;
  overflow-y: auto;
  flex-shrink: 0;
}

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-expanded .lx-featured-post-gallery-lightbox-right {
  display: none;
}

/* ── Close button ─────────────────────────────────────────────────────────── */
.lx-featured-post-gallery-close-btn {
  position: absolute;
  top: 20px; right: 20px;
  background: #fff;
  border: none;
  cursor: pointer;
  z-index: 10;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Expand button ────────────────────────────────────────────────────────── */
.lx-featured-post-gallery-expand-btn {
  position: absolute;
  top: 20px; right: 20px;
  background: #fff;
  border: none;
  width: 40px; height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-expanded .lx-featured-post-gallery-expand-btn { right: 70px; }

.lx-featured-post-gallery-expand-btn .lx-featured-post-gallery-minimize-icon { display: none; }

.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-expanded .lx-featured-post-gallery-expand-btn .lx-featured-post-gallery-expand-icon { display: none; }
.lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-expanded .lx-featured-post-gallery-expand-btn .lx-featured-post-gallery-minimize-icon { display: block; }

/* ── Nav arrows ───────────────────────────────────────────────────────────── */
.lx-featured-post-gallery-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: none;
  width: 50px; height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.lx-featured-post-gallery-nav-arrow.lx-featured-post-gallery-prev { left: 20px; }
.lx-featured-post-gallery-nav-arrow.lx-featured-post-gallery-next { right: 20px; }
.lx-featured-post-gallery-nav-arrow svg { width: 30px; height: 30px; }

/* ── Right panel — Author line ────────────────────────────────────────────── */
.lx-featured-post-gallery-author-line {
  display: block;
  margin-bottom: 20px;
  font-family: "Instrument Sans", sans-serif;
  font-size: 16px;
  line-height: 22px;
  color: #000;
}

.lx-featured-post-gallery-author-label,
.lx-featured-post-gallery-author-name {
  display: inline;
  font-family: "Instrument Sans", sans-serif;
  font-size: 16px;
  line-height: 22px;
  color: #000;
}

.lx-featured-post-gallery-author-label { font-weight: 700; }

.lx-featured-post-gallery-author-name a {
  color: #000;
  text-decoration: underline;
  font-size: 16px;
  line-height: 22px;
}

/* ── Right panel — Description ────────────────────────────────────────────── */
.lx-featured-post-gallery-lightbox-description {
  font-family: "Instrument Sans", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 24px;
  color: #000;
}

/* ── Right panel — Appears In ─────────────────────────────────────────────── */
.lx-featured-post-gallery-appears-in {
  margin-top: 30px;
}

.lx-featured-post-gallery-appears-in-label {
  font-family: "Instrument Sans", sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: #000;
  margin: 0 0 12px 0;
  padding: 0;
}

.lx-featured-post-gallery-article-appears-in {
  font-family: "Libre Caslon Display", serif;
  font-size: 24px;
  color: #000;
  line-height: 1.3;
  margin-bottom: 24px;
  font-weight: 400;
  text-decoration: none;
  display: block;
}

.lx-featured-post-gallery-article-appears-in:hover { text-decoration: none; }

/* ── Gutenberg editor ─────────────────────────────────────────────────────── */
.block-editor-block-list__block .lx-featured-post-gallery-lightbox { display: none !important; }

/* ── Mobile (≤1024px) ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .lx-featured-post-gallery-section {
    padding-top: var(--fpg-pad-top-mobile, 32px);
    padding-bottom: var(--fpg-pad-bottom-mobile, 32px);
    margin-bottom: 0;
  }

  .lx-featured-post-gallery-header {
    align-items: center;
    padding-bottom: 32px;
  }

  .lx-featured-post-gallery-header h2 { font-size: 40px; line-height: 48px; }

  .lx-featured-post-gallery-grid { grid-template-columns: 1fr !important; }

  .lx-featured-post-gallery-grid .lx-featured-post-gallery-item {
    grid-column: span 1 !important;
    aspect-ratio: 4 / 3;
    height: auto;
  }

  .lx-featured-post-gallery-grid .lx-featured-post-gallery-item:not(:first-child) { display: none; }

  .lx-featured-post-gallery-grid.lx-featured-post-gallery-open .lx-featured-post-gallery-item {
    display: block;
    animation: lx-fpg-gallery-reveal 0.35s ease forwards;
  }

  @keyframes lx-fpg-gallery-reveal {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes lx-fpg-gallery-collapse {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(10px); }
  }

  .lx-featured-post-gallery-mobile-controls { display: flex; }
  .lx-featured-post-gallery-open-btn { display: flex; width: 100%; }
  .lx-featured-post-gallery-section .lx-featured-post-gallery-load-more-wrap { display: none; }

  .lx-featured-post-gallery-lightbox-content { flex-direction: column; max-width: 100%; height: 100%; }
  .lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-expanded { max-width: 100%; }

  .lx-featured-post-gallery-lightbox-right { width: 100%; max-height: 40%; padding: 16px; }
  .lx-featured-post-gallery-lightbox-content.lx-featured-post-gallery-expanded .lx-featured-post-gallery-lightbox-image { object-fit: cover; }

  .lx-featured-post-gallery-close-btn { right: 20px !important; }
  .lx-featured-post-gallery-nav-arrow.lx-featured-post-gallery-next { right: 20px !important; bottom: 41%; top: auto; }
  .lx-featured-post-gallery-nav-arrow.lx-featured-post-gallery-prev { bottom: 41%; top: auto; }
  .lx-featured-post-gallery-expand-btn { right: 70px !important; }
}

/* ── Desktop (≥1025px) ────────────────────────────────────────────────────── */
@media (min-width: 1025px) {
  .lx-featured-post-gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .lx-featured-post-gallery-grid .lx-featured-post-gallery-item { display: block !important; }
  .lx-featured-post-gallery-lightbox-info { max-width: 90%; }
  .lx-featured-post-gallery-section .lx-featured-post-gallery-load-more-wrap { display: flex; }
  .lx-featured-post-gallery-lightbox-slider { padding: 0 64px; }
}

/* ── Alt layout grid (mosaic) ─────────────────────────────────────────────── */
.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt {
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 300px;
}

.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item { aspect-ratio: auto; height: 100%; }

.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item:nth-child(12n+1),
.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item:nth-child(12n+3),
.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item:nth-child(12n+6),
.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item:nth-child(12n+8)  { grid-column: span 2; }

.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item:nth-child(12n+2),
.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item:nth-child(12n+4),
.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item:nth-child(12n+5),
.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item:nth-child(12n+7)  { grid-column: span 1; }

.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item:nth-child(12n+9)  { grid-column: span 1; }
.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item:nth-child(12n+10) { grid-column: span 2; }
.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item:nth-child(12n+11) { grid-column: span 2; }
.lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item:nth-child(12n+12) { grid-column: span 1; }

/* ── Load More ────────────────────────────────────────────────────────────── */
.lx-featured-post-gallery-load-more-wrap { display: flex; justify-content: center; margin-top: 40px; }

.lx-featured-post-gallery-load-more-btn {
  font-family: "Instrument Sans", sans-serif;
  font-size: 14px;
  font-weight: normal;
  letter-spacing: 0.1em;
  line-height: 24px;
  color: #000;
  border: 1px solid #000;
  padding: 12px 40px;
  background: transparent;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.lx-featured-post-gallery-load-more-btn:hover:not(:disabled) { background: #000; color: #fff; }
.lx-featured-post-gallery-load-more-btn:disabled { opacity: 0.5; cursor: default; }

/* ── See All (in header) ──────────────────────────────────────────────────── */
.lx-featured-post-gallery-see-all-btn {
  display: inline-block;
  flex-shrink: 0;
  font-family: "Instrument Sans", sans-serif;
  font-size: 14px;
  font-weight: normal;
  letter-spacing: 0.1em;
  line-height: 24px;
  color: #000;
  border: 1px solid #000;
  padding: 12px 40px;
  background: transparent;
  cursor: pointer;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease;
  align-self: flex-end;
}

.lx-featured-post-gallery-see-all-btn:link,
.lx-featured-post-gallery-see-all-btn:visited,
.lx-featured-post-gallery-see-all-btn:focus,
.lx-featured-post-gallery-see-all-btn:hover,
.lx-featured-post-gallery-see-all-btn:active { text-decoration: none; }

.lx-featured-post-gallery-see-all-btn:hover { background: #000; color: #fff; }


/* ── Right panel — Related Images button ──────────────────────────────────── */
.lx-featured-post-gallery-related-images-btn {
  display: block;
  padding: 14px 32px;
  border: 1px solid #000;
  background: transparent;
  font-family: "Instrument Sans", sans-serif;
  font-size: 15px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
  color: #000;
  font-weight: 400;
  text-align: center;
  text-decoration: none;
  margin-top: 24px;
}

.lx-featured-post-gallery-related-images-btn:link,
.lx-featured-post-gallery-related-images-btn:visited,
.lx-featured-post-gallery-related-images-btn:focus,
.lx-featured-post-gallery-related-images-btn:active { text-decoration: none; color: #000; }

.lx-featured-post-gallery-related-images-btn:hover { background: #000; color: #fff; }

/* ── AJAX card reveal animation ───────────────────────────────────────────── */
.lx-featured-post-gallery-item-reveal { opacity: 0; }

/* ── SEE ALL full-width at small screens ──────────────────────────────────── */
@media (max-width: 700px) {
  .lx-featured-post-gallery-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .lx-featured-post-gallery-see-all-btn {
    width: 100%;
    text-align: center;
    align-self: stretch;
  }
}

/* ── Alt layout mobile override ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
  }

  .lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item {
    grid-column: span 1 !important;
    aspect-ratio: 4 / 3;
    height: auto;
  }
}

@media (min-width: 1025px) {
  .lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 300px;
  }

  .lx-featured-post-gallery-grid.lx-featured-post-gallery-layout-alt .lx-featured-post-gallery-item { display: block !important; }
}