/* RSS and Dynamic Pages — Frontend Styles */

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   TOP NAVIGATION
   Fixed below the theme nav (theme: fixed, h-20 = 80 px, z-50).
   Plugin nav: top 80 px, z-index 9990, height 48 px.
   Only injected on pages that contain a plugin shortcode.
   JS (navigation.php) adjusts #main padding-top on those pages only.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

#rdp-top-nav {
    position: fixed;
    top: 80px;          /* height of theme nav (h-20 = 5rem = 80 px)          */
    left: 0;
    right: 0;
    z-index: 9990;
    background-color: #003087;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    height: 48px;
}

.rdp-nav-inner {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Site name / home link */
.rdp-nav-brand {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
    padding-right: 1.25rem;
    border-right: 1px solid rgba(255, 255, 255, 0.25);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.rdp-nav-brand:hover {
    color: #ffffff;
    text-decoration: none;
}

/* Scrollable link list — hides scrollbar on all browsers */
.rdp-nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE / Edge legacy */
}

.rdp-nav-links::-webkit-scrollbar {
    display: none;              /* Chrome / Safari */
}

.rdp-nav-link {
    display: block;
    color: rgba(255, 255, 255, 0.80);
    text-decoration: none;
    font-size: 0.775rem;
    padding: 0.375rem 0.65rem;
    border-radius: 4px;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.rdp-nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

.rdp-nav-link--active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

/* ── Hamburger toggle button ─────────────────────────────────────────────── */
/* Hidden on desktop; shown via media query below */

.rdp-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    margin-left: auto;
    border-radius: 4px;
    flex-shrink: 0;
    line-height: 0;
}

.rdp-nav-toggle:hover {
    background-color: rgba(255, 255, 255, 0.10);
}

.rdp-nav-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

/* Animate to × when menu is open */
#rdp-top-nav.rdp-nav--open .rdp-nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
#rdp-top-nav.rdp-nav--open .rdp-nav-toggle__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#rdp-top-nav.rdp-nav--open .rdp-nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile nav — breakpoint ≤ 767 px ───────────────────────────────────── */

@media (max-width: 767px) {

    #rdp-top-nav {
        height: 48px;           /* bar stays 48 px; dropdown is absolute below */
    }

    .rdp-nav-toggle {
        display: flex;          /* show hamburger on mobile */
    }

    /* Links panel: hidden by default, drops down as an overlay when open */
    .rdp-nav-links {
        display: none;
        position: absolute;     /* relative to the fixed #rdp-top-nav          */
        top: 48px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background-color: #003087;
        padding: 0.5rem 1rem 0.75rem;
        gap: 2px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
        overflow-x: visible;
        overflow-y: auto;
        max-height: calc(100vh - 128px);   /* keep panel on-screen             */
    }

    #rdp-top-nav.rdp-nav--open .rdp-nav-links {
        display: flex;
    }

    .rdp-nav-link {
        font-size: 0.85rem;
        padding: 0.55rem 0.75rem;
        border-radius: 4px;
        white-space: normal;
    }

    /* Brand takes full available width before the toggle button */
    .rdp-nav-brand {
        border-right: none;
        margin-right: 0;
        padding-right: 0;
        flex: 1;
    }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   NEWS GRID  (replaces Bootstrap row / row-cols)
   Bottom margin so the grid doesn't butt against the footer.
   Column count driven by --rdp-cols CSS custom property set inline by PHP.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.rdp-grid {
    display: grid;
    grid-template-columns: repeat(var(--rdp-cols, 3), 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 3rem;
}

@media (max-width: 1023px) {
    .rdp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 639px) {
    .rdp-grid {
        grid-template-columns: 1fr;
    }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BOX CARD  (individual news category card on the homepage grid)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.rdp-box-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Fixed-height image wrapper — clips zoom transition */
.rdp-box-card__image-wrap {
    height: 200px;
    overflow: hidden;
    background-color: #dce8f5;
    line-height: 0;
    flex-shrink: 0;
}

.rdp-box-card__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 0.35s ease;
}

.rdp-box-card__image-wrap:hover img {
    transform: scale(1.05);
}

/* Dark title bar */
.rdp-box-card__title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
    padding: 0.75rem 1rem;
    background-color: #1a2a4a;
    color: #ffffff;
    flex-shrink: 0;
    line-height: 1.3;
}

