/* Blog, reader, account menu and portal modals. Builds on the tokens in site.css. */

/* ---------- account button (header) ---------- */
.acct-slot { display: flex; align-items: center; }
.acct { position: relative; }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid rgba(255,255,255,.3); background: transparent; color: var(--on-brand); font: 700 .9rem var(--font-body); cursor: pointer; }
.acct-btn:hover { border-color: var(--gold-light); color: var(--gold-light); }
.acct-btn--user { padding: 0 12px 0 6px; }
.acct-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: var(--navy-deep); display: grid; place-items: center; font-weight: 800; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 8px; z-index: 60; display: grid; }
.acct-menu p { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; }
.acct-menu p span { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.acct-menu button { text-align: left; padding: 10px; border-radius: 8px; border: 0; background: none; color: var(--ink); font: 600 .9rem var(--font-body); cursor: pointer; }
.acct-menu button:hover { background: var(--surface-2); }

/* ---------- blog page hero ---------- */
.blog-hero { background: radial-gradient(900px 500px at 90% 0%, rgba(44,84,150,.55), transparent 60%), var(--navy-deep); color: var(--on-brand); }
.blog-hero__inner { padding-block: clamp(44px, 6vw, 80px) clamp(40px, 5vw, 64px); display: grid; gap: 14px; max-width: 760px; }
.blog-hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.2rem, 1.6rem + 3vw, 3.6rem); line-height: 1.05; }
.blog-hero h1 em { color: var(--gold-light); font-style: italic; font-weight: 500; }
.blog-hero p { color: var(--on-brand-muted); font-size: var(--step-1); max-width: 60ch; }
.crumbs { font-size: .85rem; color: var(--on-brand-muted); }
.crumbs a { color: var(--gold-light); text-decoration: none; font-weight: 600; }

/* ---------- premium banner ---------- */
.premium-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); margin-top: -36px; position: relative; z-index: 2; }
.premium-bar__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--gold-soft); color: var(--gold-text); display: grid; place-items: center; }
.premium-bar__icon svg { width: 24px; height: 24px; }
.premium-bar b { display: block; font-size: 1.02rem; }
.premium-bar span { font-size: .9rem; color: var(--muted); }
.premium-bar--ok .premium-bar__icon { background: rgba(21,115,71,.12); color: var(--ok); }
.premium-bar[hidden] { display: none; }

/* ---------- toolbar ---------- */
.blog-tools { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin: 36px 0 24px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 999px; background: var(--surface-2); }
.tab { border: 0; background: transparent; color: var(--muted); font: 700 .88rem var(--font-body); padding: 9px 16px; border-radius: 999px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(13,31,60,.12); }
.tab b { font-weight: 600; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.search { position: relative; flex: 1 1 240px; max-width: 340px; }
.search input { width: 100%; min-height: 44px; padding: 10px 14px 10px 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: .92rem; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }

/* ---------- post cards ---------- */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.post { display: grid; grid-template-rows: auto 1fr; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; text-decoration: none; color: inherit; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; min-width: 0; }
.post:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.post__img { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; }
.post__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post:hover .post__img img { transform: scale(1.04); }
.post__img--empty { display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-light)); }
.post__img--empty img { width: 64px; height: 64px; border-radius: 50%; object-fit: contain; }
.post__tags { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; }
.tag-type, .tag-premium { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.tag-type { background: rgba(13,31,60,.78); color: #FFFFFF; backdrop-filter: blur(4px); }
.tag-premium { background: var(--gold); color: var(--navy-deep); display: inline-flex; align-items: center; gap: 4px; }
.tag-premium svg { width: 12px; height: 12px; }
.post__body { padding: 20px; display: grid; gap: 10px; align-content: start; }
.post__body h3 { font-size: 1.08rem; font-weight: 700; line-height: 1.35; }
.post__body p { font-size: .9rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post__meta { display: flex; gap: 12px; font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 4px; }
.post__meta .lock { color: var(--gold-text); }
.post--skeleton { pointer-events: none; }
.post--skeleton .post__img, .post--skeleton .sk { background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.4s infinite; }
.sk { height: 14px; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }

.empty { padding: 48px 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-lg); color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty b { color: var(--ink); font-size: 1.05rem; }

/* ---------- reader ---------- */
.reader { max-width: 780px; margin-inline: auto; padding-top: clamp(32px, 5vw, 56px); }
.paywall .btn--ghost-light, .blog-hero .btn--ghost-light { background: transparent; }
.reader__back { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; text-decoration: none; font-size: .92rem; margin-bottom: 22px; background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--font-body); }
.reader__back svg { width: 18px; height: 18px; transform: rotate(180deg); }
.reader__tags { display: flex; gap: 8px; margin-bottom: 14px; }
.reader__tags .tag-type { background: var(--surface-2); color: var(--ink); backdrop-filter: none; }
.reader h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem); line-height: 1.1; }
.reader__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 16px 0 26px; color: var(--muted); font-size: .9rem; }
.reader__meta button { margin-left: auto; }
.save-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 .85rem var(--font-body); cursor: pointer; }
.save-btn svg { width: 16px; height: 16px; }
.save-btn[aria-pressed="true"] { background: var(--gold-soft); color: var(--gold-text); border-color: transparent; }
.reader__img { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-2); margin-bottom: 30px; max-width: 100%; }
.reader__img img { width: 100%; height: 100%; object-fit: cover; }
.prose { font-size: 1.08rem; line-height: 1.8; color: var(--ink); overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin-top: 1.6em; }
.prose h2 { font-size: 1.8rem; } .prose h3 { font-size: 1.45rem; } .prose h4 { font-size: 1.2rem; }
.prose p { margin: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose a { color: var(--accent); font-weight: 600; }
.prose img { border-radius: var(--r-md); height: auto; margin-inline: auto; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--gold); font-family: var(--font-display); font-size: 1.3rem; font-style: italic; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose--locked { position: relative; max-height: 260px; overflow: hidden; }
.prose--locked::after { content: ""; position: absolute; inset: auto 0 0; height: 180px; background: linear-gradient(180deg, transparent, var(--bg)); }
.paywall { margin-top: 8px; padding: clamp(24px, 4vw, 36px); border-radius: var(--r-lg); background: var(--navy-deep); color: var(--on-brand); display: grid; gap: 14px; justify-items: start; }
.paywall .eyebrow { color: var(--gold-light); }
.paywall h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.8rem; line-height: 1.15; }
.paywall p { color: var(--on-brand-muted); max-width: 56ch; }
.paywall__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.paywall__price { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--gold-light); }
.reader__more { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.reader__more h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; margin-bottom: 20px; }

