/*
 Theme Name:   Astra Child - Woven Grace
 Description:  A custom child theme for a Tatting Designer based on Astra. All core styles are managed via theme.json.
 Author:       Your Name
 Template:     astra
 Version:      1.1.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  astra-child-wovengrace
*/

/* 
 * This file is for CSS overrides, complex styles, and utility classes not covered by theme.json.
 * It serves both frontend and editor styles.
*/

/* --- Header Navigation Menu Styles --- */
/*
 * Consistent with the 'Woven Grace' theme design system.
 * Targets Astra's primary navigation menu.
*/

/* 
 * Target the site title's link element. 
 * Using a more specific selector to avoid conflicts.
 */
 .site-header .site-branding .site-title a {
    /* --- Typography --- */
    /* 1. Use the elegant serif font defined in your theme.json. */
    font-family: var(--wp--preset--font-family--serif-display, "Playfair Display", serif);
    
    /* 2. Set a suitable font size. Adjust as needed. */
    font-size: 1.75rem; /* ~28px */
    
    /* 3. Set the font weight. 700 is bold, 600 is a good semi-bold option. */
    font-weight: 700;
    
    /* 4. Ensure proper line height for good spacing. */
    line-height: 1.2;
    
    /* --- Color --- */
    /* 5. Use your primary text color. This provides good contrast. */
    color: var(--wp--preset--color--primary-text, #2C2C2C);
    
    /* --- Spacing & Alignment --- */
    /* 6. A small tweak to vertically align it better with the logo. */
    /*    This might need adjustment based on your logo's size. */
    position: relative;
    top: -2px; 
    
    /* --- Effects --- */
    /* 7. Add a smooth transition for the hover effect. */
    transition: color 0.3s ease;
}

/* 
 * Style for the hover state.
 * The color changes to your accent color on hover.
 */
.site-header .site-branding .site-title a:hover {
    color: var(--wp--preset--color--accent, #8B7355);
}

/**
 * ==========================================================================
 * RESPONSIVE STYLES FOR SITE TITLE
 *
 * Adjusts the site title for smaller screens like tablets and mobiles.
 * ==========================================================================
 */
@media (max-width: 768px) {
    .site-header .site-branding .site-title a {
        /* On smaller screens, slightly reduce the font size to save space. */
        font-size: 1.5rem; /* ~24px */
    }
}

/* 为整个主头部区域添加一个微妙的下边框，以分隔内容 */
.woven-grace-theme .main-header-bar {
    border-bottom: 1px solid var(--wp--preset--color--subtle-border);
}

/* 菜单项链接的基础样式 */
.woven-grace-theme .main-header-menu .menu-link {
    font-family: var(--wp--preset--font-family--sans-serif-body);
    font-size: 0.95rem; /* 略大于按钮，或根据喜好调整为 1rem */
    font-weight: 400; /* 正常字重 */
    color: var(--wp--preset--color--primary-text);
    text-transform: uppercase; /* 大写字母，增加正式感 */
    letter-spacing: 1.2px; /* 与按钮风格类似的字母间距 */
    text-decoration: none;
    padding-top: 30px;    /* 增加垂直内边距以撑开header高度 */
    padding-bottom: 30px;
    padding-left: 18px;
    padding-right: 18px;
    background-color: transparent;
    border: none;
    position: relative; /* 为下划线动画做准备 */
    transition: color 0.3s ease; /* 平滑的颜色过渡 */
}

@media (min-width: 993px) { 
    /* 优雅的下划线动画效果 */
    .woven-grace-theme .main-header-menu .menu-link::after {
        content: '';
        position: absolute;
        bottom: 20px; /* 调整下划线与文字的距离 */
        left: 18px;  /* 与左右内边距对齐 */
        right: 18px; /* 与左右内边距对齐 */
        height: 2px;
        background-color: var(--wp--preset--color--accent); /* 使用您的主色调 */
        transform: scaleX(0); /* 初始状态：隐藏 */
        transform-origin: center; /* 从中心开始扩展 */
        transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1); /* 一个更流畅的缓动效果 */
    }

    
    /* 鼠标悬停时，触发下划线动画 */
    .woven-grace-theme .main-header-menu .menu-item:hover > .menu-link::after {
        transform: scaleX(1); /* 完全显示下划线 */
    }

    
    /* 确保当前选中项也始终显示下划线 */
    .woven-grace-theme .main-header-menu .current-menu-item > .menu-link::after,
    .woven-grace-theme .main-header-menu .current_page_item > .menu-link::after {
        transform: scaleX(1); /* 默认显示下划线 */
    }
}

/* 鼠标悬停（Hover）在菜单项上时的样式 */
.woven-grace-theme .main-header-menu .menu-item:hover > .menu-link {
    color: var(--wp--preset--color--accent); /* 悬停时文字变为您的主色调 */
}

/* 当前页面或当前选中项（Active）的样式 */
.woven-grace-theme .main-header-menu .current-menu-item > .menu-link,
.woven-grace-theme .main-header-menu .current_page_item > .menu-link {
    color: var(--wp--preset--color--accent); /* 选中项文字也是主色调 */
    font-weight: 700; /* 加粗以示突出 */
}

/* Default Button Styles */
.woven-grace-theme .ast-button,
.woven-grace-theme .button,
.woven-grace-theme .wp-block-button__link,
.woven-grace-theme .wp-block-button .wp-block-button__link,
/* Traditional WooCommerce Buttons */
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce button[name="update_cart"],
.woocommerce .checkout-button,
/* WooCommerce Block-Based Buttons (Cart, Checkout etc.) */
.wc-block-components-button.wp-element-button {
    background-color: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--white);
    border-radius: 2px;
    font-family: var(--wp--preset--font-family--sans-serif-body);
    letter-spacing: 1.5px;
    text-transform: none;
    font-size: 0.9rem;
    padding: 12px 24px;
    border: none;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.woven-grace-theme .ast-button:hover,
.woven-grace-theme .button:hover,
.woven-grace-theme .wp-block-button__link:hover,
.woven-grace-theme .wp-block-button .wp-block-button__link:hover,
/* Traditional WooCommerce Buttons */
.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce button[name="update_cart"]:hover,
.woocommerce .checkout-button:hover,
/* WooCommerce Block-Based Buttons (Cart, Checkout etc.) */
.wc-block-components-button.wp-element-button:hover {
    background-color: var(--wp--preset--color--accent-dark);
    color: var(--wp--preset--color--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 115, 85, 0.3);
}

/* Outline Button Styles */
.woven-grace-theme .wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent;
    color: var(--wp--preset--color--accent);
    border: 1px solid var(--wp--preset--color--accent);
    border-radius: 2px;
    font-family: var(--wp--preset--font-family--sans-serif-body);
    letter-spacing: 1.5px;
    text-transform: none;
    font-size: 0.9rem;
    padding: 12px 24px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.woven-grace-theme .wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(139, 115, 85, 0.3);
}

