/* PostPulse by Zulfi – Frontend CSS v4.0 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Variables ── */
.pp-wrap {
    --ppa: #e63946;
    --ppt: #1a1a2e;
    --ppb: #ffffff;
    --ppr: 230,57,70;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ppt);
}
.pp-wrap * { box-sizing: border-box; }
.pp-list  { list-style: none; margin: 0; padding: 0; }
.pp-empty { color: #94a3b8; font-size: 13px; padding: 14px 0; text-align: center; }

/* ── Thumbnail ── */
.pp-tlink { display: block; flex-shrink: 0; text-decoration: none; }
.pp-thumb {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    display: flex; align-items: center; justify-content: center;
}
.pp-thumb img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .4s ease;
}
.pp-thumb.pp-round { border-radius: 50% !important; }

/* Placeholder when no image */
.pp-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--ppa), rgba(var(--ppr), .65));
}
.pp-ph span { font-size: 20px; font-weight: 800; color: #fff; text-transform: uppercase; }

/* ── Rank badge ── */
.pp-rank {
    position: absolute; top: 6px; left: 6px; z-index: 2;
    width: 20px; height: 20px;
    background: var(--ppa); color: #fff;
    font-size: 10px; font-weight: 800;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.25); line-height: 1;
}
.pp-rank.pp-rt { width: 23px; height: 23px; font-size: 11px; }

/* ── Category ── */
a.pp-cat {
    display: inline-block;
    background: var(--ppa); color: #fff !important;
    font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 20px;
    text-transform: uppercase; letter-spacing: .4px;
    text-decoration: none; margin-right: 4px;
    transition: opacity .2s;
}
a.pp-cat:hover { opacity: .82; }

/* ── Title ── */
.pp-title { margin: 0 0 4px; font-size: 14px; line-height: 1.45; }
.pp-title a { color: var(--ppt); text-decoration: none; font-weight: 700; transition: color .2s; }
.pp-title a:hover { color: var(--ppa); }

