/* Reusable UI: buttons */
.c-btn {
    display: inline-flex;
    align-items: center;
    padding: 16px 24px;
    font-weight: 500;
    font-size: 1rem;
    min-width: 240px;
    border-radius: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-decoration: none;
}

.c-btn span {
    flex: 1;
    text-align: center;
}

.c-btn svg {
    flex-shrink: 0;
    margin-left: 8px;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.c-btn:hover svg {
    transform: translateX(8px);
}

.c-btn--back svg {
    margin-left: 0;
    margin-right: 8px;
}

.c-btn--back:hover svg {
    transform: translateX(-8px);
}

.c-btn--primary {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-text);
    position: relative;
    overflow: hidden;
}

.c-btn--primary::after {
    content: none;
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: none;
    z-index: 1;
}

.c-btn--primary > * {
    position: relative;
    z-index: 2;
}

.c-btn--primary:hover {
    background-color: transparent;
    color: var(--color-text);
    opacity: 0.8;
}

.c-btn--primary:hover::after {
    animation: shine 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 200%; }
}

.c-btn--outline {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-text);
}

.c-btn--outline:hover {
    background-color: transparent;
    color: var(--color-text);
    opacity: 0.8;
}

/* WordPress Core Blocks Overrides */

/* wp-block-table */
.wp-block-table {
    overflow-x: auto;
    margin-bottom: 40px;
}

.wp-block-table table {
    width: 100% !important;
    min-width: 400px;
    border-collapse: collapse !important;
    text-align: left;
    border: none !important;
}

.wp-block-table th,
.wp-block-table td {
    padding: 16px 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--color-border) !important;
    vertical-align: top !important;
}

.wp-block-table th:not(:last-child),
.wp-block-table td:not(:last-child) {
    padding-right: 32px !important;
}

.wp-block-table th:first-child,
.wp-block-table td:first-child {
    white-space: nowrap !important;
}

.wp-block-table thead th,
.wp-block-table thead td {
    border-bottom: 1px solid var(--color-border-dark) !important;
}

.wp-block-table th {
    font-weight: 700;
}

/* wp-block-buttons */
.wp-block-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 40px;
}

.wp-block-buttons.is-content-justification-center {
    justify-content: center;
}

.wp-block-buttons.is-content-justification-right {
    justify-content: flex-end;
}

.wp-block-buttons.is-content-justification-left {
    justify-content: flex-start;
}

.wp-block-buttons.is-content-justification-space-between {
    justify-content: space-between;
}

.wp-block-buttons.is-vertical {
    flex-direction: column;
}

.wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    font-weight: 500;
    font-size: 1rem;
    min-width: 240px;
    border-radius: 0;
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
    text-decoration: none;
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-text);
}

.wp-block-button__link:hover {
    background-color: transparent;
    color: var(--color-text);
    opacity: 0.8;
}

/* Outline style for wp-block-button */
.is-style-outline .wp-block-button__link {
    background-color: transparent !important;
    color: var(--color-text) !important;
}

.is-style-outline .wp-block-button__link:hover {
    background-color: transparent !important;
    color: var(--color-text) !important;
    opacity: 0.8;
}

/* News Component */
.news-list {
    margin-bottom: 56px;
    border-top: 1px solid var(--color-border);
}

.news-item {
    border-bottom: 1px solid var(--color-border);
}

.news-link {
    display: flex;
    align-items: baseline;
    gap: 40px;
    padding: 32px 24px;
    transition: background-color 0.3s ease;
}

.news-link:hover {
    background-color: var(--color-white);
    opacity: 1;
}

.news-date {
    font-family: var(--font-en);
    font-size: 1rem;
    color: var(--color-text-light);
    flex-shrink: 0;
    width: 120px;
}

.news-title {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.5;
}

.news-empty {
    padding: 40px 0;
    text-align: center;
    color: var(--color-text-light);
}

/* WordPress Core Blocks - Color & Background Support */
.has-background {
    padding: 1.25em 2.375em;
}

