/**
 * Single Portfolio Page Styles
 * RiseCreatives Theme - single-portfolio.css
 */

/* ==========================================
   Hero Banner 區塊
   ========================================== */

.rise-theme-portfolio-hero {
    width: 100%;
    height: 70vh;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

/* 模糊效果（使用偽元素避免模糊整個區塊）*/
.rise-theme-portfolio-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    filter: blur(4px);
    z-index: 1;
}

/* Hero Banner Placeholder（當沒有圖片時）*/
.rise-theme-portfolio-hero-placeholder {
    background-color: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rise-theme-portfolio-hero-placeholder::before {
    display: none;
}

.rise-theme-hero-placeholder-text {
    text-align: center;
    color: #999;
    font-size: 18px;
    position: relative;
    z-index: 2;
}

/* ==========================================
   懸浮的案例示意圖片
   ========================================== */

.rise-theme-portfolio-floating-image {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(30vh - 80px);
    width: 100%;
    max-width: 700px;
    z-index: 10;
    padding: 0 20px;
    box-sizing: border-box;
}

.rise-theme-portfolio-floating-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   內容區塊
   ========================================== */

.rise-theme-portfolio-content {
    padding: 160px 0 80px 0; /* 上方增加 padding 避免被圖片遮擋 */
    background-color: #fff;
    position: relative;
}

.rise-theme-portfolio-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 20px;
    align-items: start;
}

/* ==========================================
   左欄樣式
   ========================================== */

.rise-theme-portfolio-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 0 60px; /* 左右 padding */
    opacity: 1; /* 預設可見 */
    transform: translateY(0); /* 預設位置 */
    transition: opacity 1.2s ease, transform 1.2s ease;
}

/* JavaScript啟用時的初始隱藏狀態 */
.js .rise-theme-portfolio-left {
    opacity: 0;
    transform: translateY(30px);
}

.rise-theme-portfolio-left.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* 案例標題 */
.rise-theme-portfolio-title {
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
    margin: 0;
}

/* 案例類別標籤 */
.rise-theme-portfolio-category {
    margin: 0;
}

.rise-theme-category-badge {
    display: inline-block;
    padding: 8px 20px;
    background-color: #3F776F;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

/* 設計理念 */
.rise-theme-portfolio-concept {
    margin: 0;
}

.rise-theme-portfolio-concept p {
    font-size: 18px;
    line-height: 1.2;
    color: #5C5C5C;
    margin: 0;
    white-space: pre-line;
}

/* ==========================================
   案例圖庫樣式 - 長條圖卡片置中
   ========================================== */

.rise-theme-portfolio-gallery {
    padding: 60px 0;
    background-color: #FAFAFA;
}

.rise-theme-gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative; /* 為背景標題定位 */
}

/* 背景裝飾標題 */
.rise-theme-gallery-bg-title {
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 160px;
    font-weight: 900;
    font-family: cursive;
    color: rgb(0 0 0 / 8%); /* 黑色半透明 */
    z-index: 1;
    margin: 0;
    pointer-events: none; /* 不影響點擊事件 */
    user-select: none;
    letter-spacing: 0.05em;
}

.rise-theme-gallery-scroll {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 20px 0;
    position: relative;
    z-index: 2; /* 確保卡片在背景標題之上 */
}

/* 動態卡片寬度 - 根據數量調整 */
.rise-theme-gallery-scroll[data-count="2"] .rise-theme-gallery-card {
    width: 400px; /* 2張時最大 */
}

.rise-theme-gallery-scroll[data-count="3"] .rise-theme-gallery-card {
    width: 350px; /* 3張時較大 */
}

.rise-theme-gallery-scroll[data-count="4"] .rise-theme-gallery-card {
    width: 300px; /* 4張時中等 */
}

.rise-theme-gallery-card {
    flex: 0 0 auto;
    /* 寬度現在由 data-count 屬性控制 */
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    opacity: 1; /* 預設可見 */
}

/* JavaScript啟用時的初始隱藏狀態 */
.js .rise-theme-gallery-card {
    opacity: 0;
}

.rise-theme-gallery-card:hover {
    z-index: 2;
    /* transform 效果現在由 JavaScript 控制 */
}

.rise-theme-card-image {
    width: 100%;
    aspect-ratio: 18 / 24; /* 直向長條圖比例 3:4 */
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border: 1px solid #E0E0E0;
    transition: box-shadow 0.3s ease;
}

.rise-theme-gallery-card:hover .rise-theme-card-image {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.rise-theme-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center; /* 截圖從頂部開始顯示 */
    transition: none; /* 移除圖片的變換效果 */
}

/* ==========================================
   右欄樣式
   ========================================== */

