/* ==========================================================================
   Jobnest — Mobile FEED content layer (LinkedIn-style)
   Complements mobile-linkedin.css (which handles top bar + bottom tab nav).
   This file reshapes the EXISTING feed post markup (.fp / .fp-head / .fp-acts
   etc.) into a LinkedIn-style card on mobile without touching the renderer.
   Breakpoint matches mobile-linkedin.css (≤768px).
   ========================================================================== */

@media (max-width: 768px) {

  /* ---------- 1. Collapse the 3-column desktop feed to one column ---------- */
  #app-wrap { padding: 0 !important; }
  .feed-wrap {
    display: block !important;
    grid-template-columns: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    gap: 0 !important;
  }
  .feed-l, .feed-r { display: none !important; }
  .feed-c {
    padding: 8px 0 24px !important;
    max-width: 100% !important;
  }

  /* ---------- 2. Composer card — full-bleed, pill input ---------- */
  .feed-c > .card:first-of-type {
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    margin: 0 0 8px !important;
    padding: 12px 14px !important;
    background: var(--card) !important;
  }
  .compose-btn {
    flex: 1 !important;
    text-align: left !important;
    background: var(--navy2) !important;
    border: 1px solid var(--border) !important;
    border-radius: 100px !important;
    padding: 12px 16px !important;
    color: var(--muted) !important;
    font-size: 14px !important;
    font-family: inherit !important;
    min-height: 44px !important;
  }

  /* ---------- 3. Post card (.fp) — full-bleed LinkedIn look ---------- */
  .fp {
    background: var(--card) !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    margin: 0 0 8px !important;
    padding: 14px 14px 4px !important;
    box-shadow: none !important;
  }

  /* Author header — avatar + name/subtitle + menu */
  .fp-head {
    display: flex !important;
    gap: 10px !important;
    align-items: flex-start !important;
    padding: 0 !important;
    margin: 0 0 10px !important;
    background: transparent !important;
  }
  .fp-head .av,
  .fp-head .av-md {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    font-size: 15px !important;
    flex-shrink: 0 !important;
  }
  .fp-head > div[style*="flex:1"] > div:first-child {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: var(--text) !important;
    line-height: 1.25 !important;
  }
  .fp-head > div[style*="flex:1"] > div:nth-child(2) {
    font-size: 12px !important;
    color: var(--muted) !important;
    line-height: 1.4 !important;
  }

  /* Post body text */
  .fp-body {
    font-size: 14.5px !important;
    line-height: 1.5 !important;
    color: var(--text) !important;
    padding: 0 !important;
    margin: 4px 0 10px !important;
    word-wrap: break-word !important;
  }
  .fp-body.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .fp-showmore {
    background: none !important;
    border: 0 !important;
    color: var(--blue2) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    padding: 0 0 10px !important;
    cursor: pointer !important;
  }

  /* Post media — bleed to edges */
  .fp > div[style*="padding:0 16px 12px"] {
    padding: 0 !important;
    margin: 0 -14px 8px !important;
  }
  .fp img[data-jn-media],
  .fp video[data-jn-media],
  .fp img[src],
  .fp video[src] {
    border-radius: 0 !important;
    max-height: none !important;
    width: 100% !important;
  }

  .fp-tags {
    padding: 0 0 8px !important;
    display: flex;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  /* Reactions counter row (likes / comments / shares) */
  .fp-stats {
    display: flex;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 0 !important;
    border-top: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    margin-top: 4px !important;
    font-size: 12.5px !important;
  }
  .fp-stats > span { font-size: 12.5px !important; }
  .fp-stat-likes::before {
    content: "";
    display: inline-block;
    width: 14px; height: 14px;
    background: #1a6ef5;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: -2px;
    box-shadow:
      0 0 0 2px var(--card),
      5px 0 0 -2px #e0597a,
      5px 0 0 0 var(--card),
      10px 0 0 -2px var(--green2),
      10px 0 0 0 var(--card);
  }

  /* Action row — Like / Comment / Share / Follow */
  .fp-acts {
    display: flex;
    gap: 0 !important;
    padding: 2px 0 !important;
    border-top: 0 !important;
    margin: 0 !important;
  }
  .fpa {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 11px 2px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 8px !important;
    color: var(--text2) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    min-height: 44px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
  }
  .fpa:active { background: rgba(255,255,255,.04) !important; }
  .fpa.liked { color: var(--blue2) !important; }

  /* ---------- 4. Filter chips (ready-to-use utility) ---------- */
  .jnl-chips {
    display: flex; gap: 8px; overflow-x: auto;
    padding: 10px 12px; margin: 0;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    background: var(--navy);
    border-bottom: 1px solid var(--border);
  }
  .jnl-chips::-webkit-scrollbar { display: none; }
  .jnl-chip {
    flex: 0 0 auto;
    padding: 7px 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 100px;
    color: var(--text); font-size: 13px; font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
    cursor: pointer;
  }
  .jnl-chip.is-active {
    background: rgba(0,212,255,.14);
    border-color: rgba(0,212,255,.45);
    color: var(--cyan);
  }

  /* ---------- 5. Big section header ---------- */
  .jnl-section-h {
    padding: 18px 14px 4px;
    font-size: 22px; font-weight: 800;
    color: var(--text); letter-spacing: -0.02em;
    line-height: 1.2;
  }
  .jnl-section-sub {
    padding: 0 14px 12px;
    font-size: 13.5px; color: var(--muted);
    line-height: 1.45;
  }

  /* ---------- 6. LinkedIn-style job card (ready for jobs.html) ---------- */
  .jnl-jobcard {
    display: grid;
    grid-template-columns: 56px 1fr 22px;
    gap: 12px;
    padding: 16px 14px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
  }
  .jnl-jobcard .jnl-jc-logo {
    width: 56px; height: 56px; border-radius: 10px;
    background: var(--navy3);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 14px; color: var(--cyan);
    overflow: hidden;
  }
  .jnl-jobcard .jnl-jc-logo img { width:100%; height:100%; object-fit: cover; }
  .jnl-jobcard .jnl-jc-title {
    font-weight: 700; font-size: 15px; color: var(--text);
    margin: 0 0 2px; line-height: 1.3;
  }
  .jnl-jobcard .jnl-jc-co { font-size: 13.5px; color: var(--text2); margin-bottom: 2px; }
  .jnl-jobcard .jnl-jc-meta { font-size: 12.5px; color: var(--muted); }
  .jnl-jobcard .jnl-jc-status {
    display: inline-flex; align-items: center; gap: 5px;
    margin-top: 6px; font-size: 12px; color: var(--green);
  }
  .jnl-jobcard .jnl-jc-tags {
    margin-top: 6px; font-size: 11.5px; color: var(--muted);
  }
  .jnl-jobcard .jnl-jc-easy {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--blue2); font-weight: 700;
  }
  .jnl-jobcard .jnl-jc-dismiss {
    background: none; border: 0; color: var(--muted);
    font-size: 22px; line-height: 1; cursor: pointer;
    align-self: start; padding: 0;
  }

  /* ---------- 7. Notification list item (ready for notifications.html) ---------- */
  .jnl-notif-item {
    display: grid;
    grid-template-columns: 10px 44px 1fr 50px;
    gap: 10px; align-items: start;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
  }
  .jnl-notif-item.is-unread { background: rgba(26,110,245,.06); }
  .jnl-unread-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--blue2);
    align-self: center;
    visibility: hidden;
  }
  .jnl-notif-item.is-unread .jnl-unread-dot { visibility: visible; }
  .jnl-notif-av {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--navy3); overflow: hidden;
  }
  .jnl-notif-text { font-size: 13.5px; color: var(--text); line-height: 1.4; }
  .jnl-notif-text b { font-weight: 700; }
  .jnl-notif-time { font-size: 12px; color: var(--muted); text-align: right; }

  /* ---------- 8. Generic mobile touch target enforcement in feed ---------- */
  .feed-c .btn { min-height: 44px; }

  /* =========================================================================
     JOBS PAGE — mobile LinkedIn treatment
     Targets existing .jcard / .jcard-top / .jlogo / .jcard-info / .jcard-title
     / .jcard-co / .mp / .jcard-tags / .jcard-foot so live rendering adopts
     the LinkedIn "Top job picks for you" card style without JS changes.
     ========================================================================= */

  /* Big LinkedIn-style section title above the list */
  .jobs-wrap #jobs-count {
    padding: 16px 14px 10px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: var(--text) !important;
    letter-spacing: -0.01em !important;
  }

  /* Job list container — full-bleed */
  #jobs-list {
    padding: 0 !important;
    margin: 0 !important;
    background: var(--navy) !important;
  }

  /* Job card: grid with logo tile + stacked info + match pill on the right */
  .jcard {
    display: grid !important;
    grid-template-columns: 56px 1fr auto !important;
    grid-template-rows: auto auto auto !important;
    gap: 6px 12px !important;
    padding: 16px 14px !important;
    margin: 0 0 1px !important;
    background: var(--card) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    cursor: pointer !important;
  }
  .jcard.sel { background: rgba(0,212,255,.06) !important; }

  /* The existing .jcard-top wrapper — flatten it so children sit directly in the grid */
  .jcard > .jcard-top {
    display: contents !important;
  }

  .jcard .jlogo {
    grid-column: 1 / 2; grid-row: 1 / 3;
    width: 56px !important; height: 56px !important;
    border-radius: 10px !important;
    font-weight: 900 !important; font-size: 14px !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    flex-shrink: 0 !important;
    overflow: hidden;
  }
  .jcard .jcard-info {
    grid-column: 2 / 3; grid-row: 1 / 3;
    min-width: 0;
  }
  .jcard .jcard-title {
    font-size: 15.5px !important;
    font-weight: 700 !important;
    color: var(--text) !important;
    line-height: 1.3 !important;
    margin: 0 0 3px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .jcard .jcard-co {
    font-size: 13.5px !important;
    color: var(--text2) !important;
    line-height: 1.4 !important;
  }

  /* Match-score pill stays in top-right of the card */
  .jcard .mp {
    grid-column: 3 / 4; grid-row: 1 / 2;
    align-self: start;
    font-size: 12px !important;
    font-weight: 800 !important;
    padding: 4px 9px !important;
    border-radius: 100px !important;
    white-space: nowrap;
  }

  /* Tags row + foot — stack below, span the content column */
  .jcard .jcard-tags {
    grid-column: 2 / 4; grid-row: 3 / 4;
    margin: 4px 0 0 !important;
    display: flex;
    flex-wrap: wrap !important;
    gap: 5px !important;
    padding: 0 !important;
  }
  .jcard .jcard-foot {
    grid-column: 1 / 4; grid-row: 4 / 5;
    display: flex;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px dashed rgba(255,255,255,.06) !important;
    font-size: 12px !important;
  }
  .jcard .jcard-salary {
    color: var(--green) !important;
    font-weight: 700 !important;
  }

  /* Collapse the desktop 3-pane jobs layout to single column */
  .jobs-wrap {
    display: block !important;
    grid-template-columns: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    gap: 0 !important;
  }
  .jobs-wrap > .jobs-side,
  .jobs-wrap > .jobs-left,
  .jobs-wrap > .jobs-right,
  .jobs-wrap > aside { display: none !important; }

  /* Search inputs area: horizontal scroll chip row style */
  .jobs-wrap .ji-wrap {
    margin: 6px 10px !important;
  }
  .jobs-wrap .ji {
    background: var(--navy2) !important;
    border: 1px solid var(--border) !important;
    border-radius: 100px !important;
    padding: 10px 14px 10px 38px !important;
    font-size: 14px !important;
    min-height: 40px !important;
  }

  /* =========================================================================
     NOTIFICATIONS PAGE — mobile LinkedIn treatment
     Targets existing .ni list item + .unread, plus #notif-filter-tabs chips.
     ========================================================================= */

  .notif-wrap {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .notif-wrap > div:first-child {
    /* The big "Notifications" title */
    padding: 16px 14px 2px !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
  }
  .notif-wrap > div:nth-child(2) {
    padding: 0 14px 10px !important;
    font-size: 13px !important;
    color: var(--muted) !important;
  }

  /* Filter chip row — horizontal scroll */
  #notif-filter-tabs {
    display: flex;
    gap: 8px !important;
    overflow-x: auto !important;
    margin: 0 !important;
    padding: 6px 12px 10px !important;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--border);
  }
  #notif-filter-tabs::-webkit-scrollbar { display: none; }
  #notif-filter-tabs .btn {
    flex: 0 0 auto !important;
    padding: 7px 14px !important;
    border-radius: 100px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    min-height: 0 !important;
    background: rgba(255,255,255,.04) !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    color: var(--text) !important;
  }
  #notif-filter-tabs .btn.btn-ai {
    background: rgba(0,212,255,.14) !important;
    border-color: rgba(0,212,255,.45) !important;
    color: var(--cyan) !important;
  }

  /* "Mark all read" / "Clear all" secondary row */
  .notif-wrap > div[style*="gap:8px"][style*="margin-bottom:14px"] {
    padding: 8px 12px !important;
    margin: 0 !important;
    border-bottom: 1px solid var(--border) !important;
  }
  .notif-wrap > div[style*="gap:8px"] .btn { min-height: 36px !important; font-size: 12px !important; }

  /* Notification item: LinkedIn pattern with unread dot on the left */
  #notif-list .ni {
    display: grid;
    grid-template-columns: 10px 44px 1fr auto !important;
    gap: 10px !important;
    align-items: start !important;
    padding: 14px 14px !important;
    margin: 0 !important;
    background: var(--card) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
  }
  #notif-list .ni::before {
    content: "";
    align-self: center;
    width: 8px; height: 8px; border-radius: 50%;
    background: transparent;
  }
  #notif-list .ni.unread {
    background: rgba(26,110,245,.06) !important;
  }
  #notif-list .ni.unread::before {
    background: var(--blue2);
  }

  /* The icon emoji div (first child after grid insertion) */
  #notif-list .ni > div:first-of-type {
    grid-column: 2 / 3 !important;
    width: 44px; height: 44px !important;
    border-radius: 10px !important;
    background: var(--navy3) !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    font-size: 22px !important;
  }
  /* The body div (text + time) */
  #notif-list .ni > div:nth-of-type(2) {
    grid-column: 3 / 4 !important;
    min-width: 0 !important;
  }
  #notif-list .ni > div:nth-of-type(2) > div:first-child {
    font-size: 13.5px !important;
    line-height: 1.4 !important;
    color: var(--text) !important;
  }
  #notif-list .ni > div:nth-of-type(2) > div:nth-child(2) {
    font-size: 12px !important;
    color: var(--muted) !important;
    margin-top: 4px !important;
  }

  /* Accept/Decline action buttons stay on the right column, stacked tightly */
  #notif-list .ni > div:nth-of-type(2) > div[style*="display:flex"][style*="gap:7px"] {
    margin-top: 10px !important;
    gap: 8px !important;
  }

  /* NOTE: Job-detail bottom-sheet behaviour was rolled back because it
     interfered with list rendering. Re-add carefully in a follow-up. */
}
