/**
 * com_medee_articles — Magazine Layout
 * Designed to match Medeemedia Gridbox theme.
 * All classes prefixed with .mda- to avoid conflicts.
 *
 * Gridbox CSS variables used:
 *   --primary      : #34dca2  (teal)
 *   --secondary    : rgba(29,115,99,1)  (dark teal)
 *   --title        : #1b1b1d
 *   --text         : #1b1b1d
 *   --subtitle     : rgba(29,29,31,0.4)
 *   --bg-primary   : #ffffff
 *   --bg-secondary : #f5f8f8
 *   --border       : #eeeeee
 *   --shadow       : rgba(0,0,0,0.15)
 */

/* ─── WRAPPER ─────────────────────────────────────────────── */
.mda-wrapper {
    font-family: 'Chakra Petch', sans-serif;
    color: var(--text, #1b1b1d);
    padding-bottom: 64px;
}

/* ─── HERO / FEATURED ──────────────────────────────────────── */
.mda-hero {
    background: var(--bg-primary, #ffffff);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 32px var(--shadow, rgba(0, 0, 0, 0.10));
    margin-bottom: 56px;
}

.mda-hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 400px;
}

/* Hero image side */
.mda-hero-image-wrap {
    display: block;
    overflow: hidden;
    position: relative;
}

.mda-hero-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.mda-hero:hover .mda-hero-image-wrap img {
    transform: scale(1.04);
}

/* Hero content side */
.mda-hero-content {
    padding: 52px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.mda-hero-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mda-badge {
    display: inline-block;
    background: transparent;
    color: var(--primary, #34dca2);
    border: 2px solid var(--primary, #34dca2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 999px;
}

.mda-hero-title {
    font-size: 30px;
    font-weight: 900;
    line-height: 1.3;
    color: #1b1b1d !important;
    margin: 0;
    text-align: left;
}

.mda-hero-excerpt {
    font-size: 16px;
    line-height: 1.75;
    color: #333333 !important;
    margin: 0;
}

/* ─── READ MORE LINK ───────────────────────────────────────── */
.mda-readmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary, #34dca2);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
    width: fit-content;
}

.mda-readmore:hover {
    gap: 14px;
    color: var(--secondary, #1d7363);
}

/* ─── PLACEHOLDER (no image) ───────────────────────────────── */
.mda-placeholder {
    width: 100%;
    height: 100%;
    min-height: 260px;
    background: linear-gradient(135deg, var(--primary, #34dca2), var(--secondary, #1d7363));
    display: flex;
    align-items: center;
    justify-content: center;
}

.mda-placeholder span {
    font-size: 72px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1;
    text-transform: uppercase;
}

/* ─── RECENT ARTICLES ──────────────────────────────────────── */
.mda-recent {
    padding-top: 8px;
}

.mda-recent-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
}

.mda-section-title {
    font-size: 26px;
    font-weight: 900;
    color: #1b1b1d !important;
    margin: 0 0 6px;
    line-height: 1.2;
}

.mda-section-subtitle {
    font-size: 14px;
    color: #555555 !important;
    margin: 0;
}

/* ─── PAGINATION ARROWS ────────────────────────────────────── */
.mda-pagination-arrows {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.mda-arrow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--border, #eeeeee);
    background: var(--bg-primary, #ffffff);
    color: var(--title, #1b1b1d);
    font-size: 17px;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    line-height: 1;
}

.mda-arrow-btn:hover:not(.mda-arrow-disabled) {
    background: var(--primary, #34dca2);
    border-color: var(--primary, #34dca2);
    color: #ffffff;
}

.mda-arrow-btn.mda-arrow-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* ─── ARTICLE GRID ─────────────────────────────────────────── */
.mda-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* ─── ARTICLE CARD ─────────────────────────────────────────── */
.mda-card {
    background: var(--bg-primary, #ffffff);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mda-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.13);
}

/* Card image */
.mda-card-img-wrap {
    display: block;
    overflow: hidden;
}

.mda-card-img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.mda-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.mda-card:hover .mda-card-img img {
    transform: scale(1.06);
}

.mda-card-img .mda-placeholder {
    min-height: unset;
    height: 100%;
    aspect-ratio: 16 / 9;
}

.mda-card-img .mda-placeholder span {
    font-size: 44px;
}

/* Card body */
.mda-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.mda-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.mda-card-author {
    color: var(--primary, #34dca2);
    font-weight: 700;
}

.mda-card-date {
    color: #666666 !important;
}

.mda-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    margin: 0;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mda-card-title a {
    color: #1b1b1d !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mda-card-title a:hover {
    color: var(--primary, #34dca2);
}

.mda-card-excerpt {
    font-size: 14px;
    line-height: 1.65;
    color: #333333 !important;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── EMPTY STATE ──────────────────────────────────────────── */
.mda-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--subtitle, rgba(29, 29, 31, 0.5));
    font-size: 16px;
}

/* ─── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 1100px) {
    .mda-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mda-hero-title {
        font-size: 24px;
    }

    .mda-hero-content {
        padding: 36px 32px;
    }
}

@media (max-width: 768px) {
    .mda-hero-inner {
        grid-template-columns: 1fr;
    }

    .mda-hero-image-wrap {
        height: 240px;
    }

    .mda-hero-content {
        padding: 28px 24px;
        gap: 14px;
    }

    .mda-hero-title {
        font-size: 20px;
    }

    .mda-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mda-recent-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mda-section-title {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .mda-hero {
        border-radius: 10px;
    }

    .mda-card {
        border-radius: 10px;
    }
}
