/* blog.css — "Le Journal" : index, featured, cards, composer, reader */

/* ---------- toolbar : filters + actions ---------- */
.blog-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 22px 28px; flex-wrap: wrap; margin-bottom: clamp(34px, 4vw, 52px);
}
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  padding: 9px 16px; border-radius: 999px; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--paper);
  transition: color .18s, border-color .18s, background .18s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.toolbar-actions { display: flex; align-items: center; gap: 12px; }
.blog-search {
  position: relative; display: flex; align-items: center;
}
.blog-search svg { position: absolute; left: 14px; color: var(--ink-soft); pointer-events: none; }
.blog-search input {
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 11px 18px 11px 40px; width: 210px; transition: border-color .18s, box-shadow .18s, width .25s ease;
}
.blog-search input:focus { outline: none; border-color: var(--accent); width: 240px; box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 16%, transparent); }
.btn-write { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; padding: 11px 18px; border: 1px solid var(--line); border-radius: var(--radius-btn); color: var(--ink); transition: border-color .18s, background .18s; }
.btn-write:hover { border-color: var(--ink); background: color-mix(in oklch, var(--ink) 4%, transparent); }
.btn-write svg { color: var(--accent-deep); }

/* ---------- category tag ---------- */
.cat-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-deep);
}
.cat-tag::before { content: ""; width: 16px; height: 1px; background: var(--accent); }

/* ---------- cover media (shared) ---------- */
.cover { position: relative; overflow: hidden; background: var(--paper-2); }
.cover .ph-img { width: 100%; height: 100%; object-fit: cover; transition: transform .85s cubic-bezier(.2,.7,.2,1); }
/* tonal fallback cover when no image */
.cover.gen {
  background:
    radial-gradient(120% 120% at 12% 8%, oklch(0.30 0.04 256), var(--navy) 70%);
}
.cover.gen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(135deg, oklch(1 0 0 / 0.04) 0 1px, transparent 1px 13px),
    radial-gradient(80% 80% at 88% 96%, oklch(0.72 0.1 70 / 0.30), transparent 60%);
}
.cover.gen .gen-mono {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: clamp(40px, 9vw, 96px);
  color: oklch(1 0 0 / 0.16); letter-spacing: -0.02em;
}
.cover.gen .gen-cat {
  position: absolute; left: 0; bottom: 0; padding: 16px 18px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: oklch(1 0 0 / 0.72);
}

/* ---------- featured article ---------- */
.featured {
  display: grid; grid-template-columns: 1.08fr 0.92fr; gap: clamp(28px, 4vw, 56px);
  align-items: center; margin-bottom: clamp(44px, 5vw, 76px);
  padding-bottom: clamp(44px, 5vw, 76px); border-bottom: 1px solid var(--line);
}
.featured-media { aspect-ratio: 7 / 5; border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; box-shadow: 0 40px 80px -48px oklch(0.24 0.05 255 / 0.4); }
.featured:hover .featured-media .ph-img { transform: scale(1.035); }
.featured-flag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.featured-flag::before { content: ""; width: 22px; height: 1px; background: var(--accent); }
.featured h2 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em;
  font-size: clamp(30px, 4vw, 52px); line-height: 1.06; margin-top: 18px;
  color: var(--ink); text-wrap: balance; cursor: pointer; transition: color .2s;
}
.featured h2:hover { color: var(--accent-deep); }
.featured .f-excerpt { color: var(--ink-soft); font-size: clamp(16px, 1.4vw, 19px); line-height: 1.6; margin-top: 20px; max-width: 50ch; }
.featured .meta { margin-top: 26px; }
.featured .read-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; font-size: 15px; font-weight: 600; color: var(--ink); }
.featured .read-link .arrow { transition: transform .25s ease; }
.featured .read-link:hover .arrow { transform: translateX(5px); }

