/* ==========================================================================
   Dash International — theme stylesheet
   Hand-authored equivalent of the approved React/Tailwind prototype.
   ========================================================================== */

:root {
	--ink: #242424;
	--subtle: #6b6b6b;
	--line: #e6e6e6;
	--accent: #b3261e;
	--paper: #ffffff;
	--serif: Georgia, 'Times New Roman', serif;
	--sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	-webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ---------- shared bits ---------- */

.btn {
	display: inline-block;
	font-size: 14px;
	font-weight: 500;
	border: none;
	border-radius: 999px;
	padding: 7px 18px;
	text-align: center;
}
.btn--accent { background: var(--accent); color: #fff; }
.btn--ink { background: var(--ink); color: #fff; padding: 9px 18px; }
.btn--full { width: 100%; }

.icon-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	border: 1px solid var(--line);
	color: var(--subtle);
	background: transparent;
}
.icon-btn:hover { background: #fafaf9; }

.avatar-circle, .avatar-dot {
	width: 32px;
	height: 32px;
	border-radius: 999px;
	background: #d6d3d1;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.avatar-dot { width: 20px; height: 20px; }
.avatar-circle .user-avatar-img,
.profile-header .user-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

.pill {
	background: #f2f2f2;
	border-radius: 999px;
	padding: 2px 8px;
	font-size: 12px;
}

/* Placeholder gradients for posts without a featured image yet */
.thumb-grad { display: block; width: 100%; height: 100%; }
.thumb-grad.g0 { background: linear-gradient(135deg, #7c2d12, #020617); }
.thumb-grad.g1 { background: linear-gradient(135deg, #334155, #0f172a); }
.thumb-grad.g2 { background: linear-gradient(135deg, #047857, #022c22); }
.thumb-grad.g3 { background: linear-gradient(135deg, #1e40af, #020617); }
.thumb-grad.g4 { background: linear-gradient(135deg, #92400e, #0c0a09); }
.thumb-grad.g5 { background: linear-gradient(135deg, #075985, #020617); }
.thumb-grad.g6 { background: linear-gradient(135deg, #701a75, #0c0a09); }
.thumb-grad.g7 { background: linear-gradient(135deg, #312e81, #020617); }

.pagination { display: flex; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 34px; height: 34px; padding: 0 8px;
	border: 1px solid var(--line); border-radius: 6px; font-size: 14px; color: var(--subtle);
}
.pagination .current { color: #fff; background: var(--ink); border-color: var(--ink); }

.empty-note { color: var(--subtle); }

/* ---------- top bar ---------- */

.topbar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar__inner {
	max-width: 1600px; margin: 0 auto; padding: 0 24px; height: 64px;
	display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center; gap: 8px;
}
.topbar__left { display: flex; align-items: center; }
.hamburger { background: none; border: none; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-left: -4px; border-radius: 6px; color: #44403c; }
.hamburger:hover { background: #fafaf9; }
.topbar__logo {
	justify-self: center; font-family: var(--serif); font-weight: 700; font-size: 24px; color: var(--ink);
	min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar__logo img { max-height: 40px; width: auto; }
.topbar__right { justify-self: end; display: flex; align-items: center; gap: 20px; }
.topbar__bell { color: #57534e; }

@media (min-width: 1024px) { .hamburger { display: none; } }
@media (max-width: 639px) { .avatar-circle { display: none; } }
@media (max-width: 480px) { .topbar__inner { padding: 0 16px; } .topbar__logo { font-size: 18px; } }

/* ---------- page shell / layout ---------- */

.page-shell {
	max-width: 1600px; margin: 0 auto;
	display: flex; gap: 40px;
	padding: 32px 24px;
}
.main-col { flex: 1; min-width: 0; }

/* ---------- left sidebar ---------- */

.left-nav { display: none; flex-shrink: 0; width: 160px; transition: width .2s ease; }
.left-nav.is-collapsed { width: 64px; }
@media (min-width: 1024px) { .left-nav { display: block; } }
.left-nav__sticky { position: sticky; top: 96px; }

.left-nav__toggle { margin-bottom: 16px; }
.is-collapsed-icon { display: none; }
.left-nav.is-collapsed .is-expanded-icon { display: none; }
.left-nav.is-collapsed .is-collapsed-icon { display: block; }

.left-nav__search {
	display: flex; align-items: center; gap: 8px;
	border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; margin-bottom: 16px;
	color: #a8a29e;
}
.left-nav__search input { border: none; outline: none; font-size: 14px; color: var(--ink); background: transparent; width: 100%; }
.left-nav__search input::placeholder { color: #a8a29e; }
.left-nav__search-collapsed { display: none; margin-bottom: 16px; }
.left-nav.is-collapsed .left-nav__search { display: none; }
.left-nav.is-collapsed .left-nav__search-collapsed { display: flex; }

.left-nav__links { display: flex; flex-direction: column; gap: 4px; }
.left-nav__link {
	display: flex; align-items: center; gap: 16px;
	padding: 10px 12px; border-radius: 6px; font-size: 15px;
	color: var(--subtle); font-weight: 400;
}
.left-nav__link:hover { background: #fafaf9; }
.left-nav__link.is-active { color: var(--ink); font-weight: 600; }
.left-nav__link.is-soon { opacity: .55; cursor: default; }
.left-nav.is-collapsed .left-nav__link { justify-content: center; padding-left: 0; padding-right: 0; }
.left-nav.is-collapsed .left-nav__label { display: none; }

/* ---------- right rail ---------- */

.right-rail { display: none; flex-shrink: 0; width: 224px; }
@media (min-width: 1280px) { .right-rail { display: block; } }
.right-rail__sticky { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 32px; }

.right-rail__heading { font-size: 12px; letter-spacing: .1em; font-weight: 600; color: #a8a29e; margin-bottom: 12px; text-transform: uppercase; }
.right-rail__list { display: flex; flex-direction: column; gap: 2px; }
.right-rail__link { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 6px; font-size: 14px; color: #3a3a3a; }
.right-rail__link:hover { background: #fafaf9; }
.right-rail__link.is-active { color: var(--accent); font-weight: 600; }

.newsletter-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.newsletter-card__title { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.newsletter-card__copy { font-size: 13px; color: var(--subtle); margin-bottom: 12px; }

/* ---------- homepage lead story ---------- */

.lead-story__section { font-size: 12px; letter-spacing: .1em; font-weight: 600; color: var(--accent); margin-bottom: 8px; text-transform: uppercase; }
.lead-story__title { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.15; margin: 0 0 12px; color: var(--ink); }
.lead-story__byline { font-size: 14px; color: var(--subtle); margin-bottom: 20px; }
.lead-story__thumb { width: 100%; height: 288px; border-radius: 6px; margin-bottom: 20px; object-fit: cover; }
.lead-story__excerpt { line-height: 1.7; margin: 0 0 40px; max-width: 672px; color: #3a3a3a; }

@media (min-width: 768px) {
	.lead-story__title { font-size: 36px; }
	.lead-story__thumb { height: 384px; }
}

/* ---------- ticker <-> feed swap zone ---------- */

.swap-zone { position: relative; min-height: 400px; }

.ticker-wrap { position: absolute; inset: 0; transition: opacity .3s ease; opacity: 1; }
.ticker-wrap.is-hidden { opacity: 0; pointer-events: none; }

.ticker-heading { font-size: 12px; letter-spacing: .1em; font-weight: 600; color: #a8a29e; margin-bottom: 12px; text-transform: uppercase; }
.ticker-scroller { overflow: hidden; }
.ticker-track { display: flex; gap: 16px; width: max-content; }
.ticker-track.animate-marquee { animation: dash-marquee 28s linear infinite; }
.ticker-track.animate-marquee:hover { animation-play-state: paused; }

@keyframes dash-marquee {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

.ticker-card {
	display: flex; align-items: center; gap: 12px;
	border: 1px solid var(--line); border-radius: 6px; padding: 10px;
	flex-shrink: 0; width: 256px; background: #fff;
}
.ticker-card:hover { box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ticker-card__thumb { width: 56px; height: 56px; border-radius: 4px; flex-shrink: 0; object-fit: cover; }
.ticker-card__cat { font-size: 10px; letter-spacing: .1em; font-weight: 600; color: var(--accent); }
.ticker-card__title { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink); }

.feed-wrap { opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.feed-wrap.is-visible { opacity: 1; pointer-events: auto; }

/* ---------- feed item (home / category / search) ---------- */

.feed-list--divided .feed-item { border-top: 1px solid var(--line); }
.feed-list--divided .feed-item:first-child { border-top: none; }

.feed-item { display: flex; gap: 24px; padding: 28px 0; }
.feed-item__body { flex: 1; min-width: 0; }
.feed-item__byline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--subtle); margin-bottom: 8px; }
.feed-item__title { font-family: var(--serif); font-size: 20px; font-weight: 700; margin-bottom: 4px; color: var(--ink); }
.feed-item:hover .feed-item__title { text-decoration: underline; }
.feed-item__excerpt { font-size: 15px; line-height: 1.7; color: var(--subtle); margin: 0 0 12px; }
.feed-item__meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #9a9a9a; }
.feed-item__thumb { width: 128px; height: 112px; border-radius: 6px; flex-shrink: 0; object-fit: cover; }

.archive-kicker { font-size: 12px; letter-spacing: .1em; font-weight: 600; color: #a8a29e; margin-bottom: 4px; text-transform: uppercase; }
.archive-title { font-family: var(--serif); font-size: 30px; font-weight: 700; margin: 0 0 32px; color: var(--ink); }

.author-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px; }
.author-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 20px 12px; border: 1px solid var(--line); border-radius: 10px; }
.author-card:hover { background: #fafaf9; }
.author-card .user-avatar-img, .author-card .user-avatar-letter { width: 64px; height: 64px; border-radius: 999px; object-fit: cover; margin-bottom: 12px; }
.author-card__name { font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.author-card__count { font-size: 12px; color: var(--subtle); }

/* ---------- article page ---------- */

.article-page { max-width: 768px; margin: 0 auto; padding: 40px 24px; }
.back-link { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--subtle); margin-bottom: 32px; width: fit-content; }
.back-link:hover { color: var(--ink); }

.article-banner { background: var(--ink); border-radius: 6px; overflow: hidden; margin-bottom: 32px; }
.article-banner__inner { padding: 24px; }
.article-banner__top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.article-banner__tag { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: #fff; border: 1px solid rgba(255,255,255,.4); padding: 4px 8px; }
.article-banner__badge {
	width: 32px; height: 32px; border-radius: 999px; border: 1px solid rgba(255,255,255,.4);
	display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; overflow: hidden;
}
.article-banner__badge img { width: 100%; height: 100%; object-fit: cover; }
.article-banner__mid { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.article-banner__dash { font-size: 36px; font-weight: 800; color: #fff; line-height: 1; margin-bottom: 4px; }
.article-banner__section { font-family: var(--serif); font-style: italic; font-size: 22px; color: #fff; }
.article-banner__blank { width: 112px; height: 128px; background: #fff; border-radius: 3px; flex-shrink: 0; overflow: hidden; }
.article-banner__blank.has-photo { background: transparent; }
.article-banner__photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-banner__feedback { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 32px; }

@media (min-width: 768px) { .article-banner__blank { width: 128px; height: 144px; } }

.article-page__title { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.15; margin: 0 0 8px; color: var(--ink); }
.article-page__byline { font-size: 12px; letter-spacing: .1em; font-weight: 600; color: var(--subtle); margin-bottom: 24px; }
.article-page__row { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--subtle); margin-bottom: 32px; }
.article-page__row span { display: flex; align-items: center; gap: 4px; }
.article-page__thumb { width: 100%; height: 320px; border-radius: 6px; margin-bottom: 32px; object-fit: cover; }

.article-page__body { margin-bottom: 56px; }
.article-page__body p, .article-page__body :where(p) {
	font-family: var(--serif); font-size: 18px; line-height: 1.75; color: #2b2b2b; margin: 0 0 20px;
}

@media (min-width: 768px) {
	.article-page__title { font-size: 36px; }
}

.related { border-top: 1px solid var(--line); padding-top: 32px; }
.related__heading { font-size: 12px; letter-spacing: .1em; font-weight: 600; color: #a8a29e; margin-bottom: 16px; text-transform: uppercase; }
.related__list { display: flex; flex-direction: column; gap: 24px; }
.related__item { display: flex; gap: 20px; }
.related__thumb { width: 96px; height: 80px; border-radius: 6px; flex-shrink: 0; object-fit: cover; }
.related__title { font-family: var(--serif); font-weight: 700; color: var(--ink); }
.related__item:hover .related__title { text-decoration: underline; }
.related__meta { font-size: 12px; color: var(--subtle); margin-top: 4px; }

/* ---------- mobile menu ---------- */

.mobile-menu { position: fixed; inset: 0; z-index: 50; }
@media (min-width: 1024px) { .mobile-menu { display: none !important; } }
.mobile-menu__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.mobile-menu__panel {
	position: absolute; top: 0; left: 0; height: 100%; width: 288px; max-width: 85vw;
	overflow-y: auto; background: var(--paper); box-shadow: 4px 0 20px rgba(0,0,0,.15);
}
.mobile-menu__header { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; height: 64px; border-bottom: 1px solid var(--line); }
.mobile-menu__title { font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--ink); }
.mobile-menu__body { padding: 16px; }
.mobile-menu__search { margin-bottom: 20px; }

.mobile-menu__links { display: flex; flex-direction: column; gap: 2px; margin-bottom: 28px; }
.mobile-menu__link { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 6px; font-size: 15px; color: var(--subtle); }
.mobile-menu__link:hover { background: #fafaf9; }
.mobile-menu__link.is-active { color: var(--ink); font-weight: 600; }
.mobile-menu__link.is-soon { opacity: .55; }
.mobile-menu__categories { margin-bottom: 28px; }
.mobile-menu__categories .mobile-menu__link { font-size: 14px; padding: 8px 12px; }

/* ---------- login / register ---------- */

.auth-page { max-width: 420px; margin: 0 auto; padding: 64px 24px; }
.auth-card__title { font-family: var(--serif); font-size: 28px; font-weight: 700; margin: 0 0 24px; text-align: center; color: var(--ink); }

.auth-notice { font-size: 13px; padding: 10px 12px; border-radius: 6px; margin-bottom: 16px; }
.auth-notice--error { background: #fdecea; color: #7a271a; }
.auth-notice--success { background: #eaf6ec; color: #1e4620; }

.auth-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.form-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--subtle); }
.form-field input, .form-field textarea {
	font-family: var(--sans); font-size: 15px; color: var(--ink);
	border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px;
}
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--ink); }
.form-field textarea { resize: vertical; }

.dash-hp-field { position: absolute; left: -9999px; top: -9999px; }

.auth-switch { text-align: center; font-size: 14px; color: var(--subtle); }
.auth-switch a { color: var(--accent); font-weight: 600; }
.auth-help { font-size: 14px; color: var(--subtle); margin: 0 0 20px; line-height: 1.5; }
.link-button {
	background: none; border: none; padding: 0; margin: 0;
	color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: underline;
	font-family: inherit;
}
.otp-input { letter-spacing: .3em; font-size: 20px; text-align: center; }

/* ---------- profile ---------- */

.profile-header {
	display: flex; align-items: center; gap: 20px;
	margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line);
}
.profile-header .user-avatar-img, .profile-header .user-avatar-letter {
	width: 80px; height: 80px; border-radius: 999px; object-fit: cover; flex-shrink: 0;
}
.user-avatar-letter {
	display: flex; align-items: center; justify-content: center;
	background: var(--ink); color: #fff; font-family: var(--serif); font-weight: 700;
}
.profile-header__name { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.3; word-break: break-word; }
.profile-header__bio { font-size: 14px; color: var(--subtle); margin: 6px 0 0; max-width: 480px; line-height: 1.5; }

.profile-actions { margin-bottom: 32px; }

.profile-edit {
	max-width: 460px; background: #fafaf9; border: 1px solid var(--line);
	border-radius: 10px; padding: 24px;
}
.profile-edit__heading { font-size: 12px; letter-spacing: .1em; font-weight: 600; color: #a8a29e; margin-bottom: 16px; text-transform: uppercase; }
.profile-edit .form-field input[type="file"] { background: #fff; padding: 8px; font-size: 13px; }

@media (max-width: 480px) {
	.profile-header { gap: 14px; }
	.profile-header .user-avatar-img, .profile-header .user-avatar-letter { width: 64px !important; height: 64px !important; font-size: 26px !important; }
	.profile-header__name { font-size: 19px; }
	.profile-edit { padding: 20px 16px; }
}

/* ---------- save button ---------- */
.article-page__row .save-form { margin-left: auto; }

.save-form { display: inline-block; }
.save-btn {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 13px; font-weight: 600; color: var(--subtle);
	background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
.save-btn:hover { background: #fafaf9; }
.save-btn.is-saved { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- library page ---------- */

.library-list { display: flex; flex-direction: column; }
.library-item { display: flex; flex-direction: column; gap: 10px; padding: 24px 0; border-top: 1px solid var(--line); }
.library-item:first-child { border-top: none; }
.library-item .feed-item__link { display: flex; gap: 24px; }
.library-item .feed-item__link:hover .feed-item__title { text-decoration: underline; }
.library-item .save-form { align-self: flex-start; }

.profile-stats { margin-bottom: 24px; }
.profile-stat { font-size: 14px; color: var(--subtle); }
.profile-stat strong { color: var(--ink); font-family: var(--serif); font-size: 16px; }
.profile-stat:hover { text-decoration: underline; }

/* ---------- comments ---------- */

.comments-area { border-top: 1px solid var(--line); padding-top: 32px; margin-top: 40px; }
.comments-heading { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink); margin-bottom: 20px; }

.comment-list { list-style: none; margin: 0 0 32px; padding: 0; }
.comment-list .children { list-style: none; margin: 20px 0 0; padding: 0 0 0 32px; }
.comment-item { padding: 20px 0; border-top: 1px solid var(--line); }
.comment-list > .comment-item:first-child { border-top: none; }

.comment-item__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.comment-item__avatar { border-radius: 999px; width: 40px; height: 40px; }
.comment-item__author { font-weight: 600; font-size: 14px; color: var(--ink); }
.comment-item__date a { font-size: 12px; color: var(--subtle); }
.comment-item__content { font-size: 15px; line-height: 1.7; color: #2b2b2b; }
.comment-item__content p { margin: 0 0 12px; }
.comment-item__pending { font-size: 12px; color: var(--accent); font-style: italic; margin-bottom: 8px; }
.comment-item__reply { margin-top: 8px; }
.comment-item__reply a { font-size: 12px; font-weight: 600; color: var(--accent); }

.comment-form #reply-title { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink); margin-bottom: 16px; }
.comment-form .comment-form-cookies-consent { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--subtle); }
.comment-form .comment-form-cookies-consent label { display: inline; }
.comment-form .logged-in-as { font-size: 13px; color: var(--subtle); margin-bottom: 12px; }
.comment-form .logged-in-as a { color: var(--accent); }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.site-footer__inner { max-width: 1600px; margin: 0 auto; padding: 24px; font-size: 13px; color: var(--subtle); display: flex; gap: 8px; }
.site-footer__sep { color: var(--line); }
