/*
Theme Name: 終わりカレンダー
Theme URI: https://owari.news/
Author: 終わりカレンダー編集部
Description: サービス終了・閉店・生産終了など、公式発表で確認できた「終わり」を終了日順にまとめるためのテーマ。デザインは「B＋スタンプ」パターン（紙色の背景、白カード、ヘアライン境界、終了済みスタンプ）。
Version: 0.1.2
Text Domain: owari
*/

/* ============================================================
   デザイントークン（B＋スタンプ）
   - 背景は紙色 #f6f5f4、カードは白、境界は1pxヘアライン、影なし
   - 朱色 #A63A28 は「終了済み」スタンプ専用
   - 角丸は場所ごとに変える（全面均一にしない）
   ============================================================ */
:root {
  --paper: #f6f5f4;
  --card: #ffffff;
  --ink: #2b2b28;
  --ink-soft: #55534e;
  --muted: #83817b;
  --line: #e4e2db;
  --line-strong: #cfccc2;
  --stamp: #a63a28;
  --memo-bg: #fdfbf1;
  --radius-hero: 12px;
  --radius-card: 8px;
  --radius-small: 6px;
  --radius-chip: 3px;
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
}

a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }

.wrap { max-width: 1020px; margin: 0 auto; padding: 0 20px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- ヘッダー ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line-strong);
}
.site-header .wrap {
  display: flex; align-items: baseline; gap: 28px;
  padding-top: 18px; padding-bottom: 14px; flex-wrap: wrap;
}
.site-title { font-size: 24px; font-weight: 700; letter-spacing: .04em; }
.site-title a { text-decoration: none; }
.site-title .domain { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; letter-spacing: .08em; }
.site-nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a { text-decoration: none; font-size: 14px; color: var(--ink-soft); }
.site-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.site-description { font-size: 13px; color: var(--muted); margin: 0 0 26px; }

/* ---------- 共通部品 ---------- */
.section { margin: 0 0 44px; }
.section-title {
  font-size: 19px; font-weight: 700; margin: 0 0 6px;
  padding-bottom: 8px; border-bottom: 2px solid var(--ink);
}
.section-note { font-size: 13px; color: var(--muted); margin: 0 0 14px; }

.cat-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-chip);
  padding: 2px 9px 2px 7px; font-size: 12px; color: var(--ink-soft);
  text-decoration: none; white-space: nowrap;
}
.cat-chip .block { width: 10px; height: 10px; flex: none; }
a.cat-chip:hover { border-color: var(--line-strong); }

.badge-days {
  display: inline-block; background: var(--card);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 1px 12px; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.badge-days.today { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 終了済みスタンプ（朱色・二重枠・少し傾ける） */
.stamp {
  display: inline-block; position: relative;
  color: var(--stamp); font-weight: 700; font-size: 14px; letter-spacing: .28em;
  padding: 4px 12px 4px 16px;
  border: 2.5px solid var(--stamp); border-radius: 4px;
  transform: rotate(-4deg);
  opacity: .92; white-space: nowrap; background: rgba(255, 255, 255, .35);
}
.stamp::after {
  content: ""; position: absolute; inset: 2.5px;
  border: 1px solid var(--stamp); border-radius: 2px; pointer-events: none;
}
.stamp.small { font-size: 11px; padding: 2px 8px 2px 11px; border-width: 2px; }
.row-list .row:nth-child(odd) .stamp { transform: rotate(-3deg); }
.row-list .row:nth-child(even) .stamp { transform: rotate(-5.5deg); }

/* 罫線の行リスト（アーカイブ・一覧の基本形） */
.row-list { border-bottom: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 118px 1fr auto; gap: 6px 18px;
  align-items: center;
  padding: 14px 6px; border-top: 1px solid var(--line);
}
.row:hover { background: rgba(255, 255, 255, .55); }
.row .row-date { font-size: 14px; color: var(--ink-soft); }
.row .row-date .dow { font-size: 12px; color: var(--muted); }
.row .row-main { min-width: 0; }
.row .row-title { font-size: 16px; font-weight: 700; margin: 0; }
.row .row-title a { text-decoration: none; }
.row .row-title a:hover { text-decoration: underline; }
.row .row-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.row .row-side { text-align: right; }

/* ---------- トップ：ヒーロー ---------- */
.hero-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-hero);
  padding: 30px 34px; margin: 30px 0 44px;
  display: flex; gap: 30px; justify-content: space-between; align-items: center;
}
.hero-card .hero-label { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.hero-card h2 { font-size: 30px; line-height: 1.4; margin: 6px 0 10px; }
.hero-card h2 a { text-decoration: none; }
.hero-card .hero-meta { font-size: 14px; color: var(--ink-soft); margin: 0; }
.hero-count { text-align: center; flex: none; padding-left: 30px; border-left: 1px solid var(--line); }
.hero-count .count-label { font-size: 13px; color: var(--muted); display: block; }
.hero-count .count-num { font-size: 68px; font-weight: 700; line-height: 1.1; display: block; }
.hero-count .count-unit { font-size: 16px; }

/* ---------- カレンダー ---------- */
.cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 16px; }
.cal table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal caption { text-align: left; font-weight: 700; font-size: 16px; padding: 2px 2px 12px; }
.cal th { font-size: 12px; color: var(--muted); font-weight: 400; padding: 4px; }
.cal th.sun { color: var(--stamp); }
.cal td {
  border: 1px solid var(--line); vertical-align: top;
  height: 74px; padding: 5px 7px; font-size: 13px; background: #fff;
}
.cal td.out { background: transparent; border-color: transparent; }
.cal td.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal .cal-day { font-weight: 700; }
.cal .cal-item { display: block; font-size: 11px; line-height: 1.45; margin-top: 3px; text-decoration: none; }
.cal .cal-item .dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; }
.cal .cal-item.ended { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

/* ---------- 記事ページ ---------- */
.breadcrumb { font-size: 13px; color: var(--muted); margin: 22px 0 10px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.entry-header h1 { font-size: 30px; line-height: 1.45; margin: 8px 0 12px; }
.entry-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.entry-status .end-datetime { font-size: 17px; font-weight: 700; }

.data-table {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-card); overflow: hidden; margin: 0 0 30px;
}
.data-table table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 11px 16px; font-size: 15px; text-align: left; vertical-align: top; }
.data-table th { width: 168px; background: var(--paper); color: var(--ink-soft); font-weight: 700; border-top: 1px solid var(--line); }
.data-table td { border-top: 1px solid var(--line); }
.data-table tr:first-child th, .data-table tr:first-child td { border-top: none; }

