/* ========================================
   Variables (defaults - overridden by Customizer via :root)
======================================== */
:root {
    --color-primary: #1a56db;
    --color-primary-dark: #1642a8;
    --color-header-bg: #fff;
    --color-footer-bg: #000;
    --color-page-header-bg: #475569;
    --color-cta-bg: #475569;
    --color-text: #333;
    --color-text-light: #666;
    --color-white: #fff;
    --color-black: #000;
    --color-bg: #f5f5f5;
    --color-border: #ddd;
    --font-family: "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
    --header-height: 80px;
    --header-height-sp: 60px;
    --container-width: 1140px;
    --content-width: 1000px;
    --section-width: 1140px;
    --font-size-h2: 1.75rem;
    --font-size-h3: 1.25rem;
    --font-size-h4: 1rem;
    --font-weight-h2: 700;
    --font-weight-h3: 700;
    --font-weight-h4: 700;
    --btn-radius: 0px;
    --hero-overlay-opacity: 0.3;
    --transition: 0.3s ease;
}

/* ========================================
   Base
======================================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    line-height: 1.8;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-primary);
}

/* ========================================
   Container
======================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* ========================================
   Buttons
======================================== */
.btn {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.75rem 2.5rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    border-radius: var(--btn-radius);
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn--primary:hover {
    background: var(--color-primary-dark);
    color: var(--color-white);
}

.btn--outline {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: 1px solid var(--color-text);
    color: var(--color-text);
    background: transparent;
}

.btn--outline:hover {
    background: var(--color-text);
    color: var(--color-white);
}

/* WordPress Block Button */
.wp-block-button.is-style-fill .wp-block-button__link,
.wp-block-button:not(.is-style-outline) .wp-block-button__link {
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.75rem 2.5rem;
    border: none;
    border-radius: var(--btn-radius);
    transition: var(--transition);
}

.wp-block-button.is-style-fill .wp-block-button__link:hover,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
    background: var(--color-primary-dark);
    color: var(--color-white);
    opacity: 1;
}

.wp-block-button.is-style-outline .wp-block-button__link {
    border: 1px solid var(--color-text);
    color: var(--color-text);
    background: transparent;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.75rem 2rem;
    border-radius: var(--btn-radius);
    transition: var(--transition);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: var(--color-text);
    color: var(--color-white);
    opacity: 1;
}

/* ========================================
   Header
======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--color-header-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: var(--header-height);
    transition: box-shadow var(--transition);
}

.header.is-scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.header__logo {
    display: flex;
    align-items: center;
}

.header__logo a {
    display: flex;
    align-items: center;
}

.header__logo img,
.header__logo .custom-logo {
    height: 50px;
    width: auto;
}

.header__logo-link {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.header__logo-link:hover {
    color: var(--color-primary);
}

/* ========================================
   Global Navigation
======================================== */
.gnav__list {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gnav__list li {
    list-style: none;
}

.gnav__item a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    position: relative;
}

.gnav__item a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: var(--transition);
}

.gnav__item a:hover {
    color: var(--color-primary);
}

.gnav__item a:hover::after {
    width: 80%;
}

.gnav__item.current-menu-item a::after {
    width: 80%;
}

/* Sub-menu (Dropdown) */
.gnav__list .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    background: var(--color-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 100;
}

.gnav__list > li {
    position: relative;
}

.gnav__list > li:hover > .sub-menu {
    display: block;
}

.gnav__list .sub-menu li {
    list-style: none;
}

.gnav__list .sub-menu li a {
    display: block;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.gnav__list .sub-menu li a::after {
    display: none;
}

/* ========================================
   Hamburger (Mobile)
======================================== */
.header__sp-btns {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.header__tel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--color-primary);
}

.header__tel:hover {
    color: var(--color-primary-dark);
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    transition: var(--transition);
}

.hamburger.is-open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
    opacity: 0;
}

.hamburger.is-open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

body.is-menu-open {
    overflow: hidden;
}

/* ========================================
   Hero
======================================== */
.hero {
    margin-top: var(--header-height);
    position: relative;
    overflow: hidden;
    height: 600px;
}

