/*
Theme Name: KG Railing & Wood Finish
Theme URI: https://kghomecraft.com/
Author: KG Home Craft Team
Author URI: https://kghomecraft.com/
Description: Minimal, high-end architectural WordPress theme for custom stair companies.
Version: 6.14
License: GNU General Public License v2 or later
Text Domain: ascend
*/

/* ================================
   RESET
================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ================================
   BASE
================================ */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #F5F5F5;
    color: #1A1A1A;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ================================
   TYPOGRAPHY
================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #1A1A1A;
}

.section-title {
    letter-spacing: -0.02em;
    line-height: 1.15;
}

p {
    color: #555;
    font-size: 0.95rem;
}

/* ================================
   LINKS
================================ */
a {
    text-decoration: none;
    color: inherit;
    transition: color 0.25s ease;
}

/* ================================
   IMAGES
================================ */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ================================
   CONTAINER
================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ================================
   BUTTONS
================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.25s ease;
    cursor: pointer;
}

/* ================================
   SCROLL ANIMATION (PROPER)
================================ */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22,1,0.36,1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================
   LIGHTBOX
================================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

.lightbox-close { top: 30px; right: 40px; }
.lightbox-prev { left: 40px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 40px; top: 50%; transform: translateY(-50%); }

/* ================================
   MOBILE MENU
================================ */
body.menu-open {
    overflow: hidden;
}

/* ================================
   SCROLLBAR
================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb {
    background: #cfcfcf;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* ================================
   SELECTION
================================ */
::selection {
    background: #1E3A5F;
    color: #fff;
}

/* ================================
   SPACING SYSTEM (CLEAN)
================================ */
.section-large { padding: 140px 0; }
.section-medium { padding: 110px 0; }
.section-tight { padding: 70px 0; }

@media (max-width: 768px) {
    .section-large { padding: 90px 0; }
    .section-medium { padding: 70px 0; }
    .section-tight { padding: 50px 0; }
}

/* ================================
   MARQUEE (FINAL FIX)
================================ */
@keyframes marquee {
    0% { transform: translate3d(0,0,0); }
    100% { transform: translate3d(-50%,0,0); }
}

.marquee {
    animation: marquee 36s linear infinite;
    will-change: transform;
}

/* Tablet */
@media (max-width: 1024px) {
    .marquee {
        animation-duration: 24s;
    }
}

/* Mobile (FIXED SPEED) */
@media (max-width: 768px) {
    .marquee {
        animation-duration: 14s;
    }
}

/* ================================
   MARQUEE FADE EDGES
================================ */
.marquee-wrapper {
    position: relative;
    overflow: hidden;
}

.marquee-wrapper::before,
.marquee-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 2;
}

.marquee-wrapper::before {
    left: 0;
    width: 120px;
    background: linear-gradient(to right, #fff 10%, transparent);
}

.marquee-wrapper::after {
    right: 0;
    width: 120px;
    background: linear-gradient(to left, #fff 10%, transparent);
}

@media (max-width: 768px) {
    .marquee-wrapper::before,
    .marquee-wrapper::after {
        width: 60px;
    }
}

/* ================================
   SERVICE CARDS
================================ */
.service-card {
    padding: 28px;
    border: 1px solid #eee;
    border-radius: 14px;
    background: #fff;
    transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), 
                box-shadow 0.35s ease;
    will-change: transform;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
}

.js-enabled .fade-up {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
}

.js-enabled .fade-up.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* FIX CLICK BLOCKING OVERLAYS */
.absolute {
    pointer-events: none;
}

/* ================================
   FAQ ACCORDION (FINAL FIX)
================================ */

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.22,1,0.36,1);
}

.faq-item.active .faq-answer {
    max-height: 500px; /* enough for content */
}

/* OPTIONAL: smoother feel */
.faq-item {
    transition: background 0.3s ease;
}

.faq-item.active {
    background: #fafafa;
}