/* ── Excerpt ── */
.pp-exc { font-size: 12px; color: #64748b; margin: 4px 0 0; line-height: 1.55; }

/* ── Meta bar ── */
.pp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.pp-mi {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; color: #94a3b8; font-weight: 500;
}
.pp-mi svg { color: #94a3b8; flex-shrink: 0; }

/* ════════════════════════════════════════
   THEME 1 – Classic Card
   Image left · content right
════════════════════════════════════════ */
.pp-theme1 .pp-list { display: flex; flex-direction: column; gap: 12px; }
.pp-theme1 .pp-item {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--ppb);
    border: 1px solid #f1f5f9;
    border-radius: 10px; padding: 12px;
    transition: all .25s;
}
.pp-theme1.pp-shadow .pp-item { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.pp-theme1.pp-hover  .pp-item:hover {
    border-color: var(--ppa);
    transform: translateX(4px);
    box-shadow: 0 4px 18px rgba(var(--ppr),.15);
}
.pp-theme1 .pp-thumb { width: 80px; height: 80px; border-radius: 8px; }
.pp-theme1 .pp-cnt   { flex: 1; min-width: 0; }

/* ════════════════════════════════════════
   THEME 2 – Bold List
   Numbered with rank medals
════════════════════════════════════════ */
.pp-theme2 .pp-list { display: flex; flex-direction: column; }
.pp-theme2 .pp-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid #f1f5f9;
    transition: padding .2s;
}
.pp-theme2 .pp-item:last-child { border-bottom: none; }
.pp-theme2.pp-hover .pp-item:hover { padding-left: 6px; }

/* Override rank to be standalone (not on image) */
.pp-theme2 .pp-rank {
    position: static;
    width: 30px; height: 30px; font-size: 13px;
    background: transparent; color: var(--ppa);
    border: 2px solid var(--ppa); box-shadow: none; border-radius: 50%;
    flex-shrink: 0;
}
.pp-theme2 .pp-item:nth-child(1) .pp-rank { background: var(--ppa); color: #fff; }
.pp-theme2 .pp-item:nth-child(2) .pp-rank { background: #e2e8f0; border-color: #94a3b8; color: #475569; }
.pp-theme2 .pp-item:nth-child(3) .pp-rank { background: #fff3e0; border-color: #fb923c; color: #ea580c; }

.pp-theme2 .pp-thumb { width: 62px; height: 62px; border-radius: 7px; }
.pp-theme2 .pp-cnt   { flex: 1; min-width: 0; }
.pp-theme2 .pp-title { font-size: 13px; }

/* ════════════════════════════════════════
   THEME 3 – Grid
   2-column image grid
════════════════════════════════════════ */
.pp-theme3 .pp-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.pp-theme3 .pp-item {
    background: var(--ppb);
    border: 1px solid #f1f5f9;
    border-radius: 10px; overflow: hidden;
    display: flex; flex-direction: column;
    transition: all .25s; position: relative;
}
.pp-theme3.pp-shadow .pp-item { box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.pp-theme3.pp-hover  .pp-item:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.pp-theme3 .pp-tlink { display: block; }
.pp-theme3 .pp-thumb { width: 100%; height: 120px; border-radius: 0; }
.pp-theme3.pp-hover .pp-item:hover .pp-thumb img { transform: scale(1.06); }
.pp-theme3 .pp-cnt  { padding: 10px; flex: 1; display: flex; flex-direction: column; }
.pp-theme3 .pp-title { font-size: 12px; flex: 1; }

/* ════════════════════════════════════════
   THEME 4 – Minimal
   Ultra-clean text only
════════════════════════════════════════ */
.pp-theme4 .pp-list { display: flex; flex-direction: column; }
.pp-theme4 .pp-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 0; border-bottom: 1px dashed #e2e8f0;
    transition: padding .2s;
}
.pp-theme4 .pp-item:last-child { border-bottom: none; }
.pp-theme4.pp-hover .pp-item:hover { padding-left: 8px; }

.pp-theme4 .pp-rank {
    position: static;
    background: none; color: var(--ppa);
    box-shadow: none; border-radius: 0;
    width: auto; height: auto;
    font-size: 11px; font-weight: 800;
    margin-top: 3px; flex-shrink: 0;
}
.pp-theme4 .pp-thumb { width: 50px; height: 50px; border-radius: 5px; }
.pp-theme4 .pp-cnt   { flex: 1; min-width: 0; }
.pp-theme4 .pp-title { font-size: 13px; font-weight: 600; }

/* ════════════════════════════════════════
   THEME 5 – Magazine
   Big first post + list below
════════════════════════════════════════ */
.pp-theme5 .pp-list { display: flex; flex-direction: column; gap: 10px; }

/* First item = featured */
.pp-theme5 .pp-item:first-child {
    border-radius: 10px; overflow: hidden;
    display: flex; flex-direction: column;
}
.pp-theme5 .pp-item:first-child .pp-tlink  { display: block; }
.pp-theme5 .pp-item:first-child .pp-thumb  { width: 100%; height: 175px; border-radius: 0; }
.pp-theme5.pp-hover .pp-item:first-child:hover .pp-thumb img { transform: scale(1.05); }
.pp-theme5 .pp-item:first-child .pp-cnt {
    padding: 14px;
    border: 1px solid #f1f5f9; border-top: none;
    border-radius: 0 0 10px 10px;
    background: var(--ppb);
}
.pp-theme5 .pp-item:first-child .pp-title { font-size: 15px; }
.pp-theme5.pp-shadow .pp-item:first-child { box-shadow: 0 4px 16px rgba(0,0,0,.09); }

/* Other items */
.pp-theme5 .pp-item:not(:first-child) {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid #f1f5f9;
    transition: padding .2s;
}
.pp-theme5 .pp-item:last-child { border-bottom: none; }
.pp-theme5.pp-hover .pp-item:not(:first-child):hover { padding-left: 6px; }
.pp-theme5 .pp-item:not(:first-child) .pp-thumb { width: 60px; height: 60px; border-radius: 7px; }
.pp-theme5 .pp-item:not(:first-child) .pp-cnt   { flex: 1; min-width: 0; }
.pp-theme5 .pp-item:not(:first-child) .pp-title { font-size: 13px; }
.pp-theme5 .pp-item:not(:first-child) .pp-rank  { position: static; width: 20px; height: 20px; font-size: 10px; }

/* ════════════════════════════════════════
   THEME 6 – Dark Card
   Premium dark background
════════════════════════════════════════ */
.pp-theme6 { --ppt: #f8fafc; --ppb: #0f172a; }
.pp-theme6 .pp-list { display: flex; flex-direction: column; gap: 10px; }
.pp-theme6 .pp-item {
    display: flex; align-items: flex-start; gap: 12px;
    background: #1e293b; border: 1px solid #334155;
    border-radius: 10px; padding: 12px;
    transition: all .25s;
}
.pp-theme6.pp-shadow .pp-item { box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.pp-theme6.pp-hover  .pp-item:hover {
    border-color: var(--ppa);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(var(--ppr),.25);
}
.pp-theme6 .pp-thumb  { width: 74px; height: 74px; border-radius: 8px; }
.pp-theme6 .pp-cnt    { flex: 1; min-width: 0; }
.pp-theme6 .pp-title a { color: #e2e8f0; }
.pp-theme6 .pp-title a:hover { color: var(--ppa); }
.pp-theme6 .pp-exc  { color: #94a3b8; }
.pp-theme6 .pp-mi   { color: #64748b; }
.pp-theme6 .pp-mi svg { color: #64748b; }

/* ════════════════════════════════════════
   THEME 7 – Image Overlay
   Text on top of full image
════════════════════════════════════════ */
.pp-theme7 .pp-list { display: flex; flex-direction: column; gap: 10px; }
.pp-theme7 .pp-item {
    position: relative; overflow: hidden;
    border-radius: 10px; min-height: 105px;
    display: flex; align-items: flex-end;
    transition: all .25s;
}
.pp-theme7.pp-shadow .pp-item { box-shadow: 0 4px 16px rgba(0,0,0,.22); }
.pp-theme7.pp-hover  .pp-item:hover { box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.pp-theme7.pp-hover  .pp-item:hover .pp-thumb img { transform: scale(1.07); }

.pp-theme7 .pp-tlink { position: absolute; inset: 0; display: block; }
.pp-theme7 .pp-thumb { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.pp-theme7 .pp-thumb img { border-radius: 0; }
.pp-theme7 .pp-thumb::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.35) 55%, transparent 100%);
}
.pp-theme7 .pp-cnt      { position: relative; z-index: 2; padding: 12px 14px; width: 100%; }
.pp-theme7 .pp-title    { font-size: 13px; margin: 4px 0; }
.pp-theme7 .pp-title a  { color: #fff; font-weight: 700; }
.pp-theme7 .pp-title a:hover { color: rgba(255,255,255,.85); }
.pp-theme7 a.pp-cat { background: rgba(var(--ppr),.88); }
.pp-theme7 .pp-mi   { color: rgba(255,255,255,.72); }
.pp-theme7 .pp-mi svg { color: rgba(255,255,255,.72); }
.pp-theme7 .pp-rank { top: 10px; left: 10px; }

/* ════════════════════════════════════════
   THEME 8 – Compact
   Very small rows, lots of posts
════════════════════════════════════════ */
.pp-theme8 .pp-list { display: flex; flex-direction: column; }
.pp-theme8 .pp-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 0; border-bottom: 1px solid #f1f5f9;
    transition: background .2s, padding .15s;
}
.pp-theme8 .pp-item:last-child { border-bottom: none; }
.pp-theme8.pp-hover .pp-item:hover { background: #fafafa; padding-left: 4px; border-radius: 5px; }

.pp-theme8 .pp-rank { position: static; width: 18px; height: 18px; font-size: 9px; box-shadow: none; }
.pp-theme8 .pp-thumb { width: 42px; height: 42px; border-radius: 5px; }
.pp-theme8 .pp-cnt   { flex: 1; min-width: 0; }
.pp-theme8 .pp-title { font-size: 12px; font-weight: 600; margin: 0 0 2px; }
.pp-theme8 .pp-exc   { display: none; }
.pp-theme8 a.pp-cat  { font-size: 9px; padding: 1px 6px; }
.pp-theme8 .pp-mi    { font-size: 11px; }

/* ── Responsive ── */
@media (max-width: 580px) {
    .pp-theme3 .pp-list { grid-template-columns: 1fr; }
    .pp-theme7 .pp-item { min-height: 120px; }
    .pp-theme1 .pp-thumb,
    .pp-theme6 .pp-thumb { width: 65px; height: 65px; }
}