/* ---------- post meta (author · date · read) ---------- */
.meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); flex-wrap: wrap; }
.meta .av-mini { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; border: 1px solid var(--line); flex-shrink: 0; background: var(--accent-tint); display: grid; place-items: center; font-family: var(--serif); font-size: 12px; color: var(--accent-deep); }
.meta .av-mini img { width: 100%; height: 100%; object-fit: cover; }
.meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-soft); opacity: .5; }
.meta b { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.meta-compact { font-size: 12.5px; letter-spacing: 0.02em; }

/* ---------- post grid ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(26px, 3vw, 40px) clamp(24px, 2.4vw, 36px); }
.post-card { display: flex; flex-direction: column; cursor: pointer; position: relative; }
.post-card .cover { aspect-ratio: 3 / 2; border: 1px solid var(--line); border-radius: var(--radius-card); }
.post-card:hover .cover .ph-img { transform: scale(1.045); }
.pc-body { padding-top: 20px; display: flex; flex-direction: column; flex: 1; }
.pc-body h3 {
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.012em;
  font-size: clamp(20px, 1.7vw, 24px); line-height: 1.18; margin-top: 13px; color: var(--ink);
  transition: color .2s; text-wrap: pretty;
}
.post-card:hover .pc-body h3 { color: var(--accent-deep); }
.pc-body .pc-excerpt { color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; margin-top: 12px; }
.pc-body .meta { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }

/* user-added marker + actions */
.pc-own-tag { position: absolute; top: 12px; left: 12px; z-index: 3; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; background: color-mix(in oklch, var(--paper) 88%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--accent); color: var(--accent-deep); padding: 5px 9px; border-radius: 999px; }
.pc-actions { position: absolute; top: 10px; right: 10px; z-index: 3; display: flex; gap: 6px; opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; }
.post-card:hover .pc-actions { opacity: 1; transform: none; }
.pc-actions button { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: color-mix(in oklch, var(--paper) 90%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); color: var(--ink-2); transition: all .18s; }
.pc-actions button:hover { color: var(--ink); border-color: var(--ink); }
.pc-actions button.del:hover { color: oklch(0.5 0.16 25); border-color: oklch(0.6 0.16 25); }

/* empty state */
.blog-empty { text-align: center; padding: clamp(48px, 7vw, 96px) 0; border: 1px dashed var(--line); border-radius: var(--radius-card); background: var(--paper-2); }
.blog-empty .be-mark { font-family: var(--serif); font-style: italic; font-size: 48px; color: var(--accent); opacity: .6; }
.blog-empty h3 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin-top: 10px; }
.blog-empty p { color: var(--ink-soft); margin-top: 10px; max-width: 42ch; margin-inline: auto; }
.blog-empty .btn { margin-top: 24px; }

/* count line */
.blog-count { font-size: 13px; color: var(--ink-soft); margin-bottom: 22px; letter-spacing: 0.02em; }
.blog-count b { color: var(--ink-2); font-weight: 600; }
.blog-count .exp { color: var(--accent-deep); font-weight: 600; cursor: pointer; margin-left: 12px; }
.blog-count .exp:hover { text-decoration: underline; }

/* ---------- subscribe strip ---------- */
.subscribe { margin-top: clamp(56px, 7vw, 100px); background: var(--navy); color: var(--paper); border-radius: var(--radius-card); padding: clamp(38px, 5vw, 64px); position: relative; overflow: hidden; }
.subscribe::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(70% 120% at 100% 0%, oklch(0.7 0.1 70 / 0.16), transparent 60%); }
.subscribe-grid { position: relative; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.subscribe .eyebrow { color: var(--accent); }
.subscribe h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3vw, 40px); line-height: 1.1; letter-spacing: -0.015em; margin-top: 16px; }
.subscribe p { color: oklch(1 0 0 / 0.68); font-size: 15.5px; line-height: 1.6; margin-top: 14px; max-width: 42ch; }
.sub-form { display: flex; gap: 10px; flex-wrap: wrap; }
.sub-form input { flex: 1; min-width: 200px; font-family: inherit; font-size: 15px; color: var(--paper); background: oklch(1 0 0 / 0.06); border: 1px solid oklch(1 0 0 / 0.2); border-radius: var(--radius-btn); padding: 14px 16px; }
.sub-form input::placeholder { color: oklch(1 0 0 / 0.5); }
.sub-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px oklch(0.72 0.1 70 / 0.25); }
.sub-ok { color: var(--accent); font-weight: 600; font-size: 15px; }
.sub-note { color: oklch(1 0 0 / 0.5); font-size: 12.5px; margin-top: 14px; }

