/* ------------------------------
   Reset & Base
------------------------------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Noto Sans JP", sans-serif;
    color: #333;
    line-height: 1.7;
    background: #f8f8f8;
}

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

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ------------------------------
   Header
------------------------------ */

.header {
    background: #ffffff;
    border-bottom: 1px solid #e6e6e6;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo a {
    font-size: 20px;
    font-weight: bold;
    color: #0077cc;
    text-decoration: none;
}

/* Navigation */
nav ul {
    display: flex;
    gap: 25px;
    list-style: none;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

nav ul li a:hover {
    color: #0077cc;
}

/* Hamburger Menu (mobile) */
.nav-toggle {
    display: none;
    font-size: 28px;
    cursor: pointer;
    color: #0077cc;
}

@media (max-width: 768px) {

    nav ul {
        display: none;
        flex-direction: column;
        gap: 15px;
        background: white;
        padding: 20px;
        position: absolute;
        top: 70px;
        right: 20px;
        width: 200px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    nav ul.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }
}

/* ------------------------------
   Hero Section
------------------------------ */

.hero {
    height: 65vh;
    min-height: 450px;
    background: linear-gradient(rgba(0, 0, 0, 0.45),
            rgba(0, 0, 0, 0.45)),
        url("../img/medical_hero.jpg");
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    color: white;
    text-align: center;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 38px;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 30px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background: #0077cc;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
}

.btn-primary:hover {
    opacity: 0.85;
}

/* Hero responsive */
@media (max-width: 768px) {
    .hero {
        height: 50vh;
        padding-top: 40px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .hero-content p {
        font-size: 16px;
    }
}

/* ------------------------------
   Departments Section
------------------------------ */

.section-title {
    font-size: 28px;
    text-align: center;
    margin: 60px 0 30px;
    font-weight: 700;
}

.departments-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.department-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding-bottom: 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.department-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.department-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.department-card h3 {
    font-size: 20px;
    margin: 15px 0 10px;
}

.department-card p {
    padding: 0 15px;
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
}

.btn-secondary {
    display: inline-block;
    background: white;
    border: 1px solid #0077cc;
    color: #0077cc;
    padding: 8px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #0077cc;
    color: white;
}

/* Tablet */
@media (max-width: 992px) {
    .departments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 600px) {
    .departments-grid {
        grid-template-columns: 1fr;
    }

    .department-card img {
        height: 200px;
    }
}

/* ------------------------------
   Footer
------------------------------ */

.footer {
    background: #2b2b2b;
    color: white;
    padding: 30px 0;
    margin-top: 60px;
}

.footer p {
    text-align: center;
    font-size: 14px;
}


/* ------------------------------
   Doctors Section
------------------------------ */

.doctors {
    margin-top: 80px;
}

.doctors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.doctor-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding-bottom: 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.doctor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.doctor-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.doctor-card h3 {
    font-size: 20px;
    margin: 15px 0 5px;
}

.doctor-speciality {
    font-size: 14px;
    color: #0077cc;
    margin-bottom: 15px;
}

.doctor-text {
    font-size: 14px;
    padding: 0 15px;
    color: #555;
    margin-bottom: 20px;
}

/* Tablet */
@media (max-width: 992px) {
    .doctors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 600px) {
    .doctors-grid {
        grid-template-columns: 1fr;
    }

    .doctor-card img {
        height: 260px;
    }
}

/* ------------------------------
   Hours Section（強化版）
------------------------------ */
.hours {
    margin-top: 80px;
}

.hours-table-wrapper {
    overflow-x: auto;
}

/* メインテーブル */
.hours-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* セル */
.hours-table th,
.hours-table td {
    padding: 14px 12px;
    text-align: center;
    border: 1px solid #d7e3f2;
    font-size: 15px;
}

/* 見出し */
.hours-table th {
    background: #0077cc;
    color: #fff;
    font-weight: 600;
}

/* 時間帯（午前・午後） */
.time-title {
    background: #e8f3ff;
    font-weight: 600;
    color: #003f77;
}

/* 土曜強調 */
.sat {
    background: #f0faff;
    font-weight: 600;
}

/* 休診 */
.closed {
    color: #bbbbbb;
    background: #fafafa;
    font-weight: normal;
}

/* 補足 */
.hours-note {
    margin-top: 15px;
    font-size: 14px;
    color: #444;
    text-align: center;
}

/* スマホ */
@media (max-width: 768px) {

    .hours-table th,
    .hours-table td {
        padding: 10px 6px;
        font-size: 13px;
    }
}

/* ------------------------------
   Department Detail
------------------------------ */

.department-detail {
    margin: 80px auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.department-detail img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    margin: 20px 0;
}

.lead-text {
    font-size: 18px;
    font-weight: 600;
    color: #0077cc;
    margin-bottom: 15px;
}

.department-detail p {
    font-size: 15px;
    line-height: 1.8;
}

/* Mobile */
@media (max-width: 768px) {
    .department-detail {
        padding: 20px;
    }

    .lead-text {
        font-size: 16px;
    }
}

/* ------------------------------
   News
------------------------------ */

.news-list {
    list-style: none;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.news-list li {
    border-bottom: 1px solid #e6e6e6;
}

.news-list li:last-child {
    border-bottom: none;
}

.news-list a {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 18px 20px;
    text-decoration: none;
    color: #333;
}

.news-list a:hover {
    background: #f5faff;
}

.news-date {
    font-size: 14px;
    color: #777;
    min-width: 90px;
}

.news-category {
    font-size: 13px;
    background: #0077cc;
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
}

.news-title {
    font-weight: 600;
}

/* 詳細 */
.news-detail {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.news-detail h2 {
    margin: 10px 0 15px;
}

.news-content {
    margin: 20px 0;
    line-height: 1.8;
}

/* Mobile */
@media (max-width: 768px) {
    .news-list a {
        flex-direction: column;
        gap: 8px;
    }
}


/* ==============================
   フロント：お知らせ
============================== */

.front-news {
    margin: 60px auto;
}

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

.news-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #e5e5e5;
    font-size: 15px;
}

.news-item time {
    color: #666;
    font-size: 14px;
    min-width: 100px;
}

.news-title {
    color: #333;
    flex: 1;
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 13px;
    border-radius: 12px;
    color: #fff;
}

/* カテゴリ別 */
.category-重要 {
    background: #dc3545;
}

.category-お知らせ {
    background: #17a2b8;
}

.category-休診 {
    background: #6c757d;
}

.news-title {
    color: #333;
    text-decoration: none;
}

.news-title:hover {
    text-decoration: underline;
}

/* ==============================
   お知らせ詳細
============================== */

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

.news-detail-header time {
    color: #666;
    font-size: 14px;
}

.news-detail-title {
    margin: 12px 0 24px;
    font-size: 24px;
    line-height: 1.4;
}

.news-detail-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
}

.news-detail-back {
    margin-top: 40px;
}

.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination a {
    display: inline-block;
    margin: 0 6px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.pagination a.active {
    background: #2c7be5;
    color: #fff;
    border-color: #2c7be5;
}

.filter-form {
    margin: 20px 0 30px;
}

.filter-form select {
    padding: 8px 12px;
    font-size: 14px;
}

/* ==============================
   重要なお知らせ 強調表示
============================== */

.news-important {
    background: #fff4f4;
    border-left: 6px solid #dc3545;
    padding-left: 10px;
}

.news-important .category-badge {
    font-weight: bold;
}


/* 共通セクション余白 */
section.container {
    margin: 80px auto;
}


/* 診療時間 */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}


/* アクセス */
.access-box {
    display: flex;
    gap: 30px;
}

.access-map iframe {
    width: 100%;
    height: 250px;
    border: none;
}

/* 予約 */
.reservation-box {
    text-align: center;
}

/* ==============================
   レスポンシブ最終調整
============================== */

@media (max-width: 768px) {

    /* 全体 */
    body {
        font-size: 15px;
    }

    .container {
        padding: 0 16px;
    }

    section.container {
        margin: 50px auto;
    }

    /* ヘッダー */
    .header-nav {
        flex-direction: column;
        gap: 10px;
    }

    .header-nav a {
        padding: 10px 0;
        font-size: 16px;
    }

    /* ファーストビュー */
    .hero h1 {
        font-size: 26px;
    }

    .hero p {
        font-size: 15px;
    }

    /* 診療科一覧 */
    .departments-grid {
        grid-template-columns: 1fr;
    }

    /* 医師紹介 */
    .doctor-box {
        flex-direction: column;
        text-align: center;
    }

    .doctor-box img {
        width: 160px;
    }

    /* アクセス */
    .access-box {
        flex-direction: column;
    }

    .access-map iframe {
        height: 220px;
    }

    /* お知らせ */
    .news-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .news-item time {
        min-width: auto;
        font-size: 13px;
    }

    /* ボタン */
    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
}