/* Preparación de publicaciones para redes sociales. */
dialog.share-post {
  box-sizing: border-box;
  width: calc(100% - 40px);
  max-width: 780px;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 28px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #dce4ef;
  border-radius: 26px;
  background: #fff;
  color: #153b72;
  box-shadow: 0 28px 90px #102d4d30;
}
dialog.share-post::backdrop {
  background: #102d4d80;
  backdrop-filter: blur(3px);
}
body:has(dialog.share-post[open]) { overflow: hidden; }
dialog.share-post[open] { display: flex; flex-direction: column; overflow: hidden; }
.share-post-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.share-post-header, .share-post-actions, .share-post-status { flex-shrink: 0; }
.share-post-actions { padding-top: 12px; }
.share-post [hidden] { display: none !important; }
.share-post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.share-post-header > div { min-width: 0; }
.share-post-header h2 {
  margin: 0 0 7px;
  color: #153b72;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.035em;
}
.share-post-header p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.55;
}
.share-post .share-post-close {
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #dce4ef;
  border-radius: 50%;
  background: #f6f8fc;
  color: #153b72;
  font-size: 22px;
  line-height: 1;
}
.share-post .share-post-close:hover {
  border-color: #b4c9e9;
  background: #edf3fc;
  box-shadow: none;
}
.share-post-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}
.share-post-preview,
.share-post-content { min-width: 0; }
.share-post-preview {
  padding: 12px;
  border: 1px solid #e2e9f3;
  border-radius: 18px;
  background: #f3f6fb;
}
.share-post .share-post-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 11px;
  background: #fff;
}
.share-post-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 230px;
  margin: 0;
  padding: 20px;
  color: #526987;
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
}
.share-post-loading::before {
  content: "";
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 2px solid #d2deef;
  border-top-color: #153b72;
  border-radius: 50%;
  animation: share-post-loading-spin .9s linear infinite;
}
@keyframes share-post-loading-spin { to { transform: rotate(360deg); } }
.share-post-image-note {
  margin: 10px 2px 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.share-post-content label {
  display: block;
  margin: 1px 0 9px;
  color: #153b72;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}
.share-post textarea {
  display: block;
  width: 100%;
  min-height: 170px;
  max-height: 360px;
  margin: 0 0 12px;
  padding: 14px;
  resize: vertical;
  border: 1px solid #d2deef;
  border-radius: 14px;
  background: #f8fafc;
  color: #153b72;
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.share-post textarea:hover { border-color: #aebfd8; }
.share-post .button {
  min-height: 44px;
  padding: 11px 17px;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.share-post .button.secondary {
  border-color: #d2deef;
  background: #fff;
  color: #153b72;
}
.share-post .button.secondary:hover {
  border-color: #b4c9e9;
  background: #f3f6fb;
  box-shadow: none;
}
.share-post .share-copy-caption { width: 100%; }
.share-post-guide {
  margin: 22px 0 16px;
  padding: 14px 16px;
  border: 1px solid #e2e9f3;
  border-radius: 14px;
  background: #f3f6fb;
  color: #526987;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.share-post-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}
.share-post-actions > * {
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
}
.share-post-status {
  margin: 14px 0 0;
  color: #526987;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.share-post-status:empty { display: none; }
.share-post button:focus-visible,
.share-post a:focus-visible,
.share-post textarea:focus-visible {
  outline: 2px solid #3676d2;
  outline-offset: 3px;
}
@media (max-width: 650px) {
  dialog.share-post {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 94dvh;
    margin: 0;
    padding: 22px 20px max(24px, env(safe-area-inset-bottom));
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
  }
  .share-post-header { gap: 12px; margin-bottom: 18px; }
  .share-post-header h2 { font-size: 22px; }
  .share-post-header p { font-size: 13px; }
  .share-post-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .share-post-preview { width: 100%; }
  .share-post .share-post-image { max-height: 290px; }
  .share-post-loading { min-height: 180px; }
  .share-post textarea { font-size: 16px; }
  .share-post-guide { margin-top: 18px; }
  .share-post-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-post-actions > * { width: 100%; }
  .share-post-native { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .share-post-loading::before { animation: none; }
}
