/*
Theme Name: Edmond Feng Shui
Author: Chan Pen
Description: Custom one-page theme for 恒定 Edmond Lim Feng Shui Consultancy
Version: 1.0
Text Domain: edmond-fengshui
*/

/* ---=== Global Styles ===--- */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --primary-color: #000000;
    --secondary-color: #f5f5f5;
    --accent-color: #c0c0c0; /* Silver for accents */
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    font-size: 16px;
    overflow-x: hidden;
}
.container { width: 90%; max-width: 1280px; margin: 0 auto; }
section { padding: 80px 0; overflow: hidden; }
.section-title { font-size: 2.5rem; font-weight: 700; text-align: center; margin-bottom: 60px; position: relative; padding-bottom: 15px; }
.section-title::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 3px; background-color: var(--primary-color); }
img { max-width: 100%; height: auto; }
a { text-decoration: none; color: var(--text-color); transition: color 0.3s ease; }
a:hover { color: var(--primary-color); }

/* ---=== Navigation ===--- */
.navbar { position: fixed; top: auto; left: 0; width: 100%; z-index: 1000; padding: 5px 0; background-color: rgba(255, 255, 255, 0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: all 0.3s ease; }
.navbar.scrolled { padding: 15px 0; box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08); }
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
a.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
}


.logo-main {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap; /* Allow items to wrap to the next line */
}

.logo-tagline {
    font-size: 0.4rem;
    color: #666;
    margin-top: -5px;
    padding-left: 0; /* Remove the old padding */
    flex-basis: 100%; /* Force the tagline to take the full width and wrap */
    text-align: left; /* Align text to the left */
}

.logo img {
    height: auto;
    width: auto;
    max-width: 200px; /* Adjust this value as needed */
    max-height: 50px;
    object-fit: contain;
    transition: var(--transition);
    flex-shrink: 0;
}

.logo span {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
    white-space: nowrap;
    transition: var(--transition);
}
.nav-links { display: flex; list-style: none; gap: 2.5vw; white-space: nowrap; }
.nav-links li { position: relative; }
.nav-links a { font-weight: 500; position: relative; padding-bottom: 5px; }
.nav-links a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--primary-color); transition: width 0.3s ease; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* Dropdown Menu Styles */
.nav-links .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    pointer-events: none;
}

.nav-links li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-links .sub-menu li {
    padding: 0;
    margin: 0;
}

.nav-links .sub-menu a {
    display: block;
    padding: 10px 20px;
    margin: 0;
    color: var(--text-color);
    font-weight: 400;
    font-size: 0.95rem;
    white-space: normal;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.nav-links .sub-menu a:last-child {
    border-bottom: none;
}

.nav-links .sub-menu a:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    transform: translateX(5px);
}

.nav-links .sub-menu a::after {
    display: none;
}
.hamburger { display: none; cursor: pointer; flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 25px; height: 2px; background-color: var(--primary-color); transition: var(--transition); }

