/*
 * custom.css — theme.json 无法覆盖的补充样式
 *
 * 规范：
 * - 禁止重复定义 theme.json 已控制的属性
 * - 引用设计 token 必须使用 var(--wp--preset--*) 格式
 * - 断点变量：--wp--custom--breakpoints--{mobile|tablet|desktop|wide}
 */

/* ========================================
   Base Styles
   ======================================== */

/* Icon Styles */
.cclee-icon {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-bottom: var(--wp--preset--spacing--30);
}
.cclee-icon svg {
	color: var(--wp--preset--color--accent);
	transition: transform var(--wp--custom--transition--normal) var(--wp--custom--easing--default);
}
.cclee-icon:hover svg {
	transform: scale(1.1);
}

/* Skip to content - accessibility */
.skip-to-content-link {
    position: absolute;
    left: -9999px;
}
.skip-to-content-link:focus {
    left: 0;
    top: 0;
    z-index: 9999;
    padding: 8px 16px;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--base);
}

/* Header height variable (dynamic via JS, fallback for SSR) */
:root {
    --header-height: 72px;
    --admin-bar-height: 0px;
}
.admin-bar {
    --admin-bar-height: 32px;
}
@media screen and (max-width: 782px) {
    .admin-bar {
        --admin-bar-height: 46px;
    }
}

/* Site header - sticky */
.site-header {
    position: fixed;
    top: var(--admin-bar-height);
    left: 0;
    right: 0;
    z-index: 100;
    background-color: transparent;
    transition: background-color var(--wp--custom--transition--normal) var(--wp--custom--easing--default),
                box-shadow var(--wp--custom--transition--normal) var(--wp--custom--easing--default);
}

/* Header: Scrolled state (solid glass effect) */
.site-header.is-scrolled {
    background-color: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Header: Transparent variant (default for hero pages) */
.site-header--transparent {
    background-color: transparent !important;
}

.site-header--transparent .site-header__inner {
    border-bottom: none;
}

/* Header inner container - responsive padding */
.site-header__inner {
    padding-left: var(--wp--preset--spacing--50) !important;
    padding-right: var(--wp--preset--spacing--50) !important;
}

@media (max-width: 782px) {
    .site-header__inner {
        padding-left: var(--wp--preset--spacing--30) !important;
        padding-right: var(--wp--preset--spacing--30) !important;
    }
}

/* Header text color for transparent mode - white with shadow for any background */
.site-header--transparent .wp-block-site-title a,
.site-header--transparent .wp-block-site-title,
.site-header--transparent .wp-block-navigation__container a,
.site-header--transparent .wp-block-navigation a,
.site-header--transparent .wp-block-loginout a {
    color: #ffffff !important;
    text-decoration: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.site-header--transparent .wp-block-site-title a:hover,
.site-header--transparent .wp-block-navigation a:hover,
.site-header--transparent .wp-block-loginout a:hover {
    color: var(--wp--preset--color--accent) !important;
}

/* Header: Solid state (after scroll) */
.site-header--transparent.is-scrolled {
    background-color: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.site-header--transparent.is-scrolled .wp-block-site-title a,
.site-header--transparent.is-scrolled .wp-block-site-title,
.site-header--transparent.is-scrolled .wp-block-navigation__container a,
.site-header--transparent.is-scrolled .wp-block-navigation a,
.site-header--transparent.is-scrolled .wp-block-loginout a {
    color: var(--wp--preset--color--primary) !important;
    text-shadow: none;
}

.site-header--transparent.is-scrolled .wp-block-site-title a:hover,
.site-header--transparent.is-scrolled .wp-block-navigation a:hover,
.site-header--transparent.is-scrolled .wp-block-loginout a:hover {
    color: var(--wp--preset--color--accent) !important;
}

/* Header: Solid variant (for non-hero pages) */
.site-header--solid {
    background-color: var(--wp--preset--color--base);
    border-bottom: 1px solid var(--wp--preset--color--neutral-200);
    position: sticky;
}

.site-header--solid .wp-block-site-title a,
.site-header--solid .wp-block-navigation a {
    color: var(--wp--preset--color--primary);
}

/* Adjust main content for fixed header */
body:has(.site-header) .wp-site-blocks,
body:has(.site-header) main {
    padding-top: 0;
    margin-top: 0;
}

/* Hero section: negative margin pulls up, padding keeps content visible */
.wp-site-blocks > .wp-block-group.alignfull:first-of-type {
    margin-top: calc(-1 * var(--header-height) - var(--admin-bar-height)) !important;
    padding-top: calc(var(--wp--preset--spacing--80) + var(--header-height) + var(--admin-bar-height)) !important;
}

/* Hide WooCommerce mini-cart if Woo not active */
body:not(.woocommerce-active) .woo-cart-icon {
    display: none;
}

/* ========================================
   Block Styles
   ======================================== */

/* Button: Outline */
.wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent;
    border: 2px solid var(--wp--preset--color--primary);
    color: var(--wp--preset--color--primary);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--base);
}

/* Group: Card */
.wp-block-group.is-style-card {
    background-color: var(--wp--preset--color--base);
    border: 1px solid var(--wp--preset--color--neutral-200);
    border-radius: 8px;
    padding: var(--wp--preset--spacing--40);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Separator: Thick */
.wp-block-separator.is-style-thick {
    height: 3px;
    background-color: var(--wp--preset--color--accent);
    border: none;
}

/* Quote: Accent Border */
.wp-block-quote.is-style-accent-border {
    border-left: 4px solid var(--wp--preset--color--accent);
    padding-left: var(--wp--preset--spacing--40);
    border-top: none;
    border-right: none;
    border-bottom: none;
}
.wp-block-quote.is-style-accent-border cite {
    font-style: normal;
    color: var(--wp--preset--color--neutral-500);
}

/* Image: Rounded */
.wp-block-image.is-style-rounded img {
    border-radius: var(--wp--custom--border--radius--lg);
}

/* Image: Shadow */
.wp-block-image.is-style-shadow img {
    box-shadow: var(--wp--preset--shadow--card);
    border-radius: var(--wp--custom--border--radius--md);
}

/* List: Checkmark */
.wp-block-list.is-style-checkmark {
    list-style: none;
    padding-left: 0;
}
.wp-block-list.is-style-checkmark li {
    position: relative;
    padding-left: 1.5em;
}
.wp-block-list.is-style-checkmark li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--wp--preset--color--accent);
    font-weight: 700;
}
.wp-block-list.is-style-checkmark li::marker {
    content: none;
}