.entry-content { font-size: 16px; margin: 0 0 34px; }
.entry-content h2 { font-size: 21px; margin: 34px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.entry-content h3 { font-size: 18px; margin: 26px 0 8px; }

.memo {
  border: 1.5px dashed var(--line-strong); background: var(--memo-bg);
  border-radius: 4px; padding: 12px 16px; font-size: 14px; margin: 0 0 30px;
}
.memo .memo-label { font-weight: 700; margin-right: 8px; }

/* チェックリスト（チェック描画はUiverse風の小さな演出） */
.checklist {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 20px 22px; margin: 0 0 34px;
}
.checklist h2 { font-size: 19px; margin: 0 0 4px; }
.check-progress { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; }
.check-item:first-of-type { border-top: none; }
.check-item input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  flex: none; width: 22px; height: 22px; margin-top: 3px;
  border: 2px solid var(--ink-soft); border-radius: 5px; background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .18s ease, border-color .18s ease;
}
.check-box svg { width: 14px; height: 14px; }
.check-box svg path {
  stroke: #fff; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .22s ease;
}
.check-item input:checked + .check-box { background: var(--ink); border-color: var(--ink); }
.check-item input:checked + .check-box svg path { stroke-dashoffset: 0; }
.check-item input:focus-visible + .check-box { outline: 2px solid var(--ink); outline-offset: 2px; }
.check-item .check-text { flex: 1; }
.check-item input:checked ~ .check-text { color: var(--muted); text-decoration: line-through; }
.check-item .check-note { display: block; font-size: 13px; color: var(--stamp); font-weight: 700; }

/* FAQ */
.faq { margin: 0 0 34px; }
.faq-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-small); margin-bottom: 10px; padding: 4px 18px;
}
.faq-item summary { font-weight: 700; cursor: pointer; padding: 10px 0; font-size: 15.5px; }
.faq-item .faq-a { padding: 0 0 12px; font-size: 15px; color: var(--ink-soft); }

.source-line { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin: 34px 0 0; }

/* ---------- フッター ---------- */
.site-footer { border-top: 1px solid var(--line-strong); margin-top: 60px; padding: 26px 0 40px; }
.site-footer .foot-note { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.site-footer nav ul { display: flex; gap: 20px; list-style: none; margin: 0 0 12px; padding: 0; flex-wrap: wrap; }
.site-footer nav a { font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.site-footer .copyright { font-size: 12px; color: var(--muted); }

/* ---------- その他 ---------- */
.empty-note { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 18px 20px; font-size: 14px; color: var(--ink-soft); }
.pagination { margin: 26px 0; font-size: 14px; }
.pagination .page-numbers { margin-right: 8px; }

@media (max-width: 720px) {
  .hero-card { flex-direction: column; align-items: flex-start; padding: 24px 22px; }
  .hero-count { border-left: none; padding-left: 0; text-align: left; }
  .hero-count .count-num { font-size: 52px; }
  .row { grid-template-columns: 1fr auto; }
  .row .row-date { grid-column: 1 / -1; }
  .row .row-side { text-align: right; }
  .cal td { height: 56px; font-size: 12px; padding: 4px; }
  .cal .cal-item { font-size: 10px; }
  .data-table th { width: 108px; }
  .entry-header h1 { font-size: 25px; }
}
