/* ================================================================
   page-common.css
   サブページ共通スタイル（パンくずリスト、セクション、関連ページ等）
   ================================================================ */

/* ================================================================
   CSS変数
   ================================================================ */
:root {
    --page-primary: #0D47A1;
    --page-primary-light: #E3F2FD;
    --page-secondary: #2E7D32;
    --page-secondary-light: #E8F5E9;
    --page-accent: #D32F2F;
    --page-text: #212121;
    --page-text-secondary: #616161;
    --page-text-muted: #9E9E9E;
    --page-bg: #FAFAFA;
    --page-bg-light: #F5F5F5;
    --page-border: #E0E0E0;
    --page-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --page-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --page-radius: 12px;
    --page-radius-sm: 8px;
    --page-container: 1200px;
}

/* ================================================================
   ページヒーロー共通
   ================================================================ */
.page-hero {
    position: relative;
    background: linear-gradient(135deg, var(--page-primary) 0%, #1565C0 100%);
    color: #fff;
    padding: 4rem 1.5rem;
    text-align: center;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.page-hero__inner {
    position: relative;
    z-index: 1;
    max-width: var(--page-container);
    margin: 0 auto;
}

.page-hero__title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    line-height: 1.3;
}

.page-hero__icon .material-symbols-outlined {
    font-size: 2.5rem;
}

.page-hero__subtitle {
    font-size: 1.125rem;
    opacity: 0.95;
    margin: 0;
}

/* ヒーローカラーバリエーション */
.page-hero--publications {
    background: linear-gradient(135deg, #5C6BC0 0%, #3949AB 100%);
}

.page-hero--research {
    background: linear-gradient(135deg, #00897B 0%, #00695C 100%);
}

.page-hero--donations {
    background: linear-gradient(135deg, #FF7043 0%, #E64A19 100%);
}

.page-hero--checkup {
    background: linear-gradient(135deg, var(--page-secondary) 0%, #1B5E20 100%);
}

.page-hero--reservations {
    background: linear-gradient(135deg, #0288D1 0%, #0277BD 100%);
}

/* ================================================================
   パンくずリスト
   ================================================================ */
.breadcrumb {
    background: var(--page-bg-light);
    border-bottom: 1px solid var(--page-border);
    padding: 0.875rem 0;
}

.breadcrumb__inner {
    max-width: var(--page-container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}

.breadcrumb__list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--page-text-secondary);
}

.breadcrumb__list li::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid var(--page-text-muted);
    border-right: 1.5px solid var(--page-text-muted);
    transform: rotate(45deg);
}

.breadcrumb__list li:last-child::after {
    display: none;
}

.breadcrumb__list li a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--page-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb__list li a:hover {
    color: #1976D2;
    text-decoration: underline;
}

.breadcrumb__list li a .material-symbols-outlined {
    font-size: 1.125rem;
}

.breadcrumb__list li[aria-current="page"] {
    color: var(--page-text-secondary);
    font-weight: 500;
}

/* ================================================================
   ページメインコンテナ
   ================================================================ */
.page-main {
    min-width: 0; /* grid子要素のoverflow対策 */
}

/* 単独使用時のpage-main（page-layoutなしの場合） */
.page-main:not(.page-layout *) {
    background: var(--page-bg);
    padding: 3rem 1.5rem 5rem;
    max-width: var(--page-container);
    margin: 0 auto;
}

.page-main .container {
    max-width: var(--page-container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ================================================================
   セクションタイトル共通
   ================================================================ */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--page-text);
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--page-primary);
}

.section-title .material-symbols-outlined {
    font-size: 1.75rem;
    color: var(--page-primary);
}

.section-title--center {
    justify-content: center;
    border-bottom: none;
    padding-bottom: 0;
}

.section-title--center::after {
    display: none;
}

/* ================================================================
   ボタン共通
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--page-radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn .material-symbols-outlined {
    font-size: 1.25rem;
}

.btn--primary,
.btn-primary {
    background: var(--page-primary);
    color: #fff;
    border-color: var(--page-primary);
}

.btn--primary:hover,
.btn-primary:hover {
    background: #1565C0;
    border-color: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
}

.btn--secondary,
.btn-secondary {
    background: var(--page-secondary);
    color: #fff;
    border-color: var(--page-secondary);
}

.btn--secondary:hover,
.btn-secondary:hover {
    background: #388E3C;
    border-color: #388E3C;
}

.btn--outline,
.btn-outline {
    background: transparent;
    color: var(--page-primary);
    border-color: var(--page-primary);
}

.btn--outline:hover,
.btn-outline:hover {
    background: var(--page-primary);
    color: #fff;
}

.btn--lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn--sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn--block {
    width: 100%;
}

/* ================================================================
   カード共通
   ================================================================ */
.card {
    background: #fff;
    border-radius: var(--page-radius);
    box-shadow: var(--page-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--page-shadow-lg);
}

.card__image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--page-bg-light);
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card__image img {
    transform: scale(1.05);
}

.card__body {
    padding: 1.25rem;
}

.card__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--page-text);
    margin: 0 0 0.5rem;
    line-height: 1.4;
}