/* Pricing Cards */
.wp-block-columns .wp-block-column .wp-block-group.has-accent-background-color {
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: scale(1.02);
    z-index: 1;
}

/* ========================================
   Pattern-Specific Styles
   ======================================== */

/* Timeline: Fixed circle dot */
.wp-block-group.cclee-timeline-dot {
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    min-height: 80px !important;
    flex-shrink: 0 !important;
    aspect-ratio: unset !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    box-sizing: border-box !important;
    text-align: center !important;
    padding: 0 !important;
}

.wp-block-group.cclee-timeline-dot p {
    margin: 0 !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    overflow: visible !important;
}

.wp-block-columns .wp-block-column:has(.cclee-timeline-dot) {
    flex-shrink: 0 !important;
    flex-basis: 100px !important;
    width: 100px !important;
}

/* Features Grid: Card style for columns */
.is-pattern-pricing .wp-block-column > .wp-block-group,
.wp-block-columns.is-style-cards .wp-block-column > .wp-block-group {
    height: 100%;
}

/* Testimonial Cards: Quote decoration */
.wp-block-columns .wp-block-column .wp-block-group.has-base-background-color .wp-block-quote {
    position: relative;
    margin: 0;
    padding: 0;
    border: none;
}
.wp-block-columns .wp-block-column .wp-block-group.has-base-background-color .wp-block-quote::before {
    content: '"';
    position: absolute;
    top: -0.3em;
    left: -0.1em;
    font-size: 4rem;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--wp--preset--color--accent);
    opacity: 0.2;
    line-height: 1;
    pointer-events: none;
}
.wp-block-columns .wp-block-column .wp-block-group.has-base-background-color .wp-block-quote p {
    font-style: italic;
    position: relative;
    z-index: 1;
}

/* ========================================
   Responsive Breakpoints
   ======================================== */

/* Mobile: < 640px */
@media screen and (max-width: 639px) {
    /* Columns: stack on mobile */
    .wp-block-columns {
        flex-direction: column;
        gap: var(--wp--preset--spacing--40);
    }
    .wp-block-column {
        flex-basis: 100% !important;
    }

    /* Headings: scale down */
    h1, .has-h-1-font-size {
        font-size: var(--wp--preset--font-size--xx-large) !important;
    }
    h2, .has-h-2-font-size {
        font-size: var(--wp--preset--font-size--x-large) !important;
    }

    /* Hero: reduce padding */
    [class*="hero"] .wp-block-group {
        padding-top: var(--wp--preset--spacing--50) !important;
        padding-bottom: var(--wp--preset--spacing--50) !important;
    }

    /* Buttons: full width on mobile */
    .wp-block-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    .wp-block-button {
        width: 100%;
    }
    .wp-block-button .wp-block-button__link {
        text-align: center;
    }
}

