/* ==========================================================================
   RRBCONTENTS News - Components
   Supplementary styles for UI components
   ========================================================================== */

/* 1. Bookmark Button States & Animations */
.rrbcn-bookmark-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: transform var(--transition), color var(--transition);
}

.rrbcn-bookmark-btn:hover {
    color: var(--gold);
    transform: scale(1.1);
}

.rrbcn-bookmark-btn.active {
    color: var(--gold);
    animation: bookmarkPulse 0.3s ease;
}

@keyframes bookmarkPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 2. Toast Notifications */
.rrbcn-toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rrbcn-toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--gold);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toastSlideUp 0.3s ease forwards;
}

.rrbcn-toast.fade-out {
    animation: toastFadeOut 0.3s ease forwards;
}

@keyframes toastSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

/* 3. Skeleton / Shimmer Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--border-color) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-text.short { width: 60%; }
.skeleton-image { aspect-ratio: 16/9; }

/* 4. Post Card Variants */
/* Horizontal Card (Sidebar) */
.rrbcn-card--horizontal {
    flex-direction: row;
    gap: 1rem;
    background: transparent;
    border: none;
    padding: 0;
}

.rrbcn-card--horizontal:hover {
    transform: none;
    box-shadow: none;
}

.rrbcn-card--horizontal .rrbcn-card__image {
    width: 100px;
    height: 75px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.rrbcn-card--horizontal .rrbcn-card__content {
    padding: 0;
}

.rrbcn-card--horizontal .rrbcn-card__title {
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
}

/* Mini Card (Related) */
.rrbcn-card--mini .rrbcn-card__excerpt {
    display: none;
}

.rrbcn-card--mini .rrbcn-card__content {
    padding: 1rem;
}

/* 5. Social Share Row */
.rrbcn-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.rrbcn-share__label {
    font-weight: 600;
    color: var(--text-primary);
}

.rrbcn-share__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform var(--transition);
}

.rrbcn-share__btn:hover {
    transform: translateY(-2px);
}

.rrbcn-share__btn--facebook { background: #1877f2; }
.rrbcn-share__btn--twitter { background: #1da1f2; }
.rrbcn-share__btn--whatsapp { background: #25d366; }
.rrbcn-share__btn--telegram { background: #0088cc; }

/* 6. Tag Cloud */
.rrbcn-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}

.rrbcn-tags a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.rrbcn-tags a:hover {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
}

/* 7. Pagination */
.rrbcn-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.rrbcn-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
}

.rrbcn-pagination .page-numbers.current,
.rrbcn-pagination .page-numbers:hover {
    background: var(--gold);
    color: #0a1628;
    border-color: var(--gold);
}

/* 8. Forms (Inputs, Textareas, Selects) */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

/* 9. Comment Form Overrides */
.comment-respond {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    margin-top: 2rem;
}

.comment-form-comment,
.comment-form-author,
.comment-form-email,
.comment-form-url {
    margin-bottom: 1.5rem;
}

.comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-submit .submit {
    background: var(--gold);
    color: #0a1628;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.form-submit .submit:hover {
    background: var(--gold-hover);
}

.comment-list {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
}

.comment-list li.comment {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.comment-body {
    display: flex;
    gap: 1.5rem;
}

.comment-author .avatar {
    border-radius: 50%;
}

.comment-meta {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.comment-reply-link {
    font-size: 0.875rem;
    color: var(--teal-light);
}

/* 10. Admin Bar Spacing Fix */
body.admin-bar .rrbcn-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .rrbcn-header {
        top: 46px;
    }
}

/* ==========================================================================
   Breaking News Ticker (header.php) — red is a deliberate exception to the
   navy/gold/teal palette; red-for-urgency is standard news-industry
   convention, kept isolated to just this one component.
   ========================================================================== */
.rrbcn-breaking {
    /* .rrbcn-header is position:fixed (70px tall) and out of normal flow, so
       whatever renders first after it needs an explicit top offset or it
       renders hidden underneath the header. */
    margin-top: 70px;
    background: #ef4444;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.rrbcn-topic-pills {
    margin-top: 70px;
}

/* If the breaking ticker is present, the pills follow it directly and don't
   need their own offset too. */
.rrbcn-breaking + .rrbcn-topic-pills {
    margin-top: 0;
}
.rrbcn-breaking__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.5rem 1rem;
}
.rrbcn-breaking__badge {
    flex-shrink: 0;
    background: #ffffff;
    color: #ef4444;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}
.rrbcn-breaking__text {
    flex: 1;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rrbcn-breaking__text:hover {
    color: #ffffff;
    text-decoration: underline;
}
.rrbcn-breaking__close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    padding: 0 0.25rem;
}
.rrbcn-breaking__close:hover {
    opacity: 1;
}

/* ==========================================================================
   Trending Topic Pills (header.php) — horizontally scrollable category
   quick-links, mirrors the topic-tag row on major Hindi news portals.
   ========================================================================== */
.rrbcn-topic-pills {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}
.rrbcn-topic-pills__inner {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.55rem 1rem;
    scrollbar-width: none;
}
.rrbcn-topic-pills__inner::-webkit-scrollbar {
    display: none;
}
.rrbcn-topic-pill {
    flex-shrink: 0;
    white-space: nowrap;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary, var(--text-muted));
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    transition: border-color 0.2s, color 0.2s;
}
.rrbcn-topic-pill:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ==========================================================================
   Top Story Module
   A large headline + excerpt on the left, gallery thumbnails on the right.
   Mirrors the "lead story with visual strip" pattern from aajtak.in.
   ========================================================================== */

.rrbcn-top-story {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.rrbcn-top-story__content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.rrbcn-top-story__title {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.rrbcn-top-story__title a {
    color: inherit;
}

.rrbcn-top-story__title a:hover {
    color: var(--gold);
}

.rrbcn-top-story__excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rrbcn-top-story__meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.rrbcn-top-story__gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.rrbcn-top-story__gallery img {
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius-sm);
    transition: transform var(--transition);
}

.rrbcn-top-story__gallery img:hover {
    transform: scale(1.03);
}

.rrbcn-top-story__gallery img:only-child {
    grid-column: 1 / -1;
}

/* ==========================================================================
   Featured Video Card
   Shows a post with a video URL as a card with play-button overlay.
   ========================================================================== */

.rrbcn-video-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    cursor: pointer;
    transition: border-color var(--transition);
}

.rrbcn-video-card:hover {
    border-color: var(--gold);
}

.rrbcn-video-card__image {
    position: relative;
    aspect-ratio: 16/9;
}

.rrbcn-video-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rrbcn-video-card__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent 50%);
}