.card__desc {
    font-size: 0.875rem;
    color: var(--page-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ================================================================
   グリッド共通
   ================================================================ */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid--auto {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ================================================================
   サイドバー（関連ページ・よく見られるページ）
   ================================================================ */
.page-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-section {
    background: #fff;
    border-radius: var(--page-radius);
    box-shadow: var(--page-shadow);
    overflow: hidden;
}

.sidebar-section__header {
    background: linear-gradient(135deg, var(--page-primary) 0%, #1565C0 100%);
    color: #fff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section__header .material-symbols-outlined {
    font-size: 1.25rem;
}

.sidebar-section__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-section__body {
    padding: 0;
}

.sidebar-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-links li {
    border-bottom: 1px solid var(--page-border);
}

.sidebar-links li:last-child {
    border-bottom: none;
}

.sidebar-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    color: var(--page-text);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-links a:hover {
    background: var(--page-primary-light);
    color: var(--page-primary);
}

.sidebar-links a .material-symbols-outlined {
    font-size: 1.25rem;
    color: var(--page-primary);
    flex-shrink: 0;
}

.sidebar-links a .arrow {
    margin-left: auto;
    font-size: 1rem;
    color: var(--page-text-muted);
}

/* お知らせサイドバー */
.sidebar-news {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-news li {
    border-bottom: 1px solid var(--page-border);
}

.sidebar-news li:last-child {
    border-bottom: none;
}

.sidebar-news a {
    display: block;
    padding: 1rem 1.25rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.sidebar-news a:hover {
    background: var(--page-bg-light);
}

.sidebar-news__date {
    display: block;
    font-size: 0.75rem;
    color: var(--page-text-muted);
    margin-bottom: 0.25rem;
}

.sidebar-news__title {
    font-size: 0.875rem;
    color: var(--page-text);
    line-height: 1.5;
}

/* バナーエリア */
.sidebar-banner {
    display: block;
    border-radius: var(--page-radius-sm);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.sidebar-banner:hover {
    transform: scale(1.02);
}

.sidebar-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* サイドバー：お問い合わせ */
.sidebar-section--contact .sidebar-section__header {
    background: linear-gradient(135deg, #FF7043 0%, #E64A19 100%);
}

.sidebar-contact {
    padding: 1.25rem;
    text-align: center;
}

.sidebar-contact__tel {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.sidebar-contact__tel a {
    color: var(--page-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-contact__tel a::before {
    content: '\e0b0';
    font-family: 'Material Symbols Outlined';
    font-size: 1.25rem;
}

.sidebar-contact__tel a:hover {
    color: #1565C0;
}

.sidebar-contact__hours {
    font-size: 0.875rem;
    color: var(--page-text-secondary);
    margin: 0;
}

/* ================================================================
   フッターCTA（ページ下部のアクションエリア）
   ================================================================ */
.page-cta {
    background: linear-gradient(135deg, var(--page-primary-light) 0%, #fff 100%);
    border: 2px solid var(--page-primary);
    border-radius: var(--page-radius);
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 3rem;
}

.page-cta__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--page-text);
    margin: 0 0 0.75rem;
}

.page-cta__desc {
    font-size: 1rem;
    color: var(--page-text-secondary);
    margin: 0 0 1.5rem;
}

.page-cta__buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.page-cta__tel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--page-text-muted);
}

.page-cta__tel a {
    color: var(--page-text);
    font-weight: 600;
    font-size: 1.125rem;
    text-decoration: none;
}

.page-cta__tel a:hover {
    color: var(--page-primary);
}

/* ================================================================
   関連ページセクション
   ================================================================ */
.related-pages {
    background: var(--page-bg-light);
    padding: 3rem 1.5rem;
    margin-top: 0;
}

.related-pages__inner {
    max-width: var(--page-container);
    margin: 0 auto;
}

.related-pages__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--page-text);
    margin: 0 0 1.5rem;
}

.related-pages__title .material-symbols-outlined {
    color: var(--page-primary);
}

.related-pages__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.related-page-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-radius: var(--page-radius-sm);
    border: 1px solid var(--page-border);
    text-decoration: none;
    transition: all 0.2s ease;
}

.related-page-card:hover {
    border-color: var(--page-primary);
    background: var(--page-primary-light);
    transform: translateX(4px);
}

.related-page-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--page-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.related-page-card__icon .material-symbols-outlined {
    font-size: 1.5rem;
    color: var(--page-primary);
}

.related-page-card__content {
    flex: 1;
    min-width: 0;
}

.related-page-card__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--page-text);
    margin: 0 0 0.25rem;
}

.related-page-card__desc,
.related-page-card__text {
    font-size: 0.8125rem;
    color: var(--page-text-secondary);
    margin: 0;
    line-height: 1.5;
}

.related-page-card__arrow {
    flex-shrink: 0;
    font-size: 1.25rem;
    color: var(--page-text-muted);
    transition: transform 0.2s ease;
}

.related-page-card:hover .related-page-card__arrow {
    transform: translateX(4px);
    color: var(--page-primary);
}

/* ================================================================
   よく見られるページ
   ================================================================ */
.popular-pages {
    margin-top: 3rem;
}

.popular-pages__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--page-text);
    margin: 0 0 1rem;
}

.popular-pages__title .material-symbols-outlined {
    color: var(--page-accent);
}

.popular-pages__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.popular-page-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid var(--page-border);
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--page-text);
    text-decoration: none;
    transition: all 0.2s ease;
}

