/* =====================================================================
   en-home.css  —  English homepage (ECE Illinois–inspired light layout)
   Loaded ONLY by /en/index.php. Does not affect the Chinese site.
   Light, airy academic layout with DOP deep-red (#4b0000) accents.
   ===================================================================== */

:root {
    --dop-red: #4b0000;
    --dop-red-2: #7a1212;
    --enh-ink: #1f1f1f;
    --enh-muted: #6b6b6b;
    --enh-line: #e7e7e7;
    --enh-bg: #ffffff;
    --enh-bg-alt: #f6f4f2;
}

/* ---- base / layout ---- */
.enh-page {
    background: var(--enh-bg);
    color: var(--enh-ink);
}

.enh-section {
    padding: 70px 0;
}

.enh-section.enh-alt {
    background: var(--enh-bg-alt);
}

.enh-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 34px;
    flex-wrap: wrap;
}

.enh-h2 {
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    font-weight: 700;
    letter-spacing: .5px;
    margin: 0;
    position: relative;
    padding-bottom: 14px;
    color: var(--enh-ink);
}

.enh-h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 4px;
    background: var(--dop-red);
}

.enh-h2.enh-center {
    text-align: center;
}

.enh-h2.enh-center::after {
    left: 50%;
    transform: translateX(-50%);
}

.enh-h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--dop-red);
}

.enh-more {
    color: var(--dop-red);
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    white-space: nowrap;
    transition: opacity .25s;
}

.enh-more:hover {
    opacity: .65;
    text-decoration: underline;
}

/* ---- A. Hero ---- */
.enh-hero {
    position: relative;
}

.enh-hero .enh-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 8vw;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .25) 45%, rgba(0, 0, 0, 0) 75%);
    color: #fff;
}

.enh-hero-overlay h1 {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 12px;
    max-width: 16ch;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}

.enh-hero-overlay p {
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    margin: 0 0 26px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}

.enh-hero-cta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    pointer-events: auto;
}

.enh-btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .2s, background .25s, color .25s;
    border: 2px solid transparent;
}

.enh-btn:hover {
    transform: translateY(-2px);
}

.enh-btn-primary {
    background: var(--dop-red);
    color: #fff;
    border-color: var(--dop-red);
}

.enh-btn-primary:hover {
    background: var(--dop-red-2);
    border-color: var(--dop-red-2);
}

.enh-btn-ghost {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border-color: #fff;
}

.enh-btn-ghost:hover {
    background: #fff;
    color: var(--dop-red);
}

/* ---- B. News & Media (feature + list) ---- */
.enh-news-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 36px;
    align-items: stretch;
}

/* Grid 子項預設 min-width:auto，會被超長字串(如網址)撐爆而手機跑版，需可收縮 */
.enh-news-grid > .enh-news-feature,
.enh-news-grid > .enh-news-list {
    min-width: 0;
}

.enh-feature-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--enh-line);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: var(--enh-ink);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .05);
    transition: transform .3s, box-shadow .3s;
    height: 100%;
}

.enh-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .12);
}

.enh-feature-img {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #eee;
}

.enh-feature-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

.enh-feature-card:hover .enh-feature-img img {
    transform: scale(1.05);
}