/* Tablet: 640px - 1023px */
@media screen and (min-width: 640px) and (max-width: 1023px) {
    /* 4-column layouts (team): become 2x2 */
    .wp-block-columns:not(.is-not-stacked-on-mobile) {
        flex-wrap: wrap;
    }
    .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
        flex-basis: calc(50% - var(--wp--preset--spacing--30)) !important;
    }
    .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column:nth-child(even) {
        margin-left: var(--wp--preset--spacing--30);
    }

    /* 2-column layouts (contact): maintain side by side */
    .wp-block-columns.has-2-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
        flex-basis: calc(50% - var(--wp--preset--spacing--40)) !important;
    }
}

/* Desktop: 1024px - 1279px */
@media screen and (min-width: 1024px) and (max-width: 1279px) {
    /* Standard desktop - no special overrides */
}

/* Wide: >= 1280px */
@media screen and (min-width: 1280px) {
    /* Wide screens - full layout */
}

/* ========================================
   Interactive States
   ======================================== */

/* Card hover effect */
.wp-block-group.is-style-card,
.wp-block-columns .wp-block-column > .wp-block-group:not(.cclee-timeline-dot) {
    transition: transform var(--wp--custom--transition--normal) var(--wp--custom--easing--default),
                box-shadow var(--wp--custom--transition--normal) var(--wp--custom--easing--default);
}
.wp-block-group.is-style-card:hover,
.wp-block-columns .wp-block-column > .wp-block-group:not(.cclee-timeline-dot):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Button transitions */
.wp-block-button__link {
    transition: all var(--wp--custom--transition--fast) var(--wp--custom--easing--default);
    position: relative;
    overflow: hidden;
}
.wp-block-button__link:hover {
    transform: translateY(-1px);
}
.wp-block-button__link:active {
    transform: translateY(0) scale(0.98);
}

/* Button ripple effect */
.wp-block-button__link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}
.wp-block-button__link:active::after {
    width: 200%;
    height: 200%;
}

/* Link transitions */
a {
    transition: color var(--wp--custom--transition--fast) var(--wp--custom--easing--default);
}

/* ========================================
   Avatar & Icon Components
   ======================================== */

/* Avatar with initials - replaces emoji placeholders */
.cclee-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    background: linear-gradient(135deg, var(--wp--preset--color--neutral-200) 0%, var(--wp--preset--color--neutral-300) 100%);
    color: var(--wp--preset--color--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cclee-avatar--lg {
    width: 80px;
    height: 80px;
    font-size: 1.75rem;
}

.cclee-avatar--md {
    width: 48px;
    height: 48px;
    font-size: 1rem;
}

.cclee-avatar--sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.cclee-avatar--accent {
    background: linear-gradient(135deg, var(--wp--preset--color--accent) 0%, #ea580c 100%);
    color: var(--wp--preset--color--base);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.cclee-avatar--ring {
    box-shadow: 0 0 0 3px var(--wp--preset--color--base), 0 0 0 5px var(--wp--preset--color--accent);
}

/* Icon container with background */
.cclee-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--wp--custom--border--radius--lg);
    background: linear-gradient(135deg, var(--wp--preset--color--neutral-100) 0%, var(--wp--preset--color--neutral-200) 100%);
    transition: transform var(--wp--custom--transition--normal) var(--wp--custom--easing--default),
                box-shadow var(--wp--custom--transition--normal) var(--wp--custom--easing--default);
}

.cclee-icon-box--accent {
    background: linear-gradient(135deg, var(--wp--preset--color--accent) 0%, #ea580c 100%);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}

.cclee-icon-box--accent svg {
    color: var(--wp--preset--color--base);
}

.cclee-icon-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Contact icon wrapper */
.cclee-contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--wp--custom--border--radius--md);
    background: var(--wp--preset--color--neutral-100);
    flex-shrink: 0;
}

.cclee-contact-icon svg {
    width: 20px;
    height: 20px;
    color: var(--wp--preset--color--accent);
}

/* ========================================
   Decorative Elements
   ======================================== */

/* Hero background decoration */
.cclee-hero-deco {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    pointer-events: none;
}

.cclee-hero-deco--1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    background: var(--wp--preset--color--base);
}

.cclee-hero-deco--2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: 10%;
    background: var(--wp--preset--color--base);
}

/* Dot pattern overlay */
.cclee-dots-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, currentColor 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.08;
    pointer-events: none;
}