/* Hero Outline White Button Styles */
.woven-grace-theme .wp-block-button.is-style-hero-outline-white .wp-block-button__link {
    background-color: transparent;
    color: var(--wp--preset--color--white);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    font-family: var(--wp--preset--font-family--sans-serif-body);
    letter-spacing: 1.5px;
    text-transform: none;
    font-size: 0.9rem;
    padding: 12px 24px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.woven-grace-theme .wp-block-button.is-style-hero-outline-white .wp-block-button__link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--wp--preset--color--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
}

/* --- Category Card Hover Effect --- */

/* Base styles for the category card */
.woven-grace-theme .category-card {
    position: relative; /* Needed for the overlay and text positioning */
    overflow: hidden;   /* This is CRUCIAL for the image zoom effect */
    border-radius: 4px; /* Optional: adds a slight rounded corner */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* A very subtle base shadow */
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1); /* A smooth transition for all properties */
}

/* The background image inside the card */
.woven-grace-theme .category-card .uagb-container-inner-blocks-wrap {
    /* Spectra places the background image on this element */
    /* We target it for the zoom effect */
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* The text (heading) inside the card */
.woven-grace-theme .category-card .uagb-heading-text {
    /* Ensure text has a transition too */
    transition: color 0.35s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4); /* Add a subtle shadow for readability */
}

/* --- The HOVER State --- */

