@charset "utf-8";
/*
Theme Name: Clinic WP
Author: hiraipcc
Version: 1.2.0
Description: クリニック向けの1カラム・レスポンシブテーマ。診療時間表・お知らせ欄・スマホ用メニューを備え、電話番号・住所・診療時間は「外観 → カスタマイズ」から編集でき、構造化データ（JSON-LD）としても出力されます。
Requires at least: 5.5
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: clinic
Tags: one-column, custom-header, custom-menu, translation-ready
*/

/* ==========================================
   1. リセット & 基本設定（文字や余白の初期化）
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* 余白を含めたサイズ計算にする（レイアウト崩れ防止） */
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "メイリオ", Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    background-color: #fcfcfc; /* 院内の清潔感をイメージした明るい背景色 */
    -webkit-text-size-adjust: none;
}

a {
    color: #1c487d; /* クリニックのテーマカラー：誠実なブルー */
    text-decoration: none;
    transition: color 0.3s ease; /* 色の変化をふわっと滑らかに */
}

a:hover, a:active {
    color: #6f6f6f;
}

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

/* キーボード操作時に「今どこにいるか」を分かるようにする */
a:focus-visible,
label:focus-visible,
input:focus-visible,
button:focus-visible {
    outline: 2px solid #1c487d;
    outline-offset: 2px;
}

/* 青い背景（ナビ・スキップリンク）の上では、青い枠だと見えないので白にする */
nav#mainNav a:focus-visible,
nav#mainNav .menu-button:focus-visible,
.skip-link:focus,
.skip-link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

/* 画面には出さず、スクリーンリーダーにだけ読ませるテキスト */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* 「本文へスキップ」リンク。Tabキーで最初に到達したときだけ画面に現れる */
.skip-link:focus {
    position: fixed;
    clip-path: none;
    top: 8px;
    left: 8px;
    z-index: 100;
    width: auto;
    height: auto;
    margin: 0;
    padding: 10px 16px;
    clip: auto;
    color: #fff;
    background-color: #1c487d;
    border-radius: 4px;
}

/* ==========================================
   2. 全体構造（1カラム用レイアウト設定）
   ========================================== */
#wrapper, .inner {
    margin: 0 auto;
    width: 100%;
    max-width: 800px; /* 1カラムで文章が一番読みやすいとされる最適な横幅 */
    padding: 0 20px;   /* スマホ画面で見たときの端のクッション余白 */
}

/* メインコンテンツエリア */
#content {
    width: 100%;
    /* 全体の上下余白を50pxから25pxへ、上側を10pxから5pxへギュッと縮小 */
    padding: 5px 0 25px;
}

/* フッター */
#footer {
    width: 100%;
    border-top: 1px solid #e5e5e5;
    padding: 20px 0 25px; /* フッターの余白も少しスリムに */
    text-align: center;
    background-color: #fff;
}

#footer ul {
    list-style: none;
    margin-bottom: 10px; /* 15pxから10pxへ */
}

#footer li {
    display: inline-block;
    padding: 0 15px;
    border-left: 1px solid #d5d5d5;
}

#footer li:first-child {
    border-left: none; /* 最初のメニューの左線は消す */
}

#copyright {
    font-size: 12px;
    color: #767676; /* #777 だとコントラスト比 4.48:1 で AA 基準に僅かに届かない */
}

/* ==========================================
   3. 各パーツのデザイン（ヘッダー・メニュー・投稿・お知らせ）
   ========================================== */

/* ヘッダーエリア */
#header {
    padding: 15px 0; /* 上下の余白を25pxから15pxへ縮小 */
}

/* 左側：ロゴ・タイトルエリア */
.logo-area {
    float: left;
}

.site-description {
    font-size: 13px;
    color: #666;
    font-weight: normal;
    line-height: 1.2;
    margin-bottom: 2px;
}

/* 医院名。トップページでは h1、下層ページでは p として出力される
   （下層では記事タイトル側を h1 にするため） */
.site-title {
    font-size: 32px;
    font-weight: bold;
    line-height: 1.2;
}