/* Default WP Color Palette */
.has-black-color { color: #000000 !important; }
.has-cyan-bluish-gray-color { color: #abb8c3 !important; }
.has-white-color { color: #ffffff !important; }
.has-pale-pink-color { color: #f78da7 !important; }
.has-vivid-red-color { color: #cf2e2e !important; }
.has-luminous-vivid-orange-color { color: #ff6900 !important; }
.has-luminous-vivid-amber-color { color: #fcb900 !important; }
.has-light-green-cyan-color { color: #7bdcb5 !important; }
.has-vivid-green-cyan-color { color: #00d084 !important; }
.has-pale-cyan-blue-color { color: #8ed1fc !important; }
.has-vivid-cyan-blue-color { color: #0693e3 !important; }
.has-vivid-purple-color { color: #9b51e0 !important; }

.has-black-background-color { background-color: #000000 !important; }
.has-cyan-bluish-gray-background-color { background-color: #abb8c3 !important; }
.has-white-background-color { background-color: #ffffff !important; }
.has-pale-pink-background-color { background-color: #f78da7 !important; }
.has-vivid-red-background-color { background-color: #cf2e2e !important; }
.has-luminous-vivid-orange-background-color { background-color: #ff6900 !important; }
.has-luminous-vivid-amber-background-color { background-color: #fcb900 !important; }
.has-light-green-cyan-background-color { background-color: #7bdcb5 !important; }
.has-vivid-green-cyan-background-color { background-color: #00d084 !important; }
.has-pale-cyan-blue-background-color { background-color: #8ed1fc !important; }
.has-vivid-cyan-blue-background-color { background-color: #0693e3 !important; }
.has-vivid-purple-background-color { background-color: #9b51e0 !important; }

/* Fluent Forms */
.fluentform {
    --form-label-width: 176px;
    --form-column-gap: 28px;
    --form-border-color: #c9c9c9;
    --form-input-border: #d7d7d7;
    --form-error-color: #d75a64;
    --form-label-offset: 10px;
}

.fluentform .frm-fluent-form {
    margin-top: 24px;
}

.fluentform .ff-el-group {
    display: grid;
    grid-template-columns: var(--form-label-width) minmax(0, 1fr);
    column-gap: var(--form-column-gap);
    align-items: start;
    margin: 0 !important;
    padding: 22px 1em !important;
    border-top: 1px solid var(--form-border-color);
}

.fluentform fieldset > .ff-el-group:last-of-type {
    border-bottom: none;
}

.fluentform .ff-el-input--label {
    grid-column: 1;
    grid-row: 1;
    margin: 0 !important;
    padding-top: var(--form-label-offset);
}

.fluentform .ff-el-input--label label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    margin: 0 !important;
    color: var(--color-text);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.fluentform .ff-el-input--label label::before {
    content: "任意";
    display: inline-flex;
    position: relative;
    top: 2px;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 2px 5px;
    border-radius: 4px;
    background-color: #d8d8d8;
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.2;
}

.fluentform .ff-el-input--label.ff-el-is-required label::before {
    content: "必須";
    background-color: #3a3a3a;
}

.fluentform .ff-el-input--label.ff-el-is-required label::after {
    content: none !important;
}

.fluentform .ff-el-group > .ff-el-input--content {
    grid-column: 2;
    grid-row: 1;
    margin: 0 !important;
}

.fluentform .ff-el-form-control {
    width: 100% !important;
    min-height: 44px;
    padding: 10px 14px !important;
    border: 1px solid var(--form-input-border) !important;
    border-radius: 3px !important;
    background-color: var(--color-white) !important;
    color: var(--color-text) !important;
    font-family: var(--font-ja);
    font-size: 1rem !important;
    line-height: 1.7 !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.fluentform .ff-el-form-control:focus {
    border-color: var(--color-text) !important;
    outline: none !important;
}

.fluentform textarea.ff-el-form-control {
    min-height: 230px;
    resize: vertical;
}

.fluentform .ff-t-container {
    display: grid !important;
    grid-template-columns: var(--form-label-width) minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--form-column-gap);
    align-items: start;
    margin: 0 !important;
    padding: 22px 1em !important;
    border-top: 1px solid var(--form-border-color);
}

.fluentform .ff-t-container::before {
    content: "必須";
    grid-column: 1;
    grid-row: 1;
    display: inline-flex;
    position: relative;
    top: 2px;
    align-items: center;
    justify-content: center;
    width: 30px;
    padding: 2px 5px;
    border-radius: 4px;
    background-color: #3a3a3a;
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: var(--form-label-offset);
}

.fluentform .ff-t-container::after {
    content: "お名前";
    grid-column: 1;
    grid-row: 1;
    margin-left: 46px;
    padding-top: var(--form-label-offset);
    color: var(--color-text);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.fluentform .ff-t-container .ff-t-cell {
    width: auto !important;
    padding: 0 !important;
    flex-basis: auto !important;
}

.fluentform .ff-t-container .ff-t-cell:first-of-type {
    grid-column: 2;
}

.fluentform .ff-t-container .ff-t-cell:last-of-type {
    grid-column: 3;
}

.fluentform .ff-t-container .ff-el-group {
    display: block;
    padding: 0 !important;
    border-top: none;
}

.fluentform .ff-t-container .ff-el-input--label {
    display: none;
}

.fluentform .ff-t-container .ff-el-input--content {
    grid-column: auto;
    grid-row: auto;
}

.fluentform .ff-el-form-check {
    display: inline-flex;
    align-items: center;
    margin: 0 24px 0 0 !important;
}

.fluentform .ff-el-form-check-label {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.7;
}

.fluentform .ff-el-form-check-input {
    appearance: none;
    position: relative;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    border: 1px solid var(--form-input-border) !important;
    border-radius: 0 !important;
    background-color: var(--color-white);
    vertical-align: middle;
}

.fluentform .ff-el-form-check-input:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid var(--form-error-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.fluentform .ff-el-form-check-input:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 2px;
}

.fluentform .ff-custom_html {
    display: block;
    padding: 42px 0 20px !important;
    border-top: none;
    text-align: center;
}

.fluentform .ff-custom_html p {
    margin: 0;
    color: var(--color-text);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.8;
}

.fluentform .ff-custom_html a {
    border-bottom: 3px double var(--form-error-color);
    text-decoration: none;
}

.fluentform .ff-el-tc {
    display: flex;
    justify-content: center;
    margin-left: 0 !important;
}

.fluentform .ff-el-group.ff-el-input--content {
    display: block;
    grid-template-columns: none;
    padding: 14px 1em 10px !important;
    border-top: none;
}

.fluentform .ff_tc_label {
    align-items: center !important;
}

.fluentform .ff_tc_label .ff-el-form-check-input {
    top: -5px;
}

.fluentform .ff_t_c p {
    margin: 0 !important;
    line-height: 1.7;
}

.fluentform .ff_submit_btn_wrapper {
    display: flex;
    justify-content: center;
    padding-top: 8px !important;
    border-top: none;
}

.fluentform .ff-btn-submit {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    padding: 16px 24px !important;
    border: 1px solid var(--color-text) !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    color: var(--color-text) !important;
    font-family: var(--font-ja);
    font-size: 1rem !important;
    font-weight: 500 !important;
    line-height: 1.6 !important;
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.fluentform .ff-btn-submit:hover {
    background-color: transparent !important;
    color: var(--color-text) !important;
    opacity: 0.8;
}

.fluentform .ff-el-is-error .ff-el-form-control {
    border-color: var(--form-error-color) !important;
}

.fluentform .text-danger,
.fluentform .ff-el-is-error .error {
    margin-top: 8px !important;
    color: var(--form-error-color) !important;
    font-size: 0.875rem !important;
    font-weight: 700;
}

@media (max-width: 768px) {
    .fluentform {
        --form-label-width: 100%;
        --form-column-gap: 0;
        --form-label-offset: 0;
    }

    .fluentform .ff-el-group {
        grid-template-columns: 1fr;
        row-gap: 10px;
        padding: 20px 0 !important;
    }

    .fluentform .ff-el-input--label,
    .fluentform .ff-el-group > .ff-el-input--content {
        grid-column: 1;
        grid-row: auto;
    }

    .fluentform .ff-el-input--label label {
        white-space: normal;
    }

    .fluentform .ff-t-container {
        grid-template-columns: 1fr;
        row-gap: 10px;
        padding: 20px 0 !important;
    }

    .fluentform .ff-t-container::before,
    .fluentform .ff-t-container::after,
    .fluentform .ff-t-container .ff-t-cell:first-of-type,
    .fluentform .ff-t-container .ff-t-cell:last-of-type {
        grid-column: 1;
    }

    .fluentform .ff-t-container::after {
        grid-row: 1;
    }

    .fluentform .ff-el-form-check {
        margin-right: 18px !important;
        margin-bottom: 8px !important;
    }

    .fluentform .ff-el-tc {
        margin-left: 0 !important;
    }

    .fluentform .ff-el-group.ff-el-input--content {
        padding: 14px 0 10px !important;
    }
}
