/*
Theme Name: JAGA Theme
Author: siseidodesign.inc
Description: JAGA (Japan Association of Governmental Accounting) Official Theme.
Version: 1.0
*/

html {
    scroll-behavior: smooth;
}

/* Offset for sticky header when jumping to anchor links */
:target {
    scroll-margin-top: 70px;
}

body.admin-bar :target {
    scroll-margin-top: calc(70px + 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar :target {
        scroll-margin-top: calc(70px + 46px);
    }
}

:root {
    --jaga-header-max-width: 1600px; /* フロントとエディタープレビューのヘッダー最大幅を同期するための変数 */
}

/* ==========================================================================
   Global Typography Settings
   ========================================================================== */

/* Link transitions */
a {
    transition: opacity 0.25s ease, color 0.25s ease;
}

a:hover {
    opacity: 0.75;
}

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

/* Base Button - Uses theme.json and Editor settings */
.wp-block-button__link {
    display: inline-block;
    text-align: left;
    vertical-align: middle;
    position: relative;
    font-family: var(--wp--preset--font-family--noto-sans-jp);
    transition: opacity 0.2s ease, color 0.3s ease-in-out, filter 0.3s ease;
    min-height: 40px;
}

/* Link type icon styles */
.wp-block-button__link[href$=".pdf" i]::before,
.wp-block-button__link[href*=".pdf?" i]::before,
.wp-block-button__link[href^="#"]::before,
.wp-block-button__link[href$=".zip" i]::before,
.wp-block-button__link[href$=".tar" i]::before,
.wp-block-button__link[href$=".gz" i]::before,
.wp-block-button__link[href$=".rar" i]::before,
.wp-block-button__link[href$=".7z" i]::before,
.wp-block-button__link[href$=".doc" i]::before,
.wp-block-button__link[href$=".docx" i]::before,
.wp-block-button__link[href$=".xls" i]::before,
.wp-block-button__link[href$=".xlsx" i]::before,
.wp-block-button__link[href$=".csv" i]::before,
.wp-block-button__link[href$=".ppt" i]::before,
.wp-block-button__link[href$=".pptx" i]::before {
    content: "";
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    vertical-align: -0.2em;
    margin-right: 0.5em;
    background-color: var(--jaga-button-icon-color-override, #ffffff);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/* PDF Icon (White default) */
.wp-block-button__link[href$=".pdf" i]::before,
.wp-block-button__link[href*=".pdf?" i]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v1.25c0 .41-.34.75-.75.75s-.75-.34-.75-.75V8c0-.55.45-1 1-1h10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1h2c.83 0 1.5.67 1.5 1.5v3.5zm3.75-2.75c0 .41-.34.75-.75.75H18v1.25c0 .41-.34.75-.75.75s-.75-.34-.75-.75V8c0-.55.45-1 1-1h2c.41 0 .75.34.75.75s-.34.75-.75.75H18v1h1.25c.41 0 .75.34.75.75zM9 10h1V8H9v2zm4.5 2h1V8h-1v4zM4 6c0-.55-.45-1-1-1s-1 .45-1 1v14c0 1.1.9 2 2 2h14c.55 0 1-.45 1-1s-.45-1-1-1H4V6z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v1.25c0 .41-.34.75-.75.75s-.75-.34-.75-.75V8c0-.55.45-1 1-1h10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1h2c.83 0 1.5.67 1.5 1.5v3.5zm3.75-2.75c0 .41-.34.75-.75.75H18v1.25c0 .41-.34.75-.75.75s-.75-.34-.75-.75V8c0-.55.45-1 1-1h2c.41 0 .75.34.75.75s-.34.75-.75.75H18v1h1.25c.41 0 .75.34.75.75zM9 10h1V8H9v2zm4.5 2h1V8h-1v4zM4 6c0-.55-.45-1-1-1s-1 .45-1 1v14c0 1.1.9 2 2 2h14c.55 0 1-.45 1-1s-.45-1-1-1H4V6z'/%3E%3C/svg%3E");
}

/* Anchor Link Icon (White default) */
.wp-block-button__link[href^="#"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z'/%3E%3C/svg%3E");
}

/* Zip/Archive Icon (White default) */
.wp-block-button__link[href$=".zip" i]::before,
.wp-block-button__link[href$=".tar" i]::before,
.wp-block-button__link[href$=".gz" i]::before,
.wp-block-button__link[href$=".rar" i]::before,
.wp-block-button__link[href$=".7z" i]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-6 3h2v2h-2V9zm0 4h2v2h-2v-2zm-2-2h2v2h-2v-2zm0 4h2v2h-2v-2zm-2-4h2v2H8V9zm0 4h2v2H8v-2z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-6 3h2v2h-2V9zm0 4h2v2h-2v-2zm-2-2h2v2h-2v-2zm0 4h2v2h-2v-2zm-2-4h2v2H8V9zm0 4h2v2H8v-2z'/%3E%3C/svg%3E");
}

/* Word/Doc Icon (White default) */
.wp-block-button__link[href$=".doc" i]::before,
.wp-block-button__link[href$=".docx" i]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
}

/* Excel/CSV Icon (White default) */
.wp-block-button__link[href$=".xls" i]::before,
.wp-block-button__link[href$=".xlsx" i]::before,
.wp-block-button__link[href$=".csv" i]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3Cpath d='M8 11h3v2H8zm0 3h3v2H8zm4-3h3v2h-3zm0 3h3v2h-3z' fill='%23ffffff'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3Cpath d='M8 11h3v2H8zm0 3h3v2H8zm4-3h3v2h-3zm0 3h3v2h-3z' fill='%23ffffff'/%3E%3C/svg%3E");
}

/* PowerPoint Icon (White default) */
.wp-block-button__link[href$=".ppt" i]::before,
.wp-block-button__link[href$=".pptx" i]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
}





/* Arrow & Circle Styles (Opt-in) */
.wp-block-button[class*="is-style-arrow"] .wp-block-button__link,
.wp-block-button[class*="is-style-circle"] .wp-block-button__link {
    background-color: transparent;
    color: #1c1c1c; /* Default text color to Off-black */
    padding: 0 !important;
    padding-right: 50px !important;
    border: none !important;
    border-radius: 0 !important;
}

/* Green Circle (Default for Arrow styles) */
.wp-block-button[class*="is-style-arrow"] .wp-block-button__link::after,
.wp-block-button[class*="is-style-circle"] .wp-block-button__link::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: var(--jaga-button-circle-bg, var(--wp--preset--color--primary));
    border-radius: 50%;
    z-index: 1;
}

