/*
Theme Name: SeaBream
Theme URI: https://journal.bleniqa.com/
Author: BLENIQA
Description: SeaBream Journal のテーマ。波のヒーロー、スクロールで現れるカード、読了バー、ダークモード、自動翻訳の言語切り替えつき。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: seabream
*/

:root {
  --ink: #171a3d; --ink2: #4a4f72; --mute: #8a8fac; --bg: #f7f8fc; --card: #ffffff; --line: #e5e8f2;
  --navy: #1b1f4b; --sea: #3d7bff; --sea2: #22c3d6; --coral: #ff6b5a; --coral2: #ff9a6b;
  --r: 20px; --shadow: 0 1px 2px rgba(23,26,61,.04), 0 12px 32px -14px rgba(23,26,61,.18);
  --font: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Hiragino Mincho ProN", "Noto Serif JP", Georgia, serif;
  color-scheme: light;
}
html.dark {
  --ink: #e9ecfb; --ink2: #b4b9d6; --mute: #7d83a6; --bg: #0b0e22; --card: #12163a; --line: #232856;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 40px -18px rgba(0,0,0,.7);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.75; -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; top: 0 !important; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::selection { background: color-mix(in srgb, var(--coral) 30%, transparent); }

/* 読了バー */
.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 60; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--sea), var(--sea2), var(--coral)); }

/* ヘッダー */
.hd { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid transparent; transition: border-color .3s, background .3s; }
.hd.scrolled { border-bottom-color: var(--line); }
.hd .wrap { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; }
.brand img { height: 34px; width: auto; }
html.dark .brand img { filter: brightness(0) invert(1); }
.hd nav { margin-left: auto; }
.nav { display: flex; gap: 4px; list-style: none; padding: 0; margin-block: 0; }
.nav a { display: block; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink2); transition: background .2s, color .2s; }
.nav a:hover, .nav .current-menu-item a { background: color-mix(in srgb, var(--sea) 10%, transparent); color: var(--ink); }
.tools { display: flex; align-items: center; gap: 8px; }
.hd nav + .tools { margin-left: 8px; }
.ibtn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink2); cursor: pointer; transition: transform .2s, border-color .2s; }
.ibtn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--sea) 45%, var(--line)); color: var(--ink); }
.ibtn svg { width: 18px; height: 18px; }
.lang { position: relative; }
.lang select { appearance: none; -webkit-appearance: none; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 13px var(--font); padding: 0 30px 0 34px; cursor: pointer; }
.lang svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--ink2); pointer-events: none; }
.lang::after { content: ''; position: absolute; right: 13px; top: 16px; width: 6px; height: 6px; border-right: 1.5px solid var(--ink2); border-bottom: 1.5px solid var(--ink2); transform: rotate(45deg); pointer-events: none; }
@media (max-width: 760px) { .hd nav { display: none; } .hd .tools { margin-left: auto; } .lang select { width: 44px; padding: 0; color: transparent; } .lang::after { display: none; } .lang svg { left: 14px; } }