.rrbcn-video-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition);
    z-index: 2;
}

.rrbcn-video-card__play:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(251,191,36,0.8);
}

.rrbcn-video-card__badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--gold);
    color: #0a1628;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    z-index: 2;
}

.rrbcn-video-card__info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    z-index: 2;
}

.rrbcn-video-card__info .rrbcn-video-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.rrbcn-video-card__info .rrbcn-video-card__meta {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
}

/* ==========================================================================
   Asymmetric Category Layout
   One lead card + compact list items, replacing uniform grid.
   ========================================================================== */

.rrbcn-category-row__asymmetric {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
}

.rrbcn-cat-lead {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition);
}

.rrbcn-cat-lead:hover {
    border-color: var(--gold);
}

.rrbcn-cat-lead__image {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.rrbcn-cat-lead__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

.rrbcn-cat-lead:hover .rrbcn-cat-lead__image img {
    transform: scale(1.03);
}

.rrbcn-cat-lead__content {
    padding: 1.25rem;
}

.rrbcn-cat-lead__content .rrbcn-cat-lead__title {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.rrbcn-cat-lead__content .rrbcn-cat-lead__title a {
    color: var(--text-primary);
}

.rrbcn-cat-lead__content .rrbcn-cat-lead__title a:hover {
    color: var(--gold);
}

.rrbcn-cat-lead__content .rrbcn-cat-lead__excerpt {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.rrbcn-cat-lead__content .rrbcn-cat-lead__meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    gap: 0.75rem;
}

.rrbcn-compact-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rrbcn-compact-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 0;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.rrbcn-compact-item:last-child {
    border-bottom: none;
}

.rrbcn-compact-item__thumb {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.rrbcn-compact-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rrbcn-compact-item__title {
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-primary);
}

.rrbcn-compact-item__title a {
    color: inherit;
}

.rrbcn-compact-item__title a:hover {
    color: var(--gold);
}

.rrbcn-compact-item__meta {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

/* ==========================================================================
   Quick Hits — Dense headline list for sidebar
   Mirrors Aaj Tak's "सुपरफास्ट" box.
   ========================================================================== */

.rrbcn-quick-hits {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.rrbcn-quick-hits__header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gold);
}

.rrbcn-quick-hits__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rrbcn-quick-hits__item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
}

.rrbcn-quick-hits__item:last-child {
    border-bottom: none;
}

.rrbcn-quick-hits__thumb {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.rrbcn-quick-hits__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rrbcn-quick-hits__title {
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-secondary);
}

.rrbcn-quick-hits__title a {
    color: inherit;
}

.rrbcn-quick-hits__title a:hover {
    color: var(--gold);
}

/* ==========================================================================
   Ad Slot Reservations
   Invisible in production; shows dashed border + label only when
   the PHP template outputs the --debug modifier class (WP_DEBUG=true).
   ========================================================================== */

.rrbcn-ad-slot {
    min-height: 0;
    margin: 1.5rem 0;
}

.rrbcn-ad-slot--debug {
    min-height: 90px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(30,58,95,0.1) 10px, rgba(30,58,95,0.1) 20px);
}

.rrbcn-ad-slot--debug[data-slot="homepage-sidebar"] {
    min-height: 250px;
}

/* ==========================================================================
   Responsive — New Components
   ========================================================================== */

@media (max-width: 767px) {
    .rrbcn-top-story {
        grid-template-columns: 1fr;
    }
    
    .rrbcn-top-story__gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        overflow-x: auto;
        flex-direction: row;
        scroll-snap-type: x mandatory;
    }
    
    .rrbcn-category-row__asymmetric {
        grid-template-columns: 1fr;
    }
    
    .rrbcn-video-card__play {
        width: 48px;
        height: 48px;
    }
    
    .rrbcn-video-card__info {
        padding: 1rem;
    }
    
    .rrbcn-video-card__info .rrbcn-video-card__title {
        font-size: 1rem;
    }
}

@media (max-width: 479px) {
    .rrbcn-top-story__gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rrbcn-compact-item__thumb {
        width: 60px;
        height: 45px;
    }
}
