/* ==========================================================================
   Embedded PDF viewer blocks — Mandatory Disclosure page
   Renders one inline <iframe> per published PDF. The list itself is built at
   runtime by js/pdf-embed.js from /jocms/control/disclosure_docs.php, so newly
   uploaded documents appear without touching the page HTML.
   ========================================================================== */

.pdf-embed-area {
  margin-top: 26px;
}

.pdf-embed-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gold);
}
.pdf-embed-head h3 {
  color: var(--navy);
  font-size: 20px;
  margin: 0;
}
.pdf-embed-head .pdf-embed-sub {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 0;
}

/* Admin-only toolbar; the editor adds body.jo-editing-mode when it is active. */
.pdf-embed-admin {
  display: none;
}
body.jo-editing-mode .pdf-embed-admin {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ---- one embedded document ------------------------------------------- */
.pdf-embed-item {
  margin-bottom: 26px;
  border: 1px solid rgba(15, 23, 42, .10);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}

.pdf-embed-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--navy) 0%, #24457f 100%);
  color: #fff;
}
.pdf-embed-bar .pdf-embed-titles { min-width: 0; }
.pdf-embed-bar h4 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdf-embed-bar .pdf-embed-meta {
  font-size: 11.5px;
  color: rgba(255, 255, 255, .72);
  margin-top: 3px;
  word-break: break-all;
}
.pdf-embed-bar .pdf-embed-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.pdf-embed-bar .pdf-embed-links a {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  white-space: nowrap;
  transition: background .2s;
}
.pdf-embed-bar .pdf-embed-links a:hover { background: rgba(255, 255, 255, .26); }

/* ---- the actual embedded viewer -------------------------------------- */
.pdf-embed-frame {
  position: relative;
  width: 100%;
  height: 620px;
  background: #f1f5f9;
}
.pdf-embed-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Spinner shown while the document list is fetched. */
.pdf-embed-loading {
  padding: 40px 20px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}
.pdf-embed-empty {
  padding: 46px 24px;
  text-align: center;
  border: 2px dashed rgba(15, 23, 42, .18);
  border-radius: 14px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}
.pdf-embed-empty strong { color: var(--navy); }

.pdf-embed-empty-acts {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* The empty state sits on a light background, but .pdf-embed-btn is styled for
   the navy header bar. Re-colour the controls that live inside the empty state
   so they are not white-on-white. */
.pdf-embed-empty .pdf-embed-btn {
  color: #334155;
  background: #fff;
  border-color: rgba(15, 23, 42, .18);
  text-decoration: none;
  padding: 11px 20px;
  font-size: 13.5px;
}
.pdf-embed-empty .pdf-embed-btn:hover {
  background: #f1f5f9;
  color: var(--navy);
}
/* The primary upload action keeps the filled brand treatment. */
.pdf-embed-empty button.pdf-embed-btn {
  color: #fff;
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: transparent;
  font-weight: 700;
}
.pdf-embed-empty button.pdf-embed-btn:hover {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
}

/* ---- admin buttons ---------------------------------------------------- */
.pdf-embed-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .16);
  color: #fff;
  transition: background .2s;
  white-space: nowrap;
}
.pdf-embed-btn:hover { background: rgba(255, 255, 255, .3); }
.pdf-embed-btn.danger {
  background: rgba(239, 68, 68, .26);
  border-color: rgba(239, 68, 68, .5);
}
.pdf-embed-btn.danger:hover { background: rgba(239, 68, 68, .45); }

/* While a document is being replaced, dim the viewer. */
.pdf-embed-item.is-busy .pdf-embed-frame { opacity: .45; pointer-events: none; }
.pdf-embed-item.is-busy .pdf-embed-bar { opacity: .6; }

@media (max-width: 768px) {
  .pdf-embed-frame { height: 460px; }
  .pdf-embed-bar { flex-direction: column; align-items: flex-start; }
  .pdf-embed-bar h4 { white-space: normal; }
}