.rise-theme-portfolio-right {
    display: flex;
    flex-direction: column;
    gap: 40px;
    opacity: 1; /* 預設可見 */
    transform: translateY(0); /* 預設位置 */
    transition: opacity 1.2s ease 0.3s, transform 1.2s ease 0.3s;
}

/* JavaScript啟用時的初始隱藏狀態 */
.js .rise-theme-portfolio-right {
    opacity: 0;
    transform: translateY(30px);
}

.rise-theme-portfolio-right.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* 標籤區域 */
.rise-theme-portfolio-tags {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rise-theme-tags-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.rise-theme-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rise-theme-tag-item {
    display: inline-block;
    padding: 8px 16px;
    background-color: #F5F5F5;
    color: #6C6C6C;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #E0E0E0;
    transition: all 0.3s ease;
}

.rise-theme-tag-item:hover {
    background-color: #E8E8E8;
    border-color: #D0D0D0;
}

/* 瀏覽網站按鈕 */
.rise-theme-portfolio-button {
    margin-top: 20px;
}

.rise-theme-visit-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    background-color: #3F776F;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.rise-theme-visit-button:hover {
    background-color: #2d5850;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(63, 119, 111, 0.3);
}

/* 禁用狀態的按鈕 */
.rise-theme-visit-button-disabled {
    background-color: #999;
    cursor: not-allowed;
}

.rise-theme-visit-button-disabled:hover {
    background-color: #888;
    transform: none;
    box-shadow: none;
}

.rise-theme-visit-button svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.rise-theme-visit-button:hover svg {
    transform: translate(3px, -3px);
}

/* ==========================================
   第三區塊：案例說明
   ========================================== */

.rise-theme-portfolio-description {
    padding: 80px 0;
    background-color: #FAFAFA;
}

.rise-theme-portfolio-description-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
}

.rise-theme-description-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 40px;
    text-align: center;
}

.rise-theme-description-content {
    font-size: 18px;
    line-height: 1.8;
    color: #5C5C5C;
}

.rise-theme-description-content p {
    margin-bottom: 1.5em;
}

.rise-theme-description-content h2,
.rise-theme-description-content h3,
.rise-theme-description-content h4 {
    color: #2c3e50;
    margin-top: 2em;
    margin-bottom: 1em;
    font-weight: 600;
}

.rise-theme-description-content h2 {
    font-size: 28px;
}

.rise-theme-description-content h3 {
    font-size: 24px;
}

.rise-theme-description-content h4 {
    font-size: 20px;
}

.rise-theme-description-content ul,
.rise-theme-description-content ol {
    margin: 1.5em 0;
    padding-left: 2em;
}

.rise-theme-description-content li {
    margin-bottom: 0.5em;
}

.rise-theme-description-content img {
    max-width: 100%;
    height: auto;
    margin: 2em 0;
    border-radius: 8px;
}

.rise-theme-description-content blockquote {
    border-left: 4px solid #3F776F;
    padding-left: 20px;
    margin: 2em 0;
    font-style: italic;
    color: #6C6C6C;
}

/* ==========================================
   響應式設計
   ========================================== */