.popular-page-tag:hover {
    background: var(--page-primary);
    border-color: var(--page-primary);
    color: #fff;
}

.popular-page-tag .material-symbols-outlined {
    font-size: 1rem;
}

/* ================================================================
   お問い合わせボックス
   ================================================================ */
.contact-box {
    background: linear-gradient(135deg, var(--page-bg-light) 0%, #fff 100%);
    border: 2px solid var(--page-primary);
    border-radius: var(--page-radius);
    padding: 2.5rem 2rem;
    text-align: center;
    margin-top: 2rem;
}

.contact-box h2,
.contact-box__title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--page-text);
    margin: 0 0 0.75rem;
}

.contact-box > p,
.contact-box__desc {
    font-size: 1rem;
    color: var(--page-text-secondary);
    margin: 0 0 1.5rem;
}

.contact-box__buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contact-box__hours {
    font-size: 0.875rem;
    color: var(--page-text-muted);
    margin: 0;
}

/* ================================================================
   レスポンシブ
   ================================================================ */
@media (max-width: 1024px) {
    .grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .page-hero {
        padding: 3rem 1rem;
    }

    .page-hero__title {
        font-size: 1.75rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .page-hero__icon .material-symbols-outlined {
        font-size: 2rem;
    }

    .page-hero__subtitle {
        font-size: 1rem;
    }

    .breadcrumb__inner {
        padding: 0 1rem;
    }

    .page-main {
        padding: 2rem 0 3rem;
    }

    .page-main .container {
        padding: 0 1rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }

    .page-cta {
        padding: 2rem 1.5rem;
    }

    .page-cta__buttons {
        flex-direction: column;
    }

    .page-cta__buttons .btn {
        width: 100%;
    }

    .related-pages__grid {
        grid-template-columns: 1fr;
    }

    .contact-box__buttons {
        flex-direction: column;
    }

    .contact-box__buttons .btn {
        width: 100%;
    }
}

/* ================================================================
   2カラムレイアウト
   ================================================================ */
.page-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    align-items: start;
    max-width: var(--page-container);
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
    background: var(--page-bg);
}

.page-content {
    min-width: 0;
}

@media (max-width: 1024px) {
    .page-layout {
        grid-template-columns: 1fr;
    }

    .page-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 640px) {
    .page-sidebar {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   アニメーション
   ================================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* ================================================================
   プリント対応
   ================================================================ */
@media print {
    .page-hero {
        background: #333 !important;
        padding: 1.5rem !important;
    }

    .page-sidebar,
    .page-cta,
    .related-pages,
    .popular-pages {
        display: none !important;
    }

    .page-layout {
        grid-template-columns: 1fr !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
