@charset "utf-8";
/*
Theme Name: Dental Clinic
Author: hiraipcc
Version: 1.0.0
Description: 歯科医院向けの1カラム・レスポンシブテーマ。淡いオレンジを基調に、トップのメインビジュアル・診療時間表・お知らせ欄を備えます。電話番号・住所・診療時間は「外観 → カスタマイズ」から編集でき、構造化データ（JSON-LD の Dentist）としても出力されます。
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: dentalclinic
Tags: one-column, custom-header, custom-menu, translation-ready
*/

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

/*
 * 文字サイズは rem で指定している。
 * 1rem = 読者がブラウザで設定した標準文字サイズ（初期値 16px）。
 * px 固定にするとその設定を無視してしまうため、追従するようにしてある。
 * 各値のコメントは、初期設定（16px）のときの実寸。
 */
body {
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Helvetica Neue", Arial, "メイリオ", Meiryo, sans-serif;
    font-size: 1.0625rem; /* 17px */
    line-height: 1.8;
    color: #333;
    background-color: #ffffff;
    -webkit-text-size-adjust: none;
}

a {
    color: #a1490b; /* テーマカラー：落ち着いたオレンジ */
    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 #a1490b;
    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: #a1490b;
    border-radius: 4px;
}

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

/* ナビの下（トップではメインビジュアルの下）から本文までの余白。
   トップページも下層ページも同じ間隔になるよう、ここでまとめて取る */
#wrapper {
    padding-top: 32px;
}

/* メインコンテンツエリア */
#content {
    width: 100%;
    padding: 0 0 25px;   /* 上の余白は #wrapper 側で取っている */
}

/* フッター */
#footer {
    width: 100%;
    padding: 24px 0 28px;
    text-align: center;
    background-color: #ffede5;
}

#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: 0.75rem; /* 12px */
    color: #767676; /* #777 だとコントラスト比 4.48:1 で AA 基準に僅かに届かない */
}

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

/* ヘッダーエリア。淡いピーチ色の帯にして、医院名は中央ぞろえにする */
#header {
    padding: 30px 0 28px;
    background-color: #ffede5;
}

/* ヘッダーだけは本文より広く使う。
   本文の幅（800px）のままだと、連絡先が画面のかなり内側に来てしまうため。 */
#header .inner {
    position: relative;
    max-width: 1120px;
}

/* ロゴ・医院名エリア */
.logo-area {
    text-align: center;
}

.site-description {
    font-size: 0.8125rem; /* 13px */
    color: #666;
    font-weight: normal;
    line-height: 1.4;
    margin-bottom: 10px;
}

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

/* 連絡先。医院名は中央のまま、こちらは右端に寄せて縦位置をそろえる */
.contact {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    text-align: right;
    color: #333;
}

.contact .tel {
    font-size: 1.625rem; /* 26px */
    font-weight: bold;
    font-family: Arial, sans-serif;
    color: #a1490b;
}

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

/* 電話番号は、医院名より控えめな大きさにする */
.contact .tel {
    font-size: 1.25rem; /* 20px */
}

/* グローバルナビゲーション（メインメニュー） */
nav#mainNav {
    margin-bottom: 0;
    background-color: #ffe8cb;
}

/* ナビは画面幅いっぱいの帯にするので、内側だけ本文幅にそろえる */
nav#mainNav .inner {
    padding: 0 20px;
}

nav#mainNav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* 項目を中央にそろえる */
    list-style: none;
}

nav#mainNav ul li {
    flex: none;
}

nav#mainNav ul li a {
    display: block;
    text-align: center;
    color: #000;
    padding: 19px 20px;
    font-weight: bold;
    font-size: 1rem; /* 16px */
    transition: background-color 0.2s ease;
}

nav#mainNav ul li a:hover {
    background-color: rgba(255, 255, 255, .45); /* 淡い地の上なので、白を重ねて明るくする */
}

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

/* トップページのメインビジュアル。背景写真の上に、薄い白の枠を置いて文字を載せる */
.appeal {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    margin-bottom: 0;   /* 下の余白は #wrapper 側で取る */
    padding: 3% 5%;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* 写真がどんな明るさでも文字が読めるよう、半透明の白を敷く */
.appeal-in {
    width: 100%;
    max-width: 480px;   /* 元サイトは740px。キャッチコピーの文字数に合わせて詰めた */
    margin: 0 auto;
    padding: 2em;
    text-align: center;
    background-color: rgba(255, 255, 255, .85);
    border-radius: 4px;
}

.appeal-text {
    margin: 0;
    color: #333;
    font-size: 1.25rem; /* 20px */
    font-weight: bold;
    line-height: 1.6;
}

.appeal-button-wrap {
    margin: 1em 0 0;
}

.appeal-button {
    display: inline-block;
    padding: 11px 42px;
    color: #fff;
    font-weight: bold;
    text-decoration: none;
    background-color: #ff8c11;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.appeal-button:hover {
    color: #fff;
    background-color: #e07800;
}

.appeal-button:focus-visible {
    outline: 2px solid #a1490b;
    outline-offset: 3px;
}

/* 「お知らせ」エリア */
#sidebar {
    width: 100%;
    margin-bottom: 34px; /* お知らせ欄と、その下の本文とのあいだを空ける */
}

