/* Quick post templates + engagement. Shared by the public site and the composer's live preview.
   Colours come from the tenant palette (--c-*); everything else has fallbacks so the admin preview matches. */
.pt { --pt-radius: var(--radius, 14px); --pt-gap: 16px; display: flex; flex-direction: column; gap: var(--pt-gap); margin: 8px 0 24px; }
.pt-text { font-size: 1.12rem; line-height: 1.7; }
.pt-text > :first-child { margin-top: 0; }
.pt-text > :last-child { margin-bottom: 0; }
.pt-text p { margin: 0 0 .8em; }
.pt-text a { overflow-wrap: anywhere; }
.pt-headline { margin: 0; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }

/* media */
.pt-photos { display: grid; gap: 6px; border-radius: var(--pt-radius); overflow: hidden; }
.pt-photos-1 { grid-template-columns: 1fr; }
.pt-photos-2, .pt-photos-4 { grid-template-columns: 1fr 1fr; }
.pt-photos-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.pt-photos-3 .pt-photo:first-child { grid-row: span 2; aspect-ratio: auto; }
.pt-photo { display: block; overflow: hidden; aspect-ratio: 4 / 3; background: var(--c-light, #EEF2FF); }
.pt-photos-1 .pt-photo { aspect-ratio: auto; max-height: 640px; }
.pt-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.pt-photo:hover img { transform: scale(1.03); }
.pt-video { display: block; width: 100%; border-radius: var(--pt-radius); background: #000; max-height: 75vh; }
.pt-embed { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.pt-embed iframe, .pt-embed img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }

/* story: default (text, then media) */

/* spotlight: bold brand card */
.pt-card { display: flex; flex-direction: column; gap: 12px; padding: clamp(24px, 5vw, 44px); border-radius: var(--pt-radius); color: var(--c-on-primary, #fff);
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--c-secondary, #F2A541) 45%, transparent), transparent 55%), var(--c-primary, #2F4AC0); }
.pt-card .pt-headline { color: inherit; font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.9rem); }
.pt-card .pt-text a { color: inherit; }
.pt-kicker { align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* announcement: notice with badge and accent edge */
.pt-banner { display: flex; flex-direction: column; gap: 10px; padding: clamp(20px, 4vw, 32px); border-radius: var(--pt-radius); border: 1px solid color-mix(in srgb, var(--c-secondary, #F2A541) 55%, transparent);
  border-left-width: 6px; border-left-color: var(--c-secondary, #F2A541); background: color-mix(in srgb, var(--c-secondary, #F2A541) 10%, #fff); color: var(--c-dark, #0F172A); }
.pt-badge { align-self: flex-start; padding: 4px 10px; border-radius: 6px; background: var(--c-secondary, #F2A541); color: var(--c-on-secondary, #111); font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pt-banner .pt-headline { color: inherit; }

/* photo: big image, headline over a gradient */
.pt-hero { position: relative; margin: 0; border-radius: var(--pt-radius); overflow: hidden; background: var(--c-dark, #0F172A); }
.pt-hero img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: cover; }
.pt-hero figcaption { position: absolute; inset: auto 0 0 0; padding: 64px clamp(18px, 4vw, 32px) clamp(18px, 4vw, 28px); background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; }
.pt-hero .pt-headline { color: #fff; text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }

/* quote */
.pt-quote { position: relative; margin: 0; padding: clamp(28px, 6vw, 56px) clamp(22px, 5vw, 48px); border-radius: var(--pt-radius); background: var(--c-light, #EEF2FF); color: var(--c-on-light, #0F172A); }
.pt-quote::before { content: "\201C"; position: absolute; top: -.1em; left: .15em; font: 700 7rem/1 Georgia, serif; color: var(--c-primary, #2F4AC0); opacity: .22; }
.pt-quote .pt-text { position: relative; font-size: clamp(1.3rem, 1rem + 1.3vw, 1.9rem); line-height: 1.4; font-weight: 600; letter-spacing: -.01em; }
.pt-quote cite { display: block; margin-top: 16px; font-style: normal; font-weight: 700; color: var(--c-primary-ink, #1E3399); }

@media (max-width: 560px) {
  .pt-photos-3 { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .pt-photos-3 .pt-photo:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 4 / 3; }
  .pt-text { font-size: 1.05rem; }
}

/* ---------- byline ---------- */
.post-byline { display: flex; align-items: center; gap: 12px; margin: 12px 0 20px; }
.post-byline > div { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.post-byline .post-meta { color: var(--muted, #475569); font-weight: 500; font-size: .9rem; }
.post-byline a { color: inherit; }
.byline-avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem;
  background: var(--c-primary, #2F4AC0); color: var(--c-on-primary, #fff); }

/* ---------- engagement ---------- */
.engage { margin-top: 32px; border-top: 1px solid var(--line, #E2E8F0); }
.engage svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.engage-stats { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px 2px; font-size: .92rem; color: var(--muted, #475569); }
.engage-stats b { color: var(--ink, #0F172A); font-variant-numeric: tabular-nums; }
.engage-stats a { color: inherit; text-decoration: none; }
.engage-stats a:hover { text-decoration: underline; }
.stat-like { display: inline-flex; align-items: center; gap: 6px; }
.stat-like svg { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: #E11D48; stroke: #fff; fill: #fff; box-sizing: content-box; }
.engage-stats-right { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.engage-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px 0; border-top: 1px solid var(--line, #E2E8F0); border-bottom: 1px solid var(--line, #E2E8F0); }
.engage-form { margin: 0; display: contents; }
.engage-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent;
  font: inherit; font-weight: 700; font-size: .95rem; color: var(--muted, #475569); cursor: pointer; text-decoration: none; list-style: none; transition: background-color .18s, color .18s, transform .18s; }
.engage-btn::-webkit-details-marker { display: none; }
.engage-btn:hover { background: color-mix(in srgb, var(--c-dark, #0F172A) 6%, transparent); color: var(--ink, #0F172A); text-decoration: none; }
.engage-btn:active { transform: scale(.97); }
.like-btn.is-on { color: #E11D48; }
.like-btn.is-on svg { fill: #E11D48; stroke: #E11D48; }
.like-btn.pop svg { animation: like-pop .45s cubic-bezier(.2, .7, .2, 1.4); }
@keyframes like-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.share-menu { position: relative; }
.share-menu > summary { height: 100%; }
.share-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; display: flex; flex-direction: column; min-width: 190px; padding: 6px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line, #E2E8F0); box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .3); }
.share-pop a, .share-pop button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: none; font: inherit; font-weight: 600; font-size: .95rem; color: #0F172A; text-align: left; text-decoration: none; cursor: pointer; }
.share-pop a:hover, .share-pop button:hover, .share-pop a:focus-visible, .share-pop button:focus-visible { background: #F1F5F9; }

/* comments */
.comments { padding-top: 20px; }
.comments-title { font-size: 1.15rem; margin: 0 0 14px; }
.comment-form { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.comment-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.comment-fields textarea { min-height: 48px; resize: vertical; border-radius: 18px; padding: 12px 16px; }
.comment-fields input { border-radius: 999px; padding: 10px 16px; }
.comment-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.comment-form .field-error:empty { display: none; }
.comment-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .82rem;
  background: var(--c-light, #EEF2FF); color: var(--c-on-light, #1E3399); }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 12px; align-items: flex-start; }
.comment.is-new { animation: comment-in .4s cubic-bezier(.2, .7, .2, 1); }
@keyframes comment-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.comment-bubble { min-width: 0; padding: 10px 14px; border-radius: 4px 18px 18px 18px; background: color-mix(in srgb, var(--c-dark, #0F172A) 5%, transparent); }
.comment-bubble p { margin: 4px 0 0; overflow-wrap: anywhere; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: .92rem; }
.comment-head time { color: var(--muted, #475569); font-size: .8rem; }
.comments-empty { margin: 0; }

/* compact counts on post cards */
.card-stats { display: flex; gap: 14px; margin-top: auto; padding-top: 10px; font-size: .82rem; color: var(--muted, #475569); }
.card-stats span { display: inline-flex; align-items: center; gap: 4px; }
.card-stats svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

/* code pages on the site */
.code-frame { display: block; width: 100%; height: 80vh; min-height: 420px; border: 0; background: #fff; }
.code-page-foot { padding-top: 8px; padding-bottom: 56px; }

@media (max-width: 480px) {
  .engage-btn span { font-size: .9rem; }
  .engage-btn { gap: 6px; padding: 0 6px; }
  .engage-stats { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .like-btn.pop svg, .comment.is-new { animation: none; }
  .pt-photo:hover img { transform: none; }
}
