/* ============================================
   Index Page — Specific Styles
   ============================================ */

/* ── Feature Circular Icons (MoE Style) ── */
.feature-icons {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: -65px;
    position: relative;
    z-index: 20;
    flex-wrap: wrap;
}

.feature-circle {
    width: 135px;
    height: 135px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    text-decoration: none;
    color: var(--dark-blue);
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    padding: 10px;
}

.feature-circle i {
    font-size: 2.2rem;
    margin-bottom: 8px;
    color: var(--primary-orange);
}

.feature-circle:hover {
    background: var(--primary-orange);
    color: var(--white);
    transform: translateY(-10px);
}

.feature-circle:hover i {
    color: var(--white);
}

@media (max-width: 768px) {
    .feature-icons {
        margin-top: 30px;
        gap: 15px;
        padding: 0 15px;
    }

    .feature-circle {
        width: 100px;
        height: 100px;
        font-size: 0.9rem;
    }

    .feature-circle i {
        font-size: 1.6rem;
        margin-bottom: 5px;
    }
}




/* ── USR Introduction Section ── */
#usr-intro {
    background: linear-gradient(180deg, var(--white) 0%, var(--light-gray) 100%);
    position: relative;
    padding-top: 40px;
}

.intro-content-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border-top: none;
    transition: var(--transition-base);
}

.intro-image-wrapper {
    position: relative;
    transition: var(--transition-base);
    overflow: hidden;
}

.intro-image-wrapper::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 20px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--primary-orange);
    border-radius: 20px;
    z-index: -1;
    opacity: 0.3;
}

.intro-image-wrapper:hover {
    transform: translateY(-5px);
}

.intro-image-wrapper img {
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 640px;
    aspect-ratio: 640 / 420;
    object-fit: cover;
}

.intro-content-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.description-text {
    font-size: 1.15rem;
    color: var(--text-main);
    text-align: justify;
    text-justify: inter-ideograph;
    line-height: 1.8;
}

.description-text:last-of-type {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .intro-content-card {
        padding: 1.5rem 2rem;
    }

    .description-text {
        font-size: 1rem;
    }
}

/* ── Project Card Image Box (USR計畫總覽) ── */
.achiev-img-box {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.tag-row {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 8px;
    z-index: 20;
    flex-wrap: wrap; /* In case name is long */
}

.category-tag {
    background: white;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.category-tag.moe {
    color: #5d9cec;
    border: 1px solid #5d9cec;
    border-left: 3px solid #5d9cec; /* Added vertical bar */
}

.category-tag.national {
    color: #fdb45e;
    border: 1px solid #fdb45e;
    border-left: 3px solid #fdb45e; /* Added vertical bar */
}

.achiev-project-tag {
    background: rgba(0, 51, 102, 0.85);
    color: white;
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border-left: 3px solid var(--primary-orange);
    white-space: nowrap;
    transition: background 0.2s;
}

a.achiev-project-tag:hover {
    background: var(--primary-orange);
    color: white;
}

/* ── Project Filter Buttons ── */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 2px solid #eee;
    color: var(--dark-blue);
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.filter-btn:hover {
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    color: white;
    box-shadow: 0 6px 15px rgba(255, 140, 0, 0.25);
}

/* Filtering animation */
.project-item {
    transition: all 0.4s ease;
}

.project-item.hide {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}



/* ── Event Section ── */
#fields {
    padding-top: 80px;
}

.event-grid {
    margin-top: 40px;
}

.event-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.event-img-box {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.event-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.event-card:hover .event-img-box img {
    transform: scale(1.08);
}

.project-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--dark-blue);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 10;
}

.event-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.event-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.event-date i {
    color: var(--primary-orange);
}

.event-report-text {
    font-size: 1.15rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: justify;
    transition: max-height 0.3s ease;
}

.event-footer-links {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.event-toggle-link {
    color: var(--primary-orange);
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    background: #FFF5E6;
    padding: 8px 22px;
    border-radius: 50px;
    border: 1px solid rgba(255, 140, 0, 0.2);
}

.event-toggle-link:hover {
    background: var(--primary-orange);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 140, 0, 0.2);
}

.event-gallery-link {
    color: var(--text-muted);
    font-weight: 400;
    text-decoration: none;
    font-size: 1.1rem;
    transition: 0.2s;
    display: flex;
    align-items: center;
}

.event-gallery-link:hover {
    color: var(--dark-blue);
    text-decoration: underline;
}

/* ── Gallery Modal ── */
.event-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 110px);
    gap: 2px;
    background: #eee;
}

.gallery-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.gallery-item:first-child {
    grid-column: span 3;
    grid-row: span 2;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 5;
    position: relative;
    filter: brightness(0.9);
}

/* ── Related Links ── */
.related-link-item {
    text-decoration: none !important;
    text-align: center;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 15px 40px;
    border: 2px solid #eeeeee;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.related-link-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-orange);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
}

.related-link-item:hover p {
    color: var(--primary-orange) !important;
}