/**
 * Rio News Shortcode Styles — DuraIsiphala263
 * [rio_news] shortcode — 3-card news grid with tech-green aesthetic
 *
 * @package Astra Child
 */

/* ─── Imports ────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* ─── CSS Variables ──────────────────────────────────────────────────────── */
:root {
    --rn-green:      #2E7D32; /* Primary */
    --rn-green-dim:  #1B5E20; /* Secondary */
    --rn-neon:       #2E7D32; /* Primary */
    --rn-glow:       rgba(46, 125, 50, 0.15);
    --rn-dark:       #000000;
    --rn-card-bg:    #FFFFFF;
    --rn-border:     #EDF6EE; /* Fade Green */
    --rn-border-hov: #2E7D32;
    --rn-text:       #212121; /* Text */
    --rn-muted:      rgba(33, 33, 33, 0.7);
    --rn-ease:       cubic-bezier(0.25, 0.8, 0.25, 1);
    --rn-radius:     12px;
}

/* ─── Wrapper ────────────────────────────────────────────────────────────── */
.rio-news-wrap {
    font-family: 'Montserrat', sans-serif;
    padding: 12px 0 0;
}

.rio-news-empty {
    color: var(--rn-muted);
    font-family: 'Montserrat', sans-serif;
    font-size: .9rem;
    text-align: center;
    padding: 24px;
}

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.rio-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.rio-news-card {
    display: flex;
    flex-direction: column;
    background: var(--rn-card-bg);
    border: 1px solid var(--rn-border);
    border-radius: var(--rn-radius);
    overflow: hidden;
    position: relative;
    transition:
        transform    0.3s var(--rn-ease),
        box-shadow   0.3s var(--rn-ease),
        border-color 0.3s var(--rn-ease);

    /* Entrance animation */
    animation: rioNewsCardIn 0.55s var(--rn-ease) both;
}

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

.rio-news-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 12px 40px rgba(0,0,0,.45),
        0 0 0 1px var(--rn-border-hov),
        0 0 20px var(--rn-glow);
    border-color: var(--rn-border-hov);
}

/* Green top-edge accent on hover */
.rio-news-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--rn-green-dim), var(--rn-neon));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--rn-ease);
    border-radius: var(--rn-radius) var(--rn-radius) 0 0;
    z-index: 1;
}
.rio-news-card:hover::before { transform: scaleX(1); }

/* ── Featured card (first one): slightly larger thumbnail ─────────────────── */
.rio-news-card--featured .rio-news-card__thumb { height: 200px; }

/* ─── Thumbnail ──────────────────────────────────────────────────────────── */
.rio-news-card__thumb-link { display: block; text-decoration: none; }

.rio-news-card__thumb {
    position: relative;
    height: 180px;
    background-color: #0d1f16;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    transition: transform 0.5s var(--rn-ease);
}

.rio-news-card:hover .rio-news-card__thumb { transform: scale(1.04); }

/* Dark gradient over thumbnail for readability */
.rio-news-card__thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 40%,
        rgba(11, 31, 20, 0.7) 100%
    );
    pointer-events: none;
}

/* Fallback icon when no thumbnail */
.rio-news-card__thumb-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rio-news-card__thumb-fallback svg { width: 60px; height: 60px; opacity: .7; }

/* ── Category badge ─────────────────────────────────────────────────────── */
.rio-news-card__cat {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-block;
    background: var(--rn-green);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s ease;
    line-height: 1.6;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.rio-news-card__cat:hover { background: var(--rn-neon); color: var(--rn-dark); text-decoration: none; }

/* ─── Card Body ──────────────────────────────────────────────────────────── */
.rio-news-card__body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

/* ── Date block ─────────────────────────────────────────────────────────── */
.rio-news-card__date {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.date-day {
    font-size: 2rem;
    font-weight: 800;
    color: var(--rn-green);
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: 0 0 12px var(--rn-glow);
}

.date-month {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--rn-muted);
    line-height: 1;
}

/* Divider line under date */
.rio-news-card__date::after {
    content: '';
    display: block;
    flex: 1;
    height: 1px;
    background: var(--rn-border);
    margin-left: 4px;
    align-self: center;
}

/* ── Title ──────────────────────────────────────────────────────────────── */
.rio-news-card__title {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -.01em;
}

.rio-news-card__title a {
    color: var(--rn-text);
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.rio-news-card__title a:hover { color: var(--rn-neon); }

/* ── Excerpt ────────────────────────────────────────────────────────────── */
.rio-news-card__excerpt {
    margin: 0;
    font-size: .83rem;
    color: var(--rn-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    flex: 1;
}

/* ── Read More link ─────────────────────────────────────────────────────── */
.rio-news-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--rn-green);
    text-decoration: none;
    transition: color 0.2s ease, gap 0.2s ease;
}
.rio-news-card__link:hover { color: var(--rn-neon); gap: 10px; text-decoration: none; }
.rio-news-card__link svg { transition: transform 0.2s ease; }
.rio-news-card__link:hover svg { transform: translateX(3px); }

/* ─── Footer — More News Button ──────────────────────────────────────────── */
.rio-news-footer {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}

.rio-news-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 34px;
    background: transparent;
    border: 2px solid var(--rn-green);
    border-radius: 6px;
    color: var(--rn-green);
    font-family: 'Montserrat', sans-serif;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition:
        color       0.3s var(--rn-ease),
        box-shadow  0.3s var(--rn-ease),
        gap         0.2s ease;
    cursor: pointer;
}

/* Filled background sweep on hover */
.rio-news-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--rn-green-dim), var(--rn-green));
    transform: translateX(-100%);
    transition: transform 0.35s var(--rn-ease);
    z-index: 0;
}

.rio-news-btn:hover::before { transform: translateX(0); }

.rio-news-btn:hover {
    color: #fff;
    box-shadow: 0 0 24px var(--rn-glow), 0 0 48px rgba(16,185,129,.2);
    gap: 14px;
    text-decoration: none;
}

.rio-news-btn span,
.rio-news-btn svg {
    position: relative;
    z-index: 1;
}

.rio-news-btn svg { transition: transform 0.25s ease; }
.rio-news-btn:hover svg { transform: translateX(4px); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .rio-news-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    /* Stack third card full width on tablet */
    .rio-news-card:nth-child(3) { grid-column: 1 / -1; flex-direction: row; }
    .rio-news-card:nth-child(3) .rio-news-card__thumb-link { width: 260px; flex-shrink: 0; }
    .rio-news-card:nth-child(3) .rio-news-card__thumb { height: 100%; }
}

@media (max-width: 768px) {
    .rio-news-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .rio-news-card:nth-child(3) {
        grid-column: auto;
        flex-direction: column;
    }
    .rio-news-card:nth-child(3) .rio-news-card__thumb-link { width: 100%; }
    .rio-news-card:nth-child(3) .rio-news-card__thumb { height: 180px; }
    .rio-news-card--featured .rio-news-card__thumb { height: 180px; }
    .rio-news-footer { margin-top: 24px; }
    .rio-news-btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .rio-news-card__body { padding: 16px 16px 18px; }
    .date-day { font-size: 1.6rem; }
}
