/* ============================================================
   BrotherVader — styles for the backend-powered additions.
   (PR maximize, day chart, rich text, food calendar, daily log,
   video, before/after multi-image.) Matches the existing tokens.
   ============================================================ */

/* ---------------- RICHTEXT (formatted AI output) ---------------- */
.richtext .rt-p { margin: 0 0 8px; }
.richtext .rt-p:last-child { margin-bottom: 0; }
.richtext .rt-b { color: var(--chalk); font-weight: 600; }
.richtext .rt-list { margin: 4px 0 10px; padding-left: 20px; }
.richtext .rt-list li { margin: 3px 0; }
.bubble-ai .richtext { font-size: 14px; }

/* ---------------- PR cards — clickable + maximize + pulse ---------------- */
.pr-clickable { cursor: pointer; position: relative; }
.pr-clickable:focus-visible { outline: 2px solid var(--ox-bright); outline-offset: 3px; }
.pr-maximize {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-head); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--steel); background: rgba(14,14,16,0.7); border: 1px solid var(--line);
  padding: 4px 8px; border-radius: 100px; opacity: 0; transition: opacity .2s, color .2s, border-color .2s;
  pointer-events: none;
}
.pr-clickable:hover .pr-maximize { opacity: 1; color: var(--chalk); border-color: var(--line-strong); }
.pr-admin-actions { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 6; }

.pr-pulse .pr-card { animation: prPulse 2.4s ease-in-out infinite; }
.pr-pulse .pr-maximize {
  opacity: 1; color: var(--chalk); border-color: var(--ox);
  background: var(--ox); animation: prBadge 2.4s ease-in-out infinite;
}
@keyframes prPulse {
  0%, 100% { box-shadow: var(--shadow); }
  50% { box-shadow: 0 0 0 3px var(--ox-wash), 0 0 40px -8px rgba(176,57,46,0.5); }
}
@keyframes prBadge { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .pr-pulse .pr-card, .pr-pulse .pr-maximize { animation: none; } }

/* ---------------- PR MAXIMIZE modal ---------------- */
.prmax { display: flex; flex-direction: column; gap: 22px; }
.prmax-head { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.prmax-bignum { font-size: clamp(54px, 9vw, 96px); color: var(--ox-bright); line-height: 0.9; }
.prmax-unit { font-family: var(--font-head); font-size: 0.32em; color: var(--steel); margin-left: 8px; }
.prmax-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; }
.prmax-meta-row { display: flex; flex-direction: column; }
.prmax-meta-row .tnum { font-size: 16px; color: var(--chalk); }
.prmax-chart-wrap { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--ink-2); }
.prmax-chart-label { margin-bottom: 8px; }
.prmax-summary { border-top: 1px solid var(--line); padding-top: 18px; }
.prmax-summary-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.prmax-summary-text { font-size: 15px; line-height: 1.7; }
.prmax-loading { display: flex; align-items: center; }

/* ---------------- DAYCHART (SVG line chart w/ hover) ---------------- */
.daychart { width: 100%; }
.dc-axis { fill: var(--steel-2); font-family: "IBM Plex Sans", sans-serif; font-size: 10px; }
.dc-tip {
  position: absolute; transform: translate(-50%, -130%);
  background: var(--panel-2); border: 1px solid var(--ox); border-radius: 6px;
  padding: 6px 10px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); z-index: 4;
}
.dc-tip-val { color: var(--ox-bright); font-size: 15px; font-weight: 600; }
.dc-tip-date { color: var(--steel); font-size: 11px; }
.daychart-empty { padding: 40px; text-align: center; }

