/* Farm Flow v0.9.22 – Gallery detail view */

.ff918-public-card[data-ff922-post],
.ff918-gallery-card[data-ff922-post] {
  position: relative;
  cursor: zoom-in;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.ff918-public-card[data-ff922-post]:hover,
.ff918-gallery-card[data-ff922-post]:hover {
  transform: translateY(-3px);
  border-color: #afc8dc;
  box-shadow: 0 20px 45px rgba(20, 48, 68, .15);
}

.ff918-public-card[data-ff922-post]:focus-visible,
.ff918-gallery-card[data-ff922-post]:focus-visible {
  outline: 4px solid rgba(71, 119, 165, .28);
  outline-offset: 3px;
}

.ff918-public-card[data-ff922-post] .ff918-public-image::after,
.ff918-gallery-card[data-ff922-post] .ff918-gallery-image::after {
  content: "🔍";
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  background: rgba(17,47,70,.78);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

html.ff922-detail-open,
body.ff922-detail-open {
  overflow: hidden !important;
}

.ff922-detail-overlay[hidden] {
  display: none !important;
}

.ff922-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 25, 38, .78);
  opacity: 0;
  backdrop-filter: blur(12px);
  transition: opacity .18s ease;
}

.ff922-detail-overlay.is-open {
  opacity: 1;
}

.ff922-detail-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, 100%);
  max-height: min(92vh, 940px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .38);
  transform: translateY(12px) scale(.985);
  transition: transform .18s ease;
}

.ff922-detail-overlay.is-open .ff922-detail-dialog {
  transform: translateY(0) scale(1);
}

.ff922-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px 18px 14px 24px;
  border-bottom: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(135deg, #173c58, #315f92);
  color: #fff;
}

.ff922-detail-header strong {
  display: block;
  max-width: 760px;
  overflow: hidden;
  color: #fff;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ff922-detail-eyebrow {
  margin: 0 0 2px;
  color: rgba(255,255,255,.7);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
}

.ff922-detail-close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.ff922-detail-close:hover {
  background: rgba(255,255,255,.22);
}

.ff922-detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(350px, .75fr);
  min-height: 0;
}

.ff922-detail-media {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background:
    radial-gradient(circle at 20% 10%, rgba(88,134,177,.28), transparent 40%),
    linear-gradient(145deg, #0c293e, #173c58);
}

.ff922-detail-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(92vh - 72px);
  object-fit: contain;
}

.ff922-detail-missing {
  display: grid;
  place-items: center;
  min-height: 420px;
  color: #fff;
  font-size: 72px;
}

.ff922-detail-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 28px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.ff922-detail-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: #6a8397;
  font-size: 12px;
  font-weight: 800;
}

.ff922-detail-topline > span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef4f9;
}

.ff922-detail-scroll h2 {
  margin: 14px 0 20px;
  color: #173c58;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 1.04;
  letter-spacing: -.035em;
}

.ff922-detail-section {
  padding: 19px 0;
  border-top: 1px solid #dce7ef;
}

.ff922-detail-section h3 {
  margin: 0 0 11px;
  color: #173c58;
  font-size: 17px;
}

.ff922-detail-description {
  margin: 0;
  color: #45657d;
  font-size: 16px;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ff922-detail-counts {
  display: flex;
  gap: 9px;
  margin: 3px 0 2px;
}

.ff922-detail-counts span {
  padding: 8px 11px;
  border: 1px solid #d8e5ef;
  border-radius: 12px;
  background: #f7fbfe;
  color: #173c58;
  font-weight: 900;
}

.ff922-detail-comments {
  display: grid;
  gap: 10px;
}

.ff922-detail-comment {
  padding: 13px;
  border: 1px solid #d8e5ef;
  border-radius: 15px;
  background: #f8fbfe;
}

.ff922-detail-comment.is-pending {
  border-color: #ead28c;
  background: #fffaf0;
}

.ff922-detail-comment.is-hidden {
  opacity: .72;
}

.ff922-detail-comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.ff922-detail-comment strong {
  color: #173c58;
}

.ff922-detail-comment small {
  color: #6c8496;
}

.ff922-detail-comment p {
  margin: 8px 0 0;
  color: #405f76;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ff922-comment-status,
.ff922-post-status {
  display: inline-flex;
  margin-top: 6px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef4f9;
  color: #587287;
  font-size: 10px;
  font-weight: 900;
}

.ff922-detail-empty {
  padding: 16px;
  border: 1px dashed #cddde9;
  border-radius: 14px;
  color: #6c8496;
  text-align: center;
}

.ff922-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid #dce7ef;
}

.ff922-detail-actions a,
.ff922-detail-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid #cdddea;
  border-radius: 12px;
  background: #f6faff;
  color: #173c58;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.ff922-detail-actions a:hover,
.ff922-detail-actions button:hover {
  background: #eaf3fa;
}

@media (max-width: 900px) {
  .ff922-detail-overlay {
    padding: 12px;
  }

  .ff922-detail-dialog {
    max-height: 95vh;
    border-radius: 20px;
  }

  .ff922-detail-body {
    display: block;
    overflow-y: auto;
  }

  .ff922-detail-media {
    min-height: min(54vh, 520px);
    overflow: hidden;
  }

  .ff922-detail-media img {
    width: 100%;
    height: auto;
    min-height: 260px;
    max-height: 58vh;
    object-fit: contain;
  }

  .ff922-detail-scroll {
    overflow: visible;
    padding: 21px;
  }
}

@media (max-width: 560px) {
  .ff922-detail-overlay {
    padding: 0;
  }

  .ff922-detail-dialog {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .ff922-detail-header {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 64px;
    padding: 10px 12px 10px 16px;
  }

  .ff922-detail-header strong {
    max-width: calc(100vw - 90px);
    font-size: 16px;
  }

  .ff922-detail-media {
    min-height: 42vh;
  }

  .ff922-detail-scroll {
    padding: 19px 16px 34px;
  }

  .ff922-detail-scroll h2 {
    font-size: 30px;
  }

  .ff922-detail-actions > * {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ff922-detail-overlay,
  .ff922-detail-dialog,
  .ff918-public-card[data-ff922-post],
  .ff918-gallery-card[data-ff922-post] {
    transition: none !important;
  }
}