/* 右側：連絡先・電話番号エリア */
.contact {
    float: right;
    text-align: right;
    color: #333;
}

.contact .tel {
    font-size: 24px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    color: #1c487d;
}

.contact p.time {
    font-size: 13px;
    color: #555;
    margin-top: 3px;
}

/* ヘッダーの横並び（float）をクリア */
#header::after {
    content: "";
    display: block;
    clear: both;
}

/* グローバルナビゲーション（メインメニュー） */
nav#mainNav {
    background-color: #1c487d;
    margin-bottom: 15px; /* 下の隙間を25pxから15pxへ */
    border-radius: 4px;
}

nav#mainNav ul {
    display: flex; /* メニュー項目を横並びにする最新記述 */
    list-style: none;
}

nav#mainNav ul li {
    flex: 1; /* メニューの幅を均等に割り振る */
}

nav#mainNav ul li a {
    display: block;
    text-align: center;
    color: #fff;
    padding: 12px 0; /* メニューの上下クッションを15pxから12pxへ */
    font-weight: bold;
    font-size: 15px;
    transition: background-color 0.2s ease;
}

nav#mainNav ul li a:hover {
    background-color: #3167aa; /* マウスを乗せたときに明るい青に */
}

/* MENUボタンは既定（PC表示）では隠しておき、下のメディアクエリでスマホのときだけ表示する */
.menu-button {
    display: none;
}

/* トップページメイン画像 */
#mainImg {
    text-align: center;
    margin-bottom: 20px; /* 下の隙間を30pxから20pxへ */
}

/* 最上部に移動した「お知らせ」エリア（高さをスリム化） */
#sidebar {
    width: 100%;
    margin-bottom: 15px; /* 下の隙間を20pxから15pxへ */
}

.widgetInfo {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-left: 5px solid #1c487d; /* 左側に太い青線をアクセントとして配置 */
    padding: 10px 15px 5px; /* 箱の内側の余白を一回りタイトに */
    border-radius: 4px;
}

.newsTitle {
    display: flex;
    justify-content: space-between; /* タイトルと一覧リンクを左右に綺麗に振り分け */
    align-items: center;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 4px; /* 隙間を少し詰める */
    margin-bottom: 8px;
}

.newsTitle h3 {
    font-size: 17px; /* ほんの少しスマートに */
    font-weight: bold;
    color: #1c487d;
}

.newsTitle p a {
    font-size: 12px;
    color: #666;
    background-color: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
}

.news p {
    padding: 5px 0; /* お知らせ同士の上下間隔を詰める */
    border-bottom: 1px dashed #eee;
    font-size: 15px;
    line-height: 1.5;
}

/* 一番下のお知らせの下側スペースを限界までカット */
.news p:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* 本文（固定ページや投稿）の白い箱 */
.post {
    background: #fff;
    padding: 18px 20px; /* 内側の余白を30pxから、上下18px・左右20pxへと一気に狭く引き締め */
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* 本文内の見出し装飾 */
.post .title, #content .title {
    font-size: 19px;
    color: #333;
    border-bottom: 2px solid #1c487d;
    padding-bottom: 6px; /* 8pxから6pxへ */
    margin-bottom: 15px; /* 20pxから15pxへ */
    font-weight: bold;
}

.post p {
    margin-bottom: 15px; /* 段落ごとの隙間を20pxから15pxへ */
}

/* 診療時間表などのテーブル装飾 */
.post table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0; /* 表の上下の隙間を20pxから15pxへ */
}

.post table th, .post table td {
    padding: 8px 10px; /* 表の中の文字まわりの余白を12pxから狭くしてコンパクトに */
    border: 1px solid #e0e0e0;
    text-align: center;
}

.post table th {
    background-color: #f5f7fa;
    font-weight: bold;
    color: #1c487d;
}

/* 一覧ページの記事リンク */
.archive-list {
    margin-top: 20px;
}

.archive-list .list-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #ddd;
}

.archive-list .list-item:last-of-type {
    margin-bottom: 0;
    border-bottom: none;
}

/* 個別ページ・一覧用のページ送り */
.pagenav {
    margin-top: 20px;
    text-align: center;
}

