/*
 * rt-create-post.css
 * ─────────────────────────────────────────────────────────────────────────────
 * "Start a post" composer card.
 * Scoped to .rt-create-post.
 *
 * Figma reference: node 79:2067
 * ─────────────────────────────────────────────────────────────────────────────
 * Card:           655px wide  134px tall  bg #fff  radius 10px  shadow card  p 25px
 * Input row:      flex row  align-items center  gap 15px  (59-44=15)
 *   Avatar:       44×44px  border-radius 22px (= 50%)
 *   Input field:  flex 1  h 44px  bg white  border 1px solid #707070  radius 5px
 *                 shadow 0 1px 2px rgba(10,13,18,.05)  px 15px
 *   Placeholder:  Inter Regular 15px #111  lh 20px
 * Actions row:    flex row  justify space-between  mt 20px
 *   Each button:  flex row  gap 8px  align-items center  bg transparent  border none
 *   Icon:         20×20px
 *   Label:        Inter Medium 16px #111  lh 20px
 * ─────────────────────────────────────────────────────────────────────────────
 *
 * !important NOTES
 * ─────────────────
 * box-sizing  – global note 1
 * p margin    – global note 2
 * input font  – Elementor and WP themes apply their own font-family to
 *               form inputs via * or input selectors. We must force
 *               font-family:inherit on the field button to get Inter.
 * button font – same reason as input.
 * img size    – global note 4
 * ─────────────────────────────────────────────────────────────────────────────
 */

.rt-create-post,
.rt-create-post * {
  box-sizing: border-box !important;
}

.rt-create-post p,
.rt-create-post p:last-child {
  margin-top:    0 !important;
  margin-bottom: 0 !important;
  padding-top:   0 !important;
  padding-bottom:0 !important;
}

.rt-create-post img {
  display: block;
  border: 0;
}

