/* Prevent FOUC (Flash of Unstyled Content) for sidebar accordion */
/* Disable transitions on initial page load for mobile/tablet */
@media (max-width: 1279px) {

    .hpd-sidebar__content,
    .hpd-sidebar__icon {
        transition: none !important;
    }

    /* Re-enable transitions after page load via JS adding class */
    .js-loaded .hpd-sidebar__content,
    .js-loaded .hpd-sidebar__icon {
        transition: transform 0.3s ease !important;
    }
}

.hpd-top-2__results--announcements a {
    color: inherit;
    text-decoration: none;
}

.hpd-top-2__page-btn,
.hpd-top-2__filter-group a {
    text-decoration: none;
}

.hpd-top-2__search .hpd-top-2__search-btn {
    padding-right: 8px;
}

.hpd-top-2__no-results--announcements {
    padding: 30px;
}

.hpd-top-2__results--announcements {
    font-weight: bolder;
}

.hpd-top-2__results--announcements a,
.hpd-top-2__results--announcements span {
    font-weight: normal;
    display: inline-block;
    min-width: 1em;
    text-align: center;
    white-space: nowrap;
}

.hpd-top-2__results--announcements .is-active {
    font-weight: bolder;
}

.hpd-top-2__results--announcements .hpd-top-2__limit-option,
.hpd-top-2__sidebar-mobile-limit .hpd-top-2__limit-option {
    display: inline-block;
    width: 2em;
    min-width: 2em;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.hpd-top-2__results--announcements .hpd-top-2__limit-separator,
.hpd-top-2__sidebar-mobile-limit .hpd-top-2__limit-separator {
    display: inline-block;
    width: 1.2em;
    text-align: center;
    font-weight: normal;
}

.hpd-main-banner__notices-list {
    width: 100%;
}

/* Feedback 20251123 */
.container,
.container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.row {
    margin-left: 0;
    margin-right: 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.col-md-3 {
    width: 33.2%;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
}

.col-md-9 {
    width: 64.45%;
    padding-left: 0;
    padding-right: 0;
    margin-left: 0;
    margin-right: 0;
}

@media (max-width:767px) {
    .container {
        margin: 40px auto 0 auto;
        padding: 0 16px;
    }

    .row {
        display: block;
    }

    .col-md-9,
    .col-md-3 {
        width: 100%;
        margin-bottom: 20px;
    }
}

@media (min-width:768px) {
    .container {
        margin: 40px auto 0 auto;
        width: 100%;
        padding: 0 16px;
    }

    .row::before,
    .row::after {
        display: none
    }
}

@media (min-width:1200px) {
    .container {
        width: 1312px;
        margin-top: 40px;
    }
}

/* Center text vertically in notice title */
.hpd-main-banner__notice-title {
    display: flex;
    flex-direction: column;
    column-gap: 0.5rem;
    align-items: start;
}

.cbl-news-release-badge {
    color: var(--gray-dark-color-700);
    display: inline-block;
    width: auto;
}

.cbl-new-badge {
    color: #FF0000;
    display: inline-block;
    width: auto;
    text-align: right;
}

/* Footer fix for legacy wrapper pages (e.g. /about/saiyou) */
body>#wrap .hpd-footer .footer__nav-title {
    margin: 0 0 16px 0px;
    padding: 0 0 8px 0;
    line-height: 1.5em;
}

body>#wrap .hpd-footer .footer__horizontal-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Mail form error message */
.hpd-mail-form__error-message {
    color: #ff0000;
    font-size: 14px;
    margin-top: 5px;
    display: block;
    width: 100%;
}

@media (min-width: 768px) {
    .hpd-mail-form__field {
        position: relative;
    }

    .hpd-mail-form__field.has-note-error {
        margin-bottom: 60px;
    }

    .hpd-mail-form__field .hpd-mail-form__error-message {
        position: absolute;
        bottom: -30px;
        left: 285px;
        width: auto;
        margin-top: 0;
        padding-left: 0;
    }

    .hpd-mail-form__field .hpd-mail-form__note~.hpd-mail-form__error-message {
        bottom: -55px;
    }
}

/* Mail form success/error messages */
.hpd-mail-form__message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.hpd-mail-form__message--success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.hpd-mail-form__message--error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Inquiry form error message (Synced with Mail Form) */
.hpd-inquiry__error-message {
    color: #ff0000;
    font-size: 14px;
    margin-top: 5px;
    display: block;
    width: 100%;
}

@media (min-width: 768px) {
    .hpd-inquiry__field {
        position: relative;
    }

    .hpd-inquiry__field.has-note-error {
        margin-bottom: 60px;
    }

    .hpd-inquiry__field .hpd-inquiry__error-message {
        position: absolute;
        bottom: -30px;
        left: 260px;
        width: auto;
        margin-top: 0;
        padding-left: 0;
    }

    /* Use parent class selector instead of sibling combinator to handle nested wrappers */
    .hpd-inquiry__field.has-note-error .hpd-inquiry__error-message {
        bottom: -55px;
    }
}

/* Inquiry form success/error messages */
.hpd-inquiry__message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

@media (max-width: 767px) {
    .hpd-inquiry__message {
        margin-bottom: 0px;
        padding: 0px;
    }
}

.hpd-inquiry__message--success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.hpd-inquiry__message--error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Center slider items - only when pagination <= 1 (no arrows) */
.hpd-main-4__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__track {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hpd-main-4__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hpd-main-4__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__content {
    text-align: center;
}

.hpd-main-4__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hpd-main-4__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__image img {
    display: block;
    margin: 0 auto;
}

/* Center slider items for front-page - only when pagination <= 1 (no arrows) */
.hpd-main-1__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__track {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hpd-main-1__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hpd-main-1__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__content {
    text-align: center;
}

.hpd-main-1__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hpd-main-1__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__image img {
    display: block;
    margin: 0 auto;
}

/* Center slider items for page-main-2 - only when pagination <= 1 (no arrows) */
.hpd-main-2__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__track {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hpd-main-2__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hpd-main-2__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__content {
    text-align: center;
}

.hpd-main-2__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hpd-main-2__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__image img {
    display: block;
    margin: 0 auto;
}

/* Center slider items for page-main-3 - only when pagination <= 1 (no arrows) */
.hpd-main-3__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__track {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hpd-main-3__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hpd-main-3__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__content {
    text-align: center;
}

.hpd-main-3__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hpd-main-3__slider-section .hpd-slider:not(:has(.hpd-slider__arrow)) .hpd-slider__image img {
    display: block;
    margin: 0 auto;
}

.hpd-slider__title {
    text-align: left;
}

.hpd-slider__content {
    padding: 4px 0;
}

/* Fix for banner images on SP - Hide them as requested */
@media screen and (max-width: 767px) {
    .hpd-main-banner__image {
        display: none !important;
    }
}

/* Accordion for SP */
@media screen and (max-width: 767px) {
    .hpd-section-header__title {
        position: relative;
        cursor: pointer;
        padding-right: 30px;
        /* Space for arrow */
    }

    .hpd-section-header__title::after {
        content: '';
        position: absolute;
        top: 45%;
        right: 14px;
        width: 10px;
        height: 10px;
        border-right: 2px solid #333;
        border-bottom: 2px solid #333;
        transform: translateY(-50%) rotate(45deg);
        transition: transform 0.3s ease;
    }

    /* Target the parent section when open */
    [class*="hpd-main-"][class*="__section"].is-open .hpd-section-header__title::after {
        transform: translateY(-50%) rotate(-135deg);
        top: calc(45% + 5px);
    }

    /* Hide section body by default on mobile */
    [class*="hpd-main-"][class*="__section-body"] {
        display: none;
        padding-top: 10px;
    }

    /* Show section body when parent is open */
    [class*="hpd-main-"][class*="__section"].is-open [class*="hpd-main-"][class*="__section-body"] {
        display: block;
    }
}

/* Enforce slider image size for Main 1, 2, 4 and Home */
.page-template-page-main .hpd-slider__image,
.page-template-page-main-2 .hpd-slider__image,
.page-template-page-main-4 .hpd-slider__image,
.home .hpd-slider__image {
    width: 240px;
    height: auto;
}

.page-template-page-main .hpd-slider__image img,
.page-template-page-main-2 .hpd-slider__image img,
.page-template-page-main-4 .hpd-slider__image img,
.home .hpd-slider__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hpd-top-1__link-banners .hpd-top-1__link-banner {
    width: 225px;
    height: 63px;
}

@media screen and (min-width: 768px) and (max-width: 1279px) {
    .hpd-top-1__link-banners {
        gap: 10px;
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .hpd-top-1__container .cbl-slider-section {
        max-width: 764px;
        margin-left: auto;
        margin-right: auto;
    }

    .hpd-top-1__container .cbl-slider-section__inner {
        max-width: 100%;
    }
}

/* Sidebar Accordion and Hierarchy */

/* PC (>= 1280px): Default open all accordions */
@media (min-width: 1280px) {
    .hpd-sidebar__content {
        display: block;
    }

    .hpd-sidebar__item.is-active .hpd-sidebar__content {
        display: block;
    }

    /* Default icon rotated (open state) on PC */
    .hpd-sidebar__icon {
        transform: rotate(180deg);
    }

    .hpd-sidebar__item:not(.is-active) .hpd-sidebar__icon {
        transform: rotate(0deg);
    }

    .hpd-sidebar__item:not(.is-active) .hpd-sidebar__content {
        display: none;
    }
}

/* Mobile/Tablet (< 1280px): Default close all accordions */
@media (max-width: 1279px) {
    .hpd-sidebar__content {
        display: none !important;
    }

    .hpd-sidebar__item.is-active .hpd-sidebar__content {
        display: block !important;
    }

    .hpd-sidebar__icon {
        transform: rotate(0deg);
    }

    .hpd-sidebar__item.is-active .hpd-sidebar__icon {
        transform: rotate(180deg);
    }
}

/* Sidebar Link Synchronization */
.hpd-sidebar__link {
    color: var(--sidebar-link-color);
    text-decoration: none;
}

.hpd-sidebar__link:hover {
    color: var(--sidebar-link-hover-color);
    text-decoration: underline;
}

/* Sidebar Hierarchy (4 Levels) */
/* Level 2 (Main categories inside accordion) */
.hpd-sidebar__list .hpd-sidebar__link {
    padding-left: 0;
}

/* Level 3 (Sub categories) */
.hpd-sidebar__sublist {
    margin-top: 4px;
    list-style: none;
    padding-left: 16px;
}

.hpd-sidebar__sublist .hpd-sidebar__link {
    padding-left: 12px;
    position: relative;
    display: inline-block;
}

.hpd-sidebar__sublist .hpd-sidebar__link::before {
    content: "・";
    position: absolute;
    left: 0;
    color: var(--gray-dark-color-700);
    font-size: 14px;
    line-height: 1.6;
}

/* Level 4 (Nested items) */
.hpd-sidebar__sublist .hpd-sidebar__sublist {
    padding-left: 15px;
    /* Additional shift */
}

.hpd-sidebar__sublist .hpd-sidebar__sublist .hpd-sidebar__link::before {
    content: none !important;
    /* Remove dot for level 4 */
}

.hpd-sidebar__sublist .hpd-sidebar__sublist .hpd-sidebar__link {
    padding-left: 0;
}

/* Fix for Application Documents Henkou Layout */
.hpd-007__main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
    min-width: 0;
}

.hpd-007__main.is-double {
    width: 100%;
}

/* Ensure sidebar doesn't shrink in flex container */
.hpd-007__content .hpd-sidebar {
    flex-shrink: 0;
}

/* Slider gradient overlay for narrow viewer*/
@media screen and (max-width: 1279px) {

    .hpd-slider__container::before,
    .hpd-slider__container::after {
        content: "";
        position: absolute;
        top: 0;
        width: 80px;
        /* グラデーションの幅 */
        height: 100%;
        pointer-events: none;
        /* クリックを邪魔しない */
        z-index: 2;
    }

    .hpd-slider__container::before {
        left: 0;
        background: linear-gradient(to right, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
    }

    .hpd-slider__container::after {
        right: 0;
        background: linear-gradient(to left, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
    }
}


/* ========================================
   Swiper Slider for Front Page
   5 slides x 240px + 4 gaps x 20px = 1280px
   ======================================== */
.hpd-slider--swiper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1280px;
    margin: 0 auto;
}

.hpd-slider--swiper .hpd-swiper-top {
    width: 1280px;
    max-width: 100%;
    overflow: hidden;
}

.hpd-swiper-top .swiper-slide {
    width: 240px !important;
    flex-shrink: 0;
    background-color: var(--white-color, #fff);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hpd-swiper-top .swiper-slide:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.hpd-swiper__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.hpd-swiper__image {
    width: 240px;
    height: auto;
    overflow: hidden;
    background-color: var(--gray-color-50, #f5f5f5);
}

@media (max-width: 767px) {
    .hpd-swiper__image {
        width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .hpd-swiper__image {
        width: 100% !important;
    }

    .cbl-slider-section__inner {
        max-width: 1210px;
    }
}

.hpd-swiper__image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.hpd-swiper__content {
    padding: 4px 0;
    min-height: 60px;
    display: flex;
    flex-direction: column;
}

.hpd-swiper__title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-color, #333);
    text-align: left;
    margin: 0;
}

/* Arrows positioning */
.hpd-slider--swiper .hpd-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.hpd-slider--swiper .hpd-slider__arrow--prev {
    left: -50px;
}

.hpd-slider--swiper .hpd-slider__arrow--next {
    right: -50px;
}

/* Responsive */
@media (max-width: 1279px) {
    .hpd-slider--swiper .hpd-slider__arrow--prev {
        left: -40px;
    }

    .hpd-slider--swiper .hpd-slider__arrow--next {
        right: -40px;
    }
}

@media (max-width: 767px) {
    .hpd-swiper-top .swiper-slide {
        width: 200px !important;
    }
}

/* Career Index Template Synchronization */
.hpd-job-list__cell--content * {
    font: revert;
    font-family: inherit;
}

.hpd-job-list__cell--content p {
    margin: 0;
}

.hpd-job-list__cell--content p+p {
    margin-top: 10px;
}

.hpd-job-list__cell--content ul {
    margin: 10px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.hpd-job-list__cell--content li {
    margin-bottom: 5px;
}

.hpd-job-list__cell--content a {
    color: var(--sidebar-link-color);
    text-decoration: underline;
}

.hpd-job-list__cell--content a:hover {
    color: var(--sidebar-link-hover-color);
}

/* About page pamphlet - scale down on mobile */
@media (max-width: 767px) {
    .hpd-about__pamphlet {
        width: 80%;
        height: auto;
        display: block;
        margin: 0 auto 15px;
    }
}


/* Mobile search input - show when active */
@media (max-width: 1279px) {
    .header__search-form {
        position: absolute;
        right: 100px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .header__search-form.is-active {
        opacity: 1;
        visibility: visible;
    }

    .header__search-form.is-active .header__search-input {
        display: block;
        width: calc(100vw - 140px);
        max-width: 300px;
    }

    .header__search-form.is-active .header__search-button {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
    }
}

@media (max-width: 480px) {
    .header__search-form.is-active .header__search-input {
        width: calc(100vw - 120px);
        max-width: 240px;
    }
}

/* Category buttons - すべて stays in column 1, other items in columns 2,3,4 */
@media (max-width: 767px) {
    .hpd-top-2__sidebar-mobile-btns--category {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
        justify-items: stretch;
    }

    /* すべて (first item) - always column 1, row 1 */
    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:first-child {
        grid-column: 1;
        grid-row: 1;
    }

    /* Items 2,3,4 -> columns 2,3,4 row 1 */
    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
    }

    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:nth-child(3) {
        grid-column: 3;
        grid-row: 1;
    }

    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:nth-child(4) {
        grid-column: 4;
        grid-row: 1;
    }

    /* Items 5,6,7 -> columns 2,3,4 row 2 */
    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:nth-child(5) {
        grid-column: 2;
        grid-row: 2;
    }

    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:nth-child(6) {
        grid-column: 3;
        grid-row: 2;
    }

    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:nth-child(7) {
        grid-column: 4;
        grid-row: 2;
    }

    /* Items 8,9,10 -> columns 2,3,4 row 3 */
    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:nth-child(8) {
        grid-column: 2;
        grid-row: 3;
    }

    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:nth-child(9) {
        grid-column: 3;
        grid-row: 3;
    }

    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:nth-child(10) {
        grid-column: 4;
        grid-row: 3;
    }

    /* Items 11,12,13 -> columns 2,3,4 row 4 */
    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:nth-child(11) {
        grid-column: 2;
        grid-row: 4;
    }

    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:nth-child(12) {
        grid-column: 3;
        grid-row: 4;
    }

    .hpd-top-2__sidebar-mobile-btns--category .hpd-top-2__filter-btn-mobile:nth-child(13) {
        grid-column: 4;
        grid-row: 4;
    }

    /* 公開年度から探す - same layout */
    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
        justify-items: stretch;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:first-child {
        grid-column: 1;
        grid-row: 1;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:nth-child(3) {
        grid-column: 3;
        grid-row: 1;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:nth-child(4) {
        grid-column: 4;
        grid-row: 1;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:nth-child(5) {
        grid-column: 2;
        grid-row: 2;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:nth-child(6) {
        grid-column: 3;
        grid-row: 2;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:nth-child(7) {
        grid-column: 4;
        grid-row: 2;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:nth-child(8) {
        grid-column: 2;
        grid-row: 3;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:nth-child(9) {
        grid-column: 3;
        grid-row: 3;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:nth-child(10) {
        grid-column: 4;
        grid-row: 3;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:nth-child(11) {
        grid-column: 2;
        grid-row: 4;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:nth-child(12) {
        grid-column: 3;
        grid-row: 4;
    }

    .hpd-top-2__sidebar-mobile-group:last-child .hpd-top-2__sidebar-mobile-btns .hpd-top-2__filter-btn-mobile:nth-child(13) {
        grid-column: 4;
        grid-row: 4;
    }
}

.hpd-sidebar__link__special .bracket-left {
    margin-left: -0.3em;
}

.hpd-sidebar__link__special .bracket-right {
    margin-right: -0.3em;
}

.hpd-sidebar__link__special {
    letter-spacing: -0.25px;
}

.justify-center-custom {
    justify-content: center;
}

/* Inquiry Form Confirmation Styles */
.hpd-inquiry__submit-confirm {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.hpd-inquiry__button-confirm {
    max-width: 250px !important;
    width: 100% !important;
    text-decoration: none !important;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
}

.hpd-inquiry__confirm-value-box {
    padding: 13px 15px;
    min-height: 50px;
    width: 100%;
    line-height: 1.1;
}

.hpd-inquiry__intro-complete {
    padding: 50px 50px 75px 50px;
}

@media (max-width: 767px) {
    .hpd-inquiry__intro-complete {
        padding: 30px 20px 50px 20px;
    }
}

.hpd-inquiry__intro-complete .hpd-inquiry__submit {
    margin-top: 50px;
}

.hpd-inquiry__intro-complete .hpd-inquiry__submit a {
    text-decoration: none;
}

@media (max-width: 767px) {
    .hpd-inquiry__submit-confirm {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .hpd-inquiry__button-confirm {
        max-width: 100% !important;
    }
}

/* Utility Classes for Inquiry Form */
.hpd-inquiry__display-none {
    display: none !important;
}

.hpd-inquiry__display-flex {
    display: flex !important;
}

.hpd-inquiry__display-block {
    display: block !important;
}

.hpd-inquiry__display-inline {
    display: inline !important;
}

.hpd-inquiry__form--recruit {
    --inquiry-theme-color: #7F7F7F;
    --inquiry-header-bg: #DFDFDF;
}

.hpd-inquiry__recruit-note-wrapper {
    width: 100%;
    margin-top: 10px;
}

.hpd-inquiry__form--confirm {
    display: block !important;
}

@media (max-width: 767px) {
    .hpd-inquiry__display-flex {
        display: block !important;
    }
}

/* Mail Magazine Form Confirmation Styles */
.hpd-mail-form__submit-confirm {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.hpd-mail-form__button-confirm {
    max-width: 250px !important;
    width: 100% !important;
    text-decoration: none !important;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    font-size: 16px;
}

a.hpd-mail-form__button-confirm:hover {
    background-color: #777;
    border-color: #777;
}

@media (max-width: 767px) {
    .hpd-mail-form__submit-confirm {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 0 20px 0 20px;
    }

    .hpd-mail-form__button-confirm {
        max-width: 100% !important;
    }
}

/* Header Hide/Show on Scroll - Applied to all screen sizes */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transform: translate3d(0, 0, 0);
    will-change: transform;
    transition: transform 0.3s ease-in-out;
}

.header.header--hidden {
    transform: translate3d(0, calc(-1 * var(--header-height, 80px)), 0);
}

/* Add padding to body to prevent content jump when header is fixed */
body {
    padding-top: var(--header-height, 80px);
}

.map-custom {
    max-height: 600px;
    width: 80%;
    margin: auto;
}


/* Center last banner when odd number of items in hpd-top-1__link-banners - SP only */
@media (max-width: 767px) {
    .hpd-top-1__link-banners {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    /* When last item is odd (3rd, 5th, 7th...), center it on new row */
    .hpd-top-1__link-banner:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        width: calc(50% - 7.5px) !important;
        margin: 0 auto !important;
    }

    /* Ensure the image inside maintains its size */
    .hpd-top-1__link-banner:last-child:nth-child(odd) img {
        display: inline-block !important;
    }
}


/* Fix header height when hamburger menu is clicked */
/* Prevent header__main from changing height when search mobile opens */
.header__main,
.hpd-header__main,
.header__container {
    min-height: 80px;
}

@media (max-width: 1279px) {
    .header__main,
    .hpd-header__main,
    .header__container {
        min-height: 60px;
    }
}

/* Make search mobile absolute positioned to not affect header height */
.header__search-mobile {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
}

/* Remove tap highlight color on mobile for ALL drawer elements */
.header__menu-toggle,
.header__drawer,
.header__drawer *,
.header__drawer a,
.header__drawer button {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
}

/* Remove all pseudo-class color changes */
.header__menu-toggle a:link,
.header__menu-toggle a:visited,
.header__menu-toggle a:hover,
.header__menu-toggle a:active,
.header__menu-toggle a:focus,
.header__drawer a:link,
.header__drawer a:visited,
.header__drawer a:hover,
.header__drawer a:active,
.header__drawer a:focus {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
}

/* Specific fix for drawer items */
.header__drawer-item,
.header__drawer-item-secondary,
.header__drawer-link,
.header__drawer-link-secondary {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
}


/* Fix キーワードから探す label alignment on SP */
@media (max-width: 767px) {
    .hpd-top-2__sidebar-mobile-right .hpd-top-2__sidebar-mobile-label {
        text-align: left !important;
        display: block !important;
        width: 100% !important;
        align-self: flex-start !important;
    }
    
    /* Keep limit section on the right */
    .hpd-top-2__sidebar-mobile-limit {
        text-align: right !important;
        align-self: flex-end !important;
    }
}


/* Ensure キーワードから探す label is always on its own row on tablet */
@media (min-width: 768px) and (max-width: 1279px) {
    .hpd-top-2__sidebar-mobile-right .hpd-top-2__sidebar-mobile-label {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
        align-self: flex-start !important;
    }
    
    /* Keep limit section on the right */
    .hpd-top-2__sidebar-mobile-limit {
        text-align: right !important;
        align-self: flex-end !important;
    }
}