/* Grid pattern overlay */
.cclee-grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, currentColor 1px, transparent 1px),
        linear-gradient(to bottom, currentColor 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.05;
    pointer-events: none;
}

/* ========================================
   Glassmorphism
   ======================================== */

.cclee-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.cclee-glass--dark {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   Timeline Enhancement
   ======================================== */

/* Timeline connector line */
.cclee-timeline-item {
    position: relative;
}

.cclee-timeline-item::before {
    content: '';
    position: absolute;
    left: 40px;
    top: 80px;
    bottom: -40px;
    width: 2px;
    background: linear-gradient(to bottom, var(--wp--preset--color--neutral-200) 0%, transparent 100%);
}

.cclee-timeline-item:last-child::before {
    display: none;
}

/* ========================================
   Stats Enhancement
   ======================================== */

.cclee-stat-number {
    background: linear-gradient(135deg, currentColor 0%, var(--wp--preset--color--neutral-200) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Entrance Animations
   ======================================== */

@keyframes cclee-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cclee-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cclee-scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cclee-animate-fade-in-up {
    animation: cclee-fadeInUp 0.6s var(--wp--custom--easing--default) forwards;
}

.cclee-animate-fade-in {
    animation: cclee-fadeIn 0.5s var(--wp--custom--easing--default) forwards;
}

.cclee-animate-scale-in {
    animation: cclee-scaleIn 0.4s var(--wp--custom--easing--default) forwards;
}

/* Staggered animation delays */
.cclee-animate-delay-1 { animation-delay: 0.1s; }
.cclee-animate-delay-2 { animation-delay: 0.2s; }
.cclee-animate-delay-3 { animation-delay: 0.3s; }
.cclee-animate-delay-4 { animation-delay: 0.4s; }

/* ========================================
   Price Gradient Text
   ======================================== */

.cclee-price-gradient {
    background: linear-gradient(135deg, var(--wp--preset--color--primary) 0%, var(--wp--preset--color--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Logo Cloud Enhancement
   ======================================== */

.cclee-logo-item {
    transition: transform var(--wp--custom--transition--normal) var(--wp--custom--easing--default),
                opacity var(--wp--custom--transition--normal) var(--wp--custom--easing--default);
    opacity: 0.6;
}

.cclee-logo-item:hover {
    transform: scale(1.05);
    opacity: 1;
}

/* ========================================
   Portfolio Card
   ======================================== */

/* Portfolio Card Hover Effect */
.cclee-portfolio-card {
    transition: box-shadow var(--wp--custom--transition--normal);
}
.cclee-portfolio-card:hover {
    box-shadow: var(--wp--preset--shadow--lg);
}
.cclee-portfolio-card img {
    transition: transform var(--wp--custom--transition--normal);
}
.cclee-portfolio-card:hover img {
    transform: scale(1.02);
}

/* ========================================
   Landing Page Styles
   ======================================== */

/* Landing Nav */
.landing-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--wp--preset--color--neutral-100);
}

.landing-exit-link a {
    color: var(--wp--preset--color--neutral-500);
    text-decoration: none;
    transition: color var(--wp--custom--transition--fast);
}

.landing-exit-link a:hover {
    color: var(--wp--preset--color--primary);
}

/* Landing Footer */
.landing-footer a {
    color: var(--wp--preset--color--neutral-500);
    text-decoration: none;
    transition: color var(--wp--custom--transition--fast);
}

.landing-footer a:hover {
    color: var(--wp--preset--color--primary);
}

/* Landing Video Container */
.landing-video-container {
    position: relative;
    overflow: hidden;
}

.landing-video-container video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.landing-video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* Landing Countdown */
.landing-countdown-item {
    text-align: center;
}

.landing-countdown-number {
    font-family: var(--wp--preset--font-family--heading);
}

/* Landing Trust Logo */
.landing-trust-logo img {
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all var(--wp--custom--transition--normal);
}

.landing-trust-logo:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

/* Landing Form */
.cclee-landing-form input:focus,
.cclee-landing-form textarea:focus {
    outline: none;
    border-color: var(--wp--preset--color--accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.cclee-landing-form button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.cclee-landing-form button:active {
    transform: translateY(0);
}

/* Landing Mobile Responsive */
@media screen and (max-width: 768px) {
    .landing-countdown-item {
        padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30) !important;
    }

    .landing-countdown-number {
        font-size: 2rem !important;
    }

    .landing-nav {
        padding-left: var(--wp--preset--spacing--30) !important;
        padding-right: var(--wp--preset--spacing--30) !important;
    }
}
