/* 第四屆金推獎（GFSA）首頁樣式 */

:root {
    --primary-color: #004d40;
    --text-color: #333;
    --bg-page: #f8f9fa;
    --bg-light: #fff;
    --header-text-color: #333;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: "Microsoft JhengHei", "微軟正黑體", sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-page);
    color: var(--text-color);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.is-hidden {
    display: none !important;
}

/* --- Banner --- */
#hero-banner {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background-color: #e0f2f1;
    line-height: 0;
}

.hero-banner-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* --- 頂部導覽 --- */
#main-header {
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: "Microsoft JhengHei", "微軟正黑體", sans-serif;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    height: 60px;
    box-sizing: border-box;
}

.site-title {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-left: 70px;
    height: 60px;
    overflow: hidden;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.site-logo {
    height: 50px;
    width: auto;
    vertical-align: middle;
    margin-right: 10px;
    padding-left: 0;
}

.site-title-text {
    font-size: 36px;
    margin: 0;
    flex-wrap: wrap;
    color: #000;
    font-weight: normal;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    padding: 5px 10px;
    color: #333;
    line-height: 1;
}

.main-nav {
    flex-grow: 1;
}

.main-nav-list {
    display: flex;
    justify-content: flex-end;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.main-nav-item {
    margin-left: 10px;
    position: relative;
}

.main-nav-item > a {
    font-size: 24px;
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 10px 8px;
    white-space: nowrap;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.nav-signup {
    color: #c62828;
    font-weight: bold;
}

.dropdown-arrow {
    font-size: 1.2rem;
    margin-left: 5px;
    transition: transform 0.3s;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #f9f9f9;
    min-width: 350px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 0;
    margin: 0;
    list-style: none;
}

.dropdown-menu li {
    border-bottom: 1px solid #eee;
}

.dropdown-menu li a {
    font-size: 24px;
    font-weight: normal;
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--header-text-color);
}

.has-dropdown:hover > .dropdown-menu {
    display: block;
}

.has-dropdown.open > .dropdown-menu {
    display: block;
}

@media (max-width: 1400px) and (min-width: 993px) {
    .site-title {
        margin-left: 20px;
    }

    .main-nav-item > a {
        font-size: 18px;
    }

    .site-title-text {
        font-size: 28px;
    }

    .dropdown-menu {
        min-width: 300px;
    }

    .dropdown-menu li a {
        font-size: 18px;
    }
}

@media (max-width: 992px) {
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        height: auto;
        min-height: 60px;
    }

    .site-title {
        margin-left: 0;
        height: auto;
    }

    .site-title-text {
        font-size: 20px;
    }

    .site-logo {
        height: 35px;
        margin-right: 8px;
    }

    .menu-toggle {
        display: block;
        margin-right: 15px;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        padding: 15px 20px;
        z-index: 9999;
    }

    .main-nav.is-open {
        display: block;
    }

    .main-nav-list {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .main-nav-item {
        margin-left: 0;
        width: 100%;
        margin-bottom: 8px;
    }

    .main-nav-item > a {
        font-size: 18px;
        padding: 8px 10px;
        background: #f7f7f7;
        border-radius: 4px;
        width: 100%;
    }

    .has-dropdown:hover > .dropdown-menu {
        display: none;
    }

    .has-dropdown.open > .dropdown-menu {
        display: block;
    }

    .main-nav .dropdown-menu {
        position: static;
        box-shadow: none;
        background: #f1f1f1;
        width: 100%;
        min-width: unset;
        margin-top: 5px;
        padding-left: 10px;
    }

    .main-nav .dropdown-menu li a {
        font-size: 16px;
        padding: 6px 10px;
        background: none;
    }
}

/* --- 右側浮動錨點 --- */
.side-nav {
    position: fixed;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.98);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.2);
    z-index: 900;
    border: 1px solid #ddd;
    min-width: 120px;
}

.side-nav li {
    margin: 5px 0;
}

.side-nav a {
    text-decoration: none;
    color: #004d40;
    font-size: 1.1rem;
    font-weight: bold;
    display: block;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
}

.side-nav a:hover {
    background-color: #e0f2f1;
    color: #00796b;
    transform: translateX(-5px);
}

@media (max-width: 768px) {
    .side-nav {
        display: none;
    }
}

/* --- 主要內容 --- */
.main-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
    background: transparent;
    min-height: 300px;
}