.rdp-box-card__title a {
    color: inherit;
    text-decoration: none;
}

.rdp-box-card__title a:hover {
    text-decoration: underline;
}

/* Body area wrapping the news list */
.rdp-box-card__body {
    padding: 0.75rem 1rem 1rem;
    flex: 1;
}

.rdp-box-card__empty {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
}

/* "View all →" footer link */
.rdp-box-card__footer {
    padding: 0.6rem 1rem 0.85rem;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
    flex-shrink: 0;
}

.rdp-box-card__readmore {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #003087;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.rdp-box-card__readmore:hover {
    color: #0056d6;
    text-decoration: underline;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   NEWS LIST  (headline items inside each box card)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.rdp-news-box__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rdp-news-box__item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.4;
}

.rdp-news-box__item:last-child {
    border-bottom: none;
}

.rdp-news-box__link {
    display: block;
    font-size: 0.8rem;
    color: #1a1a2e;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 3px;
}

.rdp-news-box__link:hover {
    color: #003087;
    text-decoration: underline;
}

.rdp-news-box__meta {
    font-size: 0.68rem;
    color: #999;
}

.rdp-news-box__meta time {
    color: #aaa;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   INNER PAGE  (box-page template — full article listing)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.rdp-box-page {
    padding-bottom: 3rem;
}

/* Generated / static description block */
.rdp-generated-description {
    background: #f8f9ff;
    border-left: 4px solid #003087;
    padding: 18px 20px;
    margin-bottom: 1.5rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
}

.rdp-generated-description p {
    margin-bottom: 0.75rem;
}

.rdp-generated-description p:last-child {
    margin-bottom: 0;
}

.rdp-generated-description a {
    color: #003087;
    text-decoration: underline;
}

.rdp-generated-description a:hover {
    color: #0056d6;
}

/* Article count */
.rdp-article-count {
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 0.25rem;
}

/* Article card grid — auto-fill with min 280 px columns */
.rdp-article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.rdp-article-card {
    background: #ffffff;
    border: 1px solid #e4eaf2;
    border-radius: 8px;
    padding: 1rem 1.1rem;
    transition: box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
}

.rdp-article-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.rdp-article-card__title {
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0 0 0.6rem;
    line-height: 1.45;
    flex: 1;
}

.rdp-article-card__title a {
    color: #1a1a2e;
    text-decoration: none;
}

.rdp-article-card__title a:hover {
    color: #003087;
    text-decoration: underline;
}

.rdp-article-card__excerpt {
    font-size: 0.8rem;
    color: #555;
    line-height: 1.5;
    margin: 0 0 0.6rem;
}

.rdp-article-card__meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* Dark pill badge for source name */
.rdp-article-card__source {
    display: inline-block;
    background: #1a2a4a;
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.rdp-article-card__date {
    font-size: 0.72rem;
    color: #aaa;
}

.rdp-no-news {
    color: #888;
    font-style: italic;
    padding: 1rem 0;
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   AI-GENERATED ARTICLE COMPONENTS
   Key Takeaways box + FAQ section rendered inside WP posts.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.rdp-key-takeaways {
    background: #eef3ff;
    border-left: 4px solid #003087;
    border-radius: 0 6px 6px 0;
    padding: 1.1rem 1.25rem;
    margin: 2rem 0;
}

.rdp-key-takeaways h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.65rem;
    color: #003087;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rdp-key-takeaways ul {
    margin: 0;
    padding-left: 1.25rem;
}

.rdp-key-takeaways li {
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 0.35rem;
    color: #1a1a2e;
}

/* FAQ section */
.rdp-faq {
    margin: 2rem 0;
    border-top: 2px solid #e4eaf2;
    padding-top: 1.5rem;
}

.rdp-faq h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.1rem;
    color: #1a1a2e;
}

.rdp-faq__item {
    border-bottom: 1px solid #f0f0f0;
    padding: 0.85rem 0;
}

.rdp-faq__item:last-child {
    border-bottom: none;
}

.rdp-faq__question {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
    color: #1a2a4a;
    line-height: 1.4;
}

.rdp-faq__answer {
    font-size: 0.88rem;
    color: #444;
    line-height: 1.65;
    margin: 0;
}
