/**
 * Gutenberg Blocks Styles
 * 古腾堡区块样式
 * 
 * Provides styling for:
 * - Core blocks
 * - Kadence Blocks
 * - Greenshift
 * - GenerateBlocks
 * - Stackable
 * 
 * @package DUX
 * @since 9.6
 */

/* ========================================
   Core Blocks
   ======================================== */

/* Alignments */
.alignwide {
    max-width: calc(100% + 200px);
    margin-left: -100px;
    margin-right: -100px;
}

.alignfull {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
}

/* Button Block */
.wp-block-button__link {
    border-radius: 4px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Outline button style */
.is-style-dux-outline .wp-block-button__link {
    background: transparent !important;
    border: 2px solid currentColor;
}

/* Rounded button style */
.is-style-dux-rounded .wp-block-button__link {
    border-radius: 50px;
}

/* Group Block */
.wp-block-group {
    margin-bottom: 30px;
}

.wp-block-group__inner-container {
    padding: 0;
}

/* Columns Block */
.wp-block-columns {
    margin-bottom: 30px;
}

.wp-block-column {
    margin-bottom: 0;
}

/* Cover Block */
.wp-block-cover {
    margin-bottom: 30px;
}

.wp-block-cover__inner-container {
    padding: 40px 20px;
}

/* Image Block */
.wp-block-image {
    margin-bottom: 30px;
}

.wp-block-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.wp-block-image figcaption {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* Gallery Block */
.wp-block-gallery {
    margin-bottom: 30px;
}

.wp-block-gallery .blocks-gallery-item {
    margin-bottom: 16px;
}

/* Quote Block */
.wp-block-quote {
    border-left: 4px solid var(--tb--main, #007BFF);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
}

.wp-block-quote cite {
    font-style: normal;
    font-size: 14px;
    color: #666;
}

/* Pullquote Block */
.wp-block-pullquote {
    border-top: 4px solid var(--tb--main, #007BFF);
    border-bottom: 4px solid var(--tb--main, #007BFF);
    padding: 30px 0;
    margin: 40px 0;
    text-align: center;
}

/* Code Block */
.wp-block-code {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 30px 0;
    overflow-x: auto;
}

.wp-block-code code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* Preformatted Block */
.wp-block-preformatted {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 30px 0;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* Table Block */
.wp-block-table {
    margin: 30px 0;
    overflow-x: auto;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
}

.wp-block-table th,
.wp-block-table td {
    padding: 12px;
    border: 1px solid #ddd;
}

.wp-block-table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Separator Block */
.wp-block-separator {
    border: none;
    border-top: 1px solid #ddd;
    margin: 40px 0;
}

.wp-block-separator.is-style-wide {
    border-top-width: 2px;
}

.wp-block-separator.is-style-dots {
    border: none;
    text-align: center;
}

.wp-block-separator.is-style-dots::before {
    content: '···';
    font-size: 24px;
    letter-spacing: 10px;
    color: #666;
}

/* Spacer Block */
.wp-block-spacer {
    clear: both;
}

/* Embed Block */
.wp-block-embed {
    margin: 30px 0;
}

.wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========================================
   Kadence Blocks
   ======================================== */

/* Row Layout */
.kb-row-layout-wrap {
    margin-bottom: 30px;
}

.kb-row-layout-inner {
    display: flex;
    flex-wrap: wrap;
}

/* Advanced Heading */
.kt-adv-heading {
    margin-bottom: 20px;
}

/* Advanced Button */
.kt-btn-wrap {
    margin-bottom: 20px;
}

.kt-button {
    transition: all 0.3s ease;
}

.kt-button:hover {
    transform: translateY(-2px);
}

/* Icon */
.kt-svg-icon {
    display: inline-flex;
    align-items: center;
}

/* Tabs */
.kt-tabs-wrap {
    margin-bottom: 30px;
}

.kt-tabs-title-list {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.kt-tab-title {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kt-tab-title:hover {
    background: #f5f5f5;
}

.kt-tab-title.kt-tab-title-active {
    border-bottom: 2px solid var(--tb--main, #007BFF);
    margin-bottom: -2px;
}

/* Accordion */
.kt-accordion-wrap {
    margin-bottom: 30px;
}

.kt-accordion-panel {
    border: 1px solid #ddd;
    margin-bottom: 10px;
    border-radius: 4px;
}

.kt-accordion-header {
    padding: 15px 20px;
    cursor: pointer;
    background: #f5f5f5;
    transition: background 0.3s ease;
}

.kt-accordion-header:hover {
    background: #e5e5e5;
}

.kt-accordion-panel-inner {
    padding: 20px;
}

/* ========================================
   Greenshift
   ======================================== */

/* Container */
.gs-container {
    margin-bottom: 30px;
}

/* Flexbox */
.gs-flexbox {
    display: flex;
    flex-wrap: wrap;
}

/* Grid */
.gs-grid {
    display: grid;
    gap: 20px;
}

/* Button */
.gs-button {
    transition: all 0.3s ease;
}

.gs-button:hover {
    transform: translateY(-2px);
}

/* ========================================
   GenerateBlocks
   ======================================== */

/* Container */
.gb-container {
    margin-bottom: 30px;
}

/* Grid */
.gb-grid-wrapper {
    display: grid;
    gap: 20px;
}

/* Button */
.gb-button {
    transition: all 0.3s ease;
}

.gb-button:hover {
    transform: translateY(-2px);
}

/* Headline */
.gb-headline {
    margin-bottom: 20px;
}

/* ========================================
   Stackable
   ======================================== */

/* Container */
.stk-block-container {
    margin-bottom: 30px;
}

/* Columns */
.stk-block-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Button */
.stk-button {
    transition: all 0.3s ease;
}

.stk-button:hover {
    transform: translateY(-2px);
}

/* Card */
.stk-block-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stk-block-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .alignwide {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .alignfull {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
    }
    
    .wp-block-columns {
        flex-direction: column;
    }
    
    .wp-block-column {
        flex-basis: 100% !important;
    }
    
    .kb-row-layout-inner {
        flex-direction: column;
    }
    
    .gs-flexbox {
        flex-direction: column;
    }
    
    .stk-block-columns {
        flex-direction: column;
    }
}

/* ========================================
   Dark Mode Support
   ======================================== */

.darking .wp-block-code,
.darking .wp-block-preformatted {
    background: #2a2a2a;
    border-color: #444;
    color: #ccc;
}

.darking .wp-block-table th {
    background: #2a2a2a;
}

.darking .wp-block-table th,
.darking .wp-block-table td {
    border-color: #444;
}

.darking .kt-accordion-header {
    background: #2a2a2a;
}

.darking .kt-accordion-header:hover {
    background: #333;
}

.darking .stk-block-card {
    border-color: #444;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .wp-block-button,
    .kt-button,
    .gs-button,
    .gb-button,
    .stk-button {
        display: none;
    }
}