.hero__default {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--color-page-header-bg);
}

.hero__slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero__slide.is-active {
    opacity: 1;
}

.hero__slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
}

.hero__content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 5%;
    background: rgba(0, 0, 0, var(--hero-overlay-opacity));
    z-index: 10;
}

.hero__content-item {
    display: none;
}

.hero__content-item.is-active {
    display: block;
}

.hero__catch {
    color: var(--color-white);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.hero__sub {
    color: var(--color-white);
    font-size: 1.25rem;
    margin-top: 1rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
}

.hero__btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 2.5rem;
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition);
}

.hero__btn:hover {
    background: var(--color-primary-dark);
    color: var(--color-white);
}

.hero__dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 20;
}

.hero__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.hero__dot.is-active {
    background: rgba(255, 255, 255, 0.9);
}

.hero__dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* ========================================
   News (Front Page Section)
======================================== */
.news {
    background: var(--color-bg);
    padding: 2rem 0;
}

.news__inner {
    max-width: 900px;
    margin: 0 auto;
}

.news__title {
    color: var(--color-text);
    font-size: var(--font-size-h2);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.news__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
    position: relative;
    transition: var(--transition);
}

.news__item:hover {
    opacity: 0.7;
}

.news__link::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.news__date {
    color: var(--color-text-light);
    flex-shrink: 0;
    font-size: 0.9rem;
}

.news__label {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    flex-shrink: 0;
}

.news__link {
    color: var(--color-text);
}

.news__btn-wrap {
    text-align: center;
    margin-top: 2rem;
}

/* ========================================
   News Page (List)
======================================== */
.news-page {
    padding: 2rem 0;
}

.news-page__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news-page__list .news__item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
}

.news-page__list .news__item:first-child {
    border-top: 1px solid var(--color-border);
}

.news-page__list .news__item:hover {
    background: var(--color-bg);
    opacity: 1;
}

.news-page__list .news__link:hover {
    color: var(--color-primary);
}

/* ========================================
   News Detail
======================================== */
.news-detail {
    padding: 2rem 0;
}

.news-detail__article {
    max-width: 800px;
    margin: 0 auto;
}

.news-detail__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.news-detail__date {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.news-detail__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.news-detail__thumbnail {
    margin-bottom: 2rem;
}

.news-detail__thumbnail img {
    width: 100%;
    height: auto;
}

.news-detail__content {
    line-height: 2;
}

.news-detail__content p {
    margin-bottom: 1.5rem;
}

.news-detail__content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
}

.news-detail__content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.news-detail__content img {
    margin: 1rem 0;
}

.news-detail__content ul,
.news-detail__content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.news-detail__back {
    max-width: 800px;
    margin: 3rem auto 0;
    text-align: center;
}

/* Post navigation */
.post-navigation {
    max-width: 800px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
}

.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.post-navigation .nav-previous a,
.post-navigation .nav-next a {
    color: var(--color-primary);
    font-size: 0.9rem;
}

.post-navigation .nav-previous a:hover,
.post-navigation .nav-next a:hover {
    color: var(--color-primary-dark);
}

/* ========================================
   Page Header
======================================== */
.page-header {
    background: var(--color-page-header-bg);
    padding: 4rem 0;
    margin-top: var(--header-height);
    text-align: center;
    margin-bottom: 32px;
}

.page-header__title {
    font-size: var(--font-size-h2);
    font-weight: 700;
    color: var(--color-white);
    margin: 0;
}

/* ========================================
   Breadcrumb
======================================== */
.breadcrumb {
    margin-top: 1rem;
}

.breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.breadcrumb__item {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb__item:not(:last-child)::after {
    content: ">";
    margin-left: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
}

.breadcrumb__link {
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb__link:hover {
    color: var(--color-white);
}

.breadcrumb__current {
    color: var(--color-white);
}

/* ========================================
   CTA Section
======================================== */
.cta {
    background: var(--color-cta-bg);
    padding: 2rem 0;
    text-align: center;
}

.cta__title {
    font-size: var(--font-size-h2);
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 1rem;
}

.cta__text {
    color: var(--color-white);
    margin-bottom: 3rem;
}

.cta__box {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
}

.cta__tel {
    text-align: center;
}

.cta__num {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-white);
    letter-spacing: 0.02em;
}

.cta__num:hover {
    color: var(--color-white);
    opacity: 0.8;
}

.cta__hours {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.cta__btn {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 700;
    padding: 1rem 2rem;
    transition: var(--transition);
}

.cta__btn:hover {
    background: var(--color-primary-dark);
    color: var(--color-white);
}

/* ========================================
   Page Content
======================================== */
.page-content {
    /* padding: 2rem 0; */
}

.page-content .content {
    max-width: var(--content-width);
    margin: 0 auto;
}

.page-content h2,
.page-content .wp-block-heading:where(h2) {
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-h2);
}

.page-content h3,
.page-content .wp-block-heading:where(h3) {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-h3);
}

.page-content h4,
.page-content .wp-block-heading:where(h4) {
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-h4);
}

/* ========================================
   Site Content (Sidebar layout)
======================================== */
.site-content.has-sidebar {
    display: grid;
    gap: 3rem;
    grid-template-columns: 1fr 300px;
}

.site-content.has-sidebar.sidebar-left {
    grid-template-columns: 300px 1fr;
}

.site-content.has-sidebar.sidebar-left .site-main {
    order: 2;
}

.site-content.has-sidebar.sidebar-left .sidebar {
    order: 1;
}

/* ========================================
   Sidebar
======================================== */
.sidebar {
    padding-top: 0;
}

.widget {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--color-bg);
}

.widget__title {
    font-size: 1rem;
    font-weight: 700;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--color-primary);
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: var(--color-text);
    font-size: 0.9rem;
}

.widget ul li a:hover {
    color: var(--color-primary);
}

/* ========================================
   Search Form
======================================== */
.search-form__label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.search-form__inner {
    display: flex;
}

.search-form__input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--color-border);
    border-right: none;
    font-size: 0.95rem;
    outline: none;
}

.search-form__input:focus {
    border-color: var(--color-primary);
}