@media (max-width: 1024px) {
    .rise-theme-portfolio-container {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 0 30px;
    }
    
    .rise-theme-portfolio-hero {
        height: 50vh;
        min-height: 400px;
    }
    
    .rise-theme-portfolio-floating-image {
        top: calc(30vh - 60px); /* 平板位置調整 */
        max-width: 80%;
    }
    
    .rise-theme-portfolio-content {
        padding: 140px 0 60px 0;
    }
    
    .rise-theme-portfolio-title {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .rise-theme-portfolio-content {
        padding: 120px 0 60px 0;
    }
    
    .rise-theme-portfolio-container {
        padding: 0 20px;
        gap: 30px;
    }
    
    /* 手機版移除左欄的 padding */
    .rise-theme-portfolio-left {
        padding: 0;
    }
    
    .rise-theme-portfolio-hero {
        height: 40vh;
        min-height: 300px;
    }
    
    .rise-theme-portfolio-floating-image {
        top: calc(25vh - 50px); /* 手機位置調整 */
        max-width: 90%;
    }
    
    .rise-theme-portfolio-title {
        font-size: 28px;
    }
    
    .rise-theme-portfolio-concept p {
        font-size: 16px;
    }
    
    .rise-theme-visit-button {
        width: 100%;
        justify-content: center;
    }
    
    .rise-theme-description-title {
        font-size: 28px;
    }
    
    .rise-theme-portfolio-description-container {
        padding: 0 20px;
    }
    
    .rise-theme-description-content {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .rise-theme-portfolio-left {
        gap: 20px;
    }
    
    .rise-theme-portfolio-right {
        gap: 30px;
    }
    
    .rise-theme-portfolio-title {
        font-size: 24px;
    }
    
    .rise-theme-category-badge {
        font-size: 13px;
        padding: 6px 16px;
    }
    
    .rise-theme-tag-item {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    /* 圖庫響應式 */
    .rise-theme-gallery-container {
        padding: 0 30px;
    }
    
    .rise-theme-gallery-bg-title {
        font-size: 80px; /* 平板上字體縮小 */
    }
    
    .rise-theme-gallery-scroll {
        gap: 20px;
    }
    
    /* 平板上所有卡片統一寬度 */
    .rise-theme-gallery-scroll[data-count="2"] .rise-theme-gallery-card,
    .rise-theme-gallery-scroll[data-count="3"] .rise-theme-gallery-card,
    .rise-theme-gallery-scroll[data-count="4"] .rise-theme-gallery-card {
        width: 240px; /* 平板寬度稍微增加 */
        max-width: calc(50% - 10px); /* 平板最多2張並排 */
    }
}

@media (max-width: 768px) {
    .rise-theme-lightbox-prev {
        left: -60px;
    }
    
    .rise-theme-lightbox-next {
        right: -60px;
    }
    
    .rise-theme-lightbox-close {
        top: -40px;
        font-size: 25px;
    }
    
    .rise-theme-lightbox-counter {
        bottom: -40px;
        font-size: 14px;
    }
    
    /* 圖庫響應式 */
    .rise-theme-gallery-container {
        padding: 0 20px;
    }
    
    .rise-theme-gallery-bg-title {
        font-size: 60px; /* 手機上字體更小 */
    }
    
    .rise-theme-gallery-scroll {
        gap: 15px;
        padding: 15px 0;
    }
    
    /* 手機上所有卡片統一寬度 */
    .rise-theme-gallery-scroll[data-count="2"] .rise-theme-gallery-card,
    .rise-theme-gallery-scroll[data-count="3"] .rise-theme-gallery-card,
    .rise-theme-gallery-scroll[data-count="4"] .rise-theme-gallery-card {
        width: 200px; /* 手機寬度調整 */
        max-width: calc(100% - 20px); /* 手機顯示1張 */
    }
    
    /* hover 效果由 JavaScript 控制，移除 CSS hover */
}

@media (max-width: 640px) {
    /* 圖庫響應式 */
    .rise-theme-gallery-bg-title {
        font-size: 40px; /* 小螢幕字體最小 */
    }
    
    .rise-theme-gallery-scroll {
        gap: 15px;
    }
    
    /* 小螢幕統一寬度 */
    .rise-theme-gallery-scroll[data-count="2"] .rise-theme-gallery-card,
    .rise-theme-gallery-scroll[data-count="3"] .rise-theme-gallery-card,
    .rise-theme-gallery-scroll[data-count="4"] .rise-theme-gallery-card {
        width: 180px; /* 小螢幕寬度調整 */
        max-width: 100%;
    }
    
    .rise-theme-card-image {
        border-radius: 8px;
        aspect-ratio: 16 / 20; /* 手機上稍微調整比例 */
    }
}

/* ==========================================
   其他案例區塊樣式
   ========================================== */

.rise-theme-other-cases {
    padding: 80px 0;
    background-color: #fff;
}

.rise-theme-other-cases-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.rise-theme-other-cases-title {
    font-size: 36px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin: 0 0 60px 0;
    position: relative;
}

.rise-theme-other-cases-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #3F776F;
    border-radius: 2px;
}

.rise-theme-other-cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

/* 案例卡片 */
.rise-theme-case-card {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.rise-theme-case-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* 案例圖片 */
.rise-theme-case-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
}

.rise-theme-case-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.rise-theme-case-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.rise-theme-case-card:hover .rise-theme-case-image img {
    transform: scale(1.05);
}

/* 案例卡片內容 */
.rise-theme-case-content {
    padding: 24px;
}

/* 案例標題與標籤容器 */
.rise-theme-case-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* 分類標籤 */
.rise-theme-case-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #666666;
    background-color: #f5f5f5;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 案例標題 */
.rise-theme-case-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
    flex: 1;
}

.rise-theme-case-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.rise-theme-case-title a:hover {
    color: #54847A;
}

/* ==========================================
   其他案例響應式設計
   ========================================== */

@media (max-width: 1024px) {
    .rise-theme-other-cases-container {
        padding: 0 30px;
    }
    
    .rise-theme-other-cases-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .rise-theme-other-cases-title {
        font-size: 32px;
        margin-bottom: 50px;
    }
}

@media (max-width: 768px) {
    .rise-theme-other-cases {
        padding: 60px 0;
    }
    
    .rise-theme-other-cases-container {
        padding: 0 20px;
    }
    
    .rise-theme-other-cases-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .rise-theme-other-cases-title {
        font-size: 28px;
        margin-bottom: 40px;
    }
    
    .rise-theme-case-content {
        padding: 25px;
    }
    
    .rise-theme-case-title {
        font-size: 18px;
    }
}