/* ---------------- BEFORE/AFTER — multi-image (1-3 pics) ---------------- */
.ba-img { position: relative; }
.ba-img-del { position: absolute; top: 8px; left: 8px; background: rgba(14,14,16,0.75); }
.ba-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.ba-thumb { width: 52px; height: 52px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); padding: 0; cursor: pointer; background: none; opacity: 0.6; transition: opacity .2s, border-color .2s; }
.ba-thumb.on, .ba-thumb:hover { opacity: 1; border-color: var(--ox); }
.ba-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ba-imgcount { font-size: 11px; margin-top: 6px; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------------- FOOD CALENDAR (reuses cal-*) ---------------- */
.status-food .cal-pip, .cal-pip-food { background: var(--ox-bright); }
.cal-day.status-food { border-color: rgba(176,57,46,0.28); }
.lg-food::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--ox-bright); margin-right: 6px; vertical-align: middle; }
.tag-food { background: var(--ox-wash); color: var(--ox-bright); border: 1px solid var(--ox); }
.foodex-row { grid-template-columns: 1fr 80px 90px auto; }
.foodex-name { min-width: 0; }
.food-estimate { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.food-est-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.food-total { text-align: right; }
.food-total-box { display: flex; align-items: center; gap: 8px; }
.food-total-box .input { width: 130px; text-align: right; font-size: 22px; }
.food-kcal { font-family: var(--font-head); color: var(--steel); font-size: 14px; }
.food-breakdown { margin: 12px 0 0; padding: 12px; background: var(--ink); border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; color: var(--chalk-2); white-space: pre-wrap; line-height: 1.6; }

/* ---------------- DAILY LOG (posts + comments) ---------------- */
.daily-days { display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 14px; margin-top: 34px; scrollbar-width: thin; }
.daily-pill { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 74px; padding: 12px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; transition: border-color .2s, background .2s, transform .12s; }
.daily-pill:hover { border-color: var(--line-strong); }
.daily-pill.on { border-color: var(--ox); background: var(--ink-2); }
.daily-pill-mon { font-family: var(--font-head); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--steel); }
.daily-pill-d { font-size: 26px; line-height: 1; color: var(--chalk); }
.daily-pill.on .daily-pill-d { color: var(--ox-bright); }
.daily-pill-n { font-size: 10px; }
.daily-feed { display: flex; flex-direction: column; gap: 22px; margin-top: 8px; }
.post-card { padding: 22px; }
.post-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.post-title { font-size: clamp(22px, 3vw, 30px); margin: 12px 0 0; }
.post-actions { display: flex; gap: 6px; }
.post-imgs { display: grid; gap: 8px; margin: 16px 0; }
.post-imgs.n1 { grid-template-columns: 1fr; }
.post-imgs.n2 { grid-template-columns: 1fr 1fr; }
.post-imgs.n3 { grid-template-columns: 1fr 1fr 1fr; }
.post-img { padding: 0; border: none; background: none; cursor: pointer; border-radius: var(--r); overflow: hidden; aspect-ratio: 4/3; }
.post-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.post-img:hover img { transform: scale(1.04); }
.post-body { color: var(--chalk-2); margin: 6px 0 18px; white-space: pre-wrap; line-height: 1.7; }
.post-comments { border-top: 1px solid var(--line); padding-top: 16px; }
.post-comments-head { margin-bottom: 10px; }
.post-comment-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.post-comment { display: flex; flex-direction: column; gap: 2px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.post-comment-name { font-size: 12px; letter-spacing: 0.08em; color: var(--ox-bright); }
.post-comment-text { color: var(--chalk-2); font-size: 14px; }
.post-comment-encourage { font-size: 12px; margin: 0 0 8px; }
.post-comment-inputs { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; }
.post-comment-form .input { padding: 10px 12px; }
.post-lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(8,8,10,0.92); display: flex; align-items: center; justify-content: center; padding: 24px; }
.post-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: var(--r); }
.post-lightbox-close { position: absolute; top: 18px; right: 18px; background: var(--panel-2); }
.post-editor-imgs { display: flex; flex-wrap: wrap; gap: 10px; }
.post-editor-img { position: relative; width: 84px; height: 84px; border-radius: 6px; overflow: hidden; }
.post-editor-img img { width: 100%; height: 100%; object-fit: cover; }
.post-editor-img .pen { position: absolute; top: 3px; right: 3px; background: rgba(14,14,16,0.8); }
@media (max-width: 560px) {
  .post-comment-inputs { grid-template-columns: 1fr; }
  .post-imgs.n3, .post-imgs.n2 { grid-template-columns: 1fr 1fr; }
}

/* ---------------- VIDEO BLOCK ---------------- */
.video-card { padding: 14px; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--r); overflow: hidden; }
.video-el { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.video-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; cursor: pointer; border: none; background: linear-gradient(180deg, rgba(14,14,16,0.25), rgba(14,14,16,0.75)); color: var(--chalk); }
.video-play { width: 84px; height: 84px; border-radius: 50%; background: var(--ox); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 50px -8px rgba(176,57,46,0.7); transition: transform .2s, background .2s; }
.video-overlay:hover .video-play { transform: scale(1.08); background: var(--ox-bright); }
.video-title { font-size: clamp(28px, 5vw, 52px); text-align: center; padding: 0 16px; }
.video-hint { color: var(--chalk-2); }
