@charset "UTF-8";

/* 共通設定 */
* {
    box-sizing: border-box;
}
html {
    font-size: 100%;
}
body {
    margin: 0;
    padding-top: 80px;
    font-family: Arial, sans-serif;
}
a {
    text-decoration: none;
    color: midnightblue;
}

img {
    max-width: 100%;
}

/*頁首設定*/
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

/*LOGO設定*/
.logo-link {
    display: block;
    width: 110px;
    margin: 10px auto 0 auto;
    z-index: 2;
}

.logo {
    width: 100%;
    height: auto;
    display: block;
}

/*全螢幕選單設定*/
.main-nav{
    max-width: 1200px;
    margin: 0 auto;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.nav-left, .nav-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    column-gap: 16px;
}
.nav-left {
    right: 58%;
}
.nav-right {
    left: 58%;
}

/* 漢堡按鈕 (縮小版) */
.menu-btn {
    display: none; /* 預設隱藏，行動版才顯示 */
    font-size: 20px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px;
    background-color: #333;
    border-radius: 5px;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1100;
}

/* 側邊選單 (縮小版) */
.sidebar {
    width: 250px;
    height: 100vh;
    position: fixed;
    top: 0;
    right: -250px; /* 預設隱藏 */
    background-color: #333;
    padding-top: 60px;
    transition: right 0.3s ease;
    z-index: 2000;
}

.sidebar a {
    display: block;
    padding: 15px;
    color: white;
    text-decoration: none;
    transition: 0.3s;
}

.sidebar a:hover {
    background-color: #575757;
}

.sidebar.active {
    right: 0;
}

/*標題設定開始*/
.first-title {
    text-align: center;
    margin-top: 100px;
    margin-bottom: 30px;
    font-size: 28px;
    color: #333;
}
/*標題設定結束*/

/*圖片及懸浮效果*/
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 三列 */
    column-gap: 20px; /* 照片之間的間隔 */
    justify-content: center;
    margin-top: 40px;
}

.photo-item {
    position: relative;
    width: 100%; /* 讓每個項目填滿列 */
    padding-top: 100%; /* 確保高度與寬度相同，形成正方形 */
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out; /* 添加過渡效果 */
}

.photo-item:hover {
    transform: scale(1.05); /* 當懸停時放大圖片 */
}

.photo-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease-in-out; /* 圖片過渡效果 */
}

.photo-item img:hover {
    transform: scale(1.1); /* 當懸停時放大圖片 */
}

/* 照片模態窗口 */
.modal {
    display: none; /* 隱藏模態窗口 */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    margin:auto;
    padding: 20px;
    background-color: white;
    width: 80%;
    max-width: 600px;
    z-index: 3000;
    animation: fadeIn 0.5s ease-in-out; /* 模態視窗動畫 */
}

.modal-content img {
    width: 100%;
    border-radius: 10px;
}

/*關閉按鈕*/
.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 25px;
    padding: 0;
    background-color: transparent;
    border: none;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/*箭頭控制*/
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.5);
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/*點擊照片連結後的css設定開始*/
.button-block {
    width: 100%; /* 使區塊寬度佔滿 */
    margin-top: 40px;
    padding: 20px;
    background-color: #e0e0e0;
    display: flex;
    justify-content: center;
}

.button-container {
    display: flex;
    column-gap: 20px;
}

.nav-button {
    padding: 15px 30px;
    font-size: 16px;
    background-color: gray;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, transform 0.3s ease; /* 增加平滑過渡 */
}

.nav-button a{
    color: white;
}

.nav-button:hover {
    background-color: grey;
    transform: translateY(-3px); /* 按鈕懸停時向上移動 */
}

/*FOOTER開始*/
footer{
    background-color: #432;
    text-align: center;
    padding: 26px 0;
}
footer{
    color: #fff;
    font-size: 0.875rem;
}
.link{
    display: flex;
    justify-content: center;
}
.ig{
    width: 70px;
    height: 70px;
}
.line{
    width: 70px;
    height: 70px;
}
/*FOOTER結束*/
/*-----------------------------*/

/*-----------------------------*/
/*適應性測試*/
/* 當螢幕寬度小於 768px 時調整版面 */
@media screen and (max-width: 768px) {
   .main-nav {
        display: none;
        flex-direction: column;
    }

    .menu-btn {
        display: block;
    }

    .sidebar {
        right: -250px;
    }

    .sidebar.active {
        right: 0;
    }

    /* 照片網格調整為單列 */
    .photo-grid {
        grid-template-columns: 1fr; /* 單列顯示 */
        grid-row-gap: 20px;
    }

    /* 按鈕區塊修改 */
    .button-block {
        padding: 20px 10px;
    }

    /* FOOTER */
    footer {
        font-size: 0.75rem;
    }

    .ig, .line {
        width: 50px;
        height: 50px;
    }
}


/*----------------------------*/

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