/* ---=== Hero Section ===--- */
.hero { height: 110vh; position: relative; display: flex; align-items: center; padding: 0; color: #fff; }

/* Mobile background image and styles */
@media (min-width: 1025px) {
    .hero-container {
        justify-content: flex-end;
    }
    .hero-top {
        width: auto; /* Allow the container to size to its content */
    }
    .hero-bottom {
        display: none; /* Hide the mobile-only image container */
    }

    .hero-background {
        position: absolute; 
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 100%; 
        background: url('../images/herobackgroundmain.png') no-repeat; 
        background-size: cover; 
        background-position: center 80px; 
        filter: brightness(0.8); 
        z-index: 1; 
        display: block !important; /* Ensure it's visible on desktop */
    }
}

.hero-container { 
    position: relative; 
    z-index: 2; 
    display: flex; 
    width: 100%; 
    height: 100%; 
}
.master-profile { background-color: rgba(0, 0, 0, 0.5); padding: 40px; border-radius: 8px; max-width: 600px; backdrop-filter: blur(5px); }
.master-name { font-size: 3rem; font-weight: 700; margin-bottom: 0; }
.master-eng-name { font-size: 1.8rem; font-weight: 400; margin-bottom: 10px; color: var(--accent-color); }
.company-name { font-size: 1.1rem; margin-bottom: 5px; }
.company-reg { font-size: 0.9rem; margin-bottom: 30px; color: var(--accent-color); }
.timeline { list-style: none; position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; top: 5px; left: 10px; bottom: 5px; width: 2px; background-color: var(--accent-color); }
.timeline li { margin-bottom: 15px; position: relative; padding-left: 25px; }
.timeline li:not(.no-line)::before { content: ''; position: absolute; left: -2px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background-color: #fff; border: 2px solid var(--accent-color); transform: translateX(-40%); }
.timeline li span { font-weight: 700; margin-right: 10px; color: var(--accent-color); }
.timeline li.no-line i { margin-right: 10px; color: var(--accent-color); }

/* ---=== Services Section ===--- */

/* ---=== Services Section ===--- */
.services { background-color: var(--secondary-color); }
.services-container { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: flex-start; }
.services-title-container { display: flex; flex-direction: column; align-items: center; justify-content: center; position: sticky; top: 120px; }
.section-title-vertical { writing-mode: vertical-rl; text-orientation: mixed; font-size: 3rem; font-weight: 700; color: var(--primary-color); letter-spacing: 10px; }
.section-title-main { font-size: 2.5rem; font-weight: 700; margin-top: 20px; text-align: center; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
.service-card { background-color: var(--bg-color); border: 1px solid #eee; text-align: center; padding: 20px; border-radius: 8px; transition: var(--transition); }
.service-card:hover { transform: translateY(-10px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08); }
.service-card img { width: 150px; height: 180px; object-fit: cover; border-radius: 15px; margin-bottom: 15px; }
.service-card h3 { font-size: 1.1rem; font-weight: 500; margin: 0; }


/* ---=== Tailor-Made Section ===--- */
.tailor-content { display: flex; align-items: center; gap: 60px; }
.tailor-image {
    flex: 1;
    max-width: 450px;
    height: 450px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 40px;
}

.tailor-image img {
    width: 400%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
}
.tailor-text { flex: 1; }
.custom-list { 
    list-style: none; 
    margin: 20px 0 0 0; 
    padding: 0;
}
.custom-list li { 
    margin-bottom: 15px; 
    display: flex; 
    align-items: flex-start;
    line-height: 1.6;
}
.custom-list i { 
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    margin-right: 12px; 
    margin-top: 4px; 
    color: var(--primary-color); 
}
.custom-list strong {
    white-space: normal;
    margin-right: 8px;
    display: inline-block;
    min-width: 150px;
    font-weight: 600;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .custom-list li {
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 12px;
    }
    .custom-list i {
        width: 20px;
        margin-right: 10px;
        margin-top: 2px;
    }
    .custom-list strong {
        white-space: normal;
        margin-right: 8px;
        display: inline-block;
        min-width: 150px;
        font-weight: 600;
    }
}
.highlight { font-weight: 700; margin-top: 20px; background-color: var(--secondary-color); padding: 15px; border-left: 4px solid var(--primary-color); }

/* ---=== Philosophy Section ===--- */
.philosophy { background-color: var(--secondary-color); text-align: center; }
.philosophy-statement { max-width: 800px; margin: 0 auto; font-size: 1.2rem; font-style: italic; }

/* ---=== Core Values Section ===--- */
.values-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.value-card { display: flex; align-items: flex-start; gap: 25px; background-color: var(--secondary-color); padding: 25px; border-radius: 8px; transition: var(--transition); }
.value-card:hover { box-shadow: 0 8px 16px rgba(0,0,0,0.07); }
.value-icon { width: 80px; height: 80px; object-fit: cover; border-radius: 50%; flex-shrink: 0; }
.value-text h3 { font-size: 1.5rem; font-weight: 500; margin: 0 0 5px 0; }
.value-text p { font-size: 1rem; color: #555; line-height: 1.6; margin: 0; }

/* ---=== Core Philosophy Section ===--- */
.core-philosophy { background-color: var(--secondary-color); }
.philosophy-points { display: grid; grid-template-columns: 1fr; gap: 30px; max-width: 900px; margin: 0 auto; }
.philosophy-item { display: flex; align-items: center; gap: 30px; background-color: var(--bg-color); padding: 25px; border-radius: 8px; border: 1px solid #eee; }
.philosophy-item img { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; }
.philosophy-text h3 { font-size: 1.3rem; margin-bottom: 10px; }

/* ---=== Contact Section ===--- */
.contact-methods { display: flex; justify-content: center; align-items: center; gap: 40px; flex-wrap: wrap; }
.contact-item a { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 500; }
.contact-item i { font-size: 2.5rem; color: var(--primary-color); transition: transform 0.3s ease; }
.contact-item a:hover i { transform: scale(1.1); }

/* ---=== Footer ===--- */
footer { background-color: var(--primary-color); color: var(--bg-color); text-align: center; padding: 25px 0; }

/* ---=== Back to Top Button ===--- */
.back-to-top { 
    position: fixed; 
    bottom: 40px; 
    right: 40px; 
    width: 56px; 
    height: 56px; 
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    color: white; 
    border: none;
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0; /* Hide text */
    cursor: pointer; 
    opacity: 0; 
    visibility: hidden; 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999; 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.back-to-top::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 15l-6-6-6 6"/></svg>') no-repeat center center;
    background-size: 24px;
    transition: transform 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #5c7fdb, #8f5fe3);
}

.back-to-top:active {
    transform: translateY(-2px) scale(0.98);
}

.back-to-top::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    top: 0;
    left: 0;
    transform: scale(0);
    border-radius: 50%;
    transition: transform 0.5s ease-out;
}

.back-to-top:hover::after {
    transform: scale(2);
    opacity: 0;
}
.back-to-top.visible { opacity: 1; visibility: visible; }

/* ---=== Responsive Design ===--- */
@media (max-width: 1024px) {
    .services-grid { grid-template-columns: repeat(3, 1fr); }
    .tailor-content { flex-direction: column; }
    .tailor-image { text-align: center; }
    body { font-size: 15px; }
    section { padding: 60px 0; }
    .section-title { font-size: 2rem; margin-bottom: 40px; }
    .hamburger { display: flex; }
    .nav-links { position: fixed; top: 70px; left: -100%; width: 100%; height: calc(100vh - 70px); background-color: var(--bg-color); flex-direction: column; justify-content: flex-start; align-items: center; gap: 30px; transition: left 0.5s cubic-bezier(0.77, 0, 0.175, 1); overflow-y: auto; padding: 30px 0 60px 0; }
    .nav-links.active { left: 0; }
    
    /* Mobile Dropdown Styles */
    .nav-links .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background-color: transparent;
        backdrop-filter: none;
        min-width: auto;
        padding: 0;
        margin: 10px 0 0 0;
        box-shadow: none;
        border-radius: 0;
        gap: 10px;
        display: flex;
        flex-direction: column;
        pointer-events: auto;
    }
    
    .nav-links .sub-menu li {
        margin: 0;
    }
    
    .nav-links .sub-menu a {
        padding: 8px 0;
        margin: 0;
        font-size: 0.9rem;
        color: #666;
        border-bottom: none;
        text-align: center;
    }
    
    .nav-links .sub-menu a:hover {
        background-color: transparent;
        color: var(--primary-color);
        transform: none;
    }
    .hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    /* Hero Section Mobile */
    .hero {
        height: auto;
        min-height: 100vh;
        display: flex;
        align-items: center;
    }
    .hero-background {
        display: none; /* Hide the desktop background element */
    }
    .hero-container {
        flex-direction: column;
        justify-content: flex-start;
        padding: 0;
        height: 100%;
    }
    .hero-top {
        flex: 0 0 auto;
        background-color: #f5f5f5;
        padding: 20px 20px 30px;
        margin-top: -50px; /* Pull the content up */
    }
    .hero-bottom {
        flex: 1 0 950px; /* Give it a minimum height */
        background-image: url('../images/herobackgroundmain_mobile.png');
        background-position: center top;
        width: 100%;
    }
    .master-profile {
        background-color: transparent;
        backdrop-filter: none;
        padding: 0;
        max-width: 100%;
        color: var(--text-color);
    }
    .master-name, .master-eng-name, .company-name, .company-reg, .timeline li, .timeline li span, .timeline li.no-line i {
        color: var(--text-color) !important;
    }
    .master-eng-name, .company-reg, .timeline li span, .timeline li.no-line i {
        color: #555 !important;
    }
    .timeline::before {
        background-color: var(--accent-color);
    }
    .timeline li:not(.no-line)::before {
        background-color: var(--text-color);
        border-color: var(--accent-color);
    }
   .master-name { 
       font-size: 2.2rem; 
       margin-top: 0;
       margin-bottom: 5px;
   }
   .master-eng-name { 
       font-size: 1.3rem; 
       color: #555;
       margin-top: 0;
       margin-bottom: 5px;
   }

    /* Services Section Mobile */
    .services-container { grid-template-columns: 1fr; }
    .services-title-container { position: static; margin-bottom: 40px; }
    .section-title-vertical { writing-mode: horizontal-tb; font-size: 2rem; letter-spacing: 5px; }
    .section-title-main { font-size: 1.8rem; }
    .services-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }

    .values-grid { grid-template-columns: 1fr; }
    .philosophy-item { flex-direction: column; text-align: center; }
    .philosophy-item img { margin-bottom: 20px; }
}

@media (max-width: 480px) {
    .services-grid { grid-template-columns: 1fr; }
    .contact-methods { gap: 30px; }
}