section.content-box,
section.packet-section {
    scroll-margin-top: 80px;
}

.content-box {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #e0e6e0;
    margin-bottom: 24px;
}

.content-box.highlight {
    background: #fff;
}

.content-box h2,
.packet-section h2 {
    border-left: 6px solid var(--primary-color);
    padding-left: 15px;
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 0 0 24px;
}

.content-box h3 {
    color: #1b5e20;
    margin-top: 25px;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 5px;
}

.content-box h3:first-of-type {
    margin-top: 0;
}

.award-list {
    list-style: none;
    padding-left: 1.25rem;
    margin: 0;
}

.award-list li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.lead {
    font-size: 1.15rem;
    line-height: 1.8;
    margin: 0;
}

.img-container {
    text-align: center;
}

.responsive-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- 懶人包 --- */
.packet-section {
    padding: 40px 20px;
    background-color: transparent;
    margin: 0 -20px -20px;
}

.packet-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.packet-card {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.packet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.packet-img-box {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f3f5;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.packet-img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.packet-card h3 {
    font-size: 18px;
    color: #333;
    margin: 0 0 15px;
    line-height: 1.4;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-weight: bold;
}

.btn-download {
    display: inline-block;
    background-color: #28a745;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-download:hover {
    background-color: #218838;
    color: #ffffff;
}

/* --- 歷年成果（同懶人包卡片；無區塊底色） --- */
.packet-section.archive-section {
    background-color: transparent;
    margin: 0 -20px -20px;
    padding: 40px 20px;
}

.archive-img-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.archive-name-link {
    color: inherit;
    text-decoration: none;
}

.archive-name-link:hover {
    color: var(--primary-color);
}

.archive-date {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* --- 頁尾 --- */
#news-footer {
    width: 100%;
    background-color: #000;
    padding: 20px 0;
    font-size: 15px;
    text-align: center;
    margin: 0;
    clear: both;
    color: #fff;
}

#news-footer p {
    margin: 0.4rem 0;
}

/* --- 歷年成果內容頁 --- */
.gfsa-archive-page .main-container {
    background: transparent;
}

.gfsa-archive-page .content-box {
    background: #fff;
    border: 1px solid #e0e6e0;
    border-radius: 10px;
}

#intro,
#news,
#winner {
    scroll-margin-top: 80px;
}

.award-intro-section {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.award-intro-left {
    flex: 1;
    min-width: 300px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1.5 / 1;
    background: #e0f2f1;
}

.award-intro-right {
    flex: 1;
    min-width: 280px;
    background: #f9f9f9;
    padding: 25px;
    border-left: 5px solid var(--primary-color);
    border-radius: 8px;
    line-height: 1.8;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    height: 350px;
}

.award-intro-right h3,
.winner-content h3 {
    color: #1b5e20;
    margin: 1.2em 0 0.6em;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 5px;
    font-size: 1.15rem;
}

.award-intro-right p,
.winner-content p {
    margin: 0 0 15px;
    font-size: 1.05rem;
}

.carousel-wrapper {
    width: 100%;
    height: 100%;
}

.carousel-slide {
    display: none;
    width: 100%;
    height: 100%;
}

.carousel-slide.active {
    display: block;
}

.carousel-slide img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.carousel-prev:hover,
.carousel-next:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 10;
}

.carousel-dots .dot {
    height: 10px;
    width: 10px;
    margin: 0 5px;
    padding: 0;
    background-color: #bbb;
    border: none;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s;
    vertical-align: middle;
}

.carousel-dots .dot.active,
.carousel-dots .dot:hover {
    background-color: var(--primary-color);
}

.history-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-content li {
    margin-bottom: 15px;
    line-height: 1.6;
}

.history-content a {
    color: #2c3e50;
    text-decoration: none;
    border-bottom: 1px solid #ddd;
    transition: all 0.3s;
    font-size: 1.1rem;
}

.history-content a:hover {
    color: #e67e22;
    border-bottom-color: #e67e22;
}

.history-content a[href*="youtu"]::before {
    content: "影片：";
}

@media (max-width: 768px) {
    .award-intro-section {
        flex-direction: column;
        padding: 0 15px;
    }

    .award-intro-left,
    .award-intro-right {
        flex: none;
        width: 100%;
        min-width: unset;
    }

    .award-intro-right {
        height: auto;
        max-height: 350px;
    }
}
