/* 公開ブログと管理画面プレビュー iframe で共有する記事スタイル。
   このファイルと src/style.css の対応ルールは同期しておく。 */
:root {
  --bg: #fff8f1;
  --bg-2: #ffe8d6;
  --surface: #ffffff;
  --surface-2: #fff1e6;
  --text: #2a2438;
  --muted: #6b6478;
  --accent: #ff5c7a;
  --accent-2: #7c6cf0;
  --accent-3: #3ecfaf;
  --accent-hover: #ff3d62;
  --border: #f0dcc8;
  --shadow: 0 10px 30px rgba(90, 50, 30, 0.08);
  --shadow-lift: 0 18px 40px rgba(90, 50, 30, 0.14);
  --radius: 20px;
  --radius-sm: 14px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
    "Yu Gothic", system-ui, sans-serif;
  --max: 980px;
  --h-blog: 36;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.75;
  background:
    radial-gradient(900px 500px at 10% -10%, rgb(var(--t-wash1-rgb, 255 182 193) / 0.45), transparent 60%),
    radial-gradient(700px 420px at 95% 5%, rgb(var(--t-wash2-rgb, 167 232 214) / 0.4), transparent 55%),
    radial-gradient(800px 480px at 80% 100%, rgb(var(--t-wash3-rgb, 186 170 255) / 0.28), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--t-bg-mid, #fff3e8) 50%, var(--t-bg-end, #ffe9f0) 100%);
}

body.theme-blog {
  --wash: var(--h-blog);
  background:
    radial-gradient(900px 500px at 10% -10%, hsl(var(--wash) 72% 78% / 0.42), transparent 60%),
    radial-gradient(700px 420px at 95% 5%, hsl(calc(var(--wash) + 18) 62% 80% / 0.32), transparent 55%),
    radial-gradient(800px 480px at 80% 100%, hsl(calc(var(--wash) - 16) 48% 76% / 0.24), transparent 55%),
    linear-gradient(180deg, hsl(var(--wash) 55% 98%) 0%, hsl(var(--wash) 48% 96%) 50%, hsl(var(--wash) 42% 94%) 100%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

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

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.article,
.prose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.7rem 1.5rem 1.55rem;
  box-shadow: var(--shadow);
}

.article__header {
  margin-bottom: 1.2rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px dashed rgb(var(--t-line-rgb, 240 220 200) / 0.95);
}

.article__date {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  margin-bottom: 0.45rem;
}

.article h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3.5vw, 1.85rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.article h2,
.prose h2 {
  margin: 2rem 0 0.75rem;
  padding: 0.15rem 0 0.15rem 0.85rem;
  border-left: 3px solid var(--accent);
  font-size: 1.14rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
}

.article h2:first-of-type,
.prose h2:first-of-type {
  margin-top: 1.35rem;
}

.article h3,
.prose h3 {
  margin: 1.45rem 0 0.55rem;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
}

.article p,
.article li,
.prose p,
.prose li {
  color: var(--muted);
}

.article p,
.prose p {
  margin: 0.85rem 0;
  line-height: 1.85;
}

.article ul,
.article ol,
.prose ul,
.prose ol {
  margin: 0.7rem 0 1rem;
  padding-left: 1.35rem;
}

.article li,
.prose li {
  margin: 0.35rem 0;
  line-height: 1.75;
}

.article li::marker,
.prose li::marker {
  color: var(--accent-2);
}

.article a,
.prose a {
  font-weight: 700;
}

.article strong,
.prose strong {
  color: var(--text);
  font-weight: 800;
}

.article__lead,
.prose-lead,
.article > p:first-of-type {
  font-size: 1.05rem;
  line-height: 1.85;
}

.article__lead,
.prose-lead {
  font-weight: 700;
  color: var(--text) !important;
}

.article__quote,
.prose-pullquote,
.article blockquote,
.prose blockquote {
  margin: 1.1rem 0 1.35rem;
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--surface-2), var(--t-pale-a, #fff6f0));
  border-left: 4px solid var(--accent);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text) !important;
  letter-spacing: 0.02em;
  line-height: 1.65;
}

.article blockquote p,
.prose blockquote p {
  margin: 0;
  color: var(--text) !important;
  font-weight: 800;
}

.article hr,
.prose hr,
.prose-divider {
  border: none;
  height: 1px;
  margin: 1.75rem 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgb(var(--t-line-rgb, 240 200 170) / 0.95) 20%,
    rgb(var(--t-accent2-pale-rgb, 200 180 240) / 0.7) 80%,
    transparent
  );
}

.article__figure,
.prose figure {
  margin: 0 0 1.35rem;
}

.article__figure img,
.prose figure img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* 記事の中の YouTube: カバー画像と同じ 720px まで・中央・16:9 */
.article iframe.video-embed,
.prose iframe.video-embed,
.article iframe[src*="youtube-nocookie.com"],
.prose iframe[src*="youtube-nocookie.com"] {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 1.25rem auto;
  border: 0;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--border) 35%, transparent);
}