/* ---------- homepage teaser ---------- */
.blog-teaser__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: clamp(28px, 4vw, 44px); }
.blog-teaser__head .section-head { margin-bottom: 0; }

/* ---------- daily headlines ---------- */
.headlines { display: grid; gap: 16px; }
.headlines__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 20px; }
.headlines__title { display: grid; gap: 4px; }
.headlines__title h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); line-height: 1.1; display: flex; align-items: center; gap: 10px; }
.headlines__title h2::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #E5484D; box-shadow: 0 0 0 4px rgba(229,72,77,.2); flex: none; }
.headlines__title span { font-size: .84rem; color: var(--muted); }
.headlines__ctrl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hl-chip { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 13px; font: 700 .8rem var(--font-body); cursor: pointer; }
.hl-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.hl-arrows { display: flex; gap: 6px; }
.hl-arrows button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: grid; place-items: center; font-size: 1rem; }
.hl-arrows button:hover { border-color: var(--accent); }
.hl-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, calc((100% - 48px) / 4)); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.hl { scroll-snap-align: start; display: grid; grid-template-rows: auto 1fr; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); overflow: hidden; text-decoration: none; color: inherit; min-width: 0; transition: border-color .2s ease; }
.hl:hover { border-color: var(--accent); }
.hl__img { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.hl__img img { width: 100%; height: 100%; object-fit: cover; }
.hl__cat { position: absolute; left: 10px; top: 10px; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: rgba(13,31,60,.8); color: #FFFFFF; }
.hl__body { padding: 14px; display: grid; gap: 6px; align-content: start; }
.hl__body h3 { font-size: .95rem; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hl__body p { font-size: .84rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hl__meta { display: flex; gap: 8px; align-items: center; font-size: .76rem; color: var(--muted); margin-top: 2px; }
.hl__meta b { color: var(--gold-text); }
.hl__out { margin-left: auto; color: var(--accent); font-weight: 800; }
.headlines--blog { margin-top: 40px; }
@media (max-width: 1100px) { .hl-track { grid-auto-columns: minmax(250px, calc((100% - 32px) / 3)); } }
@media (max-width: 640px) { .hl-track { grid-auto-columns: 80%; } .hl-arrows { display: none; } }

/* ---------- modal ---------- */
.pm-lock, .pm-lock body { overflow: hidden; }
.pm-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8,17,31,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.pm { position: relative; width: min(460px, 100%); background: var(--surface); color: var(--ink); border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(0,0,0,.4); padding: clamp(24px, 4vw, 34px); display: grid; gap: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.pm-close { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.pm-head { display: grid; gap: 8px; padding-right: 36px; }
.pm-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.8rem; line-height: 1.1; }
.pm-head p { color: var(--muted); font-size: .93rem; }
.pm-badge { justify-self: start; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--accent); }
.pm-badge--gold { background: var(--gold-soft); color: var(--gold-text); }
.pm-notice { padding: 12px 14px; border-radius: var(--r-sm); background: var(--gold-soft); color: var(--gold-text); font-size: .9rem; font-weight: 600; }
.pm-form, .pm-upload { display: grid; gap: 14px; }
.pm-field { display: grid; gap: 6px; }
.pm-field span { font-size: .85rem; font-weight: 700; }
.pm-field input { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: .95rem; }
.pm-field input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.pm-otp { font-size: 1.5rem !important; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.pm-error { color: #C0392B; font-size: .88rem; font-weight: 600; }
.pm-submit { width: 100%; }
.pm-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.pm-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: .88rem; color: var(--muted); }
.pm-link { background: none; border: 0; padding: 0; color: var(--accent); font: 700 .88rem var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pm-price { display: flex; align-items: baseline; gap: 10px; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-2); }
.pm-price b { font-family: var(--font-display); font-size: 2.4rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.pm-price span { color: var(--muted); font-weight: 600; }
.pm-list { list-style: none; display: grid; gap: 8px; font-size: .92rem; }
.pm-list li { display: flex; gap: 10px; }
.pm-list li::before { content: "✓"; color: var(--ok); font-weight: 800; }
.pm-fine { font-size: .82rem; color: var(--muted); }
.pm-muted { color: var(--muted); font-size: .9rem; }
.pm-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pm-summary div { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); display: grid; gap: 2px; }
.pm-summary span { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pm-summary b { font-size: 1.1rem; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pm-copy { border: 1px solid var(--line); background: var(--surface); color: var(--accent); border-radius: 999px; padding: 3px 10px; font: 700 .74rem var(--font-body); cursor: pointer; }
.pm-accounts { display: grid; gap: 10px; }
.pm-acct { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: grid; gap: 8px; }
.pm-acct__head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pm-acct__head span { font-size: .78rem; color: var(--muted); }
.pm-acct dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .9rem; }
.pm-acct dt { color: var(--muted); }
.pm-acct dd { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.pm-mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; font-weight: 700; overflow-wrap: anywhere; user-select: all; }
.pm-drop { display: grid; justify-items: center; gap: 4px; padding: 20px; border: 2px dashed var(--line); border-radius: var(--r-md); text-align: center; cursor: pointer; background: var(--bg); }
.pm-drop:hover { border-color: var(--accent); }
.pm-drop__icon { font-size: 1.4rem; color: var(--accent); }
.pm-drop span:last-child { font-size: .8rem; color: var(--muted); }
.pm-status { padding: 12px 14px; border-radius: var(--r-md); display: grid; gap: 4px; font-size: .9rem; }
.pm-status--ok { background: rgba(21,115,71,.12); color: var(--ok); }
.pm-status--wait { background: var(--gold-soft); color: var(--gold-text); }
.pm-status--todo { background: var(--surface-2); color: var(--ink); }
.pm-status span { color: var(--ink); opacity: .85; }
.pm-purchases { display: grid; gap: 10px; }
.pm-purchase { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.pm-purchase div { display: grid; min-width: 0; }
.pm-purchase span { font-size: .8rem; color: var(--muted); }
.pm-pill { font-size: .74rem !important; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pm-pill--ok { background: rgba(21,115,71,.12); color: var(--ok) !important; }
.pm-pill--wait { background: var(--gold-soft); color: var(--gold-text) !important; }
.pm-pill--todo { background: var(--surface-2); color: var(--ink) !important; }

@media (max-width: 960px) {
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acct-name { display: none; }
}
@media (max-width: 640px) {
  .posts { grid-template-columns: minmax(0, 1fr); }
  .premium-bar { grid-template-columns: auto minmax(0, 1fr); }
  .premium-bar .btn { grid-column: 1 / -1; width: 100%; }
  .search { max-width: none; }
  .pm-summary { grid-template-columns: minmax(0, 1fr); }
  .nav { gap: 10px; }
  .brand { gap: 10px; }
  .brand__mark { width: 44px; height: 44px; }
  .brand__text { min-width: 0; }
  .brand__name { font-size: 1.12rem; overflow: hidden; text-overflow: ellipsis; }
  .acct-btn { min-height: 40px; padding: 0 12px; font-size: .84rem; }
  .acct-btn--user { padding: 0 4px; border-color: transparent; }
  .nav__toggle { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .post, .post__img img { transition: none; }
  .post--skeleton .post__img, .post--skeleton .sk { animation: none; }
}
