/* static/css/profile/profile-desktop.css
   ============================================
   KELIBATMU V2 - DESKTOP PROFILE + POST POLISH
   Namespace: kv2-profile-
   Scope: desktop only (min-width: 981px).
   Loaded last, and only from public_profile.html and status_detail.html.
   This layer never applies below the 981px breakpoint, so the accepted
   tablet/mobile presentation remains byte-for-byte untouched.
   ============================================ */

@media (min-width: 981px) {
  /* ---------------------------------------------------------------
     Shared shell
     --------------------------------------------------------------- */
  .kv2-profile-stage {
    width: min(1200px, calc(100% - 64px));
  }

  /* ---------------------------------------------------------------
     Profile hero: cover, avatar, identity, badges, stats, actions
     --------------------------------------------------------------- */
  .kv2-profile-hero {
    border-radius: 24px;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.04) inset,
      0 30px 90px rgba(0, 0, 0, 0.46);
  }

  .kv2-profile-banner {
    height: clamp(240px, 21vw, 320px);
    border-radius: 23px 23px 0 0;
  }

  .kv2-profile-banner-image {
    opacity: 0.7;
    filter: saturate(0.95) contrast(1.06) brightness(0.9);
  }

  .kv2-profile-banner-shadow {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.18) 46%, rgba(0, 0, 0, 0.84) 100%),
      radial-gradient(circle at 70% 72%, rgba(160, 255, 170, 0.06), transparent 24%);
  }

  .kv2-profile-hero-content {
    gap: 15px;
    padding: 0 30px 26px;
  }

  .kv2-profile-identity-strip {
    gap: 24px;
    margin-top: -66px;
    align-items: flex-end;
  }

  .kv2-profile-avatar-wrap::before {
    inset: -8px;
    border-radius: 50%;
    opacity: 0.9;
    filter: blur(14px);
  }

  .kv2-profile-avatar {
    width: 136px;
    height: 136px;
    border-width: 4px;
    border-color: rgba(7, 9, 8, 0.96);
    border-radius: 50%;
    box-shadow:
      0 0 0 1px rgba(212, 175, 55, 0.42),
      0 0 0 6px rgba(7, 9, 8, 0.72),
      0 20px 46px rgba(0, 0, 0, 0.5);
  }

  .kv2-profile-avatar-edit {
    right: 2px;
    bottom: 8px;
    width: 34px;
    height: 34px;
  }

  .kv2-profile-hero-copy {
    padding: 0 0 6px;
  }

  .kv2-profile-display-name {
    gap: 9px;
    font-size: clamp(2rem, 2.3vw, 2.45rem);
    font-weight: 650;
    letter-spacing: -0.01em;
  }

  .kv2-profile-verified {
    width: 21px;
    height: 21px;
    font-size: 11px;
  }

  .kv2-profile-handle-row {
    gap: 8px;
    margin-top: 6px;
  }

  .kv2-profile-username {
    color: rgba(255, 255, 255, 0.56);
    font-size: 0.95rem;
    font-weight: 550;
    letter-spacing: 0.01em;
  }

  .kv2-profile-echo {
    margin-top: 2px;
    gap: 7px;
  }

  .kv2-profile-echo__role,
  .kv2-profile-echo__rank,
  .kv2-profile-echo__item {
    min-height: 28px;
    padding: 0 12px;
    font-size: 0.76rem;
    font-weight: 600;
  }

  .kv2-profile-meta-row {
    margin-top: 10px;
    gap: 0;
  }

  .kv2-profile-meta-item {
    gap: 5px;
    padding: 2px 0;
  }

  .kv2-profile-meta-item + .kv2-profile-meta-item::before {
    top: 2px;
    bottom: 2px;
    background: rgba(255, 255, 255, 0.08);
  }

  .kv2-profile-meta-item strong {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
  }

  .kv2-profile-meta-item span {
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.79rem;
  }

  .kv2-profile-actions {
    gap: 12px;
    margin-top: 10px;
  }

  .kv2-profile-actions:has(.kv2-profile-action-compact) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 58px 58px;
  }

  .kv2-profile-actions:has(.kv2-safety-menu):not(:has(.kv2-profile-action-compact)) {
    grid-template-columns: minmax(0, 1fr) 58px;
  }

  .kv2-profile-action {
    gap: 9px;
    min-height: 52px;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 0.95rem;
    font-weight: 650;
  }

  .kv2-profile-action svg,
  .kv2-safety-menu summary svg {
    width: 19px;
    height: 19px;
  }

  .kv2-profile-action-compact,
  .kv2-safety-menu summary {
    width: 58px;
    min-width: 58px;
  }

  .kv2-safety-menu summary {
    min-height: 52px;
    border-radius: 12px;
  }

  /* Deep-emerald primary actions, as in the approved desktop reference. */
  .kv2-profile-action-primary {
    border-color: rgba(148, 209, 138, 0.3);
    color: #f3fbf4;
    background: linear-gradient(
      135deg,
      color-mix(in srgb, var(--kv2-profile-accent) 32%, #07130e),
      color-mix(in srgb, var(--kv2-profile-accent) 16%, #04100a)
    );
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  }

  .kv2-profile-action-primary:hover {
    border-color: rgba(148, 209, 138, 0.44);
    color: #ffffff;
    background: linear-gradient(
      135deg,
      color-mix(in srgb, var(--kv2-profile-accent) 40%, #07130e),
      color-mix(in srgb, var(--kv2-profile-accent) 22%, #04100a)
    );
    transform: translateY(-1px);
  }

  #kv2-message-user {
    border-color: rgba(148, 209, 138, 0.24);
    color: #e9f8ee;
    background: linear-gradient(
      135deg,
      color-mix(in srgb, var(--kv2-profile-accent) 22%, #08170f),
      color-mix(in srgb, var(--kv2-profile-accent) 10%, #050f09)
    );
  }

  #kv2-message-user:hover {
    border-color: rgba(148, 209, 138, 0.38);
    background: linear-gradient(
      135deg,
      color-mix(in srgb, var(--kv2-profile-accent) 28%, #08170f),
      color-mix(in srgb, var(--kv2-profile-accent) 14%, #050f09)
    );
    transform: translateY(-1px);
  }

  /* Profile content cards */
  .kv2-profile-layout {
    gap: 20px;
    margin-top: 18px;
  }

  .kv2-profile-main {
    gap: 18px;
  }

  .kv2-profile-section,
  .kv2-profile-identity-panel {
    border-radius: 20px;
  }

  .kv2-profile-section {
    padding: 20px;
  }

  .kv2-profile-section-heading {
    margin-bottom: 14px;
  }

  /* ---------------------------------------------------------------
     Post detail: navigation, card, author, caption, media
     --------------------------------------------------------------- */
  .kv2-profile-endpoint-nav {
    margin: 0 0 12px;
  }

  .kv2-profile-endpoint-nav__link {
    min-height: 40px;
    padding: 0 16px;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    transition:
      color 0.2s ease,
      border-color 0.2s ease,
      background 0.2s ease;
  }

  .kv2-profile-endpoint-nav__link:hover {
    border-color: rgba(212, 175, 55, 0.4);
    color: #ffffff;
    background: rgba(212, 175, 55, 0.08);
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] {
    margin-top: 0;
    padding: 22px 26px 16px;
    border-color: rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    background:
      radial-gradient(circle at 18% 0%, rgba(224, 148, 113, 0.1), transparent 32%),
      rgba(255, 255, 255, 0.032);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.32);
  }

  .kv2-profile-status-detail[data-action-type="profile-status"]:has(+ .kv2-status-comment-section) {
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    padding-bottom: 16px;
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-profile-status-author {
    gap: 12px;
    margin-bottom: 14px;
    align-items: center;
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-profile-status-author__avatar {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    font-size: 1.2rem;
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-profile-status-author__copy {
    padding-top: 1px;
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-profile-status-author__headline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-profile-status-author__name {
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: -0.005em;
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-profile-status-author__feeling {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.88rem;
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-profile-status-author__meta {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.78rem;
  }

  .kv2-profile-status-detail__body {
    margin-top: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    line-height: 1.6;
  }

  /* Media keeps the original aspect ratio. The height cap only binds tall
     images, so portrait/square posts stay compact while wide images still
     use the available width. Nothing is cropped or stretched. */
  .kv2-profile-status-detail[data-action-type="profile-status"] > .kv2-profile-status__media {
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: none;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 14px;
    background: transparent;
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] > .kv2-profile-status__media .kv2-profile-status__media-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.16);
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] > .kv2-profile-status__media .kv2-profile-status__image,
  .kv2-profile-status-detail[data-action-type="profile-status"] > .kv2-profile-status__media .kv2-profile-status__image--detail {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(500px, 56vh);
    object-fit: contain;
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] > .kv2-profile-status__media .kv2-profile-status__media-button:hover .kv2-profile-status__image {
    transform: scale(1.008);
  }

  /* Like / Comment row */
  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 2px;
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-action-bar__form {
    display: flex;
    margin: 0;
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-action-bar__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 88px;
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0 16px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.04);
    transition:
      color 0.2s ease,
      border-color 0.2s ease,
      background 0.2s ease;
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-action-bar__button:hover {
    border-color: rgba(224, 148, 113, 0.28);
    color: #f4d7c2;
    background: rgba(224, 148, 113, 0.08);
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-action-bar__like.is-liked {
    border-color: rgba(224, 72, 92, 0.38);
    color: #ff8f9c;
    background: rgba(224, 72, 92, 0.1);
  }

  .kv2-profile-status-detail[data-action-type="profile-status"] .kv2-action-bar__menu {
    width: 38px;
    min-width: 38px;
    height: 38px;
    margin-left: auto;
    border-radius: 999px;
  }

  /* ---------------------------------------------------------------
     Comments: joined to the post card, calmer empty state and composer
     --------------------------------------------------------------- */
  #status-comments.kv2-status-comment-section {
    margin-top: 0;
    padding: 16px 26px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top-color: rgba(255, 255, 255, 0.07);
    border-radius: 0 0 24px 24px;
    background: rgba(255, 255, 255, 0.032);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.3);
  }

  #status-comments .kv2-profile-section-heading {
    margin: 0 0 4px;
    align-items: center;
  }

  #status-comments .kv2-profile-section-title {
    font-size: 1.08rem;
    font-weight: 650;
    letter-spacing: -0.005em;
  }

  #status-comments .kv2-profile-status-comments {
    gap: 2px;
    margin-top: 4px;
  }

  #status-comments .kv2-profile-status-comment {
    padding: 8px 0;
  }

  #status-comments [data-kv2-comment-empty] {
    display: grid;
    place-items: center;
    justify-items: center;
    gap: 10px;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 24px 16px 20px;
    color: rgba(255, 255, 255, 0.58);
    background: transparent;
    font-size: 0.92rem;
    line-height: 1.5;
    text-align: center;
    white-space: normal;
  }

  #status-comments [data-kv2-comment-empty]::before {
    content: "";
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.38);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' d='M21 11.5a8.4 8.4 0 0 1-8.7 8.2 9.6 9.6 0 0 1-3.9-.8L3 20l1.2-4.3A7.8 7.8 0 0 1 3 11.5a8.4 8.4 0 0 1 8.7-8.2 8.4 8.4 0 0 1 9.3 8.2z'/%3E%3Ccircle cx='8.2' cy='11.5' r='.9' fill='white'/%3E%3Ccircle cx='12' cy='11.5' r='.9' fill='white'/%3E%3Ccircle cx='15.8' cy='11.5' r='.9' fill='white'/%3E%3C/svg%3E")
      center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round' d='M21 11.5a8.4 8.4 0 0 1-8.7 8.2 9.6 9.6 0 0 1-3.9-.8L3 20l1.2-4.3A7.8 7.8 0 0 1 3 11.5a8.4 8.4 0 0 1 8.7-8.2 8.4 8.4 0 0 1 9.3 8.2z'/%3E%3Ccircle cx='8.2' cy='11.5' r='.9' fill='white'/%3E%3Ccircle cx='12' cy='11.5' r='.9' fill='white'/%3E%3Ccircle cx='15.8' cy='11.5' r='.9' fill='white'/%3E%3C/svg%3E")
      center / contain no-repeat;
  }

  #status-comments .kv2-status-comment-guest {
    margin: 0;
    padding: 10px 0 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
  }

  #status-comments .kv2-profile-status-comment-form.kv2-facebook-composer {
    margin-top: 4px;
  }

  #status-comments .kv2-facebook-composer__bar {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 6px 10px 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
    transition:
      border-color 0.2s ease,
      box-shadow 0.2s ease;
  }

  #status-comments .kv2-facebook-composer__bar:focus-within {
    border-color: rgba(212, 175, 55, 0.38);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.06);
  }

  #status-comments .kv2-profile-status-comment__avatar--composer {
    width: 38px;
    height: 38px;
  }

  #status-comments .kv2-facebook-composer__bar textarea {
    min-height: 36px;
    border: 0;
    border-radius: 0;
    padding: 8px 2px;
    background: transparent;
    font-size: 0.92rem;
    line-height: 1.45;
    resize: none;
  }

  #status-comments .kv2-facebook-composer__bar textarea:focus {
    outline: none;
    box-shadow: none;
  }

  #status-comments .kv2-facebook-composer__extras {
    margin-left: 48px;
    margin-top: 6px;
  }

  #status-comments .kv2-facebook-composer__send {
    min-width: 38px;
    min-height: 38px;
    border-radius: 11px;
  }
}