/* When the card is hovered */
.woven-grace-theme .category-card:hover {
    transform: translateY(-8px); /* 1. The "Lift" effect */
    box-shadow: 0 10px 20px rgba(44, 44, 44, 0.15); /* 2. The "Soft Shadow" effect */
}

/* When the card is hovered, zoom the image */
.woven-grace-theme .category-card:hover .uagb-container-inner-blocks-wrap {
    transform: scale(1.05); /* 3. The "Image Zoom" effect (enlarges by 5%) */
}

/* When the card is hovered, highlight the text */
.woven-grace-theme .category-card:hover .uagb-heading-text {
    color: var(--wp--preset--color--accent) !important; /* 4. The "Text Highlight" effect */
}

/* Optional: Add a subtle overlay on hover to make text pop more */
.woven-grace-theme .category-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 50%); /* Gradient from bottom */
    opacity: 0;
    transition: opacity 0.35s ease;
}

.woven-grace-theme .category-card:hover::after {
    opacity: 1;
}

/*.woven-grace-theme .wp-block-uagb-advanced-heading,
.woven-grace-theme .wp-block-heading,
.editor-styles-wrapper .wp-block-uagb-advanced-heading,
.editor-styles-wrapper .wp-block-heading {
    margin-bottom: 1.5rem;
} */

/** link styles */
/*.woven-grace-theme a,
editor-styles-wrapper a {
    color: var(--wp--preset--color--accent);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.woven-grace-theme a:hover,
editor-styles-wrapper a:hover {
    color: var(--wp--preset--color--accent-dark);
    text-decoration: underline;
}*/

/* 
 * A reusable class for sections with a secondary background color.
 * Applied to a Spectra Container's "Additional CSS Class" field.
 * Using woven-grace-theme class for specificity instead of !important.
*/
.woven-grace-theme .textured-background,
.editor-styles-wrapper .textured-background {
    background-color: var(--wp--preset--color--secondary-background);
    padding: 4rem 2rem;
}

/* 
 * A reusable class for applying the special handwritten font style.
 * Applied to a Heading or Paragraph block's "Additional CSS Class" field.
*/
.font-signature,
.editor-styles-wrapper .font-signature {
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    color: var(--wp--preset--color--accent);
}


/* --- Spectra Block Tweaks (if necessary) --- */

/* 
 * Most Spectra styles should inherit from theme.json. 
 * Only add rules here if a style is not being applied correctly.
*/

/* Example: Ensure Spectra headings also use the serif font by default */
.wp-block-uagb-advanced-heading .uagb-heading-text,
.editor-styles-wrapper .wp-block-uagb-advanced-heading .uagb-heading-text {
    font-family: var(--wp--preset--font-family--serif-display);
}

/* Example: Style for the focus state on Spectra Forms */
.wp-block-uagb-forms .uagb-forms-input:focus,
.editor-styles-wrapper .wp-block-uagb-forms .uagb-forms-input:focus {
    border-color: var(--wp--preset--color--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 115, 85, 0.2); /* elegant-brown with 20% opacity */
}

/* --- Copyright / Footer Bottom Bar (Common Addition) --- */
/* This styles the standard Astra copyright bar at the very bottom */
.site-footer .site-footer-section .uagb-heading-text {
    font-family: var(--wp--preset--font-family--serif-display);
    color: var(--wp--preset--color--primary-text);
}

/* --- Footer Links Styling --- */
.site-footer .site-footer-section .wp-block-list a {
    color: var(--wp--preset--color--accent);
    text-decoration: none;
    transition: all 0.3s ease;
}

/* --- Footer Links Hover Effect --- */
.site-footer .site-footer-section .wp-block-list a:hover {
    color: var(--wp--preset--color--accent-dark);
    /* Add a subtle visual cue on hover */
    padding-left: 5px; 
}

@media (max-width: 768px) {
    .woven-grace-theme .textured-background,
    .woven-grace-theme .editor-styles-wrapper .textured-background {
        padding: 3rem 1.5rem;
    }

    /* Example: Reduce heading sizes on smaller screens if needed */
    h1, .h1 {
        /* Fluid typography in theme.json should handle this, but you can override here if needed */
    }
}

@media (max-width: 480px) {
    .woven-grace-theme .textured-background,
    .woven-grace-theme .editor-styles-wrapper .textured-background {
        padding: 2.5rem 1rem;
    }
}