@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@400;500;600&display=swap');
/* ═══════════════════════════════════════
   TRN Articles Plugin — Stylesheet
   Clean editorial · Light theme
═══════════════════════════════════════ */

:root {
    --trn-bg:       #f7f5f0;
    --trn-white:    #ffffff;
    --trn-ink:      #1a1a1a;
    --trn-muted:    #6b6b6b;
    --trn-border:   #e4e0d8;
    --trn-accent:   #c0392b;
    --trn-radius:   12px;
    --trn-shadow:   0 2px 16px rgba(0,0,0,0.06);
}

/* ── WRAPPER ── */
.trn-wrapper {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 20px 80px;
    font-family: 'DM Sans', sans-serif;
    background: var(--trn-bg);
    min-height: 100vh;
}

/* ── HEADER ── */
.trn-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 36px;
    border-bottom: 2px solid var(--trn-ink);
}

.trn-site-title {
    font-family: 'Lora', serif;
    font-size: clamp(28px, 6vw, 48px);
    font-weight: 600;
    color: var(--trn-ink);
    letter-spacing: -0.5px;
    margin: 0 0 8px;
    line-height: 1.1;
}

.trn-site-sub {
    font-size: 15px;
    color: var(--trn-muted);
    margin: 0;
    font-style: italic;
    font-family: 'Lora', serif;
}

/* ── CONTROLS ── */
.trn-controls {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Search */
.trn-search-wrap {
    position: relative;
}

.trn-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--trn-muted);
    pointer-events: none;
}

.trn-search {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border: 1.5px solid var(--trn-border);
    border-radius: var(--trn-radius);
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    background: var(--trn-white);
    color: var(--trn-ink);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.trn-search:focus {
    border-color: var(--trn-ink);
    box-shadow: 0 0 0 3px rgba(26,26,26,0.07);
}

.trn-search::placeholder { color: #aaa; }

/* Category pills */
.trn-categories-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trn-cat-btn {
    padding: 7px 16px;
    border: 1.5px solid var(--trn-border);
    border-radius: 100px;
    background: var(--trn-white);
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--trn-muted);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

.trn-cat-btn:hover {
    border-color: var(--trn-ink);
    color: var(--trn-ink);
}

.trn-cat-btn.active {
    background: var(--trn-ink);
    border-color: var(--trn-ink);
    color: #fff;
}

/* ── ARTICLE LIST ── */
.trn-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    min-height: 200px;
}

.trn-list.trn-loading {
    opacity: 0.4;
    pointer-events: none;
}

/* ── ARTICLE CARD ── */
.trn-article {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    border-bottom: 1px solid var(--trn-border);
    padding: 28px 0;
}

.trn-article.trn-visible {
    opacity: 1;
    transform: translateY(0);
}

.trn-article:first-child { padding-top: 0; }

.trn-article-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Meta top row */
.trn-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trn-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: var(--cat-color, #4f7dff);
    color: #fff;
}

.trn-date {
    font-size: 13px;
    color: var(--trn-muted);
}

/* Title */
.trn-title {
    font-family: 'Lora', serif;
    font-size: clamp(19px, 3.5vw, 24px);
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: var(--trn-ink);
}

.trn-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.trn-title a:hover {
    color: var(--trn-accent);
}

/* Resume */
.trn-resume {
    font-size: 15px;
    color: var(--trn-muted);
    line-height: 1.65;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer row */
.trn-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.trn-byline {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.trn-author,
.trn-source {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--trn-muted);
    font-weight: 500;
}

.trn-author svg,
.trn-source svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Read More button */
.trn-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    background: var(--trn-accent);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.2px;
    transition: background 0.18s, transform 0.15s;
    white-space: nowrap;
}

.trn-read-btn svg {
    width: 15px;
    height: 15px;
    transition: transform 0.2s;
}

.trn-read-btn:hover {
    background: #a93226;
    transform: translateY(-1px);
}

.trn-read-btn:hover svg {
    transform: translateX(3px);
}

/* ── EMPTY STATE ── */
.trn-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--trn-muted);
    font-size: 16px;
    font-family: 'Lora', serif;
    font-style: italic;
}

/* ── SPINNER ── */
.trn-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 60px 0;
}

.trn-spinner span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--trn-ink);
    animation: trn-bounce 1s infinite ease-in-out;
}

.trn-spinner span:nth-child(2) { animation-delay: 0.15s; }
.trn-spinner span:nth-child(3) { animation-delay: 0.3s; }

@keyframes trn-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%            { transform: scale(1);   opacity: 1; }
}

/* ── LOAD MORE ── */
.trn-loadmore-wrap {
    text-align: center;
    margin-top: 40px;
}

.trn-loadmore {
    padding: 13px 40px;
    border: 2px solid var(--trn-ink);
    border-radius: 8px;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    color: var(--trn-ink);
    cursor: pointer;
    transition: all 0.18s;
    letter-spacing: 0.3px;
}

