/* --- CSS Variables --- */
:root {
    /* Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #555555;
    --heading-primary: #222222;
    --color-accent: #c5a47e;
    --border-color: #eaeaea;
    --shadow-color: rgba(0, 0, 0, 0.05);

    /* Fonts */
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Playfair Display', serif;
    --transition-speed: 0.8s;
}

/* --- Global Styles --- */
html, body {
    height: 100%;
    overflow: hidden; /* Disable native scrollbars */
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-weight: 300;
    margin: 0;
    padding: 0;
    line-height: 1.8;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#fortuna-design-page {
    position: relative;
    height: 100%;
    width: 100%;
}

/* --- Header --- */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: top 0.3s ease;
}

.header-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-family: var(--font-secondary);
    font-size: 1.8rem;
    font-weight: 700;
    color: #000000 !important; /* Explicitly set to black */
    text-decoration: none;
}

.logo a:hover {
    color: #000000 !important; /* Keep black on hover */
}

.main-nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: #000000 !important; /* Explicitly set to black */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 0;
    position: relative;
}

.nav-link:hover {
    color: #000000 !important; /* Keep black on hover */
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.menu-toggle-btn {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle-btn svg {
    stroke: #000000 !important; /* Explicitly set to black */
    width: 28px;
    height: 28px;
}

/* --- Backgrounds Container --- */
#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind all content */
    background-color: var(--bg-primary); /* Fallback for sections without images */
    transition: background-color 0.3s ease;
}

h1, h2, h3, h4 { font-family: var(--font-secondary); color: var(--heading-primary); font-weight: 700; }
h1 { font-size: 4.2rem; margin: 0; }
.h1-subtitle {
    font-weight: 400;
    opacity: 0.9;
    white-space: nowrap; /* 避免英文單字在不同裝置寬度下被換行 */
}
h2 { font-size: 2.8rem; }
h3 { font-size: 1.8rem; }
h4 { font-size: 1.3rem; font-family: var(--font-primary); font-weight: 600; }
a { color: var(--color-accent); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--text-primary); }

.container { max-width: 1140px; margin: 0 auto; padding: 0 40px; }

/* --- Full Page Section Styling --- */
.page-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-color: transparent; /* Changed for background image visibility */
    transition: opacity var(--transition-speed) ease-in-out, visibility var(--transition-speed) ease-in-out, background-color 0.3s ease;
    opacity: 0;
    visibility: hidden;

}

.page-section.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;

}


/* --- Background Image Styling (Cross-fade) --- */
.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out; /* Slower, smoother transition */
    z-index: 1;
}

.background-image.active {
    opacity: 1;
}

/* Dark overlay for text readability on each image */
.background-image::before {
    content: "";
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2; /* Above the image, below the content */
}

/* Animate content inside active section */
.page-section .animated-content {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    transition-delay: 0.4s; /* Delay to let the section fade in first */
}

.page-section.active .animated-content {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.6s; /* Increased delay for a more graceful entrance */
}

/* --- Text color on sections with background images --- */
.has-bg-image,
.has-bg-image h1, .has-bg-image h2, .has-bg-image h3, .has-bg-image h4,
.has-bg-image p, .has-bg-image .section-subtitle, .has-bg-image .service-description {
    color: #ffffff;
}

/* Ensure footer (bg-alt) has its own background color on top */
.bg-alt {
    background-color: var(--bg-secondary);
}

.section-title { text-align: center; margin-bottom: 20px; }
.section-subtitle { text-align: center; margin-top: 0; margin-bottom: 60px; font-size: 1.1rem; color: var(--text-secondary); }

/* --- Hero Section --- */
.hero-content {
    text-align: center;
}