.search-form__submit {
    padding: 0.6rem 1rem;
    background: var(--color-primary);
    color: var(--color-white);
    border: 1px solid var(--color-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.search-form__submit:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

/* ========================================
   404 Page
======================================== */
.error-404 {
    padding: 2rem 0;
}

.error-404__content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.error-404__code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-404__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.error-404__text {
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

/* ========================================
   Content None
======================================== */
.content-none {
    padding: 2rem 0;
    text-align: center;
}

.content-none__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.content-none__text {
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

/* ========================================
   Pagination
======================================== */
.nestia-pagination,
.pagination,
.nav-links {
    margin-top: 3rem;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.9rem;
    margin: 0 2px;
    transition: var(--transition);
}

.page-numbers:hover {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.page-numbers.current {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.page-numbers.dots {
    border: none;
}

.page-numbers.dots:hover {
    background: transparent;
    color: var(--color-text);
}

/* ========================================
   Footer
======================================== */
.footer {
    background: var(--color-footer-bg);
    padding: 40px 0 20px;
}

.footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__logo a {
    display: inline-block;
}

.footer__logo img,
.footer__logo .custom-logo {
    height: 40px;
    filter: brightness(0) invert(1);
}

.footer__logo-link {
    color: var(--color-white);
    font-size: 1.1rem;
    font-weight: 700;
}

.footer__logo-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

.footer__company {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.footer__company p {
    margin: 0;
}

.footer__company-name {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.footer__nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer__nav-list li {
    list-style: none;
}

.footer__nav-list li a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.footer__nav-list li a:hover {
    color: var(--color-white);
}

.footer__widgets {
    padding: 30px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-widget {
    color: rgba(255, 255, 255, 0.7);
}

.footer-widget .widget__title {
    color: var(--color-white);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.footer-widget a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-widget a:hover {
    color: var(--color-white);
}

.footer__copy {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-top: 20px;
}

/* ========================================
   Block Pattern: Section width (共通)
======================================== */
.nestia-cards-section,
.nestia-img-text,
.nestia-2col-section,
.nestia-greeting,
.nestia-company-info,
.nestia-access,
.nestia-flow {
    max-width: var(--section-width);
    margin-left: auto;
    margin-right: auto;
}

/* ── Pattern: padding 統一 ── */
.nestia-cards-section,
.nestia-2col-section,
.nestia-greeting,
.nestia-company-info,
.nestia-access,
.nestia-flow,
.nestia-text-section-bg,
.nestia-concerns {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

/* ── Pattern: 見出し margin-bottom 統一 ── */
.nestia-cards-section > .wp-block-heading,
.nestia-2col-section > .wp-block-heading,
.nestia-greeting > .wp-block-heading,
.nestia-company-info > .wp-block-heading,
.nestia-access > .wp-block-heading,
.nestia-flow > .wp-block-heading,
.nestia-text-section-bg > .wp-block-heading,
.nestia-concerns > .wp-block-heading {
    margin-bottom: 2rem !important;
}

/* ========================================
   Block Pattern: Cards Section
======================================== */
.nestia-cards-section > .wp-block-heading {
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-h2);
    color: var(--color-text);
}

.nestia-card {
    background: var(--color-bg);
    padding: 2rem 1.5rem;
    border-top: 4px solid var(--color-primary);
}

.nestia-card h3 {
    font-size: var(--font-size-h3);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.nestia-card p {
    line-height: 1.8;
    color: var(--color-text-light);
}

/* ========================================
   Block Pattern: Image Cards (.nestia-img-card)
======================================== */
.nestia-img-card {
    background: var(--color-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.nestia-img-card .wp-block-image {
    margin-bottom: 0;
}

.nestia-img-card .wp-block-image img {
    aspect-ratio: 4/3;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.nestia-img-card__body {
    padding: 1.25rem;
}

.nestia-img-card__body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.nestia-img-card__body p {
    line-height: 1.8;
    color: var(--color-text-light);
}

/* ========================================
   Block Pattern: Image + Text (.nestia-img-text)
======================================== */
.nestia-img-text {
    overflow: hidden;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.nestia-img-text .wp-block-columns {
    margin-bottom: 0;
    gap: 0;
}

.nestia-img-text + .nestia-img-text {
    margin-top: 48px;
}

.nestia-img-text .nestia-img-text__img img {
    width: 100%;
    height: 450px;
    object-fit: cover;
}

.nestia-img-text .nestia-img-text__content {
    padding: 60px 5%;
}

.nestia-img-text--img-left .nestia-img-text__content {
    padding-left: 4rem;
}

.nestia-img-text--img-right .nestia-img-text__content {
    padding-right: 4rem;
}

.nestia-img-text .nestia-img-text__content h2 {
    font-size: var(--font-size-h2);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.nestia-img-text .nestia-img-text__content p {
    font-size: 1rem;
    line-height: 2;
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

/* ========================================
   Block Pattern: Detail Cards (.nestia-detail-card)
======================================== */
.nestia-detail-section .nestia-detail-card {
    margin-bottom: 4rem;
}

.nestia-detail-section .nestia-detail-card:last-child {
    margin-bottom: 0;
}

.nestia-detail-card__content {
    padding: 1rem 0;
}

.nestia-detail-card__title {
    font-size: var(--font-size-h3);
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--color-primary);
}

.nestia-detail-section .nestia-detail-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.nestia-detail-section .nestia-detail-card p {
    line-height: 2;
    color: var(--color-text-light);
}

/* ========================================
   Block Pattern: Access Map (.nestia-access)
======================================== */
.nestia-access__map {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.nestia-access__map iframe {
    display: block;
    width: 100%;
    height: 450px;
}

@media (max-width: 767px) {
    .nestia-access__map iframe {
        height: 300px;
    }
}

/* ========================================
   Block Pattern: Flow (.nestia-flow)
======================================== */
/* 共通: 番号バッジ */
.nestia-flow__num {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    flex-shrink: 0;
}

/* 横4列: 各カード */
.nestia-flow__item {
    text-align: center;
    padding: 2rem 1.25rem;
}

/* 縦4段 */
.nestia-flow__v-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.nestia-flow__v-item:last-child {
    border-bottom: none;
}

.nestia-flow__v-item .nestia-flow__num {
    margin: 0;
}

.nestia-flow__v-body {
    flex: 1;
    padding: 0;
}

.nestia-flow__v-body .wp-block-heading {
    margin-top: 0;
}

@media (max-width: 767px) {
    .nestia-flow__item {
        padding: 1.5rem 1rem;
    }
}

/* ========================================
   Block Pattern: Info Table (.nestia-info-table)
======================================== */
.nestia-info-table table {
    width: 100%;
    border-collapse: collapse;
}

.nestia-info-table table th,
.nestia-info-table table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
    line-height: 1.8;
}

.nestia-info-table table tr {
    background: var(--color-white);
}

.nestia-info-table table th {
    width: 200px;
    font-weight: 700;
    white-space: nowrap;
    background: transparent;
}

@media (max-width: 767px) {
    .nestia-info-table table th,
    .nestia-info-table table td {
        display: block;
        width: 100%;
        padding: 0.75rem 0;
    }

    .nestia-info-table table th {
        padding-bottom: 0.25rem;
        border-bottom: none;
    }

    .nestia-info-table table td {
        padding-top: 0;
    }
}

/* ========================================
   Block Pattern: Latest Posts Cards (.nestia-latest-cards)
======================================== */
.wp-block-latest-posts.nestia-latest-cards.is-grid {
    display: grid !important;
    gap: 1.5rem;
    padding: 0;
    list-style: none;
}

.wp-block-latest-posts.nestia-latest-cards.columns-2 { grid-template-columns: repeat(2, 1fr); }
.wp-block-latest-posts.nestia-latest-cards.columns-3 { grid-template-columns: repeat(3, 1fr); }
.wp-block-latest-posts.nestia-latest-cards.columns-4 { grid-template-columns: repeat(4, 1fr); }
.wp-block-latest-posts.nestia-latest-cards.columns-5 { grid-template-columns: repeat(5, 1fr); }
.wp-block-latest-posts.nestia-latest-cards.columns-6 { grid-template-columns: repeat(6, 1fr); }

.wp-block-latest-posts.nestia-latest-cards li {
    background: var(--color-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow var(--transition);
    margin: 0 !important;
    width: 100% !important;
    display: flex;
    flex-direction: column;
    position: relative;
}

.wp-block-latest-posts.nestia-latest-cards li:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.wp-block-latest-posts.nestia-latest-cards .wp-block-latest-posts__post-title:hover {
    color: inherit;
}

.wp-block-latest-posts.nestia-latest-cards .wp-block-latest-posts__post-title::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.nestia-latest-cards__more {
    margin-top: auto;
    padding: 0 1.25rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary);
    text-align: right;
    transition: color var(--transition);
}

.wp-block-latest-posts.nestia-latest-cards li:hover .nestia-latest-cards__more {
    color: var(--color-primary-dark);
}

.wp-block-latest-posts.nestia-latest-cards .wp-block-latest-posts__featured-image {
    margin-bottom: 0;
}

.wp-block-latest-posts.nestia-latest-cards .wp-block-latest-posts__featured-image a {
    display: block;
}

.wp-block-latest-posts.nestia-latest-cards .wp-block-latest-posts__featured-image img {
    aspect-ratio: 4/3;
    object-fit: cover;
    width: 100%;
    height: auto;
    display: block;
}

.wp-block-latest-posts.nestia-latest-cards .wp-block-latest-posts__post-title {
    padding: 1rem 1.25rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    display: block;
}

.wp-block-latest-posts.nestia-latest-cards .wp-block-latest-posts__post-date {
    padding: 0.5rem 1.25rem 0;
    font-size: 0.85rem;
    color: var(--color-text-light);
    display: block;
}

.wp-block-latest-posts.nestia-latest-cards .wp-block-latest-posts__post-excerpt {
    padding: 0.5rem 1.25rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--color-text-light);
}

@media (max-width: 600px) {
    .wp-block-latest-posts.nestia-latest-cards.is-grid {
        grid-template-columns: 1fr !important;
    }

    .wp-block-latest-posts.nestia-latest-cards.is-grid li {
        width: 100% !important;
    }
}

/* ========================================
   Block Pattern: Text Section with BG (.nestia-text-section-bg)
======================================== */
.nestia-text-section-bg {
    max-width: var(--section-width);
    margin-left: auto;
    margin-right: auto;
    background: var(--color-bg);
}

.nestia-text-section-bg p {
    color: var(--color-text-light);
    line-height: 2;
}

/* ========================================
   Block Pattern: Concerns List (.nestia-concerns)
======================================== */
.nestia-concerns {
    max-width: var(--section-width);
    margin-left: auto;
    margin-right: auto;
}

.nestia-concerns__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nestia-concerns__list li {
    position: relative;
    padding: 1rem 1rem 1rem 3rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
    line-height: 1.8;
}

.nestia-concerns__list li:last-child {
    border-bottom: none;
}

.nestia-concerns__list li::before {
    content: "\2713";
    position: absolute;
    left: 0.75rem;
    top: 1rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Scroll Animation (fade-in)
======================================== */
.nst-fade-up,
.nst-fade-in,
.nst-fade-left,
.nst-fade-right {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.nst-fade-up {
    transform: translateY(30px);
}

.nst-fade-left {
    transform: translateX(-30px);
}

.nst-fade-right {
    transform: translateX(30px);
}

.nst-fade-up.is-visible,
.nst-fade-in.is-visible,
.nst-fade-left.is-visible,
.nst-fade-right.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

@media (prefers-reduced-motion: reduce) {
    .nst-fade-up,
    .nst-fade-in,
    .nst-fade-left,
    .nst-fade-right {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Mobile: 見出し → 画像 → 文章 の順に並べ替え */
@media (max-width: 991px) {
    .nestia-img-text .wp-block-columns,
    .nestia-detail-card.wp-block-columns {
        flex-wrap: wrap;
        gap: 0;
    }

    .nestia-img-text .wp-block-column,
    .nestia-detail-card .wp-block-column {
        flex-basis: 100% !important;
    }

    /* テキスト列を分解して子要素を直接並べ替え */
    .nestia-img-text .nestia-img-text__content,
    .nestia-detail-card .nestia-detail-card__content {
        display: contents;
    }

    /* 見出し: 最初 */
    .nestia-img-text .nestia-img-text__content h2,
    .nestia-detail-card .nestia-detail-card__content h2 {
        order: -1;
        width: 100%;
        padding: 10px 0;
        margin: 0;
    }

    /* detail-card タイトルの border-bottom 余白調整 */
    .nestia-detail-card .nestia-detail-card__title {
        padding-bottom: 0.5rem;
    }

    /* 画像列 */
    .nestia-img-text .wp-block-column:not(.nestia-img-text__content),
    .nestia-detail-card .wp-block-column:not(.nestia-detail-card__content) {
        margin: 0;
        padding: 10px 0 0;
    }

    .nestia-img-text .wp-block-column:not(.nestia-img-text__content) .wp-block-image,
    .nestia-detail-card .wp-block-column:not(.nestia-detail-card__content) .wp-block-image {
        margin: 0;
    }

    .nestia-img-text .wp-block-column:not(.nestia-img-text__content) .wp-block-image img,
    .nestia-detail-card .wp-block-column:not(.nestia-detail-card__content) .wp-block-image img {
        display: block;
        width: 100%;
        height: auto;
    }

    /* 文章: 画像の下 */
    .nestia-img-text .nestia-img-text__content p,
    .nestia-detail-card .nestia-detail-card__content p {
        order: 1;
        width: 100%;
        padding: 10px 0 0;
        margin: 0;
    }

    /* ボタン: 最後 */
    .nestia-img-text .nestia-img-text__content .wp-block-buttons {
        order: 2;
        width: 100%;
        padding: 16px 0 0;
        margin: 0;
        justify-content: center;
    }
}

/* ========================================
   Editor Color Palette (カスタマイザー連動)
======================================== */
.has-primary-color { color: var(--color-primary); }
.has-primary-dark-color { color: var(--color-primary-dark); }
.has-light-bg-color { color: var(--color-bg); }
.has-text-color-color { color: var(--color-text); }
.has-text-light-color { color: var(--color-text-light); }

.has-primary-background-color { background-color: var(--color-primary); }
.has-primary-dark-background-color { background-color: var(--color-primary-dark); }
.has-light-bg-background-color { background-color: var(--color-bg); }
.has-white-background-color { background-color: var(--color-white); }
.has-text-color-background-color { background-color: var(--color-text); }
.has-text-light-background-color { background-color: var(--color-text-light); }
.has-black-background-color { background-color: var(--color-black); }

/* ========================================
   Page Top Button
======================================== */
.pagetop {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 900;
}

.pagetop.is-visible {
    opacity: 1;
    visibility: visible;
}

.pagetop:hover {
    background: var(--color-primary-dark);
}

/* ========================================
   SP Fixed Bottom Bar
======================================== */
.sp-fixed-bar {
    display: none;
}

@media (max-width: 991px) {
    .sp-fixed-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 900;
    }

    .sp-fixed-bar__link {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.85rem;
        color: var(--color-white);
        font-size: 0.95rem;
        font-weight: 700;
        text-align: center;
        flex: 1;
    }

    .sp-fixed-bar__link--phone {
        background: var(--color-primary);
    }

    .sp-fixed-bar__link--phone:hover {
        background: var(--color-primary-dark);
        color: var(--color-white);
    }

    .sp-fixed-bar__link--contact {
        background: #e67e22;
    }

    .sp-fixed-bar__link--contact:hover {
        background: #d35400;
        color: var(--color-white);
    }

    .sp-fixed-bar ~ .pagetop {
        bottom: 70px;
    }

    .footer:has(~ .sp-fixed-bar) {
        padding-bottom: 60px;
    }
}

/* ========================================
   WordPress Block Editor Styles
======================================== */
:where(.wp-block-group.has-background) {
    padding: 1.25em 0;
}

.wp-block-image {
    margin-bottom: 1.5rem;
}

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

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
}

/* ========================================
   WordPress Specific
======================================== */
body.admin-bar .header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .header {
        top: 46px;
    }
}

/* ========================================
   Contact Form 7
======================================== */
.wpcf7-form {
    max-width: 700px;
    margin: 0 auto;
}

.wpcf7-form p {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.wpcf7-form .required {
    font-size: 0.8rem !important;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form input[type="number"],
.wpcf7-form select,
.wpcf7-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-white);
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--color-text);
    transition: border-color var(--transition);
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form input[type="tel"]:focus,
.wpcf7-form input[type="url"]:focus,
.wpcf7-form input[type="number"]:focus,
.wpcf7-form select:focus,
.wpcf7-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.wpcf7-form textarea {
    min-height: 180px;
    resize: vertical;
}

.wpcf7-form input.wpcf7-submit {
    display: inline-block;
    padding: 0.875rem 3rem;
    background: var(--color-primary);
    color: var(--color-white);
    border: 2px solid var(--color-primary);
    border-radius: var(--btn-radius);
    font-size: 1rem;
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    width: 100%;
    max-width: 300px;
}

.wpcf7-form input.wpcf7-submit:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.wpcf7-form p:last-of-type {
    text-align: center;
    margin-top: 2rem;
}

.wpcf7-form .wpcf7-response-output {
    margin: 1.5rem 0 0;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}

.wpcf7-form.sent .wpcf7-response-output {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #166534;
}

.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.unaccepted .wpcf7-response-output {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.wpcf7-not-valid-tip {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

/* ========================================
   Responsive: Tablet (max-width: 991px)
======================================== */
@media (max-width: 991px) {
    .header {
        height: var(--header-height-sp);
    }

    .header__inner {
        height: var(--header-height-sp);
    }

    .header__logo img,
    .header__logo .custom-logo {
        height: 40px;
    }

    .gnav {
        position: fixed;
        top: var(--header-height-sp);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-white);
        padding: 2rem;
        transform: translateX(100%);
        transition: var(--transition);
        overflow-y: auto;
        z-index: 999;
    }

    body.admin-bar .gnav {
        top: calc(var(--header-height-sp) + 46px);
    }

    .gnav.is-open {
        transform: translateX(0);
    }

    .gnav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .gnav__item a {
        padding: 1rem 0;
        font-size: 1rem;
        border-bottom: 1px solid var(--color-bg);
    }

    .gnav__item a::after {
        display: none;
    }

    .gnav__list .sub-menu {
        position: static;
        display: block;
        box-shadow: none;
        padding: 0 0 0 1rem;
        min-width: 0;
    }

    .gnav__list .sub-menu li a {
        padding: 0.75rem 0;
        font-size: 0.95rem;
        border-bottom: 1px solid var(--color-bg);
    }

    .header__sp-btns {
        display: flex;
    }

    /* Hero */
    .hero {
        margin-top: var(--header-height-sp);
        height: 400px;
    }

    .hero__catch {
        font-size: 2rem;
    }

    .hero__sub {
        font-size: 1rem;
    }

    /* News */
    .news {
        padding: 2rem 0;
    }

    .news__title {
        font-size: 1.5rem;
    }

    .news__item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .news__link {
        width: 100%;
        margin-top: 0.25rem;
    }

    /* CTA */
    .cta {
        padding: 2rem 0;
    }

    .cta__title {
        font-size: 1.5rem;
    }

    .cta__box {
        flex-direction: column;
        gap: 2rem;
    }

    .cta__num {
        font-size: 2rem;
    }

    /* Page Header */
    .page-header {
        margin-top: var(--header-height-sp);
        padding: 2rem 0;
    }

    .page-header__title {
        font-size: 2rem;
    }

    /* Sidebar layout */
    .site-content.has-sidebar {
        grid-template-columns: 1fr;
    }

    .site-content.has-sidebar.sidebar-left .site-main {
        order: 1;
    }

    .site-content.has-sidebar.sidebar-left .sidebar {
        order: 2;
    }

    /* Block Pattern: Cards Section */
    .nestia-cards-section > .wp-block-heading {
        font-size: 2rem;
    }

    .nestia-card {
        padding: 1.5rem 1rem;
    }

    .nestia-card h3 {
        font-size: 1.1rem;
    }

    /* Block Pattern: Image Cards */
    .nestia-cards-section > .wp-block-columns {
        padding: 0 0.75rem;
    }

    .nestia-img-card__body {
        padding: 1rem;
    }

    /* Block Pattern: Image + Text */
    .nestia-img-text .nestia-img-text__img img {
        height: 300px;
    }

    .nestia-img-text .nestia-img-text__content h2 {
        font-size: 1.75rem;
    }

    /* Block Pattern: Detail Cards */
    .nestia-detail-section .nestia-detail-card {
        margin-bottom: 2rem;
    }

    .nestia-detail-section .nestia-detail-card img {
        height: 220px;
    }

    .nestia-detail-card__title {
        font-size: 1.5rem;
    }

    /* Footer */
    .footer__inner {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .footer__nav-list {
        justify-content: center;
        gap: 1rem;
    }

    .footer__widgets {
        grid-template-columns: 1fr;
    }

    /* wp-block-columns: スマホ時にカラムを縦積み＆画像全幅 */
    .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column[style*="flex-basis"] {
        flex-basis: 100% !important;
    }

    .wp-block-column .wp-block-image img {
        width: 100%;
    }
}

/* ========================================
   Responsive: Mobile (max-width: 575px)
======================================== */
@media (max-width: 575px) {
    .header__logo img,
    .header__logo .custom-logo {
        height: 32px;
    }

    .hero {
        height: 300px;
    }

    .hero__catch {
        font-size: 1.5rem;
    }

    .page-header__title {
        font-size: 1.5rem;
    }

    .page-header {
        padding: 2rem 0;
    }

    .error-404__code {
        font-size: 4rem;
    }

    /* Block Pattern: Image + Text */
    .nestia-img-text .nestia-img-text__img img {
        height: 200px;
    }

    .nestia-img-text .nestia-img-text__content h2 {
        font-size: 1.5rem;
    }

    /* Block Pattern: Cards Section */
    .nestia-cards-section > .wp-block-heading {
        font-size: 1.75rem;
    }
}