.trn-loadmore:hover {
    background: var(--trn-ink);
    color: #fff;
}

.trn-loadmore.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
    .trn-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .trn-read-btn { width: 100%; justify-content: center; }
    .trn-wrapper { padding: 32px 16px 60px; }
}




/* ═══════════════════════════════════════
   ARTICLE META TOP ROW
═══════════════════════════════════════ */
.trn-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.trn-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    max-width: 220px;
}

/* ═══════════════════════════════════════
   ACTION BUTTONS — top right of meta row
═══════════════════════════════════════ */
.trn-actions-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
    padding-left: 60px;
}

.trn-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 100px;
    border: 1.5px solid #e0ddd8;
    background: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    color: #777;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.4;
    box-shadow: none;
}

.trn-action-btn:hover {
    border-color: #bbb;
    color: #333;
    background: #fafafa;
    transform: translateY(-1px);
}

/* SAVE */
.trn-save:hover { border-color: #f5a623; color: #d97706; background: #fffbf0; }
.trn-save.active { border-color: #f5a623; background: #fff8e1; color: #b45309; font-weight: 600; }

/* LIKE */
.trn-like:hover { border-color: #c0392b; color: #c0392b; background: #fff5f5; }
.trn-like.active { border-color: #c0392b; background: #ffe8e8; color: #991b1b; font-weight: 600; }

/* SHARE */
.trn-share:hover { border-color: #16a34a; color: #16a34a; background: #f0fdf4; }
.trn-share.copied { border-color: #16a34a; background: #dcfce7; color: #166534; font-weight: 600; }

/* FEEDBACK */
.trn-feedback:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.trn-feedback.sent { border-color: #2563eb; background: #dbeafe; color: #1d4ed8; font-weight: 600; }

/* Like count badge */
.trn-like-count {
    background: #c0392b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5px;
    display: none;
    line-height: 1.5;
}
.trn-like-count:not(:empty) { display: inline; }

/* Dark mode */
body.dark-mode .trn-action-btn { background: transparent; border-color: #3a3a3a; color: #666; }
body.dark-mode .trn-action-btn:hover { background: rgba(255,255,255,0.05); border-color: #555; color: #aaa; }
body.dark-mode .trn-save.active  { background: rgba(245,166,35,0.12);  border-color: #f5a623; color: #f5a623; }
body.dark-mode .trn-like.active  { background: rgba(192,57,43,0.12);   border-color: #e05a5a; color: #e05a5a; }
body.dark-mode .trn-share.copied { background: rgba(22,163,74,0.12);   border-color: #22c55e; color: #22c55e; }
body.dark-mode .trn-feedback.sent { background: rgba(37,99,235,0.12);  border-color: #3b82f6; color: #3b82f6; }

/* ═══════════════════════════════════════
   SIGNIN POPUP
═══════════════════════════════════════ */
.trn-popup-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.trn-popup-overlay.open { display: flex; }
.trn-popup { background: #fff; border-radius: 16px; padding: 36px 32px; max-width: 360px; width: 90%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.2); position: relative; animation: popIn 0.2s ease; }
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.trn-popup-icon { font-size: 36px; margin-bottom: 12px; display: block; }
.trn-popup h3 { font-size: 20px; font-weight: 700; margin: 0 0 8px; color: #222; }
.trn-popup p  { font-size: 14px; color: #666; margin: 0 0 24px; line-height: 1.5; }
.trn-popup-btns { display: flex; flex-direction: column; gap: 10px; }
.trn-popup-btn { padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; font-family: inherit; text-decoration: none; display: block; transition: opacity 0.15s; }
.trn-popup-btn:hover { opacity: 0.85; }
.trn-popup-btn.primary { background: #c0392b; color: #fff; }
.trn-popup-btn.secondary { background: #f0f0f0; color: #333; }
.trn-popup-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 18px; cursor: pointer; color: #999; }

/* ═══════════════════════════════════════
   SHARE MINI MENU
═══════════════════════════════════════ */
.trn-share-popup { display: none; position: absolute; top: calc(100% + 6px); left: 0; background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 200; min-width: 180px; white-space: nowrap; }
.trn-share-popup.open { display: block; }
.trn-share-option { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; color: #333; border: none; background: none; width: 100%; text-align: left; font-family: inherit; transition: background 0.1s; }
.trn-share-option:hover { background: #f5f5f5; }

/* ═══════════════════════════════════════
   FEEDBACK POPUP
═══════════════════════════════════════ */
.trn-feedback-popup { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.trn-feedback-popup.open { display: flex; }
.trn-feedback-box { background: #fff; border-radius: 16px; padding: 28px; max-width: 420px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.2); position: relative; animation: popIn 0.2s ease; }
.trn-feedback-box h3 { margin: 0 0 16px; font-size: 17px; color: #222; }
.trn-feedback-types { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.trn-feedback-type { padding: 5px 13px; border-radius: 20px; border: 1.5px solid #e0e0e0; background: none; font-size: 12px; cursor: pointer; font-family: inherit; color: #555; transition: all 0.15s; }
.trn-feedback-type.active, .trn-feedback-type:hover { border-color: #c0392b; color: #c0392b; background: rgba(192,57,43,0.06); }
.trn-feedback-box textarea { width: 100%; border: 1.5px solid #e0e0e0; border-radius: 10px; padding: 10px 12px; font-size: 13px; font-family: inherit; resize: vertical; min-height: 90px; outline: none; box-sizing: border-box; color: #222; transition: border-color 0.2s; }
.trn-feedback-box textarea:focus { border-color: #c0392b; }
.trn-feedback-submit { margin-top: 12px; width: 100%; padding: 12px; background: #c0392b; color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.trn-feedback-submit:hover { background: #a93226; }

/* ═══════════════════════════════════════
   MY FAVORITES PAGE
═══════════════════════════════════════ */
.trn-favorites-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 20px;
}

.trn-favorites-header {
    margin-bottom: 32px;
    border-bottom: 1px solid var(--trn-border);
    padding-bottom: 20px;
}

.trn-favorites-header h1 {
    font-family: var(--trn-font-head);
    font-size: 28px;
    font-weight: 600;
    color: var(--trn-ink);
    margin: 0 0 6px;
}

.trn-favorites-header p {
    font-size: 14px;
    color: var(--trn-muted);
    margin: 0;
}

.trn-favorites-empty {
    text-align: center;
    padding: 80px 20px;
}

.trn-empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    color: var(--trn-muted);
}

.trn-favorites-empty h2 {
    font-size: 22px;
    color: var(--trn-ink);
    margin: 0 0 8px;
}

.trn-favorites-empty p {
    font-size: 14px;
    color: var(--trn-muted);
    margin: 0 0 24px;
}

.trn-back-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--trn-accent);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s;
}

.trn-back-btn:hover { background: var(--trn-accent-h); }

/* Fix share popup position — inside button */
.trn-share { position: relative; }
.trn-share-popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 300;
}

/* ── LIKE COUNT BADGE ── */
.trn-like-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #c0392b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    min-width: 16px;
    line-height: 1.5;
    margin-left: 4px;
    font-family: var(--font-sans, sans-serif);
}

.trn-like-count:empty { display: none; }

.trn-like.active .trn-like-count {
    background: #fff;
    color: #c0392b;
}

/* ── FAVORITES PAGE ── */
.trn-favorites-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 20px;
}
.trn-favorites-header {
    margin-bottom: 20px;
}
.trn-favorites-empty {
    text-align: center;
    padding: 60px 20px;
}
.trn-empty-icon {
    font-size: 44px;
    display: block;
    margin-bottom: 12px;
    color: #ccc;
}
.trn-favorites-empty h2 { font-size: 20px; color: var(--trn-ink, #222); margin: 0 0 8px; }
.trn-favorites-empty p  { font-size: 14px; color: var(--trn-muted, #888); margin: 0 0 20px; }
.trn-back-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #c0392b;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
.trn-back-btn:hover { background: #a93226; }

/* ── SAVE ACTIVE STATE ── */
.trn-save.active {
    border-color: #f5a623 !important;
    background: #fff8e1 !important;
    color: #b45309 !important;
    font-weight: 600;
}
.trn-save:hover { border-color: #f5a623; color: #d97706; background: #fffbf0; }

/* ═══════════════════════════════════════
   SHARE POPUP — 5 options
═══════════════════════════════════════ */
.trn-share-popup {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #e8e5e0;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    z-index: 9998;
    min-width: 190px;
    white-space: nowrap;
    animation: trn-popup-in 0.15s ease;
}

.trn-share-popup.open { display: block; }

@keyframes trn-popup-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.trn-share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: none;
    font-size: 13px;
    font-family: inherit;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
}

.trn-share-option:hover { background: #f7f5f0; }

.trn-share-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    background: #f0f0f0;
}

/* Platform colors */
.trn-icon-x  { background: #000; color: #fff; font-style: normal; font-weight: 700; font-size: 12px; }
.trn-icon-wa { background: #25d366; font-size: 14px; }
.trn-icon-fb { background: #1877f2; color: #fff; font-weight: 700; font-size: 14px; font-style: normal; }

/* Dark mode */
body.dark-mode .trn-share-popup { background: #1e1e1e; border-color: #333; }
body.dark-mode .trn-share-option { color: #ddd; }
body.dark-mode .trn-share-option:hover { background: #2a2a2a; }
body.dark-mode .trn-share-icon { background: #333; }