.cta-button { display: inline-block; background: var(--color-accent); color: white; padding: 15px 35px; border-radius: 5px; margin-top: 20px; font-weight: 600; letter-spacing: 1px; transition: background-color 0.3s ease, transform 0.3s ease; }
.cta-button:hover { background: #b38f69; color: white; transform: translateY(-3px); }

/* --- About Section --- */
.about-content { display: flex; align-items: center; gap: 80px; width: 100%; }
.about-text { flex: 1; }
.about-image { flex: 1; }
.about-image img { width: 100%; height: auto; object-fit: cover; min-height: 400px; background-color: var(--bg-secondary); border-radius: 5px; }

/* --- Portfolio (Alternating) Section --- */
.portfolio-alternating { display: flex; flex-direction: column; gap: 60px; width: 100%; }
.portfolio-item { display: flex; align-items: center; gap: 60px; }
.portfolio-item:nth-child(even) { flex-direction: row-reverse; }
.portfolio-image { flex: 0.8; } /* 您可以調整這個數值，例如 0.8 或 1，來改變圖片容器的大小 */
.portfolio-image img { width: 100%; display: block; border-radius: 5px; background-color: var(--bg-secondary);}
.portfolio-content { flex: 1; }
.portfolio-content h3 { margin-top: 0; color: #ffffff; }
.portfolio-content p { color: rgba(255, 255, 255, 0.85); }
.portfolio-location { display: block; margin-top: 20px; font-size: 0.9rem; font-weight: 600; color: #ffffff; }

/* --- Services Section --- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; text-align: center; width: 100%; }
.service-card { padding: 40px; transition: transform 0.3s ease; }
.service-card:hover { transform: translateY(-5px); }
.service-card:hover .service-icon svg { stroke: var(--color-accent); }
.service-icon { margin-bottom: 20px; }
.service-icon svg { width: 48px; height: 48px; stroke: #ffffff; transition: stroke 0.3s ease; }
.has-bg-image .service-card h4 {
    color: #ffffff;
}

/* --- Footer --- */
.site-footer h2 { color: var(--heading-primary); font-size: 1.5rem; font-family: var(--font-primary); font-weight: 600; margin-bottom: 30px; }
.contact-grid { display: flex; justify-content: center; align-items: center; gap: 60px; margin-bottom: 40px; }
.contact-info p { margin: 8px 0; font-size: 1rem; }
.contact-detail { display: flex; align-items: center; margin-bottom: 12px; }
.contact-icon { margin-right: 12px; stroke: var(--text-secondary); }
.contact-detail a { color: var(--text-primary); }
.contact-detail a:hover { color: var(--color-accent); }
.contact-social { display: flex; flex-direction: column; gap: 15px; }
.social-link-fb { display: inline-block; background-color: #4267B2; color: white; padding: 12px 25px; border-radius: 5px; font-weight: 600; transition: background-color 0.3s ease; text-align: center; }
.social-link-fb:hover { background-color: #365899; color: white; }
.social-link-ig { display: inline-block; background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); color: white; padding: 12px 25px; border-radius: 5px; font-weight: 600; transition: opacity 0.3s ease; text-align: center; }
.social-link-ig:hover { opacity: 0.9; color: white; }
.copyright { margin-top: 40px; font-size: 0.9rem; color: #aaa; }




/* --- Back to Top Button --- */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    background-color: var(--color-accent) !important;
    color: white !important;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background-color: #b38f69 !important;
    color: white !important;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .main-nav {
        display: none; /* Hide desktop nav on mobile */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.95);
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        padding: 20px 0;
        border-top: 1px solid var(--border-color);
    }

    .main-nav.active {
        display: flex;
    }

    .nav-link {
        padding: 10px 40px;
        text-align: center;
    }

    .menu-toggle-btn {
        display: block; /* Show hamburger on mobile */
    }

    .about-content, .portfolio-item, .portfolio-item:nth-child(even) { flex-direction: column; text-align: center; }
    .portfolio-image {
        flex: none; /* Reset flex property */
        width: 100%; /* Ensure it takes full width */
    }
    .contact-grid { flex-direction: column; gap: 30px; }
    .container { padding: 0 20px; }
}

@media (max-width: 768px) {
    h1 { font-size: 3rem; } h2 { font-size: 2.2rem; }
    .h1-subtitle {
        display: block; /* 讓英文標題換行 */
        font-size: 1.8rem; /* 調整副標題字體大小 */
        margin-top: 8px; /* 與主標題間距 */
        margin-left: 0; /* 重設左邊間距 */
    }
    .section-subtitle { margin-bottom: 40px; }
    .portfolio-alternating { gap: 40px; }
    .portfolio-image {
        max-width: 80%; /* 您可以調整此百分比，例如 70% 或 90%，來改變圖片大小 */
        margin: 0 auto; /* 讓圖片在容器內水平置中 */
        overflow: hidden;
    }
    ._df_thumb {
        height: auto !important;
    }

}

/* --- Portfolio Flipbook Modal Styles --- */

/* Trigger Image */
.portfolio-image-trigger {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 5px;
}

.portfolio-image-trigger img {
    display: block;
    width: 100%;
    transition: transform 0.4s ease;
}

.portfolio-image-trigger:hover img {
    transform: scale(1.05);
}

.portfolio-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.portfolio-image-trigger:hover .portfolio-image-overlay {
    opacity: 1;
}

.portfolio-image-overlay span {
    margin-top: 10px;
    font-weight: 600;
}
._df_thumb {
  width: 100%;
  height: auto;
}