.enh-feature-body {
    padding: 26px 28px 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.enh-feature-tag {
    align-self: flex-start;
    background: var(--dop-red);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 3px;
}

.enh-feature-title {
    font-size: 1.45rem;
    line-height: 1.35;
    font-weight: 700;
    margin: 0;
    color: var(--enh-ink);
    overflow-wrap: anywhere;
}

.enh-feature-date {
    color: var(--enh-muted);
    font-size: .9rem;
    margin: 0;
}

.enh-feature-excerpt {
    color: #444;
    line-height: 1.7;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.enh-feature-link {
    color: var(--dop-red);
    font-weight: 700;
    margin-top: 4px;
}

.enh-news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.enh-news-item {
    border-bottom: 1px solid var(--enh-line);
}

.enh-news-item:first-child {
    border-top: 3px solid var(--dop-red);
}

.enh-news-item a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 6px;
    text-decoration: none;
    color: var(--enh-ink);
    transition: background .2s, padding-left .2s;
}

.enh-news-item a:hover {
    background: var(--enh-bg-alt);
    padding-left: 14px;
}

.enh-news-item-date {
    color: var(--dop-red);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .5px;
}

.enh-news-item-title {
    font-size: 1.05rem;
    line-height: 1.5;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* ---- C. Category columns (reuses shared .news-card-new) ---- */
/* 類別由上往下整列，每列內卡片橫向排成一排 */
.enh-cats-grid {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.enh-cat-col .enh-section-head {
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--enh-line);
}

.enh-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* card overrides so shared cards look at home on the light grid */
.enh-cards .news-card-new {
    border: 1px solid var(--enh-line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .04);
}

.enh-cards .news-card-new .card-text {
    padding: 18px 20px 22px;
}

/* ---- D. Research Focus (reuses shared .fields-grid/.field-item) ---- */
.enh-focus .fields-grid {
    margin-top: 0;
}

.enh-focus .field-item {
    border-top-color: var(--dop-red);
}

.enh-focus .field-item:hover {
    box-shadow: 0 15px 35px rgba(75, 0, 0, .12);
    border-top-color: var(--dop-red-2);
}

.enh-focus .field-item > div {
    color: var(--dop-red);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 14px;
}

/* ---- E. Quick Links ---- */
.enh-quick-list {
    list-style: none;
    margin: 30px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.enh-quick-list li a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 84px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--enh-line);
    border-left: 4px solid var(--dop-red);
    border-radius: 6px;
    color: var(--enh-ink);
    font-weight: 600;
    text-decoration: none;
    transition: background .25s, color .25s, transform .2s;
}

.enh-quick-list li a:hover {
    background: var(--dop-red);
    color: #fff;
    transform: translateY(-3px);
}

/* =====================================================================
   Research list — horizontal card (left image / right text)
   Used by en/research.php via research_list_en_x.html
   ===================================================================== */
.pg-rcard {
    display: flex;
    align-items: stretch;
    gap: 30px;
    padding: 20px;
    margin-bottom: 24px;
    background: #f7f8fa;
    border: 1px solid var(--enh-line);
    border-radius: 10px;
    text-decoration: none;
    color: var(--enh-ink);
    transition: box-shadow .3s, transform .3s, background .3s;
}

.pg-rcard:hover {
    background: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .10);
    transform: translateY(-3px);
}

.pg-rcard-img {
    flex: 0 0 400px;
    max-width: 400px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    background: #e9ebee;
}

.pg-rcard-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

.pg-rcard:hover .pg-rcard-img img {
    transform: scale(1.04);
}

.pg-rcard-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 16px 8px 0;
    min-width: 0;
}

.pg-rcard-title {
    color: var(--ncu-blue, #003366);
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 14px;
}

.pg-rcard-desc {
    color: #4a4a4a;
    font-size: 1rem;
    line-height: 1.75;
    margin: 0 0 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pg-rcard-more {
    color: #a30a0a;
    font-weight: 700;
    font-size: .98rem;
}

@media (max-width: 768px) {
    .pg-rcard {
        flex-direction: column;
        gap: 16px;
    }

    .pg-rcard-img {
        flex-basis: auto;
        max-width: 100%;
        width: 100%;
    }

    .pg-rcard-body {
        padding: 0 4px 6px;
    }
}

/* ---- bottom ad banner ---- */
.enh-adband {
    padding: 0;
}

/* ---- responsive ---- */
@media (max-width: 1024px) {
    .enh-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .enh-quick-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .enh-section {
        padding: 48px 0;
    }

    .enh-news-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .enh-cards {
        grid-template-columns: 1fr;
    }

    .enh-cats-grid {
        gap: 34px;
    }

    .enh-hero .enh-hero-overlay {
        padding: 0 24px;
        background: linear-gradient(90deg, rgba(0, 0, 0, .6) 0%, rgba(0, 0, 0, .35) 100%);
    }
}

@media (max-width: 480px) {
    .enh-quick-list {
        grid-template-columns: 1fr;
    }
}

/* 輪播自動播放暫停/播放按鈕 (WCAG 2.2.2 Pause, Stop, Hide) */
.swiper-autoplay-toggle {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 20;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swiper-autoplay-toggle::before {
    content: "❚❚";
    /* 暫停圖示 (預設播放中) */
}

.swiper-autoplay-toggle.is-paused::before {
    content: "▶";
    /* 已暫停，按下可播放 */
}

.swiper-autoplay-toggle:hover {
    background: rgba(0, 0, 0, 0.78);
}

.swiper-autoplay-toggle:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}