/* ── Reset button / anchor / contenteditable inside card ────────────────── */
.rt-create-post button,
.rt-create-post [contenteditable],
.rt-create-post a {
  font-family: var(--rt-font-primary, 'Inter', sans-serif) !important; /* Elementor btn font */
  cursor: pointer;
  text-decoration: none;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   Component
   ══════════════════════════════════════════════════════════════════════════ */

.rt-create-post {
  position: relative;
  width: 100%;
  max-width: var(--rt-feed-max-width, 655px);
  background-color: var(--rt-color-white, #ffffff);
  border-radius: var(--rt-radius-md, 10px);
  box-shadow: var(--rt-shadow-card, 0px 0px 20px 0px rgba(0, 0, 0, 0.05));
  padding: 25px;             /* exact Figma card padding */
  font-family: var(--rt-font-primary, 'Inter', sans-serif);
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: 20px;                 /* gap between input row and action row */
}

/* ── Input row ───────────────────────────────────────────────────────────── */
.rt-create-post__input-row {
  display: flex;
  align-items: center;
  gap: 15px;   /* Figma: input ML = 59px, avatar = 44px → gap = 15px */
  position: relative;
}

/* ── Avatar ──────────────────────────────────────────────────────────────── */
.rt-create-post__avatar {
  flex-shrink: 0;
  width:  44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  object-fit: cover;
  display: block;
  overflow: hidden;
}

/* ── Input field (contenteditable div) ──────────────────────────────────── */
/*
 * Replaced <textarea> with a contenteditable <div>.  Many textarea-specific
 * properties (resize, overflow:hidden, height driven by JS) are dropped; the
 * div auto-grows naturally.  !important kept on border/color/font to beat
 * Elementor and theme resets that target div[contenteditable].
 */
.rt-create-post__field {
  flex: 1;
  min-width: 0;
  display: block;
  width: 100%;
  min-height: 44px;
  background-color: var(--rt-color-white, #ffffff) !important;
  border: 1px solid var(--rt-color-border, #707070) !important;
  border-radius: var(--rt-radius-sm, 5px);
  box-shadow: var(--rt-shadow-input, 0px 1px 2px 0px rgba(10, 13, 18, 0.05));
  padding: 12px 15px;
  font-family: var(--rt-font-primary, 'Inter', sans-serif) !important;
  font-size:   var(--rt-text-lg, 15px) !important;
  font-weight: var(--rt-fw-normal, 400);
  line-height: var(--rt-lh-base, 20px);
  color: var(--rt-color-text-primary, #111111) !important;
  background-image: none !important;
  letter-spacing: normal;
  transition: border-color 150ms ease;
  cursor: text;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  position: relative;
}

/* Placeholder via :empty pseudo-element + data-placeholder attribute */
.rt-create-post__field:empty::before {
  content: attr(data-placeholder);
  color: var(--rt-color-text-primary, #111111);
  opacity: 0.55;
  pointer-events: none;
  font-family: var(--rt-font-primary, 'Inter', sans-serif);
  font-size:   var(--rt-text-lg, 15px);
  font-weight: var(--rt-fw-normal, 400);
  line-height: var(--rt-lh-base, 20px);
}

.rt-create-post__field:focus {
  border-color: var(--rt-color-brand, #558af5) !important;
  box-shadow: 0 0 0 3px rgba(85, 138, 245, 0.15),
              var(--rt-shadow-input, 0px 1px 2px 0px rgba(10, 13, 18, 0.05));
}

/* ── @mention chip (inline non-editable pill) ────────────────────────────── */
.rt-create-post__mention {
  display: inline;
  background-color: rgba(85, 138, 245, 0.12);
  color: var(--rt-color-brand, #558af5);
  border-radius: 3px;
  padding: 1px 4px;
  font-weight: var(--rt-fw-medium, 500);
  white-space: nowrap;
  cursor: default;
  user-select: all; /* select whole chip on click */
}

/* ── Mention dropdown ────────────────────────────────────────────────────── */
.rt-create-post__mention-dropdown {
  position: absolute;
  z-index: 200;
  background: var(--rt-color-white, #ffffff);
  border: 1px solid var(--rt-color-border-light, #e5e7eb);
  border-radius: var(--rt-radius-md, 10px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
  overflow: hidden;
  max-height: 264px;
  overflow-y: auto;
  min-width: 240px;
}

.rt-create-post__mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color 100ms ease;
}

.rt-create-post__mention-item:hover,
.rt-create-post__mention-item--active {
  background-color: var(--rt-color-bg-hover, #f3f6ff);
}

.rt-create-post__mention-avatar {
  width:  32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.rt-create-post__mention-avatar--placeholder {
  background-color: var(--rt-color-border-light, #e5e7eb);
}

.rt-create-post__mention-name {
  font-family: var(--rt-font-primary, 'Inter', sans-serif);
  font-size:   var(--rt-text-base, 14px);
  font-weight: var(--rt-fw-medium, 500);
  color: var(--rt-color-text-primary, #111111);
  line-height: var(--rt-lh-base, 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Action buttons row ──────────────────────────────────────────────────── */
/* Offset by avatar (44px) + gap (15px) so the row left-aligns with the field */
.rt-create-post__actions {
  display:     flex;
  align-items: center;
  margin-left: calc(44px + 15px);  /* = 59px — matches field's left edge */
}

/* The three media-type buttons stay grouped together */
.rt-create-post__action-group {
  display:     flex;
  align-items: center;
  gap:         20px;
  flex:        1;
}

/* ── Single action button ────────────────────────────────────────────────── */
.rt-create-post__action {
  display: flex;
  align-items: center;
  gap: 8px;                   /* icon (20px) + 8px + label */
  padding: 0 !important;      /* beat Elementor button padding */
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--rt-color-brand, #558af5) !important; /* brand blue by default */
  font-size: var(--rt-text-xl, 16px) !important;
  font-weight: var(--rt-fw-medium, 500) !important;
  line-height: var(--rt-lh-base, 20px);
  letter-spacing: normal;
  cursor: pointer;
  transition: color 150ms ease;
}

.rt-create-post__action:hover {
  color: var(--rt-color-text-primary, #111111) !important; /* darken on hover */
  background: transparent !important;
}

/* Anchor variant — beat Elementor link resets */
a.rt-create-post__action {
  display: inline-flex !important;
  text-decoration: none !important;
  color: var(--rt-color-brand, #558af5) !important;
  cursor: pointer !important;
}

a.rt-create-post__action:hover {
  text-decoration: none !important;
  color: var(--rt-color-text-primary, #111111) !important;
}

/* First action (Photo) sits flush at the left edge — no leading space */
.rt-create-post__action:first-child {
  margin-left:  0 !important;
  padding-left: 0 !important;
}

/* ── Action icon ───────────────────────────────────────────────────────────── */
.rt-create-post__action-icon {
  width:  20px !important;
  height: 20px !important;
  display: block;
  flex-shrink: 0;
  fill: currentColor;
  pointer-events: none;
}

/* ── Action label ────────────────────────────────────────────────────────── */
.rt-create-post__action-label {
  font-family: var(--rt-font-primary, 'Inter', sans-serif);
  font-size:   var(--rt-text-xl, 16px);
  font-weight: var(--rt-fw-medium, 500);
  line-height: var(--rt-lh-base, 20px);
  color: var(--rt-color-text-primary, #111111) !important; /* always black */
  white-space: nowrap;
  transition: color 150ms ease;
}

.rt-create-post__action:hover .rt-create-post__action-label {
  color: var(--rt-color-text-primary, #111111) !important;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .rt-create-post {
    padding: 16px;
  }

  .rt-create-post__actions {
    margin-left: 0;           /* full width on small screens */
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* Hide action labels, keep icons only, when the card gets narrow */
@media (max-width: 480px) {
  .rt-create-post__action-label {
    display: none !important;
  }

  .rt-create-post__action {
    padding: 6px 10px !important;
    gap: 0 !important;
  }

  /* re-align icon-only buttons so they look centred */
  .rt-create-post__action:first-child {
    padding-left: 6px !important;
  }
}

/* ── Expanded state (JS adds .rt-create-post--expanded on textarea focus) ── */
/*
 * The JS also sets inline height via scrollHeight for typing growth;
 * this CSS provides the initial snap-open on focus before any typing.
 */
.rt-create-post--expanded .rt-create-post__field {
  min-height: 88px !important; /* 2× single-line height – snap open on focus */
  overflow: auto;              /* show scrollbar if user pastes huge text */
}

/* ── Submit button (hidden until expanded, lives inside actions row) ─────── */
.rt-create-post__submit-btn {
  display:          inline-flex;
  align-items:      center;
  justify-content:  center;
  height:           36px;
  padding:          0 20px !important;
  margin-left:      auto;   /* push to far right of the flex row */
  background-color: var(--rt-color-brand, #558af5) !important;
  color:            #ffffff !important;
  border:           none !important;
  border-radius:    var(--rt-radius-full, 9999px);
  font-family:      var(--rt-font-primary, 'Inter', sans-serif) !important;
  font-size:        var(--rt-text-lg, 15px) !important;
  font-weight:      var(--rt-fw-semibold, 600) !important;
  line-height:      1;
  cursor:           pointer;
  box-shadow:       none !important;
  transition:       background-color 150ms ease, opacity 150ms ease;
  white-space:      nowrap;
  flex-shrink:      0;
}

.rt-create-post__submit-btn:hover {
  background-color: var(--rt-color-brand-dark, #3a6fd4) !important;
  color: #ffffff !important;
}

.rt-create-post__submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rt-create-post__field {
  transition: min-height 150ms ease, border-color 150ms ease;
}

/* ═══════════════════════════════════════════════════════════════════════
   PHOTO PREVIEW
   ═══════════════════════════════════════════════════════════════════════ */

.rt-create-post__photo-preview {
  margin: 12px 0 0;
}

.rt-create-post__photo-preview-inner {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.rt-create-post__photo-preview-inner img {
  display: block;
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  object-fit: cover;
}

.rt-create-post__photo-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent !important;
  border: 0;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff !important;
  cursor: pointer;
  line-height: 0;
  transition: background 150ms ease;
}

.rt-create-post__photo-remove  svg {
	color:#fff !important;
}

.rt-create-post__photo-remove:hover {
  background: rgba(0,0,0,.8);
}

/* ═══════════════════════════════════════════════════════════════════════
   VIDEO UPLOAD — FORCE [hidden] TO ACTUALLY HIDE
   (Elementor and other page-builder resets can override the UA stylesheet
   display:none that [hidden] relies on — lock it down here.)
   ═══════════════════════════════════════════════════════════════════════ */

.rt-create-post__video-progress[hidden],
.rt-create-post__video-preview[hidden] {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   VIDEO UPLOAD — PROGRESS BAR
   ═══════════════════════════════════════════════════════════════════════ */

.rt-create-post__video-progress {
  display: flex !important;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
}

.rt-create-post__video-progress-track {
  flex: 1;
  height: 6px;
  background: var(--rt-color-divider, #DBDBDC);
  border-radius: 3px;
  overflow: hidden;
}

.rt-create-post__video-progress-bar {
  height: 100% !important;
  width: 0%;
  background: var(--rt-color-brand, #558AF5) !important;
  border-radius: 3px;
  transition: width 150ms linear;
}

.rt-create-post__video-progress-text {
  font-family: Inter, sans-serif;
  font-size: 12px;
  color: #666;
  min-width: 36px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════════
   VIDEO UPLOAD — PREVIEW THUMBNAIL
   ═══════════════════════════════════════════════════════════════════════ */

.rt-create-post__video-preview {
  display: block !important;
  margin: 12px 0 0;
}

.rt-create-post__video-preview-inner {
  position: relative !important;
  display: block !important;
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  line-height: 0;
}

.rt-create-post__video-thumb-preview {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: 300px !important;
  height: auto !important;
  object-fit: cover;
  border-radius: 0;
  opacity: .9;
}

.rt-create-post__video-play-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.rt-create-post__video-name {
  display: block !important;
  padding: 12px 16px;
  font-family: Inter, sans-serif;
  font-size: 13px;
  color: #fff;
  background: #222;
  line-height: 1.4;
}

/* Remove button — all key props !important to beat Elementor button resets */
.rt-create-post__video-remove {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: rgba(0,0,0,.6) !important;
  border: 0 !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  color: #fff !important;
  cursor: pointer !important;
  line-height: 1 !important;
  font-size: 0 !important;
  text-indent: 0 !important;
  transition: background 150ms ease;
  z-index: 10 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.rt-create-post__video-remove svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  fill: none !important;
  flex-shrink: 0;
}

.rt-create-post__video-remove svg path {
  fill: #fff !important;
}

.rt-create-post__video-remove:hover {
  background: rgba(0,0,0,.85) !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   REPOST PREVIEW  (shown in create-post when reposting)
   ═══════════════════════════════════════════════════════════════════════ */

.rt-create-post__repost-preview {
  margin: 12px 0 0;
}

/* reuses .rt-post__repost-block styles; cancel button override */
.rt-create-post__repost-cancel {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  background: rgba(0,0,0,.08) !important;
  border: 0 !important;
  border-radius: 50% !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--rt-color-meta, #585858) !important;
  cursor: pointer !important;
  line-height: 0 !important;
  box-shadow: none !important;
  transition: background 150ms ease !important;
}

.rt-create-post__repost-cancel:hover {
  background: rgba(0,0,0,.15) !important;
}
