/**
 * TTFC User Preferences - Personal feed page
 *
 * Card visuals are deliberately copied from the homepage carousel card
 * (`.posts-tabs-wrapper .article-card.rounded-corners.regular-frame`).
 * To avoid depending on the posts-tabs wrapper being present on this page,
 * the same rules are re-declared here scoped to `.ttfc-prefs-feed`.
 */

.ttfc-prefs-feed {
    direction: rtl;
    max-width: 920px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
    font-family: var(--font-family-accent) !important;
    color: var(--text-color, #333);
}

/* כרטיסי כותרת + התקדמות — אותה שפה כמו .profile-section באזור האישי */
.ttfc-prefs-feed .profile-section {
    margin-bottom: 1.25rem;
}

.ttfc-prefs-feed-header {
    text-align: right;
}

/* h1 בתוך כרטיס — נראה כמו h2 של לשונית בפרופיל, לא כותרת עמוד ענקית */
.ttfc-prefs-feed-header .ttfc-prefs-feed-title {
    font-family: var(--font-family-accent) !important;
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--auth-primary-color, var(--primary-color-daat, #273b6b));
    margin: 0;
    line-height: 1.3;
    letter-spacing: normal;
    border: 0;
    padding: 0;
    min-height: 0;
}

.ttfc-prefs-feed-header .ttfc-prefs-section-desc {
    margin-top: 0.65rem;
}

.ttfc-prefs-feed-link-inline {
    margin-inline-start: 0.35rem;
}

/* טאבים — כמו כפתורי הסיידבר בפרופיל */
.ttfc-prefs-feed-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.ttfc-prefs-feed-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-family: var(--font-family-accent) !important;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color, #333);
    text-decoration: none;
    border: 1px solid rgba(39, 59, 107, 0.12);
    background: #fff;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.ttfc-prefs-feed-tab:hover,
.ttfc-prefs-feed-tab:focus-visible {
    background: rgba(39, 59, 107, 0.06);
    color: var(--primary-color-daat, #273b6b);
    text-decoration: none;
    border-bottom: 0 !important;
    outline: none;
}

.ttfc-prefs-feed-tab.is-active {
    background: var(--primary-color-daat, #273b6b);
    color: #fff !important;
    font-weight: 700;
    border-color: var(--primary-color-daat, #273b6b);
    pointer-events: none;
}

/* ---------- Reading progress panel ---------- */
.ttfc-prefs-reading-progress .ttfc-prefs-section-header {
    margin-bottom: 0.85rem;
}

.ttfc-prefs-reading-progress-title {
    margin: 0;
    font-family: var(--font-family-accent) !important;
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--auth-primary-color, var(--primary-color-daat, #273b6b));
    line-height: 1.3;
    border: 0;
    padding: 0;
}

.ttfc-prefs-reading-progress-overall {
    margin-bottom: 1.15rem;
    padding: 1rem 1.1rem;
    background: var(--secondary-color-daat-bright, #f0f0f3);
    border-inline-end: 4px solid var(--secondary-color-daat, #7183c0);
    border-radius: 5px;
}

.ttfc-prefs-reading-progress-overall-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.ttfc-prefs-reading-progress-overall-pct {
    flex: 0 0 auto;
    min-width: 3.5rem;
    margin: 0;
    font-family: var(--font-family-accent) !important;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color-daat, #273b6b);
    line-height: 1;
}

.ttfc-prefs-reading-progress-overall-copy {
    flex: 1;
    min-width: 0;
}

.ttfc-prefs-reading-progress-overall-label,
.ttfc-prefs-reading-progress-overall-count {
    margin: 0;
    font-family: var(--font-family-accent) !important;
    line-height: 1.45;
}

.ttfc-prefs-reading-progress-overall-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color-daat, #273b6b);
}

.ttfc-prefs-reading-progress-overall-count {
    margin-top: 0.15rem;
    font-size: 0.92rem;
    font-weight: 300;
    color: #555;
}

.ttfc-prefs-reading-progress-cats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.85rem 1.5rem;
}

.ttfc-prefs-reading-progress-cat {
    padding-top: 0.85rem;
    border-top: 1.6px solid var(--secondary-color-daat, #7183c0);
}

.ttfc-prefs-reading-progress-cat:first-child,
.ttfc-prefs-reading-progress-cat:nth-child(2) {
    padding-top: 0;
    border-top: 0;
}

.ttfc-prefs-reading-progress-cat-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.ttfc-prefs-reading-progress-cat-name {
    font-family: var(--font-family-accent) !important;
    font-weight: 600;
    color: var(--primary-color-daat, #273b6b);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 0 !important;
}

.ttfc-prefs-reading-progress-cat-name:hover,
.ttfc-prefs-reading-progress-cat-name:focus-visible {
    color: var(--secondary-color, #1274ac);
    text-decoration: none;
    outline: none;
}

.ttfc-prefs-reading-progress-cat-meta {
    flex: 0 0 auto;
    font-family: var(--font-family-accent) !important;
    font-size: 0.85rem;
    font-weight: 400;
    color: #7181bf;
    white-space: nowrap;
}

.ttfc-prefs-reading-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(39, 59, 107, 0.12);
    overflow: hidden;
    direction: rtl;
}

.ttfc-prefs-reading-progress-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--primary-color-daat, #273b6b);
    transition: width 400ms ease;
}

@media (min-width: 720px) {
    .ttfc-prefs-reading-progress-cats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 719px) {
    .ttfc-prefs-reading-progress-cat:nth-child(2) {
        padding-top: 0.85rem;
        border-top: 1.6px solid var(--secondary-color-daat, #7183c0);
    }
}

@media screen and (max-width: 768px) {
    .ttfc-prefs-feed-header .ttfc-prefs-feed-title,
    .ttfc-prefs-reading-progress-title {
        font-size: 1.2rem;
    }

    .ttfc-prefs-feed-tabs {
        flex-direction: column;
    }

    .ttfc-prefs-feed-tab {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ttfc-prefs-feed-tab,
    .ttfc-prefs-reading-progress-bar-fill {
        transition: none;
    }
}

.ttfc-prefs-feed-empty {
    background: var(--auth-white, #fff);
    border: 1px solid var(--auth-gray-mild, #d9d9d9);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(39, 59, 107, 0.06);
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-color, #333);
}

.ttfc-prefs-feed-empty p {
    margin: 0 0 1rem;
}

.ttfc-prefs-feed-locked {
    text-align: center;
    padding: 3rem 1rem;
}

.ttfc-prefs-btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 150ms ease;
    font-family: inherit;
}

.ttfc-prefs-btn-primary {
    font-family: var(--font-family-accent) !important;
    background: var(--primary-color-daat, #273b6b);
    color: #fff;
    border-color: var(--primary-color-daat, #273b6b);
}

.ttfc-prefs-btn-primary:hover,
.ttfc-prefs-btn-primary:focus-visible {
    background: var(--secondary-color-daat, #7183c0);
    border-color: var(--secondary-color-daat, #7183c0);
    color: #fff;
    text-decoration: none;
    outline: none;
}

/* ---------- Layout ----------
 * החל מ-v1.11.x ה-feed-grid עובר להשתמש בקלאסי `.posts-grid-square-container`
 * (ראו class-prefs-feed.php :: render_shortcode + render_card), ועיצוב הכרטיסים
 * מוגדר ב-profile.css תחת `.ttfc-prefs-feed-grid .article-card-square ...`.
 *
 * הסגנונות הישנים (`.carousel-item`, `.article-card.regular-frame`, ...)
 * הוסרו — אבל אנחנו עדיין צריכים *לא* ליצור `flex` layout כאן, כי profile.css
 * מגדיר `display: grid` על אותו אלמנט. אם לא נדרס אותו במפורש, הדפדפן יעדיף
 * את ה-cascade.
 *
 * הקובץ ממשיך לשרת את ה-header/empty/pagination של עמוד הפיד (`/my-feed/`)
 * ושל הטאב הפנימי (`/profile/#feed-tab`).
 */

/* (חלק הסגנונות הישן של `.article-card` הוסר ב-v1.11.2 — ראו ההערה ב-Layout) */

/* (סגנונות הכרטיס הישנים — `.ttfc-prefs-feed-figure`, `.article-title`,
 *  `.article-meta.columns-4`, `.ttfc-prefs-card-save` כ-pill וכו' — הוסרו
 *  ב-v1.11.2. העיצוב החדש מוגדר ב-profile.css תחת
 *  `.ttfc-prefs-feed-grid .article-card-square ...`. הקובץ הזה ממשיך לשרת
 *  רק את ה-header / empty-state / pagination של הפיד.) */

/* ---------- Pagination ---------- */
.ttfc-prefs-feed-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0 0;
}

.ttfc-prefs-feed-pagination .ttfc-prefs-page-btn {
    font-family: var(--font-family-accent) !important;
    background: transparent;
    border: 1px solid rgba(39, 59, 107, 0.2);
    color: var(--primary-color-daat, #273b6b);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    font-family: inherit;
}

.ttfc-prefs-feed-pagination .ttfc-prefs-page-btn:hover,
.ttfc-prefs-feed-pagination .ttfc-prefs-page-btn:focus-visible {
    background: rgba(39, 59, 107, 0.06);
    text-decoration: none;
    outline: none;
}

.ttfc-prefs-feed-pagination .ttfc-prefs-page-info {
    color: var(--text-color, #333);
    opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
    .ttfc-prefs-btn {
        transition: none;
    }
}

/* (Media queries הישנים של `.carousel-item` הוסרו ב-v1.11.2 — הגריד החדש
 *  משתמש ב-CSS grid עם data-columns ב-profile.css ועובד רספונסיבית משם.) */
