/* 共通のヘッダー（src/pages/site_header.ts）とフッター（src/pages/footer.ts）。どのページも読み込む */
.site-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 10px 20px;
               border-bottom: 1px solid #2c3542; background: #151a22; text-align: left; }
.site-header .logo { margin-right: auto; color: #e6e9ee; text-decoration: none; font: bold 20px/1.2 "Segoe UI", "Yu Gothic UI", system-ui, sans-serif;
                     letter-spacing: .02em; white-space: nowrap; }
.site-header .logo .logo-fn { color: #5aa9ff; }
.site-header .logo:hover .logo-lab { text-decoration: underline; }
.site-header .site-nav a { color: #e6e9ee; text-decoration: none; font-size: 14px; white-space: nowrap; }
.site-header .site-nav a:hover { color: #5aa9ff; text-decoration: underline; }
.site-header .about-op { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: #e6e9ee; font-size: 14px; white-space: nowrap; cursor: pointer; }
.site-header .about-op:hover { color: #5aa9ff; text-decoration: underline; }
.site-header .about-op:focus-visible { outline: 3px solid #5aa9ff; outline-offset: 2px; border-radius: 4px; }
/* 「運営者について」のポップオーバー（HTML の Popover API。JavaScript は使わない） */
.about-pop { inset: 64px 16px auto auto; margin: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 80px); overflow: auto; box-sizing: border-box;
             background: #1a2029; color: #e6e9ee; border: 1px solid #2c3542; border-radius: 10px; padding: 16px 20px 20px; box-shadow: 0 8px 28px rgba(0,0,0,.55); }
.about-pop::backdrop { background: rgba(0,0,0,.35); }
/* Popover API が無い古いブラウザでは、閉じたままにする（:popover-open を知らないブラウザは 2 行目ごと無視するので、隠れたままになる） */
.about-pop { display: none; }
.about-pop:popover-open { display: block; }
.about-pop::before { content: ""; position: absolute; top: -8px; right: 40px; width: 14px; height: 14px; background: #1a2029; border-left: 1px solid #2c3542; border-top: 1px solid #2c3542; transform: rotate(45deg); }
.about-pop h2 { font-size: 16px; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid #2c3542; }
/* 紹介カード（src/pages/social.ts の creatorCard）。トップページの「作った人」とヘッダーのポップオーバーで共通 */
.creator-body { display: flex; align-items: center; gap: 24px; background: #1a2029; border: 1px solid #2c3542; border-radius: 10px; padding: 20px 24px; }
.creator-logo { flex: 0 0 auto; width: 160px; height: auto; }
.creator-main { flex: 1 1 auto; min-width: 0; }
.creator-text { margin: 0; color: #e6e9ee; font-size: 15px; line-height: 1.7; }
.creator-social { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 16px; }
.creator-social a { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; color: #9aa4b2; text-decoration: none; padding: 4px; border-radius: 8px; }
.creator-social a:hover { color: #e6e9ee; }
.creator-social a:focus-visible { outline: 3px solid #5aa9ff; outline-offset: 2px; }
.creator-social svg { width: 40px; height: 40px; }
.social-caption { font-size: 12.5px; }
/* お知らせのベル（src/pages/site_header.ts）。未読のときだけ右上に赤い点 */
.site-header .news-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; color: #e6e9ee; padding: 2px; border-radius: 4px; line-height: 1; }
.site-header .news-bell:hover { color: #5aa9ff; }
.site-header .news-bell:focus-visible { outline: 3px solid #5aa9ff; outline-offset: 2px; }
.news-icon { width: 18px; height: 18px; display: block; }
.news-dot { position: absolute; top: 0; right: 0; width: 8px; height: 8px; border-radius: 50%; background: #ff4d4f; border: 1px solid #151a22; box-sizing: border-box; }
/* お知らせの一覧（/news） */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: 10px 0; border-bottom: 1px solid #2c3542; line-height: 1.7; }
.news-list time { display: inline-block; margin-right: 10px; color: #9aa4b2; font-variant-numeric: tabular-nums; }
/* ヘッダーの下の細い帯「コーヒーをおごりませんか？」（src/pages/tip.ts）。控えめな薄い青の帯 */
.tip-bar { display: block; width: 100%; box-sizing: border-box; margin: 0; padding: 6px 16px; border: 0; border-bottom: 1px solid #2c3542;
           background: rgba(90,169,255,.10); color: #b9d6f5; font: inherit; font-size: 13px; line-height: 1.5; text-align: center; cursor: pointer; }
.tip-bar:hover { background: rgba(90,169,255,.16); color: #e6e9ee; text-decoration: underline; }
.tip-bar:focus-visible { outline: 3px solid #5aa9ff; outline-offset: -3px; }
/* コーヒーの説明の窓（Popover API。about-pop と同じ作り。画面の中央に出す） */
.tip-pop { inset: 0; margin: auto; width: min(620px, calc(100vw - 32px)); height: fit-content; max-height: calc(100vh - 48px); overflow: auto; box-sizing: border-box;
           background: #1a2029; color: #e6e9ee; border: 1px solid #2c3542; border-radius: 12px; padding: 24px 28px 28px; box-shadow: 0 8px 28px rgba(0,0,0,.55); }
.tip-pop::backdrop { background: rgba(0,0,0,.55); }
.tip-pop { display: none; }
.tip-pop:popover-open { display: block; }
.tip-pop h2 { font-size: 18px; line-height: 1.5; margin: 0 28px 14px 0; }
.tip-pop p { margin: 0 0 12px; font-size: 15px; line-height: 1.8; }
.tip-pop .tip-cta-row { margin: 20px 0 0; text-align: center; }
.tip-cta { display: inline-block; padding: 14px 32px; border-radius: 999px; background: #29ABE0; color: #fff; font-size: 17px; font-weight: bold; text-decoration: none; }
.tip-cta:hover { background: #4cbdee; text-decoration: none; }
.tip-cta:focus-visible { outline: 3px solid #5aa9ff; outline-offset: 3px; }
.tip-close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: #9aa4b2; font-size: 22px; line-height: 1; cursor: pointer; }
.tip-close:hover { color: #e6e9ee; background: #24364d; }
.tip-close:focus-visible { outline: 3px solid #5aa9ff; outline-offset: 2px; }
@media (max-width: 600px) {
  .tip-bar { font-size: 12px; padding: 6px 10px; }
  .tip-pop { padding: 20px 18px 22px; }
  .site-header { padding: 8px 16px; gap: 6px 14px; }
  .about-pop { inset: 56px 0 auto 0; margin: 0 auto; }
  .about-pop::before { display: none; }
  .creator-body { flex-direction: column; text-align: center; padding: 16px; }
  .creator-logo { width: 120px; }
  .creator-social { justify-content: center; }
}
.site-footer { max-width: 960px; margin: 56px auto 0; padding: 20px 16px 80px; border-top: 1px solid #2c3542; text-align: center;
               color: #9aa4b2; font-size: 13px; line-height: 1.7; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin-bottom: 10px; }
.site-footer a { color: #9aa4b2; text-decoration: none; }
.site-footer a:hover { color: #e6e9ee; text-decoration: underline; }
/* X・YouTube のロゴのリンク（src/pages/social.ts）。小さく横に並べ、ホバーで少し明るくする */
.site-footer .social { display: flex; justify-content: center; gap: 16px; margin: 0 0 12px; }
.site-footer .social a { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; opacity: .8; }
.site-footer .social a:hover { opacity: 1; text-decoration: none; }
.site-footer .social a:focus-visible { outline: 3px solid #5aa9ff; outline-offset: 2px; }
.site-footer .social svg { width: 20px; height: 20px; }
.site-footer .notice { margin: 0; font-size: 12px; color: #9aa4b2; overflow-wrap: anywhere; line-height: 1.6; }
/* ページの先頭へ戻るボタン（src/pages/footer.ts・frontend/to_top.js）。右下に固定し、1 画面分より下までスクロールしたときだけ出す。
   画面の下に固定したものはほかに無い。フッターの下の余白（80px）で、いちばん下までスクロールしてもフッターの文字に重ならない。
   スマホのホームバーの分（safe-area）も空ける */
.to-top { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50;
          width: 44px; height: 44px; padding: 0; border: 1px solid #2c3542; border-radius: 50%; background: rgba(26,32,41,.92);
          color: #e6e9ee; font: bold 20px/1 system-ui, sans-serif; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.to-top:hover { background: #24364d; }
.to-top:focus-visible { outline: 3px solid #5aa9ff; outline-offset: 2px; }
.to-top[hidden] { display: none; }
@media print { .to-top { display: none; } }