/* ============================================================
   COMPOSER (write / edit an article)
   ============================================================ */
.composer-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: oklch(0.18 0.03 256 / 0.5); backdrop-filter: blur(4px);
  display: flex; justify-content: flex-end;
  animation: cmp-fade .25s ease;
}
@keyframes cmp-fade { from { opacity: 0; } to { opacity: 1; } }
.composer {
  width: min(640px, 100%); height: 100%; background: var(--paper);
  display: flex; flex-direction: column;
  box-shadow: -30px 0 80px -40px oklch(0.2 0.04 256 / 0.6);
  animation: cmp-slide .35s cubic-bezier(.2,.7,.2,1);
}
@keyframes cmp-slide { from { transform: translateX(40px); } to { transform: none; } }
.composer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px clamp(24px, 4vw, 40px); border-bottom: 1px solid var(--line); }
.composer-head .eyebrow { margin: 0; }
.composer-head h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin-top: 6px; }
.composer-close { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); transition: background .18s, color .18s; }
.composer-close:hover { background: var(--paper-2); color: var(--ink); }
.composer-body { flex: 1; overflow-y: auto; padding: clamp(24px, 4vw, 40px); display: grid; gap: 22px; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px clamp(24px, 4vw, 40px); border-top: 1px solid var(--line); background: var(--paper-2); flex-wrap: wrap; }
.composer-foot .btn { padding: 13px 24px; }

/* cover dropzone */
.cover-drop { border: 1px dashed var(--line); border-radius: var(--radius-card); aspect-ratio: 16 / 8; display: grid; place-items: center; text-align: center; cursor: pointer; position: relative; overflow: hidden; background: var(--paper-2); transition: border-color .18s, background .18s; }
.cover-drop:hover { border-color: var(--accent); background: var(--accent-tint); }
.cover-drop.has { border-style: solid; border-color: var(--line); background: var(--navy); }
.cover-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-drop .cd-hint { position: relative; z-index: 1; color: var(--ink-soft); font-size: 13.5px; display: grid; gap: 8px; justify-items: center; padding: 16px; }
.cover-drop .cd-hint svg { color: var(--accent-deep); }
.cover-drop .cd-change { position: absolute; right: 10px; bottom: 10px; z-index: 2; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: oklch(0.2 0.03 256 / 0.7); backdrop-filter: blur(6px); padding: 6px 11px; border-radius: 999px; }
.field .hint { font-size: 12px; color: var(--ink-soft); font-weight: 400; }
.field textarea.body-input { min-height: 280px; line-height: 1.6; font-size: 15px; }
.composer-help { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: 6px; padding: 12px 14px; }
.composer-help code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; color: var(--accent-deep); }

/* ============================================================
   READER (full article)
   ============================================================ */
