/* Wrapper - Base positioning for all users */
.paragraph-wrapper {
  position: relative;
}

/* ONLY apply the outline and transition if the user is logged in */
body.user-logged-in .paragraph-wrapper {
  outline: 1px dashed transparent;
  transition: outline 0.2s;
}

/* ONLY show the blue dashed box on hover for logged-in users */
body.user-logged-in .paragraph-wrapper:hover {
  outline: 1px dashed #0073e6;
}

/* Edit button */
.paragraph-edit-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 500;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.paragraph-wrapper:hover .paragraph-edit-btn {
  opacity: 1;
}
.paragraph-edit-btn a {
  background: #0073e6;
  color: #fff !important;
  font-size: 11px;
  font-weight: 700;
  font-family: sans-serif;
  padding: 4px 12px;
  border-radius: 3px;
  text-decoration: none !important;
  line-height: 22px;
  display: inline-block;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.paragraph-edit-btn a:hover {
  background: #005bb5;
}

/* Hide Gin left sidebar on frontend */
#toolbar-item-administration-tray.toolbar-tray {
  display: none !important;
}
.toolbar-oriented .toolbar-bar {
  flex-wrap: nowrap;
}
body.toolbar-fixed {
  padding-top: 40px !important;
}
body.toolbar-tray-open {
  margin-left: 0 !important;
}

/* Modal overlay */
.para-edit-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.55);
  z-index: 9998;
}
.para-edit-modal-overlay.active {
  display: block;
}
.para-edit-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  max-width: 900px;
  height: 85vh;
  background: #fff;
  border-radius: 6px;
  z-index: 9999;
  display: none;
  flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.para-edit-modal.active {
  display: flex;
}
.para-edit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: #0073e6;
  color: white;
  border-radius: 6px 6px 0 0;
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 700;
}
.para-edit-modal-close {
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  background: none;
  border: none;
  color: white;
  padding: 0 4px;
}
.para-edit-modal iframe {
  flex: 1;
  border: none;
  width: 100%;
  border-radius: 0 0 6px 6px;
}
/* ==========================================================================
   Restyle Drupal Contextual Links (Edit Dropdown) to match Caledon UI
   ========================================================================== */

/* The dropdown container */
.paragraph-wrapper .contextual .contextual-links {
  background-color: #fff !important;
  border: 1px solid var(--border, #d9e2ec) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
  padding: 6px 0 !important;
  min-width: 160px !important;
}

/* Remove default dark margins/borders on list items */
.paragraph-wrapper .contextual .contextual-links li {
  border: none !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Style the links inside the dropdown */
.paragraph-wrapper .contextual .contextual-links li a {
  color: var(--text, #1d2b36) !important;
  font-family: "myriad-pro", Arial, Helvetica, sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 8px 16px !important;
  text-shadow: none !important;
  background: transparent !important;
  transition: background 0.15s ease, color 0.15s ease !important;
  display: block !important;
  line-height: 1.4 !important;
}

/* Hover state matching your popup buttons */
.paragraph-wrapper .contextual .contextual-links li a:hover,
.paragraph-wrapper .contextual .contextual-links li a:focus {
  background-color: var(--blue-light, #eaf3fb) !important;
  color: var(--blue, #0256a4) !important;
  text-decoration: none !important;
  outline: none !important;
}

/* Specific fix for the hidden/visually-hidden text that core sometimes injects */
.paragraph-wrapper .contextual .contextual-links li a .visually-hidden {
  display: none !important;
}
/* ==========================================================================
   Restyle Drupal Contextual Trigger (Pencil Icon) to match "+ Add" button
   ========================================================================== */

/* The main pencil button */
.paragraph-wrapper .contextual button.trigger {
  background-color: var(--blue, #0256a4) !important;
  border: 2px solid var(--blue, #0256a4) !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 6px rgba(2, 86, 164, 0.25) !important;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease !important;
}

/* Hover, Focus, and Active (clicked) states */
.paragraph-wrapper .contextual button.trigger:hover,
.paragraph-wrapper .contextual button.trigger:focus,
.paragraph-wrapper .contextual button.trigger[aria-pressed="true"] {
  background-color: var(--blue-dark, #014785) !important;
  border-color: var(--blue-dark, #014785) !important;
  transform: scale(1.15) !important;
  box-shadow: 0 4px 12px rgba(2, 86, 164, 0.35) !important;
  outline: none !important;
}

/* Ensure the pencil SVG inside remains white */
.paragraph-wrapper .contextual button.trigger::before {
  filter: brightness(0) invert(1) !important;
}