/* Arrow Icon (Chevron) */
.wp-block-button[class*="is-style-arrow"] .wp-block-button__link::before,
.wp-block-button[class*="is-style-circle"] .wp-block-button__link::before {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--jaga-button-arrow-color, #fff);
    border-right: 2px solid var(--jaga-button-arrow-color, #fff);
    transform: translateY(-50%) rotate(45deg);
    z-index: 2;
    transition: border-color 0.2s ease, right 0.2s ease;
}

.wp-block-button__link:hover::before {
    right: 14px !important;
}


/* Custom Circle Colors */
.wp-block-button.is-style-circle-secondary {
    --jaga-button-circle-bg: var(--wp--preset--color--secondary);
}
.wp-block-button.is-style-circle-contrast {
    --jaga-button-circle-bg: var(--wp--preset--color--contrast);
}


/* With Arrow Style (Standard button with chevron) */
.wp-block-button.is-style-with-arrow .wp-block-button__link {
    padding-right: 48px !important;
}

.wp-block-button.is-style-with-arrow .wp-block-button__link::after {
    content: "";
    position: absolute;
    right: 20px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
    z-index: 1;
    transition: right 0.2s ease;
}



.wp-block-button.is-style-with-arrow .wp-block-button__link:hover::after {
    right: 14px;
}



/* ==========================================================================
   Layout Spacing
   ========================================================================== */

section, article {
    padding: 40px 16px;
}

@media (min-width: 782px) {
    section, article {
        padding: 80px 40px; /* 0から40pxに拡張し、PCでの最低横パディングを確保 */
    }
}

@media (max-width: 781px) {
    /* Grid SP Layouts (Dynamic Input) - High Specificity */
    .wp-block-group.is-layout-grid[data-sp-columns]:not([data-sp-columns="0"]),
    .wp-block-post-template.is-layout-grid[data-sp-columns]:not([data-sp-columns="0"]),
    .wp-block-columns[data-sp-columns]:not([data-sp-columns="0"]),
    [class*="is-layout-grid"][data-sp-columns]:not([data-sp-columns="0"]),
    [class*="is-layout-grid"][style*="--sp-columns"],
    .wp-block-jaga-users-loop[data-sp-columns]:not([data-sp-columns="0"]),
    /* Editor support */
    .wp-block[data-type="jaga/users-loop"][data-sp-columns]:not([data-sp-columns="0"]) .jaga-users-loop-editor-container .block-editor-inner-blocks > .block-editor-block-list__layout,
    .wp-block[data-type="jaga/users-loop"][data-sp-columns]:not([data-sp-columns="0"]) > .block-editor-inner-blocks > .block-editor-block-list__layout {
        display: grid !important;
        grid-template-columns: repeat(var(--sp-columns), minmax(0, 1fr)) !important;
    }

    /* Reset width/flex values on children of columns blocks when grid is active on SP */
    .wp-block-columns[data-sp-columns]:not([data-sp-columns="0"]) > .wp-block-column,
    .wp-block-jaga-users-loop[data-sp-columns]:not([data-sp-columns="0"]) > *,
    .wp-block[data-type="jaga/users-loop"] .block-editor-block-list__block {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: auto !important;
        max-width: 100% !important;
        flex-basis: auto !important;
        min-width: 0 !important; /* Allow layout shrinkage */
    }

    /* Reset grid item spans on children of grid layouts to prevent implicit grid column generation */
    .wp-block-group.is-layout-grid[data-sp-columns]:not([data-sp-columns="0"]) > *,
    .wp-block-post-template.is-layout-grid[data-sp-columns]:not([data-sp-columns="0"]) > *,
    [class*="is-layout-grid"][data-sp-columns]:not([data-sp-columns="0"]) > *,
    .wp-block-jaga-users-loop[data-sp-columns]:not([data-sp-columns="0"]) > *,
    /* Editor support */
    .wp-block[data-type="jaga/users-loop"][data-sp-columns]:not([data-sp-columns="0"]) .jaga-users-loop-editor-container .block-editor-inner-blocks > .block-editor-block-list__layout > * {
        grid-column: auto !important;
    }

    /* Flex SP Layouts (Direction toggle) */
    .wp-block-group[data-sp-direction="column"],
    .wp-block-jaga-users-loop[data-sp-direction="column"],
    .wp-block-navigation[data-sp-direction="column"] .wp-block-navigation__container,
    /* Editor support */
    .wp-block[data-type="core/navigation"][data-sp-direction="column"] .wp-block-navigation__container,
    .wp-block[data-type="jaga/users-loop"][data-sp-direction="column"] .jaga-users-loop-editor-container .block-editor-inner-blocks > .block-editor-block-list__layout,
    .wp-block[data-type="jaga/users-loop"][data-sp-direction="column"] > .block-editor-inner-blocks > .block-editor-block-list__layout {
        display: flex !important;
        flex-direction: column !important;
    }
    .wp-block-group[data-sp-direction="row"],
    .wp-block-jaga-users-loop[data-sp-direction="row"],
    .wp-block-navigation[data-sp-direction="row"] .wp-block-navigation__container,
    /* Editor support */
    .wp-block[data-type="core/navigation"][data-sp-direction="row"] .wp-block-navigation__container,
    .wp-block[data-type="jaga/users-loop"][data-sp-direction="row"] .jaga-users-loop-editor-container .block-editor-inner-blocks > .block-editor-block-list__layout,
    .wp-block[data-type="jaga/users-loop"][data-sp-direction="row"] > .block-editor-inner-blocks > .block-editor-block-list__layout {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }

    /* Disable line breaks on mobile */
    .has-sp-no-br br {
        display: none !important;
    }

    /* SP flex-basis setting if defined */
    [style*="--sp-flex-basis"] {
        flex-basis: var(--sp-flex-basis) !important;
    }

    /* SP align-items setting if defined */
    [style*="--sp-align-items"],
    [data-sp-align-items] .block-editor-block-list__layout {
        align-items: var(--sp-align-items) !important;
    }
    .wp-block-navigation[data-sp-align-items] .wp-block-navigation__container {
        align-items: var(--sp-align-items) !important;
    }

    /* Reset margins on children if SP align-items is set, to prevent margin auto override */
    [data-sp-align-items="flex-start"] > *,
    [data-sp-align-items="flex-start"] .block-editor-block-list__layout > *,
    .wp-block-group[data-sp-align-items="flex-start"] > .wp-block-group__inner-container > *,
    .wp-block-navigation[data-sp-align-items="flex-start"] .wp-block-navigation-item {
        margin-left: 0 !important;
        margin-right: auto !important;
    }
    [data-sp-align-items="flex-end"] > *,
    [data-sp-align-items="flex-end"] .block-editor-block-list__layout > *,
    .wp-block-group[data-sp-align-items="flex-end"] > .wp-block-group__inner-container > *,
    .wp-block-navigation[data-sp-align-items="flex-end"] .wp-block-navigation-item {
        margin-left: auto !important;
        margin-right: 0 !important;
    }
    [data-sp-align-items="center"] > *,
    [data-sp-align-items="center"] .block-editor-block-list__layout > *,
    .wp-block-group[data-sp-align-items="center"] > .wp-block-group__inner-container > *,
    .wp-block-navigation[data-sp-align-items="center"] .wp-block-navigation-item {
        margin-left: auto !important;
        margin-right: auto !important;
    }
}


/* ==========================================================================
   PC/SP Max Width Custom Properties
   ========================================================================== */

/* PC Max Width Override */
@media (min-width: 782px) {
    [style*="--pc-max-width"] {
        max-width: var(--pc-max-width) !important;
        width: 100% !important;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Limit width to 100% in Gutenberg editor wrapper to prevent SP preview overflow */
    .editor-styles-wrapper [style*="--pc-max-width"] {
        max-width: min(var(--pc-max-width), 100%) !important;
    }

    /* Prevent margin auto from overriding flex/grid child alignments or explicit block alignments */
    .is-layout-flex > [style*="--pc-max-width"],
    .is-layout-grid > [style*="--pc-max-width"],
    .wp-block-column > [style*="--pc-max-width"],
    .wp-block-columns > [style*="--pc-max-width"] {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    [style*="--pc-max-width"].alignleft {
        margin-left: 0 !important;
        margin-right: auto !important;
    }
    [style*="--pc-max-width"].alignright {
        margin-left: auto !important;
        margin-right: 0 !important;
    }
    [style*="--pc-max-width"].aligncenter {
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* SP Max Width Override */
@media (max-width: 781px) {
    [style*="--sp-max-width"] {
        max-width: var(--sp-max-width) !important;
        width: 100% !important;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Limit width to 100% in Gutenberg editor wrapper to prevent SP preview overflow */
    .editor-styles-wrapper [style*="--sp-max-width"] {
        max-width: min(var(--sp-max-width), 100%) !important;
    }

    /* Prevent margin auto from overriding flex/grid child alignments or explicit block alignments */
    .is-layout-flex > [style*="--sp-max-width"],
    .is-layout-grid > [style*="--sp-max-width"],
    .wp-block-column > [style*="--sp-max-width"],
    .wp-block-columns > [style*="--sp-max-width"] {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    [style*="--sp-max-width"].alignleft {
        margin-left: 0 !important;
        margin-right: auto !important;
    }
    [style*="--sp-max-width"].alignright {
        margin-left: auto !important;
        margin-right: 0 !important;
    }
    [style*="--sp-max-width"].aligncenter {
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* ==========================================================================
   Hero Zoom Slider
   ========================================================================== */

.jaga-hero-zoom {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Full width logic */
.jaga-hero-zoom.alignfull {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
}

/* Allow inline style to override max-width if set */
.jaga-hero-zoom[style*="max-width"] {
    width: 100%; /* Fallback to 100% of container if max-width is set */
    margin-left: auto;
    margin-right: auto;
}

.jaga-hero-zoom__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.jaga-hero-zoom__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.jaga-hero-zoom__slide.is-active,
.jaga-hero-zoom__slide.is-leaving {
    /* Zoom animation */
    animation-name: kenburns;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.jaga-hero-zoom__slide.is-active {
    opacity: 1;
}

.jaga-hero-zoom__slide.is-leaving {
    opacity: 0;
}

.jaga-hero-zoom__content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.jaga-hero-zoom__content > * {
    pointer-events: auto;
}

@keyframes kenburns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

/* Editor specific styles */
.jaga-hero-zoom-editor-preview {
    border: 1px dashed #ccc;
    margin: 20px 0;
}

/* ==========================================================================
   Sticky Header Block Styles
   ========================================================================== */

/* Outer container */
.jaga-sticky-header-container {
    width: 100%;
}

/* Base padding to push content down below fixed header */
body,
.wp-site-blocks {
    padding-top: 0 !important; /* コンテナ全体への一律パディングは個別ブロックのレイアウトを壊すため廃止 */
}

@media (max-width: 781px) {
    body,
    .wp-site-blocks {
        padding-top: 0 !important;
    }
}

/* Frontend block container */
.wp-block-jaga-sticky-header {
    background-color: #ffffff;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

/* When sticky option is active */
.wp-block-jaga-sticky-header.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
}

/* Fix top position when WordPress Admin Bar is active */
body.admin-bar .wp-block-jaga-sticky-header.is-sticky {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar .wp-block-jaga-sticky-header.is-sticky {
        top: 46px;
    }
}

/* Inner container to restrict width & alignment */
.jaga-sticky-header__inner,
.wp-block-jaga-sticky-header .jaga-sticky-header__inner {
    max-width: var(--jaga-header-max-width) !important; /* 最大幅を同期 */
    margin: 0 auto !important; /* !importantを追加して中央寄せを絶対化 */
    padding: 0 20px 0 143px !important; /* !importantを追加してGutenbergのデフォルト上書きを防ぐ */
    height: 70px;
    display: flex !important;
    flex-wrap: nowrap !important; /* 絶対に折り返さないように強制 */
    align-items: center !important;
    justify-content: flex-end !important; /* right-aligned to match demo */
    transition: height 0.3s ease, box-shadow 0.3s ease;
}

/* Prevent navigation and search block from wrapping or pushing each other in header */
.wp-block-navigation,
.wp-block-jaga-sticky-header .wp-block-navigation {
    flex-grow: 0 !important;
    flex-shrink: 1 !important;
    width: auto !important;
}

.jaga-site-search-container,
.wp-block-jaga-sticky-header .jaga-site-search-container {
    flex-shrink: 0 !important;
}

/* Prevent navigation menu list items and search container from wrapping inside the navigation container */
.wp-block-navigation__container,
.wp-block-navigation .wp-block-navigation__container {
    flex-wrap: nowrap !important;
}

/* Prevent navigation menu item text from wrapping vertically (forcing single-line text) */
.jaga-sticky-header__inner .wp-block-navigation-item,
.jaga-sticky-header__inner .wp-block-navigation-item__content,
.jaga-sticky-header__inner .wp-block-navigation-link,
.jaga-sticky-header-editor-preview .wp-block-navigation-item,
.jaga-sticky-header-editor-preview .wp-block-navigation-item__content,
.jaga-sticky-header-editor-preview .wp-block-navigation-link {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Scrolled state for sticky header (Shrink height & add shadow) */
.wp-block-jaga-sticky-header.is-sticky.is-scrolled .jaga-sticky-header__inner {
    height: 55px; /* Shrink height a bit */
}

.wp-block-jaga-sticky-header.is-sticky.is-scrolled {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Support for hanging logo demo behavior */
.hanging-logo,
.hanging-logo-v3 {
    position: fixed; /* fixed位置に戻して、既存ページのHTML構造互換性を維持 */
    top: 0;
    left: max(20px, calc((100% - var(--jaga-header-max-width)) / 2 + 20px)); /* 幅変数に追従して自动計算 */
    width: 103px;
    height: 147px;
    background-color: #ffffff;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* Adjust hanging logo position when WordPress Admin Bar is active */
body.admin-bar .hanging-logo,
body.admin-bar .hanging-logo-v3 {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar .hanging-logo,
    body.admin-bar .hanging-logo-v3 {
        top: 46px;
    }
}


.hanging-logo img,
.hanging-logo-v3 img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Medium screens / Small PC responsive settings */
@media (min-width: 782px) and (max-width: 1199px) {
    .hanging-logo,
    .hanging-logo-v3 {
        width: 80px;
        height: 114px;
    }
}

/* Mobile responsive settings */
@media (max-width: 781px) {
    .wp-block-jaga-sticky-header .jaga-sticky-header__inner {
        padding: 0 20px;
        height: 60px;
    }
    
    .hanging-logo,
    .hanging-logo-v3 {
        left: 20px;
        width: 55px;
        height: 80px;
    }
}

/* Reset Gutenberg start-block-margin on the first content block when sticky header pushes content down */
body .wp-site-blocks > *:first-child,
body .entry-content > *:first-child,
body main > *:first-child {
    margin-top: 0 !important;
}

/* Push down only elements that don't have default top padding (like group and breadcrumbs) when they are the first content block after header */
.jaga-sticky-header-container + .wp-block-group,
.jaga-sticky-header-container + .wp-block-breadcrumbs,
.jaga-sticky-header-container + nav,
body .wp-site-blocks > .wp-block-group:first-of-type,
body .wp-site-blocks > .wp-block-breadcrumbs:first-child {
    margin-top: 70px !important;
}

@media (max-width: 781px) {
    .jaga-sticky-header-container + .wp-block-group,
    .jaga-sticky-header-container + .wp-block-breadcrumbs,
    .jaga-sticky-header-container + nav,
    body .wp-site-blocks > .wp-block-group:first-of-type,
    body .wp-site-blocks > .wp-block-breadcrumbs:first-child {
        margin-top: 60px !important;
    }
}

/* ==========================================================================
   Accordion Block Styles (Overrides for Core Accordion)
   ========================================================================== */

.wp-block-accordion {
    width: 100%;
    max-width: 1080px;
}

.wp-block-accordion-item {
    border-bottom: none;
    padding-bottom: 20px;
}

/* Compact Style */
.wp-block-accordion.is-style-compact .wp-block-accordion-heading__toggle,
.wp-block-accordion-item.is-style-compact .wp-block-accordion-heading__toggle {
    justify-content: flex-start !important;
    gap: 12px !important;
}

/* Compact Style Alignments (Right / Center) */
.wp-block-accordion.has-button-align-right .wp-block-accordion-heading__toggle,
.wp-block-accordion-item.has-button-align-right .wp-block-accordion-heading__toggle,
.wp-block-accordion.is-style-compact [class*="has-text-align-right"] .wp-block-accordion-heading__toggle,
.wp-block-accordion-item.is-style-compact [class*="has-text-align-right"] .wp-block-accordion-heading__toggle,
.wp-block-accordion.is-style-compact .wp-block-accordion-heading__toggle[class*="has-text-align-right"],
.wp-block-accordion-item.is-style-compact .wp-block-accordion-heading__toggle[class*="has-text-align-right"] {
    justify-content: flex-end !important;
}

.wp-block-accordion.has-button-align-center .wp-block-accordion-heading__toggle,
.wp-block-accordion-item.has-button-align-center .wp-block-accordion-heading__toggle,
.wp-block-accordion.is-style-compact [class*="has-text-align-center"] .wp-block-accordion-heading__toggle,
.wp-block-accordion-item.is-style-compact [class*="has-text-align-center"] .wp-block-accordion-heading__toggle,
.wp-block-accordion.is-style-compact .wp-block-accordion-heading__toggle[class*="has-text-align-center"],
.wp-block-accordion-item.is-style-compact .wp-block-accordion-heading__toggle[class*="has-text-align-center"] {
    justify-content: center !important;
}

.wp-block-accordion.has-button-align-left .wp-block-accordion-heading__toggle,
.wp-block-accordion-item.has-button-align-left .wp-block-accordion-heading__toggle {
    justify-content: flex-start !important;
}

.wp-block-accordion.is-style-compact .wp-block-accordion-heading__toggle-title,
.wp-block-accordion-item.is-style-compact .wp-block-accordion-heading__toggle-title {
    flex: none !important;
    flex-grow: 0 !important;
    width: auto !important;
}

.wp-block-accordion.is-style-compact .wp-block-accordion-heading__toggle-icon,
.wp-block-accordion-item.is-style-compact .wp-block-accordion-heading__toggle-icon {
    width: 36px;
    height: 36px;
    margin-left: 0 !important;
}

.wp-block-accordion.is-style-compact .wp-block-accordion-heading__toggle-icon::after,
.wp-block-accordion-item.is-style-compact .wp-block-accordion-heading__toggle-icon::after {
    width: 10px;
    height: 10px;
    border-right-width: 2px;
    border-bottom-width: 2px;
    margin-top: -4px;
}

.wp-block-accordion.is-style-compact .wp-block-accordion-item.is-open .wp-block-accordion-heading__toggle-icon::after,
.wp-block-accordion-item.is-style-compact.is-open .wp-block-accordion-heading__toggle-icon::after {
    margin-top: 4px;
}

@media (max-width: 781px) {
    .wp-block-accordion.is-style-compact .wp-block-accordion-heading__toggle-icon,
    .wp-block-accordion-item.is-style-compact .wp-block-accordion-heading__toggle-icon {
        width: 30px;
        height: 30px;
    }
    
    .wp-block-accordion.is-style-compact .wp-block-accordion-heading__toggle-icon::after,
    .wp-block-accordion-item.is-style-compact .wp-block-accordion-heading__toggle-icon::after {
        width: 8px;
        height: 8px;
        border-right-width: 2px;
        border-bottom-width: 2px;
        margin-top: -3px;
    }

    .wp-block-accordion.is-style-compact .wp-block-accordion-item.is-open .wp-block-accordion-heading__toggle-icon::after,
    .wp-block-accordion-item.is-style-compact.is-open .wp-block-accordion-heading__toggle-icon::after {
        margin-top: 3px;
    }
}

/* Accordion header button resets */
.wp-block-accordion-heading {
    margin: 0 !important;
    padding: 0 !important;
}

.wp-block-accordion-heading__toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    text-align: left;
    padding: 0 !important;
}

/* Custom visual style for the + toggle icon to match DEMO */
.wp-block-accordion-heading__toggle-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(180deg, #3d973b 0%, #2b9a37 12.5%, #23a438 27.885%, #1eaa39 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent !important; /* Hide the native '+' text character */
    font-size: 0 !important;
    position: relative;
    transition: filter 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
    transform: none !important; /* Prevent the container shape from rotating */
}

.wp-block-accordion-heading__toggle-icon:hover {
    filter: brightness(1.1);
}

/* Draw custom arrow utilizing pseudo-element */
.wp-block-accordion-heading__toggle-icon::after {
    content: "";
    width: 16px;
    height: 16px;
    border-right: 3px solid #ffffff;
    border-bottom: 3px solid #ffffff;
    transform: rotate(45deg);
    margin-top: -6px;
    transition: transform 0.4s ease, margin-top 0.4s ease;
    position: absolute;
}

/* Active/Opened state classes triggered by WP Interactivity API */
.wp-block-accordion-item.is-open .wp-block-accordion-heading__toggle-icon {
    transform: none !important; /* Enforce shape stays upright */
}

.wp-block-accordion-item.is-open .wp-block-accordion-heading__toggle-icon::after {
    transform: rotate(225deg) !important;
    margin-top: 6px;
}

/* Accordion panel container */
.wp-block-accordion-panel {
    display: block !important; /* Force display block to allow transitions (overrides display: none) */
    max-height: 0;
    overflow: hidden;
    padding: 0 40px;
    background-color: #f9f9f9;
    transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1), padding 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Add background padding and animation on active/opened state */
.wp-block-accordion-item.is-open .wp-block-accordion-panel {
    max-height: 500px; /* Limit height to prevent excessive page length */
    padding: 40px;
    overflow-y: auto; /* Enable scrollbar for long content */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--primary-green, #1EAA39) #f1f1f1; /* Firefox */
}

/* Custom scrollbar styling for JAGA theme accordion panel */
.wp-block-accordion-panel::-webkit-scrollbar {
    width: 6px;
}

.wp-block-accordion-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.wp-block-accordion-panel::-webkit-scrollbar-thumb {
    background: var(--primary-green, #1EAA39);
    border-radius: 3px;
}

.wp-block-accordion-panel::-webkit-scrollbar-thumb:hover {
    background: #178f2e;
}

/* Internal spacing helper inside accordion panel */
.wp-block-accordion-panel h3 {
    color: var(--primary-green, #1EAA39);
}

/* Responsive adjustments */
@media (max-width: 781px) {
    .wp-block-accordion-heading__toggle-icon {
        width: 40px;
        height: 40px;
    }
    
    .wp-block-accordion-heading__toggle-icon::after {
        width: 12px;
        height: 12px;
        border-right-width: 2px;
        border-bottom-width: 2px;
        margin-top: -4px;
    }
    
    .wp-block-accordion-item.is-open .wp-block-accordion-heading__toggle-icon::after {
        margin-top: 4px;
    }
}






/* ==========================================================================
   Contact Form Block Styles
   ========================================================================== */

.jaga-contact-form {
    width: 100%;
    margin: 40px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

@media (max-width: 781px) {
    .jaga-contact-form {
        padding: 20px 15px;
        margin: 20px auto;
        border-radius: 6px;
    }
}


.wp-block-jaga-contact-form-item.jaga-contact-form-item,
.jaga-contact-form-item {
    margin-bottom: 25px;
    width: 100% !important;
    box-sizing: border-box;
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    flex-basis: 0% !important;
}

.jaga-contact-form-item__label-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.jaga-contact-form-item__label {
    font-weight: 700;
    font-size: 15px;
    color: #333333;
    font-family: var(--wp--preset--font-family--noto-sans-jp);
}

.jaga-contact-form-item__required {
    font-size: 11px;
    background-color: #e53e3e;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 10px;
    font-weight: normal;
}

.jaga-contact-form-item__input,
.jaga-contact-form-item__textarea,
.jaga-contact-form-item__select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    color: #1f2937;
    background-color: #f9fafb;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.jaga-contact-form-item__input:focus,
.jaga-contact-form-item__textarea:focus,
.jaga-contact-form-item__select:focus {
    outline: none;
    border-color: var(--primary-green, #1EAA39);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(30, 170, 57, 0.15);
}

.jaga-contact-form-item__textarea {
    min-height: 150px;
    resize: vertical;
}

.jaga-contact-form-item__choices {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 5px 0;
}

.jaga-contact-form-item__choice-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #4b5563;
}

.jaga-contact-form-item__radio,
.jaga-contact-form-item__checkbox {
    margin-right: 6px;
    accent-color: var(--primary-green, #1EAA39);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.jaga-contact-form__submit-wrap {
    margin-top: 35px;
    text-align: center;
}

.jaga-contact-form__submit-wrap button[type="submit"] {
    background-color: var(--primary-green, #1EAA39);
    color: #ffffff;
    padding: 14px 45px;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(30, 170, 57, 0.2);
}

@media (max-width: 480px) {
    .jaga-contact-form__submit-wrap button[type="submit"] {
        width: 100%;
        padding: 14px 20px;
        text-align: center;
    }
}


.jaga-contact-form__submit-wrap button[type="submit"]:hover:not(:disabled) {
    background-color: #178a2d;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(30, 170, 57, 0.3);
}

.jaga-contact-form__submit-wrap button[type="submit"]:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.jaga-contact-form__response {
    padding: 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    animation: contactFormFadeIn 0.3s ease;
}

.jaga-contact-form__response.is-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.jaga-contact-form__response.is-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

@keyframes contactFormFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Editor Specific Styles for Contact Form Block */
.jaga-contact-form-editor-wrapper {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px;
    background-color: #f9fafb;
    margin: 20px 0;
}

.jaga-contact-form-editor {
    background: #ffffff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.jaga-contact-form-item-editor {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #ffffff;
    width: 100%;
    box-sizing: border-box;
}

.wp-block[data-type="jaga/contact-form-item"] {
    width: 100% !important;
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    flex-basis: 0% !important;
}

.jaga-contact-form-item-preview__label-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.jaga-contact-form-item-preview__label-input input {
    font-weight: bold;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 15px !important;
    box-shadow: none !important;
    width: auto !important;
}

.jaga-contact-form-item-preview__field input,
.jaga-contact-form-item-preview__field textarea,
.jaga-contact-form-item-preview__field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background-color: #f9fafb;
    box-sizing: border-box !important;
}

/* ==========================================================================
   Scroll Fade In Animation
   ========================================================================== */

.js-enabled section,
.js-enabled article {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.0s cubic-bezier(0.215, 0.61, 0.355, 1), transform 1.0s cubic-bezier(0.215, 0.61, 0.355, 1);
    will-change: opacity, transform;
}

.js-enabled section.is-visible,
.js-enabled article.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Breadcrumbs Styles
   ========================================================================== */
.wp-block-breadcrumbs {
    box-sizing: border-box;
}

.wp-block-breadcrumbs ol {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.wp-block-breadcrumbs ol li a {
    display: inline-flex;
    align-items: center;
}

.wp-block-breadcrumbs ol li:first-child a::before {
    content: "\f015";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 6px;
    display: inline-block;
}

/* ==========================================================================
   Post Navigation Link Styles (Previous / Next Buttons)
   ========================================================================== */
.wp-block-post-navigation-link {
    display: inline-flex !important;
    align-items: center;
    border: 2px solid var(--primary-green, #1EAA39) !important;
    border-radius: 30px !important;
    padding: 10px 24px !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    background-color: transparent !important;
    cursor: pointer;
    position: relative;
    text-decoration: none !important;
}

/* Hide empty wrapper to prevent blank border button */
.wp-block-post-navigation-link:empty,
.wp-block-post-navigation-link:not(:has(a)) {
    display: none !important;
}

.wp-block-post-navigation-link a {
    color: var(--primary-green, #1EAA39) !important;
    font-weight: 700 !important;
    font-family: var(--wp--preset--font-family--noto-sans-jp) !important;
    font-size: 14px !important;
    text-decoration: none !important;
    z-index: 2;
    transition: color 0.3s ease !important;
}

/* Expand clickable area to the entire button container */
.wp-block-post-navigation-link a::after {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 3 !important;
}

.wp-block-post-navigation-link__arrow-previous,
.wp-block-post-navigation-link__arrow-next {
    color: var(--primary-green, #1EAA39) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.3s ease !important;
    z-index: 2;
}

.wp-block-post-navigation-link__arrow-previous {
    margin-right: 8px !important;
}

.wp-block-post-navigation-link__arrow-next {
    margin-left: 8px !important;
}

/* Hover States with premium easing and slide micro-animations */
.wp-block-post-navigation-link:hover {
    background-color: var(--primary-green, #1EAA39) !important;
    box-shadow: 0 6px 20px rgba(30, 170, 57, 0.2) !important;
    transform: translateY(-2px) !important;
    opacity: 1 !important;
}

.wp-block-post-navigation-link:hover a,
.wp-block-post-navigation-link:hover .wp-block-post-navigation-link__arrow-previous,
.wp-block-post-navigation-link:hover .wp-block-post-navigation-link__arrow-next {
    color: #ffffff !important;
    opacity: 1 !important;
}

.wp-block-post-navigation-link:hover .wp-block-post-navigation-link__arrow-previous {
    transform: translateX(-5px) !important;
}

.wp-block-post-navigation-link:hover .wp-block-post-navigation-link__arrow-next {
    transform: translateX(5px) !important;
}

/* ==========================================================================
   Users Loop Custom Blocks (jaga/users-loop, name, avatar)
   ========================================================================== */
.wp-block-jaga-users-loop {
    width: 100%;
}

.jaga-users-loop__item {
    border-bottom: 1px solid #eee;
    padding-bottom: 40px;
}

.jaga-users-loop__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Remove bottom borders when loop items are laid out horizontally (Grid/Flex-Row) */
.wp-block-jaga-users-loop.is-layout-grid .jaga-users-loop__item,
.wp-block-jaga-users-loop.is-layout-flex.is-layout-row .jaga-users-loop__item,
.wp-block-jaga-users-loop[data-sp-columns]:not([data-sp-columns="0"]) .jaga-users-loop__item,
.wp-block-jaga-users-loop[data-sp-direction="row"] .jaga-users-loop__item,
.wp-block-jaga-users-loop[style*="--sp-columns"] .jaga-users-loop__item {
    border-bottom: none;
    padding-bottom: 0;
}

@media (min-width: 782px) {
    /* Stretch items and their cards to equal height on PC */
    .wp-block-jaga-users-loop.is-layout-grid,
    .wp-block-jaga-users-loop.is-layout-flex.is-layout-row,
    .wp-block[data-type="jaga/users-loop"] .jaga-users-loop-editor-container {
        align-items: stretch !important;
    }

    .wp-block-jaga-users-loop.is-layout-grid .jaga-users-loop__item,
    .wp-block-jaga-users-loop.is-layout-flex.is-layout-row .jaga-users-loop__item,
    .wp-block[data-type="jaga/users-loop"] .jaga-users-loop-editor-container > .block-editor-inner-blocks > .block-editor-block-list__layout {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
    }

    .wp-block-jaga-users-loop.is-layout-grid .jaga-users-loop__item > *,
    .wp-block-jaga-users-loop.is-layout-flex.is-layout-row .jaga-users-loop__item > *,
    .wp-block[data-type="jaga/users-loop"] .jaga-users-loop-editor-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .block-editor-block-list__block {
        flex-grow: 1 !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Target only the direct outer group container of the loop item to stretch and allow flex pushing */
    .wp-block-jaga-users-loop .jaga-users-loop__item > .wp-block-group,
    .wp-block[data-type="jaga/users-loop"] .jaga-users-loop-editor-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .block-editor-block-list__block > .wp-block-group {
        display: flex !important;
        flex-direction: column !important;
        flex-grow: 1 !important;
    }

    /* Push the buttons block to the absolute bottom of the card flex container */
    .wp-block-jaga-users-loop .jaga-users-loop__item > .wp-block-group > .wp-block-buttons,
    .wp-block-jaga-users-loop .jaga-users-loop__item > .wp-block-buttons,
    .wp-block[data-type="jaga/users-loop"] .jaga-users-loop-editor-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .block-editor-block-list__block > .wp-block-group > .wp-block-buttons,
    .wp-block[data-type="jaga/users-loop"] .jaga-users-loop-editor-container > .block-editor-inner-blocks > .block-editor-block-list__layout > .block-editor-block-list__block > .wp-block-buttons {
        margin-top: auto !important;
    }
}

/* User Name styling inside loop */
.jaga-user-name {
    margin-top: 10px;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-green, #1EAA39);
}

/* User Avatar styling inside loop */
.jaga-user-avatar img {
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 3px solid #fff;
    outline: 1px solid #eee;
}

/* Fallback card */
.jaga-user-fallback {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Editor container spacing helper */
.jaga-users-loop-editor-container {
    display: grid !important; /* 条件なしで常にグリッドとして配置する */
    grid-template-columns: repeat(2, 1fr) !important; /* フロント同様に常に2列プレビュー */
    gap: 30px !important;
    padding: 30px 0 0 0 !important; /* 左右の余計な外回りパディングをなくして横幅を揃える */
    box-sizing: border-box !important;
    max-width: 100% !important;
    width: 100% !important;
    position: relative;
    border-bottom: none !important; /* Remove legacy border */
}

/* 編集用のアクティブなひな形カード */
.jaga-users-loop-editor-item {
    border: 1px dashed var(--wp--preset--color--primary, #1EAA39) !important;
    padding: 30px !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
    position: relative;
}

/* ダミーのループゴーストカード */
.jaga-users-loop-editor-ghost {
    border: 1px dashed #ddd !important;
    padding: 30px !important;
    border-radius: 8px !important;
    background: #fafafa !important;
    opacity: 0.55 !important;
    pointer-events: none !important;
    user-select: none !important;
    display: flex;
    flex-direction: column;
}

/* レスポンシブ対応：エディタ内でも画面幅が狭い場合や、SP表示を意識して縦並びになるように */
@media (max-width: 781px) {
    .jaga-users-loop-editor-container {
        grid-template-columns: 1fr !important;
    }
}

/* 控えめなエディタ用バッジスタイル */
.jaga-users-loop-editor-label {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    background: rgba(30, 170, 57, 0.08);
    color: var(--wp--preset--color--primary, #1EAA39);
    border: 1px solid rgba(30, 170, 57, 0.15);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    pointer-events: none;
    z-index: 10;
    user-select: none;
}

/* Prevent padding/width overflow of inner block layout containers in the editor */
.wp-block[data-type="jaga/users-loop"] .block-editor-inner-blocks,
.wp-block[data-type="jaga/users-loop"] .block-editor-block-list__layout {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ==========================================================================
   Table Block Styles
   ========================================================================== */
.wp-block-table {
    margin: 2rem 0;
    width: 100%;
    overflow-x: auto;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.6;
    color: var(--wp--preset--color--contrast, #525552);
    border: 1px solid #e5e7eb;
    table-layout: auto !important; /* テーブル自動レイアウトを強制し、セルの重なり合いを防止 */
}

.wp-block-table th,
.wp-block-table td {
    padding: 14px 20px;
    text-align: left;
    border: 1px solid #e5e7eb;
}

.wp-block-table th {
    background-color: var(--wp--preset--color--primary, #1EAA39);
    color: #ffffff;
    font-weight: 700;
    font-family: var(--wp--preset--font-family--noto-sans-jp, sans-serif);
}

/* 1列目の背景色と文字スタイルを変更 */
.wp-block-table td:first-child {
    background-color: rgba(30, 170, 57, 0.04); /* 薄いプライマリーグリーン */
    font-weight: 700;
    color: var(--wp--preset--color--primary, #1EAA39);
}

.wp-block-table th:first-child {
    background-color: #178a2d; /* 少し濃いグリーンでアクセント */
}

/* 1列目の幅を一番長い文字幅に自動で合わせる（データセルは改行を防ぎフィット、ヘッダーは改行を許容） */
.wp-block-table td:first-child {
    width: 1px !important;
    white-space: nowrap;
    padding-right: 30px; /* 2列目のテキストと重ならないように右側に余白を確保 */
}

.wp-block-table th:first-child {
    width: 1px !important;
    padding-right: 30px;
}

/* ストライプ（しましま）オプションが有効な場合の調整 */
.wp-block-table.is-style-stripes {
    border-spacing: 0;
    border-collapse: collapse;
}

.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
    background-color: #f9fafb;
}

.wp-block-table.is-style-stripes tbody tr:nth-child(odd) td:first-child {
    background-color: rgba(30, 170, 57, 0.07); /* ストライプ行の1列目は少し濃く */
}

/* スマホ表示時のレスポンシブ対応（縦1列のカード型に変更） */
@media (max-width: 781px) {
    .wp-block-table table {
        border: none !important;
    }

    .wp-block-table table,
    .wp-block-table thead,
    .wp-block-table tbody,
    .wp-block-table tr,
    .wp-block-table th,
    .wp-block-table td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    /* 縦並びの際に重複するテーブルヘッダーは非表示 */
    .wp-block-table thead {
        display: none;
    }

    /* 各行をカード状のレイアウトに整形 */
    .wp-block-table tr {
        border: 1px solid #e5e7eb;
        margin-bottom: 15px;
        background-color: #ffffff;
    }

    /* セルをブロック化して縦並びにし、横幅制限をリセット */
    .wp-block-table td {
        border: none;
        border-bottom: 1px solid #f3f4f6;
        padding: 12px 16px;
        white-space: normal !important; /* 横長の折り返し制限を解除 */
    }

    .wp-block-table td:last-child {
        border-bottom: none;
    }

    /* 1列目をスマホ時のカードの見出しとして機能するように調整 */
    .wp-block-table td:first-child {
        background-color: rgba(30, 170, 57, 0.06) !important;
        border-bottom: 1px solid #e5e7eb;
        width: 100% !important;
        padding-right: 16px !important; /* PC用の右側余白30pxをリセット */
    }
}

/* ==========================================================================
   Editor-Specific Spacing & Layout Overrides
   ========================================================================== */
.editor-styles-wrapper .wp-block[data-type="jaga/users-loop"] .block-editor-inner-blocks > .block-editor-block-list__layout {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
}
.editor-styles-wrapper .wp-block[data-type="jaga/users-loop"] .block-editor-block-list__block {
    width: 100% !important;
    max-width: 100% !important;
}

/* Sticky Header Editor Override */
.editor-styles-wrapper .wp-block[data-type="jaga/sticky-header"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* フロント用の margin-top: 70px !important 自動変換をエディター上でクリア */
.editor-styles-wrapper .jaga-sticky-header-container + .wp-block-group,
.editor-styles-wrapper .jaga-sticky-header-container + .wp-block-breadcrumbs,
.editor-styles-wrapper .jaga-sticky-header-container + nav,
.editor-styles-wrapper .wp-site-blocks > .wp-block-group:first-of-type,
.editor-styles-wrapper .wp-site-blocks > .wp-block-breadcrumbs:first-child {
    margin-top: 0 !important;
}

.editor-styles-wrapper .jaga-sticky-header-container {
    position: relative !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.editor-styles-wrapper .hanging-logo,
.editor-styles-wrapper .hanging-logo-v3 {
    position: absolute !important;
    top: 0 !important;
    left: 20px !important; /* 40pxから20pxに変更 */
    z-index: 1001 !important;
}

@media (max-width: 781px) {
    .editor-styles-wrapper .hanging-logo,
    .editor-styles-wrapper .hanging-logo-v3 {
        left: 20px !important;
    }
}

/* WordPressの管理バー用のtop調整をエディタ内では無効化 */
.editor-styles-wrapper body.admin-bar .hanging-logo,
.editor-styles-wrapper body.admin-bar .hanging-logo-v3,
.editor-styles-wrapper .admin-bar .hanging-logo,
.editor-styles-wrapper .admin-bar .hanging-logo-v3 {
    top: 0 !important;
}

.editor-styles-wrapper .wp-block-jaga-sticky-header.is-sticky {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
}

.editor-styles-wrapper body.admin-bar .wp-block-jaga-sticky-header.is-sticky,
.editor-styles-wrapper .admin-bar .wp-block-jaga-sticky-header.is-sticky {
    top: 0 !important;
}

/* Responsive sizes for editor logo preview */
.editor-styles-wrapper .hanging-logo-editor,
.editor-styles-wrapper .hanging-logo-editor-v3 {
    width: 103px !important;
    height: 147px !important;
}

@media (min-width: 782px) and (max-width: 1199px) {
    .editor-styles-wrapper .hanging-logo-editor,
    .editor-styles-wrapper .hanging-logo-editor-v3 {
        width: 80px !important;
        height: 114px !important;
    }
}

@media (max-width: 781px) {
    .editor-styles-wrapper .hanging-logo-editor,
    .editor-styles-wrapper .hanging-logo-editor-v3 {
        width: 55px !important;
        height: 80px !important;
    }
}

/* Prevent first column cells from wrapping in block editor table */
.editor-styles-wrapper .wp-block-table td:first-child,
.editor-styles-wrapper .wp-block-table td:first-child * {
    white-space: nowrap !important;
}
/* エディタ用：プレビューヘッダーの土台グレー背景を廃止し、余白を透明（白）にする */
.editor-styles-wrapper .jaga-sticky-header-editor-preview-container {
    background: transparent !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important; /* 80pxから0pxに変更してヘッダー下の空きを解消 */
}

/* プレビューヘッダー自体の白い帯は横幅100%に伸ばす */
.editor-styles-wrapper .jaga-sticky-header-editor-preview {
    max-width: 100% !important;
    width: 100% !important;
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important; /* 内側のインナーコンテナに余白を移管 */
}

/* プレビューヘッダーのインナー（ナビゲーション）を最大幅に制限して中央寄せ */
.editor-styles-wrapper .jaga-sticky-header-editor-preview > div:last-child {
    max-width: var(--jaga-header-max-width) !important;
    margin: 0 auto !important;
    width: 100% !important;
    padding: 0 20px 0 143px !important; /* フロントと同様にインナーで余白を確保し、右偏りを解消 */
    display: flex !important;
    flex-wrap: nowrap !important; /* 絶対に折り返さないように強制 */
    align-items: center !important;
    justify-content: flex-end !important;
    box-sizing: border-box !important;
}

/* Prevent nav and search wrapping in editor preview */
.editor-styles-wrapper .jaga-sticky-header-editor-preview .wp-block-navigation {
    flex-grow: 0 !important;
    flex-shrink: 1 !important;
    width: auto !important;
}

.editor-styles-wrapper .jaga-sticky-header-editor-preview .jaga-site-search-editor {
    flex-shrink: 0 !important;
}

/* Gutenberg Editor specific override for search form inside sticky header to prevent button distortion */
.editor-styles-wrapper .jaga-sticky-header-editor-preview .jaga-site-search-editor {
    max-width: 200px !important;
    margin: 0 0 0 15px !important;
    flex-shrink: 0 !important;
}

.editor-styles-wrapper .jaga-sticky-header-editor-preview .jaga-site-search-editor__wrapper {
    height: 40px !important; /* 高さを40pxに固定して安定させる */
    align-items: center !important;
    padding: 0 !important;
    border-radius: 20px !important;
    display: flex !important;
}

.editor-styles-wrapper .jaga-sticky-header-editor-preview .jaga-site-search-editor__wrapper input {
    height: 100% !important;
    padding: 0 15px !important;
    font-size: 14px !important;
    flex-grow: 1 !important;
}

.editor-styles-wrapper .jaga-sticky-header-editor-preview .jaga-site-search-editor__wrapper button {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    flex-shrink: 0 !important; /* 絶対に楕円に潰れないようにする */
    margin: 0 2px 0 0 !important; /* はみ出さずにカプセル内に収める */
    border-radius: 50% !important; /* 確実に真円にする */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Force horizontal layout for InnerBlocks container in block editor preview */
.editor-styles-wrapper .jaga-sticky-header-editor-preview .block-editor-block-list__layout {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: 100% !important;
    gap: 15px !important;
}

.editor-styles-wrapper .jaga-sticky-header-editor-preview .block-editor-block-list__block {
    margin: 0 !important;
}


/* ==========================================================================
   Site Search Block Styles
   ========================================================================== */

.jaga-site-search-container {
    width: 100%;
    max-width: 450px;
    margin: 20px 0;
}

.jaga-site-search-form__inner {
    display: flex;
    align-items: center;
    position: relative;
    border-radius: 30px;
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    overflow: hidden;
    transition: all 0.2s ease;
}

.jaga-site-search-form__inner:focus-within {
    border-color: var(--primary-green, #1EAA39);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(30, 170, 57, 0.15);
}

.jaga-site-search-input {
    flex-grow: 1;
    border: none !important;
    background: transparent !important;
    padding: 12px 20px 12px 20px !important;
    font-size: 15px;
    color: #1f2937;
    outline: none !important;
    box-shadow: none !important;
    width: 100%;
    min-width: 0 !important;
}

.jaga-site-search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #3d973b 0%, #1eaa39 100%) !important;
    color: #ffffff !important;
    border: none !important;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin: 2px;
    cursor: pointer;
    transition: filter 0.2s ease;
    flex-shrink: 0;
}

.jaga-site-search-submit:hover {
    filter: brightness(1.1);
}

/* Editor preview styles */
.jaga-site-search-editor {
    width: 100%;
    max-width: 450px;
    margin: 20px 0;
}

.jaga-site-search-editor__wrapper {
    display: flex !important;
    align-items: center !important;
    border-radius: 30px !important;
    border: 1px solid #d1d5db !important;
    background-color: #f9fafb !important;
    overflow: hidden !important;
}

.jaga-site-search-editor__wrapper input {
    flex-grow: 1 !important;
    border: none !important;
    background: transparent !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    outline: none !important;
    width: 100% !important;
    min-width: 0 !important;
}

.jaga-site-search-editor__wrapper button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(180deg, #3d973b 0%, #1eaa39 100%) !important;
    color: #ffffff !important;
    border: none !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    margin: 2px !important;
    flex-shrink: 0 !important;
}

/* Custom layout adjustment for search form when embedded in sticky header */
.wp-block-jaga-sticky-header .jaga-site-search-container,
.jaga-sticky-header-editor-preview .jaga-site-search-editor {
    max-width: 200px !important;
    margin: 0 0 0 15px !important;
}

.wp-block-jaga-sticky-header .jaga-site-search-input,
.jaga-sticky-header-editor-preview .jaga-site-search-editor__wrapper input {
    height: 100% !important;
    padding: 0 15px !important;
    font-size: 14px !important;
    width: 100% !important;
    min-width: 0 !important;
}

.wp-block-jaga-sticky-header .jaga-site-search-submit,
.jaga-sticky-header-editor-preview .jaga-site-search-editor__wrapper button {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0 !important; /* 絶対に楕円に潰れないようにする */
    margin: 0 2px 0 0 !important; /* はみ出さずにカプセル内に収める */
    border-radius: 50% !important; /* 確実に真円にする */
}

.wp-block-jaga-sticky-header .jaga-site-search-submit i,
.jaga-sticky-header-editor-preview .jaga-site-search-editor__wrapper button i {
    font-size: 13px !important;
}

.wp-block-jaga-sticky-header .jaga-site-search-form__inner,
.jaga-sticky-header-editor-preview .jaga-site-search-editor__wrapper {
    display: flex !important;
    height: 40px !important; /* 高さを40pxに固定して安定させる */
    align-items: center !important;
    padding: 0 !important;
    border-radius: 20px !important;
}

@media (max-width: 600px) {
    /* Hide site search in sticky header when burger menu is active (mobile viewports) */
    .wp-block-jaga-sticky-header .jaga-site-search-container,
    .jaga-sticky-header-editor-preview .jaga-site-search-editor {
        display: none !important;
    }

    /* Tighten vertical gap and paddings inside the mobile responsive drawer menu */
    .wp-block-jaga-sticky-header .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
        gap: 6px !important;
    }
    .wp-block-jaga-sticky-header .wp-block-navigation__responsive-container-content .wp-block-navigation-item {
        margin: 0 !important;
    }
    .wp-block-jaga-sticky-header .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content,
    .wp-block-jaga-sticky-header .wp-block-navigation__responsive-container-content .wp-block-navigation-link {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }
}

@media (max-width: 1024px) {
    /* Reduce header inner padding and logo offsets, protecting logo area on the left */
    .wp-block-jaga-sticky-header .jaga-sticky-header__inner {
        padding: 0 20px 0 120px !important;
    }
    .hanging-logo,
    .hanging-logo-v3 {
        left: 20px !important;
    }

    /* Slim down navigation item spacing and size utilizing flex gap */
    .wp-block-jaga-sticky-header .wp-block-navigation-item {
        margin: 0 !important;
    }
    .wp-block-jaga-sticky-header .wp-block-navigation,
    .wp-block-jaga-sticky-header .wp-block-navigation__container {
        gap: 6px !important;
        flex-grow: 0 !important;
    }
    .wp-block-jaga-sticky-header .wp-block-navigation-item__content,
    .wp-block-jaga-sticky-header .wp-block-navigation-link__label {
        font-size: 14px !important;
    }

    /* Make search block even more compact */
    .wp-block-jaga-sticky-header .jaga-site-search-container,
    .jaga-sticky-header-editor-preview .jaga-site-search-editor {
        max-width: 120px !important;
        margin-left: 6px !important;
    }
    .wp-block-jaga-sticky-header .jaga-site-search-input,
    .jaga-sticky-header-editor-preview .jaga-site-search-editor__wrapper input {
        padding: 6px 12px !important;
        font-size: 13px !important;
    }
    .wp-block-jaga-sticky-header .jaga-site-search-submit,
    .jaga-sticky-header-editor-preview .jaga-site-search-editor__wrapper button {
        width: 30px !important;
        height: 30px !important;
    }
    .wp-block-jaga-sticky-header .jaga-site-search-submit i,
    .jaga-sticky-header-editor-preview .jaga-site-search-editor__wrapper button i {
        font-size: 11px !important;
    }

    /* SP/Tablet gap settings if defined (active under 1024px) */
    [style*="--sp-row-gap"] {
        row-gap: var(--sp-row-gap) !important;
    }
    [style*="--sp-row-gap"] > *,
    [style*="--sp-row-gap"] .wp-block,
    [data-sp-row-gap] .block-editor-block-list__layout > *,
    [data-sp-row-gap] .block-editor-block-list__layout .block-editor-block-list__block,
    [data-sp-row-gap] .block-editor-block-list__layout .wp-block {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        margin-block-start: 0 !important;
        margin-block-end: 0 !important;
    }
    [style*="--sp-col-gap"] {
        column-gap: var(--sp-col-gap) !important;
    }
}

/* ==========================================================================
   Query Pagination Styles (Pager)
   ========================================================================== */

.wp-block-query-pagination {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important;
    margin: 50px auto !important;
    max-width: 100% !important;
    font-family: var(--wp--preset--font-family--noto-sans-jp, sans-serif) !important;
}

/* Pagination container reset */
.wp-block-query-pagination-numbers {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Individual page number styles */
.wp-block-query-pagination .page-numbers {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important;
    height: 44px !important;
    padding: 0 8px !important;
    border-radius: 50% !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--wp--preset--color--contrast, #525552) !important;
    background-color: #ffffff !important;
    border: 1.5px solid #e5e7eb !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

/* Current page style */
.wp-block-query-pagination .page-numbers.current {
    color: #ffffff !important;
    background-color: var(--primary-green, #1EAA39) !important;
    border-color: var(--primary-green, #1EAA39) !important;
    box-shadow: 0 4px 12px rgba(30, 170, 57, 0.2) !important;
    cursor: default !important;
}

/* Dots ellipsis style */
.wp-block-query-pagination .page-numbers.dots {
    border-color: transparent !important;
    background-color: transparent !important;
    color: #9ca3af !important;
    cursor: default !important;
    min-width: 30px !important;
}

/* Previous / Next buttons styling */
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 44px !important;
    padding: 0 24px !important;
    border-radius: 22px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--wp--preset--color--contrast, #525552) !important;
    background-color: #ffffff !important;
    border: 1.5px solid #e5e7eb !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

/* Arrow micro-interactions and hover states */
.wp-block-query-pagination a.page-numbers:hover,
.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
    color: #ffffff !important;
    background-color: var(--primary-green, #1EAA39) !important;
    border-color: var(--primary-green, #1EAA39) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(30, 170, 57, 0.25) !important;
}

/* Disabled/active states or fallback styles protection */
.wp-block-query-pagination-previous:active,
.wp-block-query-pagination-next:active,
.wp-block-query-pagination a.page-numbers:active {
    transform: translateY(0) !important;
}

/* Mobile responsive adjustments */
@media (max-width: 600px) {
    .wp-block-query-pagination {
        gap: 12px !important;
    }
    
    /* Hide all page numbers except the current active page and its immediate neighbors (prev/next) */
    .wp-block-query-pagination .page-numbers:not(.current):not(.current + .page-numbers):not(:has(+ .current)) {
        display: none !important;
    }

    /* Convert Previous/Next text buttons to compact circular arrow buttons */
    .wp-block-query-pagination-previous,
    .wp-block-query-pagination-next {
        font-size: 0 !important; /* Hide the default text ("前ページ" / "次ページ") */
        min-width: 40px !important;
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        border-radius: 50% !important; /* Make it circular */
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .wp-block-query-pagination-previous::before {
        content: "" !important;
        display: block !important;
        width: 8px !important;
        height: 8px !important;
        border-left: 2px solid currentColor !important;
        border-bottom: 2px solid currentColor !important;
        transform: rotate(45deg) !important;
        margin-left: 3px !important; /* Offset visually to the right to correct optical illusion */
    }

    .wp-block-query-pagination-next::before {
        content: "" !important;
        display: block !important;
        width: 8px !important;
        height: 8px !important;
        border-right: 2px solid currentColor !important;
        border-top: 2px solid currentColor !important;
        transform: rotate(45deg) !important;
        margin-right: 3px !important; /* Offset visually to the left to correct optical illusion */
    }

    /* Adjust size of current page number button to match arrows */
    .wp-block-query-pagination .page-numbers.current {
        min-width: 40px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 14px !important;
    }
}

/* ==========================================================================
   Subtitle Block Styles
   ========================================================================== */
.jaga-subtitle {
    color: var(--primary-green, #1EAA39);
    margin-top: 5px;
    margin-bottom: 15px;
}

.jaga-subtitle-editor-wrapper p {
    color: var(--primary-green, #1EAA39);
}

/* ==========================================================================
   Post Date Block Styles
   ========================================================================== */
.wp-block-post-date {
    white-space: nowrap !important;
}

/* ==========================================================================
   FontAwesome Icon Block Styles
   ========================================================================== */
.wp-block-jaga-fa-icon {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* ==========================================================================
   Bilingual Paragraph Block Styles
   ========================================================================== */
.jaga-bilingual-paragraph {
    margin-bottom: 1.5rem;
}
.jaga-bilingual-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.jaga-bilingual-switch .jaga-lang-btn {
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}
.jaga-bilingual-switch .jaga-lang-btn.active {
    background-color: #1EAA39;
    color: #fff;
    border-color: #1EAA39;
}
.jaga-bilingual-switch .jaga-lang-btn:hover:not(.active) {
    background-color: #f0f0f0;
}
.jaga-bilingual-content {
    /* RichText paragraphs are contained within these blocks */
}

/* ==========================================================================
   Bilingual Group Block Styles
   ========================================================================== */
.jaga-bilingual-group {
    margin-bottom: 2rem;
}

/* Editor Specific Styles for Bilingual Group */
.editor-styles-wrapper .jaga-bilingual-group-editor.show-ja .wp-block-jaga-bilingual-group-en,
.editor-styles-wrapper .jaga-bilingual-group-editor.show-ja [data-type="jaga/bilingual-group-en"],
.editor-styles-wrapper .jaga-bilingual-group-editor.show-ja .block-editor-block-list__block[data-type="jaga/bilingual-group-en"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}
.editor-styles-wrapper .jaga-bilingual-group-editor.show-en .wp-block-jaga-bilingual-group-ja,
.editor-styles-wrapper .jaga-bilingual-group-editor.show-en [data-type="jaga/bilingual-group-ja"],
.editor-styles-wrapper .jaga-bilingual-group-editor.show-en .block-editor-block-list__block[data-type="jaga/bilingual-group-ja"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Optional editor styling to distinguish language areas */
.wp-block-jaga-bilingual-group-ja,
.wp-block-jaga-bilingual-group-en {
    transition: all 0.2s ease;
}

/* ==========================================================================
   PDF Download Block Style
   ========================================================================== */
.jaga-pdf-download-card {
    background: var(--wp--preset--color--base, #ffffff);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    padding: 24px;
    margin: 32px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.jaga-pdf-download-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.jaga-pdf-download-container {
    display: flex;
    gap: 24px;
    align-items: center;
}

@media (max-width: 600px) {
    .jaga-pdf-download-container {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

.jaga-pdf-download-cover {
    flex-shrink: 0;
    max-width: 140px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.jaga-pdf-download-cover:hover {
    transform: scale(1.03);
}

.jaga-pdf-download-cover img {
    display: block;
    width: 100%;
    height: auto;
}

.jaga-pdf-download-content {
    flex-grow: 1;
}

.jaga-pdf-download-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.05rem; /* 1.25rem から 1.05rem に縮小 */
    line-height: 1.4;
    color: var(--wp--preset--color--contrast, #333333);
}

@media (max-width: 600px) {
    .jaga-pdf-download-content .wp-block-buttons {
        justify-content: center;
    }
    .jaga-pdf-download-title {
        font-size: 0.9rem;
    }
}

.jaga-pdf-download-card .wp-block-button__link::before {
    content: none !important;
}



