/* =========================================================
   EDUMi.my Detail Page CSS
   Full Repaired Version
   Concept: Consistent card hover, gradient outline CTA, calm premium UI
   ========================================================= */

/* =========================================================
   Page Base
   ========================================================= */

.detail-page {
    background: #f5f8ff;
}

.detail {
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 42%, #f5f8ff 100%);
}

/* =========================================================
   Detail Hero
   ========================================================= */

.detail-hero {
    padding: 34px 0 38px;
    background:
        radial-gradient(circle at 86% 12%, rgba(4, 102, 194, 0.12), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.detail-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 26px;
    color: var(--edumi-muted, #62748a);
    font-size: 0.78rem;
    font-weight: 800;
}

.detail-breadcrumb a {
    color: var(--edumi-blue, #0466c2);
    text-decoration: none;
    transition: color 0.2s ease;
}

.detail-breadcrumb a:hover {
    color: #034f96;
}

.detail-breadcrumb .material-icons-outlined {
    background: none;
    color: var(--edumi-muted, #62748a);
    font-size: 14px;
    -webkit-text-fill-color: var(--edumi-muted, #62748a);
}

.detail-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 34px;
    align-items: center;
}

.detail-hero__copy {
    max-width: 760px;
}

.detail-chip {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    border: 1.5px solid transparent;
    border-radius: 999px;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        var(
            --edumi-gradient,
            linear-gradient(135deg, #ff3e3e 0%, #a00070 48%, #0466c2 100%)
        ) border-box;
    color: var(--edumi-blue, #0466c2);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0 12px;
}

.detail-hero h1 {
    margin: 14px 0 0;
    color: var(--edumi-navy, #102a43);
    font-size: clamp(2.35rem, 4.15vw, 3.75rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.02;
}

.detail-hero p {
    max-width: 620px;
    margin: 14px 0 0;
    color: #334e68;
    font-size: 1rem;
    line-height: 1.65;
}

/* =========================================================
   Meta Row
   ========================================================= */

.detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.detail-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--edumi-muted, #62748a);
    font-size: 0.82rem;
    font-weight: 800;
}

.detail-meta-row .material-icons-outlined {
    background: none;
    color: var(--edumi-blue, #0466c2);
    font-size: 14px;
    -webkit-text-fill-color: var(--edumi-blue, #0466c2);
}

/* =========================================================
   Article Detail Featured Image
   Recommended class name
   ========================================================= */

.detail-featured-image {
    display: block;
    width: 100%;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid var(--edumi-border, #dfe7f1);
    border-radius: 14px;
    background: #ffffff;
    padding: 0;
    box-shadow: 0 14px 32px rgba(16, 42, 67, 0.08);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.detail-featured-image:hover {
    border-color: var(--edumi-blue, #0466c2);
    box-shadow: 0 14px 32px rgba(4, 102, 194, 0.14);
    transform: translateY(-3px);
}

.detail-featured-image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 260px;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    transition: transform 0.25s ease;
}

.detail-featured-image:hover img {
    transform: scale(1.025);
}

/* =========================================================
   Detail Body Layout
   ========================================================= */

.detail-body {
    padding: 34px 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.article-card,
.side-card,
.related-card,
.contact-card {
    border: 1px solid var(--edumi-border, #dfe7f1);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(16, 42, 67, 0.06);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.article-card:hover,
.side-card:hover,
.related-card:hover,
.contact-card:hover {
    border-color: var(--edumi-blue, #0466c2);
    box-shadow: 0 14px 32px rgba(4, 102, 194, 0.14);
    transform: translateY(-3px);
}

.article-card {
    padding: 30px;
}

.content-section + .content-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--edumi-border, #dfe7f1);
}

.content-section h2,
.side-card h2,
.contact-card h2 {
    margin: 0 0 12px;
    color: var(--edumi-navy, #102a43);
    font-size: 1.22rem;
    font-weight: 800;
    line-height: 1.25;
}

.article-card:hover h2,
.side-card:hover h2,
.contact-card:hover h2 {
    color: var(--edumi-blue, #0466c2);
}

/* =========================================================
   Rich Text
   ========================================================= */

.richtext {
    color: #294966;
    font-size: 0.94rem;
    line-height: 1.75;
}

.richtext p {
    margin: 0 0 14px;
}

.richtext p:last-child,
.richtext ul:last-child,
.richtext ol:last-child {
    margin-bottom: 0;
}

.richtext ul,
.richtext ol {
    margin: 10px 0 14px;
    padding-left: 20px;
}

.richtext li {
    margin-bottom: 6px;
}

.richtext a {
    color: var(--edumi-blue, #0466c2);
    font-weight: 800;
    text-decoration: none;
}

.richtext a:hover {
    color: #034f96;
    text-decoration: underline;
}

/* =========================================================
   Article Actions
   ========================================================= */

.article-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 14px;
}

.article-actions--between {
    justify-content: space-between;
    gap: 12px;
}

/* =========================================================
   Detail Sidebar
   ========================================================= */

.detail-sidebar {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 14px;
}

.side-card {
    padding: 20px;
}

/* =========================================================
   Facts
   ========================================================= */

.facts {
    display: grid;
    gap: 12px;
    margin: 0;
}

.facts div {
    border: 1px solid #e5edf6;
    border-radius: 8px;
    background: #f9fafc;
    padding: 12px;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.facts div:hover {
    border-color: rgba(4, 102, 194, 0.24);
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(4, 102, 194, 0.08);
}

.facts dt {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 5px;
    color: var(--edumi-navy, #102a43);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.facts dt .material-icons-outlined {
    background: none;
    color: var(--edumi-blue, #0466c2);
    font-size: 14px;
    -webkit-text-fill-color: var(--edumi-blue, #0466c2);
}

.facts dd {
    margin: 0;
    color: #294966;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.45;
}

/* =========================================================
   Fact Pills
   Gradient outline default, full gradient on hover
   ========================================================= */

.fact-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.fact-pill {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    border: 1.5px solid transparent;
    border-radius: 999px;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        var(
            --edumi-gradient,
            linear-gradient(135deg, #ff3e3e 0%, #a00070 48%, #0466c2 100%)
        ) border-box;
    color: var(--edumi-blue, #0466c2);
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.2;
    padding: 7px 12px;
    box-shadow: 0 6px 14px rgba(4, 102, 194, 0.08);
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.fact-pill:hover {
    background:
        var(
            --edumi-gradient,
            linear-gradient(135deg, #ff3e3e 0%, #a00070 48%, #0466c2 100%)
        ) padding-box,
        var(
            --edumi-gradient,
            linear-gradient(135deg, #ff3e3e 0%, #a00070 48%, #0466c2 100%)
        ) border-box;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(4, 102, 194, 0.14);
    transform: translateY(-1px);
}

/* =========================================================
   CTA Side Card
   ========================================================= */

.side-card--cta {
    background:
        radial-gradient(circle at 86% 14%, rgba(4, 102, 194, 0.12), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
}

.side-card--cta p {
    margin: 8px 0 14px;
    color: var(--edumi-muted, #62748a);
    font-size: 0.86rem;
    line-height: 1.6;
}

/* =========================================================
   Buttons In Detail Page
   Gradient outline default, full gradient on hover
   ========================================================= */

.detail-page .home-btn,
.detail-page .edumi-btn,
.detail .home-btn,
.detail .edumi-btn,
.side-card--cta a,
.article-actions a,
.article-actions button,
.contact-form button {
    position: relative;
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
    border: 1.5px solid transparent;
    border-radius: 999px;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        var(
            --edumi-gradient,
            linear-gradient(135deg, #ff3e3e 0%, #a00070 48%, #0466c2 100%)
        ) border-box;
    color: var(--edumi-blue, #0466c2);
    font-size: 0.88rem;
    font-weight: 850;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    padding: 0 18px;
    box-shadow: 0 8px 18px rgba(4, 102, 194, 0.10);
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease,
        color 0.18s ease;
}

.detail-page .home-btn span,
.detail-page .edumi-btn span,
.detail .home-btn span,
.detail .edumi-btn span,
.side-card--cta a span,
.article-actions a span,
.article-actions button span,
.contact-form button span {
    background: var(
        --edumi-gradient,
        linear-gradient(135deg, #ff3e3e 0%, #a00070 48%, #0466c2 100%)
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.detail-page .home-btn .material-icons-outlined,
.detail-page .edumi-btn .material-icons-outlined,
.detail .home-btn .material-icons-outlined,
.detail .edumi-btn .material-icons-outlined,
.side-card--cta a .material-icons-outlined,
.article-actions a .material-icons-outlined,
.article-actions button .material-icons-outlined,
.contact-form button .material-icons-outlined {
    background: var(
        --edumi-gradient,
        linear-gradient(135deg, #ff3e3e 0%, #a00070 48%, #0466c2 100%)
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-size: 18px;
}

.detail-page .home-btn:hover,
.detail-page .edumi-btn:hover,
.detail .home-btn:hover,
.detail .edumi-btn:hover,
.side-card--cta a:hover,
.article-actions a:hover,
.article-actions button:hover,
.contact-form button:hover {
    background:
        var(
            --edumi-gradient,
            linear-gradient(135deg, #ff3e3e 0%, #a00070 48%, #0466c2 100%)
        ) padding-box,
        var(
            --edumi-gradient,
            linear-gradient(135deg, #ff3e3e 0%, #a00070 48%, #0466c2 100%)
        ) border-box;
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(4, 102, 194, 0.18);
    transform: translateY(-1px);
}

.detail-page .home-btn:hover span,
.detail-page .edumi-btn:hover span,
.detail .home-btn:hover span,
.detail .edumi-btn:hover span,
.side-card--cta a:hover span,
.article-actions a:hover span,
.article-actions button:hover span,
.contact-form button:hover span,
.detail-page .home-btn:hover .material-icons-outlined,
.detail-page .edumi-btn:hover .material-icons-outlined,
.detail .home-btn:hover .material-icons-outlined,
.detail .edumi-btn:hover .material-icons-outlined,
.side-card--cta a:hover .material-icons-outlined,
.article-actions a:hover .material-icons-outlined,
.article-actions button:hover .material-icons-outlined,
.contact-form button:hover .material-icons-outlined {
    background: none;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

.detail-page .home-btn:focus-visible,
.detail-page .edumi-btn:focus-visible,
.detail .home-btn:focus-visible,
.detail .edumi-btn:focus-visible,
.side-card--cta a:focus-visible,
.article-actions a:focus-visible,
.article-actions button:focus-visible,
.contact-form button:focus-visible {
    outline: 0;
    box-shadow:
        0 12px 26px rgba(4, 102, 194, 0.18),
        0 0 0 3px rgba(4, 102, 194, 0.16);
}

/* =========================================================
   Related Section
   ========================================================= */

.related {
    padding: 24px 0 38px;
    background: #ffffff;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.related-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    color: inherit;
    padding: 14px;
    text-decoration: none;
}

.related-card:hover h3 {
    color: var(--edumi-blue, #0466c2);
}

.related-card__image {
    display: flex;
    width: 92px;
    height: 68px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5edf6;
    border-radius: 8px;
    background: #f8fbff;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.related-card:hover .related-card__image {
    border-color: rgba(4, 102, 194, 0.24);
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(4, 102, 194, 0.04);
}

.related-card__image img {
    max-width: 74%;
    max-height: 42px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.related-card:hover .related-card__image img {
    transform: scale(1.025);
}

.related-card h3 {
    margin: 0;
    color: var(--edumi-navy, #102a43);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.28;
    transition: color 0.2s ease;
}

/* =========================================================
   Contact Section
   ========================================================= */

.contact {
    padding: 36px 0 44px;
    background: #ffffff;
}

.contact-card {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
    gap: 28px;
    align-items: start;
    background:
        radial-gradient(circle at 88% 12%, rgba(4, 102, 194, 0.10), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 28px;
}

.contact-card p {
    margin: 8px 0 0;
    color: var(--edumi-muted, #62748a);
    line-height: 1.65;
}

.contact-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.contact-form label {
    display: grid;
    gap: 6px;
    color: var(--edumi-navy, #102a43);
    font-size: 0.78rem;
    font-weight: 800;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--edumi-border, #dfe7f1);
    border-radius: 8px;
    background: #ffffff;
    color: var(--edumi-text, #102a43);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0 12px;
}

.contact-form textarea {
    min-height: 104px;
    padding-top: 10px;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--edumi-blue, #0466c2);
    box-shadow: 0 0 0 3px rgba(4, 102, 194, 0.12);
    outline: 0;
}

.contact-form__wide,
.contact-form .alert,
.contact-form button {
    grid-column: 1 / -1;
}

.funding-inquiry-modal {
    position: relative;
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1fr);
    gap: 24px;
    padding: 34px;
    overflow: hidden;
}

.funding-inquiry-modal__intro {
    padding: 10px 0 0;
}

.funding-inquiry-modal__content {
    display: grid;
    gap: 16px;
    align-content: start;
    padding-right: 2px;
}

.funding-inquiry-modal__content > p {
    margin: 0;
}

.funding-inquiry-modal .btn-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    margin: 0;
    padding: 10px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(16, 42, 67, 0.12);
    opacity: 1;
}

.funding-inquiry-modal .btn-close:focus {
    box-shadow:
        0 10px 24px rgba(16, 42, 67, 0.12),
        0 0 0 3px rgba(4, 102, 194, 0.16);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 991.98px) {
    .detail-hero__grid,
    .detail-layout,
    .contact-card {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        position: static;
    }

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

    .funding-inquiry-modal {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 24px;
    }

    .funding-inquiry-modal__intro,
    .funding-inquiry-modal__content {
        padding-left: 0;
        padding-right: 0;
    }

    .funding-inquiry-modal__intro {
        padding-top: 6px;
        padding-right: 72px;
        padding-bottom: 12px;
    }
}

@media (max-width: 767.98px) {
    .detail-hero {
        padding: 28px 0 30px;
    }

    .detail-hero h1 {
        font-size: 2rem;
    }

    .article-card,
    .contact-card {
        padding: 18px;
    }

    .related-grid,
    .contact-form {
        grid-template-columns: 1fr;
    }

    .related-card {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .related-card__image {
        width: 76px;
        height: 58px;
    }

    .funding-inquiry-modal .btn-close {
        top: 14px;
        right: 14px;
    }

    .funding-inquiry-modal {
        padding: 18px;
    }

    .funding-inquiry-modal__intro {
        padding-top: 24px;
        padding-right: 58px;
    }
}

@media (max-width: 575.98px) {
    .article-actions--between {
        flex-direction: column;
        align-items: stretch;
    }

    .article-actions--between .home-btn,
    .article-actions--between .edumi-btn,
    .article-actions--between a,
    .article-actions--between button {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================================
   Touch Devices and Reduced Motion
   ========================================================= */

@media (hover: none) {
    .detail-logo-card:hover,
    .article-card:hover,
    .side-card:hover,
    .related-card:hover,
    .contact-card:hover,
    .fact-pill:hover,
    .detail-page .home-btn:hover,
    .detail-page .edumi-btn:hover,
    .detail .home-btn:hover,
    .detail .edumi-btn:hover,
    .side-card--cta a:hover,
    .article-actions a:hover,
    .article-actions button:hover,
    .contact-form button:hover {
        transform: none;
    }

    .detail-logo-card:hover img,
    .related-card:hover .related-card__image img {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .detail-logo-card,
    .detail-logo-card img,
    .article-card,
    .side-card,
    .related-card,
    .contact-card,
    .related-card__image,
    .related-card__image img,
    .facts div,
    .fact-pill,
    .detail-page .home-btn,
    .detail-page .edumi-btn,
    .detail .home-btn,
    .detail .edumi-btn,
    .side-card--cta a,
    .article-actions a,
    .article-actions button,
    .contact-form button {
        transition: none !important;
        animation: none !important;
    }
}
