/* The Devam blog: the Blog page (/blog) and a post (/blog/<slug>), in the portal design (assets/portal.css):
   the night sky, gold, Marcellus for headings and Poppins for words. Loaded after portal.css. */

.blog { padding-bottom: 8px; }
.blog .wrap.narrow-wide { width: min(760px, calc(100% - 2 * var(--gut))); }
.blog i { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.6; vertical-align: middle; margin: 0 8px; }

/* ── the Blog page: opening ── */
.blog-hero { padding: clamp(34px, 6.5vw, 88px) 0 clamp(18px, 3vw, 34px); }
.blog-hero h1 { font-size: clamp(36px, 6vw, 68px); line-height: 1.04; max-width: 16ch; }
.blog-hero .lede { max-width: 54ch; font-size: clamp(15.5px, 1.3vw, 18px); }

/* ── search and topics ── */
.blog-list { padding: clamp(8px, 2vw, 18px) 0 clamp(36px, 5vw, 64px); }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: clamp(18px, 2.5vw, 28px); }
.tools input[type="search"] { flex: 0 1 300px; min-width: 0; width: 100%; max-width: 300px; font: 500 15px var(--sans); color: var(--text);
  background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f2c14e' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 15px 50% / 18px;
  border: 1px solid rgba(242, 193, 78, 0.28); border-radius: 999px; padding: 11px 18px 11px 42px; -webkit-appearance: none; appearance: none; }
.tools input[type="search"]::placeholder { color: #8e8576; }
.tools input[type="search"]:focus { outline: none; border-color: var(--gold); background-color: rgba(255, 255, 255, 0.08); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { font: 500 13.5px var(--sans); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; cursor: pointer; transition: border-color 0.2s, color 0.2s, background 0.2s; }
.fchip:hover { border-color: var(--gold); color: var(--gold-2); }
.fchip.on { background: var(--gold); border-color: var(--gold); color: var(--ink-on-gold); font-weight: 600; }
@media (max-width: 640px) {
  .tools input[type="search"] { max-width: none; flex-basis: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gut)); padding: 2px var(--gut) 6px; scrollbar-width: none; flex-basis: 100%; }
  .chips::-webkit-scrollbar { display: none; }
  .fchip { flex: none; }
}

/* ── the cards ── */
.grid-posts { display: grid; gap: clamp(14px, 2vw, 22px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.grid-posts.three { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.post { display: flex; flex-direction: column; text-decoration: none; color: var(--text); border-radius: 22px; overflow: hidden;
  background: rgba(13, 11, 28, 0.92); border: 1px solid var(--line-2); transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s; }
.post:hover, .post:focus-visible { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45), 0 0 40px rgba(242, 193, 78, 0.07); }
.post .pic { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #120f26; }
.post .pic img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; transition: transform 0.6s ease; }
.post:hover .pic img { transform: scale(1.04); }
.post .pic.none { display: grid; place-items: center; background: radial-gradient(70% 90% at 50% 40%, rgba(242, 193, 78, 0.2), transparent 70%), #120f26; }
.post .pic.none span { font: 400 30px var(--serif); color: var(--gold); letter-spacing: 0.02em; }
.post .txt { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.post .cat { align-self: flex-start; font: 600 11.5px var(--sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--gold); }
.post h2, .post h3 { font-size: clamp(20px, 1.9vw, 24px); line-height: 1.2; color: var(--text); }
.post p { color: var(--muted); font-size: 14.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post .meta { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--dim); }

/* the newest story leads, across the whole width, until someone searches or picks a topic */
@media (min-width: 860px) {
  .grid-posts:not(.filtering) .post.featured { grid-column: 1 / -1; flex-direction: row; }
  .grid-posts:not(.filtering) .post.featured .pic { flex: 0 0 56%; aspect-ratio: auto; min-height: 340px; }
  .grid-posts:not(.filtering) .post.featured .txt { justify-content: center; gap: 12px; padding: clamp(24px, 3.4vw, 46px); }
  .grid-posts:not(.filtering) .post.featured h2 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.1; }
  .grid-posts:not(.filtering) .post.featured p { font-size: 16px; -webkit-line-clamp: 4; }
  .grid-posts:not(.filtering) .post.featured .meta { margin-top: 10px; }
}
.post[hidden] { display: none; }
.none-found { text-align: center; color: var(--muted); padding: 40px 0; }
.more { display: flex; justify-content: center; margin-top: clamp(22px, 3vw, 34px); }

/* ── the band at the foot of the Blog page ── */
.blog-cta { padding: clamp(12px, 2vw, 24px) 0 clamp(20px, 3vw, 36px); }
.cta-card { display: flex; align-items: center; gap: 22px; padding: clamp(22px, 3vw, 34px); border-radius: 26px; border: 1px solid var(--line);
  background: radial-gradient(80% 140% at 0% 0%, rgba(242, 193, 78, 0.12), transparent 60%), rgba(13, 11, 28, 0.94); }
.cta-card .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); flex: none; align-self: flex-start; margin-top: 10px; }
.cta-card h2 { font-size: clamp(22px, 2.5vw, 32px); line-height: 1.15; }
.cta-card p { color: var(--muted); margin-top: 8px; max-width: 62ch; font-size: 15px; }
.cta-card .btn { flex: none; margin-left: auto; }
@media (max-width: 760px) {
  .cta-card { flex-direction: column; align-items: stretch; gap: 16px; }
  .cta-card .dot { display: none; }
  .cta-card .btn { margin-left: 0; width: 100%; justify-content: center; }
}

/* ── one post ── */
.post-head { padding-top: clamp(26px, 4.5vw, 56px); }
.back { display: inline-block; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: clamp(18px, 2.5vw, 28px); }
.back:hover { color: var(--gold-2); }
.post-head h1 { font-size: clamp(31px, 5vw, 54px); line-height: 1.08; }
.byline { margin-top: 16px; font-size: 14px; color: var(--dim); }
.cover { width: min(980px, calc(100% - 2 * var(--gut))); margin: clamp(22px, 3.4vw, 40px) auto 0; }
.cover img { width: 100%; max-height: 560px; object-fit: cover; object-position: center 38%; border-radius: 22px; border: 1px solid var(--line-2); }
.cover figcaption, .prose figcaption { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--dim); }

