/* catalog/css/home.css */

.ritm-home {
    background: #f6f9fc;
}

.home-hero {
    min-height: clamp(430px, 58vh, 640px) !important;
    margin-bottom: 0 !important;
}

.ritm-home .ritm-hero-tags a,
.ritm-home .ritm-hero-tags span {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.78rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.ritm-home .ritm-hero-tags a:hover,
.ritm-home .ritm-hero-tags a:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.home-overview-section {
    position: relative;
    z-index: 4;
    margin-top: clamp(1.5rem, 4vw, 3rem);
    padding-bottom: clamp(2rem, 5vw, 4rem);
}

.home-section {
    padding-bottom: clamp(2.25rem, 5vw, 4.5rem);
}

.home-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.home-section-head h2,
.home-overview-card-main h2,
.home-contribute-panel h2 {
    margin: 0 0 0.45rem;
    color: #0f172a;
    font-size: clamp(1.45rem, 2.3vw, 2rem);
    line-height: 1.12;
    font-weight: var(--font-weight-heading);
}

.home-section-head p,
.home-overview-card-main p,
.home-contribute-panel p {
    max-width: 760px;
    margin: 0;
    color: #64748b;
    line-height: 1.55;
}

.home-section-head-compact {
    align-items: start;
    margin-bottom: 1rem;
}

.home-section-head-compact h2 {
    font-size: clamp(1.15rem, 1.7vw, 1.35rem);
}

.home-section-head-compact > a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 700;
}

.home-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(180px, 0.65fr));
    gap: 1rem;
    align-items: stretch;
}

.home-overview-card,
.home-event-card,
.home-plan-card,
.home-article-card,
.home-discovery-panel,
.home-contribute-panel,
.home-empty-card {
    border: var(--detail-panel-border, 1px solid rgba(15, 23, 42, 0.08));
    border-radius: var(--detail-panel-radius, 12px);
    background: #fff;
    box-shadow: var(--detail-panel-shadow, 0 10px 26px rgba(15, 23, 42, 0.06));
}

.home-overview-card {
    min-height: 144px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.15rem;
    color: #0f172a;
    text-decoration: none;
}

.home-overview-card-main {
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
}

.home-overview-card:not(.home-overview-card-main):hover {
    border-color: rgba(13, 110, 253, 0.2);
    color: #0f172a;
}

.home-overview-card i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(13, 110, 253, 0.09);
    color: var(--accent-blue);
    font-size: 1.15rem;
}

.home-overview-card span {
    color: #64748b;
    font-size: 0.92rem;
    font-weight: 700;
}

.home-overview-card strong {
    color: #0f172a;
    font-size: clamp(1.8rem, 3vw, 2.45rem);
    line-height: 1;
    font-weight: var(--font-weight-heading);
}

.home-events-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-event-card,
.home-article-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.home-event-media,
.home-article-media {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f3ff, #f7fafc);
    background-position: center;
    background-size: cover;
    color: var(--accent-blue);
    text-decoration: none;
}

.home-event-media::after,
.home-article-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.34));
}

.home-event-media > i,
.home-article-media > i {
    position: relative;
    z-index: 1;
    font-size: 2.4rem;
}

.home-event-date {
    position: absolute;
    z-index: 2;
    top: 1rem;
    left: 1rem;
    width: 60px;
    height: 66px;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    background: rgba(255, 255, 255, 0.94);
    color: var(--accent-blue);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
}

.home-event-date strong {
    font-size: 1.45rem;
    line-height: 1;
    font-weight: var(--font-weight-heading);
}

.home-event-date small {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.home-event-body,
.home-article-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.home-card-meta {
    min-height: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
}

.home-card-meta span {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
}

.home-event-card h3,
.home-article-card h3,
.home-plan-card h3 {
    margin: 0 0 0.55rem;
    color: #0f172a;
    font-size: 1.05rem;
    line-height: 1.25;
    font-weight: var(--font-weight-heading);
}

.home-event-card h3 a,
.home-article-card h3 a {
    color: inherit;
    text-decoration: none;
}

.home-event-card h3 a:hover,
.home-article-card h3 a:hover {
    color: var(--accent-blue);
}

.home-event-body p,
.home-plan-card p,
.home-article-body p {
    margin: 0 0 1rem;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.5;
}

.home-card-foot {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 700;
}

.home-card-foot span {
    min-width: 0;
}

.home-card-foot i {
    margin-right: 0.28rem;
}

.home-card-foot a {
    flex: 0 0 auto;
    color: var(--accent-blue);
    text-decoration: none;
}

.home-plan-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}

.home-plan-card {
    min-height: 184px;
    padding: 1rem;
    color: #0f172a;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.home-plan-card:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 110, 253, 0.18);
    color: #0f172a;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.09);
}

.home-plan-card i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border-radius: 10px;
    background: rgba(13, 110, 253, 0.09);
    color: var(--accent-blue);
    font-size: 1.15rem;
}

.home-articles-grid {
    display: grid;
    grid-template-columns: 1.3fr repeat(3, minmax(0, 0.9fr));
    gap: 1rem;
}

.home-article-card-featured {
    grid-row: span 2;
}

.home-article-card-featured .home-article-media {
    min-height: 320px;
    aspect-ratio: 16 / 11;
}

.home-article-body p i {
    margin-right: 0.35rem;
}

.home-discovery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.home-discovery-panel {
    padding: clamp(1rem, 2vw, 1.25rem);
}

.home-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.home-chip-grid a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none;
    font-weight: 700;
}

.home-chip-grid a:hover {
    border-color: rgba(13, 110, 253, 0.22);
    color: var(--accent-blue);
}

.home-chip-grid small {
    min-width: 1.45rem;
    padding: 0.08rem 0.38rem;
    border-radius: 999px;
    background: #e8eef6;
    color: #64748b;
    font-size: 0.72rem;
    text-align: center;
}

.home-contribute-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: clamp(1.25rem, 3vw, 2rem);
}

.home-contribute-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.home-empty-card {
    grid-column: 1 / -1;
    padding: clamp(2rem, 4vw, 3rem);
    text-align: center;
}

.home-empty-card i {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border-radius: 14px;
    background: rgba(13, 110, 253, 0.09);
    color: var(--accent-blue);
    font-size: 1.35rem;
}

.home-empty-card h3 {
    font-size: 1.2rem;
    font-weight: var(--font-weight-heading);
}

.home-empty-card p {
    margin: 0;
    color: #64748b;
}

@media (max-width: 1399.98px) {
    .home-overview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-overview-card-main {
        grid-column: 1 / -1;
    }

    .home-plan-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1199.98px) {
    .home-events-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .home-overview-grid,
    .home-events-grid,
    .home-plan-grid,
    .home-articles-grid,
    .home-discovery-grid,
    .home-contribute-panel {
        grid-template-columns: 1fr;
    }

    .home-section-head {
        align-items: start;
        flex-direction: column;
    }

    .home-contribute-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .home-hero {
        min-height: 390px !important;
    }

    .home-overview-section {
        margin-top: 1.25rem;
    }

    .home-overview-grid {
        gap: 0.75rem;
    }

    .home-article-card-featured {
        grid-row: auto;
    }

    .home-article-card-featured .home-article-media {
        min-height: 210px;
    }
}

@media (max-width: 575.98px) {
    .home-overview-card,
    .home-event-body,
    .home-article-body,
    .home-plan-card,
    .home-discovery-panel,
    .home-contribute-panel {
        padding: 0.95rem;
    }

    .home-contribute-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-plan-card {
        transition: none !important;
    }

    .home-plan-card:hover {
        transform: none;
    }
}