.reader { padding-top: clamp(34px, 4vw, 56px); }
.back-link { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: color .18s, gap .2s; margin-bottom: 30px; }
.back-link:hover { color: var(--accent-deep); gap: 13px; }
.article-head { max-width: 760px; }
.article-head h1 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.022em; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.05; margin-top: 20px; color: var(--ink); text-wrap: balance; }
.article-head .lede { margin-top: 24px; font-size: clamp(18px, 1.5vw, 22px); }
.article-head .meta { margin-top: 28px; font-size: 14px; }
.article-head .meta .av-mini { width: 34px; height: 34px; font-size: 14px; }
.article-cover { margin: clamp(34px, 4vw, 56px) 0; aspect-ratio: 16 / 8; border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.article-cover .ph-img { width: 100%; height: 100%; object-fit: cover; }
.article-body { max-width: 720px; margin-inline: auto; }
.article-body > p { color: var(--ink-2); font-size: 18.5px; line-height: 1.72; margin-top: 26px; }
.article-body > p:first-child { margin-top: 0; }
.article-body > p:first-child::first-letter {
  font-family: var(--serif); float: left; font-size: 4.2em; line-height: 0.82;
  padding: 6px 14px 0 0; color: var(--accent-deep); font-weight: 500;
}
.article-body h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -0.012em; margin-top: 48px; }
.article-body h3 { font-family: var(--serif); font-weight: 500; font-size: 23px; margin-top: 36px; }
.article-body ul { list-style: none; margin-top: 24px; display: grid; gap: 12px; }
.article-body ul li { display: flex; gap: 13px; font-size: 17.5px; color: var(--ink-2); line-height: 1.6; align-items: flex-start; }
.article-body ul li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 11px; flex-shrink: 0; box-shadow: 0 0 0 3px var(--accent-tint); }
.article-body blockquote { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.4; color: var(--ink); margin: 40px 0; padding-left: 28px; border-left: 2px solid var(--accent); text-wrap: pretty; }
.article-foot { max-width: 720px; margin: clamp(44px, 5vw, 72px) auto 0; padding-top: 32px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.share { display: flex; align-items: center; gap: 10px; }
.share span { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.share a, .share button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-2); transition: all .18s; }
.share a:hover, .share button:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-2px); }

/* related */
.related-posts { margin-top: clamp(56px, 6vw, 88px); padding-top: clamp(40px, 4vw, 56px); border-top: 1px solid var(--line); }
.related-posts .rp-head { font-family: var(--serif); font-weight: 500; font-size: clamp(24px, 2.6vw, 32px); margin-bottom: 32px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .featured { grid-template-columns: 1fr; gap: 28px; }
  .featured-media { order: -1; }
  .subscribe-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .post-grid { grid-template-columns: 1fr; }
  .blog-search input { width: 100%; }
  .blog-search { flex: 1; }
  .toolbar-actions { width: 100%; }
  .article-body > p:first-child::first-letter { font-size: 3.4em; }
}

/* ============================================================
   ADMIN — login pill + sign-in modal
   ============================================================ */
.admin-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  padding: 11px 15px; border: 1px solid var(--line); border-radius: var(--radius-btn);
  color: var(--ink-soft); background: transparent; white-space: nowrap;
  transition: border-color .18s, color .18s, background .18s;
}
.admin-pill svg { opacity: .8; }
.admin-pill:hover { border-color: var(--ink); color: var(--ink); }
.admin-pill.on {
  color: var(--accent-deep);
  border-color: color-mix(in oklch, var(--accent) 45%, var(--line));
  background: var(--accent-tint);
}
.admin-pill.on svg { opacity: 1; }

.login-card {
  margin: auto;
  width: min(420px, calc(100% - 32px));
  background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: clamp(28px, 4vw, 40px);
  box-shadow: 0 40px 90px -50px oklch(0.2 0.04 256 / 0.7);
  animation: login-rise .32s cubic-bezier(.2,.7,.2,1);
}
@keyframes login-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.login-ic {
  width: 50px; height: 50px; display: grid; place-items: center;
  border-radius: 50%; margin-bottom: 22px;
  color: var(--accent-deep);
  background: var(--accent-tint);
  border: 1px solid color-mix(in oklch, var(--accent) 35%, transparent);
}
.login-card .eyebrow { display: block; }
.login-card h3 { font-family: var(--serif); font-size: 27px; font-weight: 500; letter-spacing: -0.012em; margin-top: 12px; }
.login-card > p { color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; margin-top: 10px; }
.login-card form { margin-top: 24px; }
.login-card input {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-btn);
  background: var(--paper); transition: border-color .18s, box-shadow .18s;
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 16%, transparent); }
.login-card input.err { border-color: #b4453c; box-shadow: 0 0 0 3px color-mix(in oklch, #b4453c 14%, transparent); }
.login-err { display: block; color: #b4453c; font-size: 13px; margin-top: 9px; }
.login-foot { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
.login-foot .btn { padding: 12px 22px; }
@media (max-width: 460px) {
  .login-foot { flex-direction: column-reverse; }
  .login-foot .btn { justify-content: center; }
}
