/**
 * Block Common Styles
 */

/* Block Spacing */
.wp-block {
    margin-bottom: 2rem;
}

.wp-block:last-child {
    margin-bottom: 0;
}

/* ACF Block Common */
[class^="dgf-"],
[class*=" dgf-"] {
    position: relative;
}

/* Block Animations (GSAP) */
.dgf-animate {
    opacity: 0;
}

.dgf-animate.is-visible {
    opacity: 1;
}

/* Editor Styles */
.acf-block-preview {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    position: relative;
}

.acf-block-preview:empty::after {
    content: 'ブロックを編集するにはクリックしてください';
    color: #999;
    font-style: italic;
}

/* Block Alignment - Frontend only */
body:not(.block-editor-page) .alignfull {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.alignwide {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Common Button Styles */
.wp-block-button__link,
.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    text-align: center;
}

.wp-block-button__link:hover,
.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Primary Button */
.wp-block-button.is-style-fill .wp-block-button__link,
.button--primary {
    background-color: var(--dgf-primary-color, #007cba);
    color: #fff;
    border-color: var(--dgf-primary-color, #007cba);
}

.wp-block-button.is-style-fill .wp-block-button__link:hover,
.button--primary:hover {
    background-color: var(--dgf-secondary-color, #005a87);
    border-color: var(--dgf-secondary-color, #005a87);
    color: #fff;
}

/* Outline Button */
.wp-block-button.is-style-outline .wp-block-button__link,
.button--outline {
    background-color: transparent;
    color: var(--dgf-primary-color, #007cba);
    border-color: var(--dgf-primary-color, #007cba);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.button--outline:hover {
    background-color: var(--dgf-primary-color, #007cba);
    color: #fff;
}

/* Block Loading State */
.dgf-block-loading {
    position: relative;
    min-height: 200px;
}

.dgf-block-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--dgf-primary-color, #007cba);
    border-radius: 50%;
    animation: dgf-spin 1s linear infinite;
}

@keyframes dgf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Block Error State */
.dgf-block-error {
    padding: 2rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    color: #dc2626;
    text-align: center;
}

/* Icon Styles */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: inherit;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* Responsive Block Utilities */
@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-on-desktop {
        display: none !important;
    }
}

/* Block Hover Effects */
.dgf-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dgf-hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.dgf-hover-scale {
    transition: transform 0.3s ease;
}

.dgf-hover-scale:hover {
    transform: scale(1.05);
}

/* Block Background Patterns */
.dgf-pattern-dots {
    position: relative;
}

.dgf-pattern-dots::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, currentColor 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.05;
    pointer-events: none;
}

/* Block Overlays */
.dgf-overlay {
    position: relative;
}

.dgf-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.dgf-overlay > * {
    position: relative;
    z-index: 2;
}