.widgetInfo {
    padding: 0;
    overflow: hidden;   /* 角丸から中身がはみ出さないように */
    background-color: #fff;
    border: 1px solid #f0e2d6;
    border-radius: 8px;
}

.newsTitle {
    display: flex;
    justify-content: space-between; /* 見出しと「一覧」を左右に振り分け */
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    margin-bottom: 0;
    background-color: #ffe8cb;   /* ナビと同じ淡いクリームで帯にする */
}

.newsTitle h3 {
    font-size: 1.1875rem; /* 19px */
    font-weight: bold;
    color: #4a2a10;   /* 淡いクリームの上で読みやすい濃い茶 */
}

.newsTitle p a {
    font-size: 0.8125rem; /* 13px */
    color: #4a2a10;
    background-color: rgba(255, 255, 255, .75);
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.news {
    padding: 4px 16px 12px;
}

.news p {
    padding: 9px 0;
    border-bottom: 1px solid #f3ece6;
    font-size: 1.0625rem; /* 17px */
    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: 1.1875rem; /* 19px */
    color: #333;
    border-bottom: 2px solid #a1490b;
    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: #a1490b;
}

/* 一覧ページの記事リンク */
.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;
    }

    /* 狭い画面では、ヘッダーの帯は高くしすぎない */
    #header {
        padding: 22px 0 20px;
    }

    /* 狭い画面では右に置くと重なるので、医院名の下に戻す */
    .contact {
        position: static;
        transform: none;
        margin-top: 8px;
        text-align: center;
    }

    /* スマホ表示時のキャッチフレーズと医院名の文字サイズバランス */
    .logo-area .site-description { font-size: 0.8125rem; /* 13px */ }
    .logo-area .site-title { font-size: 1.625rem; /* 26px */ }
    .contact .tel { font-size: 1.125rem; /* 18px */ }

    /* メインビジュアルは、狭い画面では高さを抑える */
    .appeal {
        min-height: 220px;
        padding: 24px 15px;
    }

    .appeal-in {
        padding: 1.5em 1.2em;
    }

    .appeal-text {
        font-size: 1.125rem; /* 18px */
    }

    .appeal-button {
        padding: 11px 32px;
    }

    #wrapper {
        padding-top: 24px;
    }

    /* ナビは帯なので、開閉ボタンの左右に余白を残す */
    nav#mainNav .inner {
        padding: 8px 15px;
    }

    /* --- スマホ用メニューの開閉（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: #a1490b;
        border: none;
        cursor: pointer;
        border-radius: 4px;
        margin-bottom: 5px;
    }

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

    /* アイコン。読み上げには不要なので 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: #ffe8cb;
        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 {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, .12);
    }
    nav#mainNav ul li:last-child {
        border-bottom: none;
    }
    nav#mainNav ul li a {
        display: block;
        text-align: center;
        padding: 12px 0;
        color: #000;
        font-size: 1rem; /* 16px */
    }
}


/* ==========================================================================
   本文内（.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;
}

/* ==========================================================================
   5. 動きを減らす設定への配慮
   ========================================================================== */

/*
 * OSやブラウザで「視差効果を減らす」を選んでいる人には、色や背景の変化を出さない。
 * 動きで気分が悪くなる人がいるため。
 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   6. 印刷（診療時間やアクセスを紙に控える人向け）
   ========================================================================== */

@media print {
    /* 紙では意味を持たないものを消す。
       医院名・電話・住所（#header）は連絡先として残す */
    nav#mainNav,
    #mainImg,
    #sidebar,
    #footer,
    .pagenav,
    .back-home,
    .skip-link {
        display: none !important;
    }

    body {
        font-size: 11pt;
        line-height: 1.6;
        color: #000;
        background: #fff;
    }

    #wrapper,
    .inner {
        max-width: none;
        padding: 0;
    }

    /* 画面用の枠線や背景は、紙では邪魔になるので外す */
    .post {
        padding: 0;
        border: none;
        background: none;
    }

    #header {
        padding-bottom: 8px;
        border-bottom: 1px solid #000;
    }

    .site-title {
        font-size: 16pt;
    }

    /* 診療時間表は紙でも罫線を残す */
    .post table th,
    .post table td {
        border: 1px solid #000;
    }

    .post table th {
        background: none;
        color: #000;
    }

    /* 見出しやページの途中で不自然に切れないようにする */
    h1, h2, h3,
    .post table {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}