/* ヒーロー */
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(1200px 500px at 10% -10%, #3d4bb8 0%, transparent 60%), radial-gradient(900px 500px at 100% 0%, #0f7fa8 0%, transparent 55%), linear-gradient(160deg, #141846 0%, #1b1f4b 45%, #0e3a63 100%); padding: 96px 0 150px; isolation: isolate; }
.hero .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; z-index: -1; animation: drift 16s ease-in-out infinite; }
.hero .b1 { width: 420px; height: 420px; background: #ff6b5a; left: -120px; top: 40px; }
.hero .b2 { width: 360px; height: 360px; background: #22c3d6; right: -80px; top: -60px; animation-delay: -6s; }
.hero .b3 { width: 280px; height: 280px; background: #6b5bff; right: 30%; bottom: -60px; animation-delay: -11s; }
@keyframes drift { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(40px,-30px) scale(1.08); } 66% { transform: translate(-30px,20px) scale(.95); } }
.hero .grain { position: absolute; inset: 0; z-index: -1; opacity: .06; background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 3px 3px; }
.hero .kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.hero .kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 0 rgba(255,107,90,.7); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(255,107,90,0); } 100% { box-shadow: 0 0 0 0 rgba(255,107,90,0); } }
.hero h1 { font-size: clamp(40px, 7vw, 84px); line-height: 1.02; letter-spacing: -.035em; margin: 22px 0 18px; font-weight: 800; max-width: 12ch; }
.hero h1 .g { background: linear-gradient(90deg, #fff, #9fe8f2 40%, #ffb39a 80%); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: shine 8s linear infinite; }
@keyframes shine { to { background-position: -200% 0; } }
.hero p.lead { font-size: clamp(16px, 2vw, 19px); color: rgba(255,255,255,.78); max-width: 46ch; margin: 0; }
.hero .fish { position: absolute; right: 7%; top: 50%; width: min(34vw, 380px); transform: translateY(-50%); opacity: .95; animation: swim 7s ease-in-out infinite; filter: drop-shadow(0 20px 40px rgba(0,0,0,.35)); }
.hero .fish img { width: 100%; filter: brightness(0) invert(1); opacity: .9; }
@keyframes swim { 0%,100% { transform: translateY(-50%) rotate(-3deg); } 50% { transform: translateY(-58%) rotate(3deg); } }
@media (max-width: 860px) { .hero .fish { display: none; } .hero { padding: 64px 0 120px; } }
.waves { position: absolute; left: 0; right: 0; bottom: -2px; height: 120px; z-index: 1; overflow: hidden; pointer-events: none; }
.waves svg { position: absolute; bottom: 0; width: 200%; height: 100%; }
.waves .w1 { animation: wave 18s linear infinite; opacity: .35; }
.waves .w2 { animation: wave 12s linear infinite reverse; opacity: .6; }
.waves .w3 { animation: wave 9s linear infinite; }
.waves path { fill: var(--bg); transition: fill .3s; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* セクション見出し */
.sec { padding: 56px 0 24px; }
.sec-h { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.sec-h h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; line-height: 1.2; }
.sec-h small { color: var(--mute); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; display: block; margin-bottom: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: color-mix(in srgb, var(--sea) 10%, transparent); color: color-mix(in srgb, var(--sea) 80%, var(--ink)); border: 1px solid transparent; transition: background .2s, border-color .2s; }
a.chip:hover { border-color: color-mix(in srgb, var(--sea) 40%, transparent); }
.chip.coral { background: color-mix(in srgb, var(--coral) 12%, transparent); color: color-mix(in srgb, var(--coral) 85%, var(--ink)); }

/* カード */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
.card { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, border-color .35s; }
.card:hover { transform: translateY(-6px); box-shadow: 0 2px 4px rgba(23,26,61,.05), 0 28px 50px -20px color-mix(in srgb, var(--sea) 40%, transparent); border-color: color-mix(in srgb, var(--sea) 30%, var(--line)); }
.card .th { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--line); }
.card .th img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.card:hover .th img { transform: scale(1.06); }
.ph { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.ph::before { content: ''; position: absolute; inset: -40%; background: conic-gradient(from var(--a, 0deg), var(--c1), var(--c2), var(--c3), var(--c1)); animation: spin 14s linear infinite; filter: blur(30px); opacity: .9; }
.ph span { position: relative; font-size: clamp(22px, 3vw, 30px); font-weight: 800; color: #fff; letter-spacing: -.02em; text-shadow: 0 2px 20px rgba(0,0,0,.2); padding: 0 24px; text-align: center; line-height: 1.25; }
@keyframes spin { to { transform: rotate(360deg); } }
.card .bd { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { margin: 0; font-size: 19px; line-height: 1.45; letter-spacing: -.01em; }
.card h3 a::after { content: ''; position: absolute; inset: 0; }
.card p { margin: 0; color: var(--ink2); font-size: 14.5px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--mute); font-weight: 600; margin-top: auto; padding-top: 6px; }
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.card .chip { position: relative; z-index: 1; align-self: flex-start; }

/* 大きいカード（最新の記事） */
.feature { display: grid; grid-template-columns: 1.25fr 1fr; gap: 0; margin-bottom: 30px; }
.feature .th { aspect-ratio: auto; min-height: 360px; }
.feature .bd { padding: 38px 40px; justify-content: center; gap: 14px; }
.feature h3 { font-size: clamp(24px, 3vw, 34px); line-height: 1.3; letter-spacing: -.02em; }
.feature p { -webkit-line-clamp: 4; font-size: 15.5px; }
.feature .meta { margin-top: 8px; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } .feature .th { min-height: 240px; } .feature .bd { padding: 24px; } }

/* スクロールで現れる（JS が使えるときだけ隠す） */
.js .rv { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0s); }
.js .rv.in { opacity: 1; transform: none; }

/* ページ送り */
.pager { display: flex; justify-content: center; gap: 8px; margin: 46px 0 10px; flex-wrap: wrap; }
.pager .page-numbers { min-width: 42px; height: 42px; padding: 0 14px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; color: var(--ink2); transition: all .2s; }
.pager .page-numbers:hover { color: var(--ink); border-color: var(--sea); }
.pager .current { background: var(--navy); color: #fff; border-color: var(--navy); }
html.dark .pager .current { background: var(--sea); border-color: var(--sea); }

/* 記事がまだないとき */
.empty { text-align: center; padding: 70px 20px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--card); }
.empty .emj { font-size: 46px; display: inline-block; animation: swim2 4s ease-in-out infinite; }
@keyframes swim2 { 0%,100% { transform: translateX(-10px) rotate(-4deg); } 50% { transform: translateX(10px) rotate(4deg); } }
.empty h2 { margin: 12px 0 6px; } .empty p { color: var(--ink2); margin: 0; }

/* アーカイブの見出し */
.ahd { padding: 64px 0 10px; }
.ahd small { color: var(--coral); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
.ahd h1 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -.03em; line-height: 1.1; margin: 8px 0 10px; }
.ahd p { color: var(--ink2); margin: 0; max-width: 60ch; }

/* 記事ページ */
.post-hd { padding: 70px 0 30px; text-align: center; }
.post-hd .chips { justify-content: center; }
.post-hd h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.18; letter-spacing: -.03em; margin: 18px auto 18px; max-width: 22ch; text-wrap: balance; word-break: auto-phrase; }
.post-hd .meta { justify-content: center; font-size: 13.5px; }
.post-hero { width: min(1100px, 100% - 40px); margin: 10px auto 0; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 21 / 9; position: relative; }
.post-hero img { width: 100%; height: 100%; object-fit: cover; }
.prose { width: min(720px, 100% - 40px); margin: 50px auto 0; font-size: 17.5px; line-height: 2; }
.prose > * + * { margin-top: 1.3em; }
.prose p { margin: 0; }
.prose h2 { font-size: 1.6em; line-height: 1.35; letter-spacing: -.02em; margin-top: 2.2em; padding-top: .2em; position: relative; }
.prose h2::before { content: ''; position: absolute; left: -22px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--sea), var(--coral)); }
.prose h3 { font-size: 1.25em; line-height: 1.45; margin-top: 1.9em; }
.prose a { color: var(--sea); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--sea) 35%, transparent); transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: var(--sea); }
.prose img, .prose figure { border-radius: 16px; }
.prose figure { margin-inline: 0; }
.prose figcaption { color: var(--mute); font-size: 13px; text-align: center; margin-top: 8px; }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--coral); color: var(--ink2); font-family: var(--serif); font-size: 1.1em; }
.prose pre { background: #0f1230; color: #e6e9ff; padding: 18px 20px; border-radius: 14px; overflow-x: auto; font-size: 14px; line-height: 1.7; }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; }
.prose :not(pre) > code { background: color-mix(in srgb, var(--sea) 10%, transparent); padding: 2px 6px; border-radius: 6px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 3em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9em; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; }
.prose .alignwide { width: min(1000px, 100vw - 40px); margin-left: 50%; transform: translateX(-50%); }
.prose .alignfull { width: 100vw; margin-left: 50%; transform: translateX(-50%); border-radius: 0; }
.post-ft { width: min(720px, 100% - 40px); margin: 56px auto 0; padding-top: 26px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.share { display: flex; gap: 8px; align-items: center; }
.share span { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--mute); text-transform: uppercase; margin-right: 4px; }
.navp { width: min(1000px, 100% - 40px); margin: 50px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.navp a { display: block; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); transition: transform .3s, border-color .3s; }
.navp a:hover { transform: translateY(-3px); border-color: var(--sea); }
.navp small { color: var(--mute); font-weight: 700; font-size: 12px; letter-spacing: .06em; }
.navp b { display: block; margin-top: 4px; line-height: 1.5; }
.navp .nx { text-align: right; grid-column: 2; }
@media (max-width: 640px) { .navp { grid-template-columns: 1fr; } .navp .nx { grid-column: 1; } }

/* 目次（見出しが3つ以上あるとき） */
.toc { width: min(720px, 100% - 40px); margin: 40px auto 0; padding: 18px 22px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 14.5px; }
.toc b { font-size: 12px; letter-spacing: .12em; color: var(--mute); text-transform: uppercase; }
.toc ol { margin: 8px 0 0; padding-left: 1.3em; }
.toc a { color: var(--ink2); } .toc a:hover { color: var(--sea); }

/* 自動翻訳 */
.tr-note { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(140%); z-index: 70; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 16px 40px -10px rgba(0,0,0,.5); transition: transform .5s cubic-bezier(.2,.8,.2,1), visibility 0s .5s; visibility: hidden; }
.tr-note.show { transform: translateX(-50%) translateY(0); visibility: visible; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.tr-note button { border: 0; border-radius: 999px; padding: 6px 12px; font: 700 12.5px var(--font); cursor: pointer; background: rgba(255,255,255,.14); color: #fff; }
.tr-note button:hover { background: rgba(255,255,255,.24); }
.goog-te-banner-frame, iframe.skiptranslate, .goog-te-balloon-frame, #goog-gt-tt, .goog-tooltip, .VIpgJd-ZVi9od-ORHb-OEVmcd, .VIpgJd-ZVi9od-aZ2wEe-wOHMyf { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
#gte { position: absolute; left: -9999px; top: 0; }

/* 検索 */
.search-form { display: flex; gap: 8px; max-width: 460px; }
.search-form label { flex: 1; }
.search-field { width: 100%; height: 46px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 0 18px; font: 15px var(--font); }
.search-field:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sea) 18%, transparent); }
.search-submit { height: 46px; border: 0; border-radius: 999px; padding: 0 20px; background: var(--navy); color: #fff; font: 700 14px var(--font); cursor: pointer; }

/* フッター */
.ft { position: relative; margin-top: 110px; background: var(--navy); color: rgba(255,255,255,.75); padding: 70px 0 40px; }
.ft .waves { top: -118px; bottom: auto; }
.ft .waves path { fill: var(--navy); }
.ft .cols { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; align-items: flex-start; }
.ft .brand img { height: 32px; filter: brightness(0) invert(1); }
.ft p { margin: 10px 0 0; font-size: 14px; max-width: 40ch; }
.ft nav ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.ft nav a:hover { color: #fff; }
.ft .copy { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.totop { position: fixed; right: 18px; bottom: 18px; z-index: 40; opacity: 0; transform: translateY(12px); transition: opacity .3s, transform .3s; pointer-events: none; }
.totop.show { opacity: 1; transform: none; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv { opacity: 1; transform: none; }
}