.prose { padding-top: clamp(24px, 3.5vw, 40px); padding-bottom: clamp(28px, 4vw, 48px); font-size: clamp(16.5px, 1.35vw, 18px); line-height: 1.82; color: #e4dccb; font-weight: 400; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: clamp(25px, 3vw, 34px); line-height: 1.15; color: var(--text); margin-top: 2.1em; scroll-margin-top: 20px; }
.prose h3 { font-size: clamp(20px, 2.1vw, 25px); line-height: 1.2; color: var(--gold-2); margin-top: 1.7em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose a { color: var(--gold-2); text-decoration: underline; text-decoration-color: rgba(242, 193, 78, 0.45); text-underline-offset: 3px; transition: text-decoration-color 0.2s, color 0.2s; }
.prose a:hover { color: var(--gold); text-decoration-color: var(--gold); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul { padding-left: 1.3em; display: grid; gap: 0.5em; }
.prose blockquote { border-left: 3px solid var(--gold); padding: 4px 0 4px 20px; color: var(--text); font-family: var(--serif); font-size: 1.12em; line-height: 1.6; }
.prose figure { margin-top: 1.9em; margin-bottom: 1.9em; }
.prose figure img { display: block; width: auto; max-width: 100%; max-height: min(78vh, 760px); margin: 0 auto; border-radius: 18px; border: 1px solid var(--line-2); }
/* a link to the waitlist is a button to press, not a page to leave: it looks like a link, and the form opens */
.prose a.dwl-open { cursor: pointer; font-weight: 600; text-decoration-color: var(--gold); }

.end-cta { margin-top: 2.4em !important; padding: clamp(22px, 3vw, 32px); border-radius: 24px; border: 1px solid var(--line); text-align: center; font-family: var(--sans); font-size: 16px; line-height: 1.6;
  background: radial-gradient(90% 140% at 50% 0%, rgba(242, 193, 78, 0.14), transparent 65%), rgba(13, 11, 28, 0.94); }
.end-cta h2 { font-size: clamp(22px, 2.6vw, 30px); margin-top: 0; color: var(--text); }
.end-cta p { color: var(--muted); max-width: 52ch; margin: 10px auto 0; font-size: 15px; }
.end-cta .btn { margin-top: 18px; }

.more-posts { padding: clamp(10px, 2vw, 24px) 0 clamp(20px, 3vw, 40px); border-top: 1px solid var(--line-2); margin-top: clamp(8px, 2vw, 20px); }
.more-posts h2 { font-size: clamp(24px, 3vw, 34px); margin: clamp(22px, 3vw, 34px) 0 clamp(14px, 2vw, 22px); }

@media (prefers-reduced-motion: reduce) {
  .post, .post .pic img { transition: none; }
  .post:hover { transform: none; }
}