.pagenav .nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pagenav .page-numbers.current {
    font-weight: bold;
    color: #333;
}

/* 「トップページへ戻る」リンク */
.back-home {
    margin-top: 30px;
    text-align: center;
}

.btn-back {
    display: inline-block;
    padding: 10px 20px;
    border-bottom: 1px solid #e5e5e5;
    border-radius: 4px;
}

/* ==========================================
   4. レスポンシブ設定（スマートフォン表示への切り替え）
   ========================================== */
@media only screen and (max-width: 768px) {
    #wrapper, .inner {
        padding: 0 15px;
    }

    /* ヘッダー情報をスマホ用に縦並び・中央揃えに */
    .logo-area, .contact {
        float: none;
        width: 100%;
        text-align: center;
    }
    .logo-area { margin-bottom: 12px; }
    
    /* スマホ表示時のキャッチフレーズと医院名の文字サイズバランス */
    .logo-area .site-description { font-size: 12px; }
    .logo-area .site-title { font-size: 22px; }
    .contact .tel { font-size: 22px; }

    /* --- スマホ用メニューの開閉（JavaScript + aria-expanded） --- */

    /* スマホ用のメニュー開閉ボタン */
    .menu-button {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        height: 40px; /* 45pxから40pxへスリムに */
        font-weight: bold;
        font-size: inherit;
        font-family: inherit;
        color: #fff;
        background-color: #1c487d;
        border: none;
        cursor: pointer;
        border-radius: 4px;
        margin-bottom: 5px;
    }

    /* 開いている間はボタンの色を濃くして状態を示す */
    .menu-button[aria-expanded="true"] {
        background-color: #12345d;
    }

    /* アイコン。読み上げには不要なので aria-hidden の span に CSS で出す */
    .menu-icon::before {
        content: "\2630"; /* ☰ 三本線 */
        font-size: 1.1em;
        line-height: 1;
    }

    .menu-button[aria-expanded="true"] .menu-icon::before {
        content: "\2715"; /* ✕ 閉じる */
    }

    #navPanel {
        width: 100%;
        background-color: #1c487d;
        border-radius: 4px;
        overflow: hidden;
        padding: 5px 0;
    }

    /* JavaScript が動くときだけ、初期状態でメニューを閉じる。
       JavaScript が無効な環境ではメニューが開いたままになるので、操作できなくなることがない */
    .js #navPanel {
        display: none;
    }

    .js #navPanel.is-open {
        display: block;
    }

    /* メニュー項目をスマホ用に縦一列に並べる */
    nav#mainNav ul {
        flex-direction: column;
    }
    nav#mainNav ul li {
        border-bottom: 1px solid #3167aa;
    }
    nav#mainNav ul li:last-child {
        border-bottom: none;
    }
    nav#mainNav ul li a {
        display: block;
        text-align: center;
        padding: 10px 0; /* 12pxから10pxへ */
        color: #fff;
        font-size: 15px;
    }
}


/* ==========================================================================
   本文内（.post）のリスト表示（箇条書き）の余白調整
   ========================================================================== */

/* 箇条書き（ul）と数字リスト（ol）全体の調整 */
.post ul, .post ol {
    margin: 10px 0 15px 22px; /* 上に10px、下に15px、左に22pxの余白を作って右に寄せます */
    padding: 0;
}

/* リストの各項目（li）の調整 */
.post ul li, .post ol li {
    margin-bottom: 5px;       /* 箇条書きの項目ごとに少し隙間をあけて読みやすく */
    line-height: 1.6;         /* 行間を綺麗に整える */
}

/* 箇条書き（ul）のときは標準の黒丸（•）を表示 */
.post ul {
    list-style-type: disc;
}

/* 数字リスト（ol）のときは数字（1. 2. 3.）を表示 */
.post ol {
    list-style-type: decimal;
}

/* リストの中にさらにリストがネスト（階層化）した場合の左余白 */
.post ul ul, .post ul ol, .post ol ul, .post ol ol {
    margin: 5px 0 5px 20px;
}