.article__figure figcaption,
.prose figure figcaption,
.prose figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.article__sign {
  margin-top: 1.85rem !important;
  padding-top: 1rem;
  border-top: 1px dashed rgb(var(--t-line-rgb, 240 220 200) / 0.95);
  font-weight: 700;
  color: var(--text) !important;
}

/* 書いた人（記事の最後） */
.article__byline {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem 1rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 500;
}

.article__sign.article__byline {
  border-top: none;
}

.article .article__byline-icon {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px var(--surface-2);
}

.article__byline-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.article__byline-kicker {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.article__byline-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.article__byline-bio {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.7;
}

@media (max-width: 560px) {
  .article__byline {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .article .article__byline-icon {
    width: 72px;
    height: 72px;
  }
}

.article code,
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  font-weight: 600;
  color: var(--t-code, #5a4a78);
  background: rgb(var(--t-accent2-rgb, 124 108 240) / 0.1);
  border: 1px solid rgb(var(--t-accent2-rgb, 124 108 240) / 0.16);
  border-radius: 0.4em;
  padding: 0.08em 0.38em;
}

/* コードブロック: 横にはみ出さず、ブロックの中だけ横スクロール */
.article,
.prose,
.article > *,
.prose > * {
  min-width: 0;
}

.article code,
.prose code {
  overflow-wrap: anywhere;
}

.article pre,
.prose pre {
  display: block;
  max-width: 100%;
  margin: 1rem 0 1.2rem;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #1f1d2b;
  color: #f2eefa;
  border-radius: var(--radius-sm, 12px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  tab-size: 2;
}

.article pre code,
.prose pre code {
  display: block;
  font: inherit;
  font-weight: 400;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  white-space: pre;
  overflow-wrap: normal;
}

.article kbd,
.prose kbd,
kbd {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82em;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(180deg, rgb(var(--t-glass-rgb, 255 255 255)), var(--t-pale-a, #fff1e6));
  border: 1px solid var(--t-line-strong, #e8d2bc);
  border-bottom-width: 2px;
  border-radius: 0.4em;
  padding: 0.12em 0.45em;
  line-height: 1.3;
  box-shadow: 0 1px 0 rgb(var(--t-shadow-rgb, 90 50 30) / 0.06);
}

.callout {
  margin: 1.15rem 0;
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: 0 4px 14px rgb(var(--t-shadow-rgb, 90 50 30) / 0.04);
}

.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

.callout__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent-2);
}

.callout--note {
  background: linear-gradient(135deg, var(--t-pale-a, #fff8f1), var(--t-pale-b, #f7f2ff));
  border-color: var(--t-line-strong, #e8d4f0);
}

.callout--tip {
  background: linear-gradient(135deg, var(--t-pale-c, #f2fbf7), var(--t-pale-c, #eef8ff));
  border-color: var(--t-line-strong, #c8e8dc);
}

.callout--tip .callout__label { color: var(--t-teal, #2aaf95); }

.callout--warn {
  background: linear-gradient(135deg, var(--t-pale-a, #fff8f0), var(--t-pale-d, #fff0f3));
  border-color: var(--t-line-strong, #f0d0b8);
}

.callout--warn .callout__label { color: var(--accent); }

.key-list {
  list-style: none;
  margin: 0.85rem 0 1.1rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.key-list li {
  position: relative;
  margin: 0;
  padding: 0.7rem 0.9rem 0.7rem 2.35rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  line-height: 1.65;
}

.key-list li::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 3px rgb(var(--t-accent-rgb, 255 92 122) / 0.12);
}

.article details,
.prose details {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.95rem 0.15rem;
  margin: 0.65rem 0;
}

.article details[open],
.prose details[open] {
  padding-bottom: 0.75rem;
}

.article summary,
.prose summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.75rem 0;
  color: var(--text);
}

.article summary::-webkit-details-marker,
.prose summary::-webkit-details-marker {
  display: none;
}

.article summary::before,
.prose summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.45rem;
  color: var(--accent-2);
  transition: transform 0.15s ease;
}

.article details[open] summary::before,
.prose details[open] summary::before {
  transform: rotate(90deg);
}

.article details p,
.prose details p,
.article details li,
.prose details li {
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.article .ql-align-center { text-align: center; }
.article .ql-align-right { text-align: right; }

.preview-shell {
  padding: 1.25rem 0 1.5rem;
}

.article__figure--icon img {
  width: min(100%, 256px);
  margin-inline: auto;
  border-radius: 28px;
}


.preview-shell {
  padding: 1.25rem 0 1.5rem;
}
.preview-shell .container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* 書いた人: カード全体が運営者情報へのリンク */
.article a.article__byline,
a.article__byline {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.article__byline:hover {
  border-color: rgb(var(--t-accent2-rgb, 124 108 240) / 0.45);
  transform: translateY(-1px);
}
a.article__byline:focus-visible {
  outline: 2px solid rgb(var(--t-accent2-rgb, 124 108 240));
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  a.article__byline { transition: none; }
  a.article__byline:hover { transform: none; }
}
