/*
 * Evolving Poet — desktop comments layout
 * Blog Posts + Verse of the Day
 * Desktop only. Mobile remains unchanged.
 */

@media (min-width: 769px) {

  /* Larger desktop modal */
  .ep-comments-overlay .ep-comments-window,
  .ep-blog-comments-overlay .ep-comments-window {
    width: min(94vw, 1280px) !important;
    max-width: 1280px !important;
    height: 92dvh !important;
    max-height: 92dvh !important;
    min-height: 0 !important;
    border-radius: 18px !important;
    overflow: hidden !important;
  }

  /* Full-height conversation structure */
  .ep-comments-overlay .ep-comments-window-body,
  .ep-blog-comments-overlay .ep-comments-window-body {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .ep-comments-window-body .ep-final-section {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    width: 100% !important;
  }

  /* Scrollable comments occupy available space */
  .ep-comments-window-body .ep-final-scroll {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 24px clamp(24px, 4vw, 56px) !important;
    box-sizing: border-box !important;
  }

  /* Keep comments towards the bottom */
  .ep-final-scroll > :first-child {
    margin-top: auto !important;
  }

  /* Conversation content fills desktop width */
  .ep-final-scroll .ep-c2-list,
  .ep-final-scroll .comment-list,
  .ep-final-scroll .ep-discussion-comments {
    width: 100% !important;
    max-width: none !important;
  }

  /* Logged-in composer stays at bottom */
  .ep-comments-window-body form.ep-final-composer {
    flex: 0 0 auto !important;
    position: relative !important;
    margin-top: auto !important;
    width: 100% !important;
    padding: 16px clamp(24px, 4vw, 56px) !important;
    border-top: 1px solid var(--border) !important;
    background: var(--surface) !important;
  }

  /* Keep the mobile-style input layout */
  .ep-final-composer .ep-final-input-row {
    display: flex !important;
    align-items: flex-end !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .ep-final-composer .ep-final-input-row textarea {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Larger, readable comment content */
  .ep-final-scroll .ep-c2-body,
  .ep-final-scroll .ep-discussion-comment-body,
  .ep-final-scroll .comment-body {
    font-size: 1rem !important;
    line-height: 1.65 !important;
  }

  /* Logged-out controls near the bottom */
  .ep-final-scroll .ep-discussion-signin,
  .ep-final-scroll .ep-blog-discussion-signin,
  .ep-final-scroll .ep-c2-signin {
    margin-top: auto !important;
    padding-top: 24px !important;
  }

  .ep-final-scroll .ep-discussion-empty,
  .ep-final-scroll .ep-blog-discussion-empty,
  .ep-final-scroll .ep-c2-empty {
    margin-top: 20px !important;
    margin-bottom: 20px !important;
  }

}

/* Full-screen desktop comments — blog and Scripture */
@media (min-width: 769px) {

  .ep-comments-overlay,
  .ep-blog-comments-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    background: var(--surface) !important;
    backdrop-filter: none !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    box-sizing: border-box !important;
  }

  .ep-comments-overlay .ep-comments-window,
  .ep-blog-comments-overlay .ep-comments-window {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    background: var(--surface) !important;
  }

  .ep-comments-overlay .ep-comments-window-body,
  .ep-blog-comments-overlay .ep-comments-window-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .ep-comments-window-body .ep-final-section {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  .ep-comments-window-body .ep-final-scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  .ep-comments-window-body form.ep-final-composer {
    flex: 0 0 auto !important;
    margin-top: auto !important;
  }

}
