/* ===== News-site shell (inspired by editorial cyber news, not a clone) =====
   Horizontal masthead, solid paper page, article feed as Home.
   No left spine, no mesh, no pastel washes, no animated color shifts. */

:root {
  --font-display: "Inter", "Segoe UI", system-ui, sans-serif;
  --radius: 2px;
  --radius-lg: 2px;
}

html, body {
  background-color: var(--bg);
  transition: none !important;
}

/* ----- App: masthead on top, not a left cover ----- */
html:not(.is-mobile) .app {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "cover"
    "stage"
    "footer";
  --status-h: 64px;
  --cover-w: 0px;
}

html:not(.is-mobile) .site-header,
html:not(.is-mobile) .status-bar {
  grid-area: cover;
  position: sticky;
  min-width: 0;
  top: 0;
  height: auto;
  max-height: none;
  min-height: 0 !important;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap !important;
  gap: 1.25rem;
  padding: 0.7rem clamp(1.1rem, 3vw, 2.25rem);
  background: color-mix(in srgb, var(--masthead) 82%, transparent) !important;
  color: var(--masthead-ink);
  border: 0 !important;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.45) !important;
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.12) !important;
  backdrop-filter: blur(14px) saturate(1.2) !important;
  overflow: visible;
}

html:not(.is-mobile) .site-header::after {
  display: none;
}

html:not(.is-mobile) .brand {
  gap: 0.15rem;
  padding-bottom: 0;
  border-bottom: 0;
  min-width: 0;
  flex: 0 1 14rem;
  overflow: hidden;
}

html:not(.is-mobile) .brand-name {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 1.12rem;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(var(--accent-rgb), 0.45);
}

html:not(.is-mobile) .brand:hover .brand-name {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(var(--accent-rgb), 0.7);
}

html:not(.is-mobile) .brand-role {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--masthead-mute);
  max-width: 38ch;
  line-height: 1.35;
}

.cover-stamp {
  display: none !important;
}

html:not(.is-mobile) .top-nav {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.1rem;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  order: 0;
}

html:not(.is-mobile) .nav-link {
  width: auto;
  text-align: center;
  border-radius: 0;
  border: 0;
  border-left: 0;
  border-bottom: 2px solid transparent;
  background: transparent !important;
  color: var(--masthead-mute);
  padding: 0.55rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex: 0 0 auto;
  box-shadow: none !important;
  transform: none !important;
}

html:not(.is-mobile) .nav-link:hover {
  color: var(--masthead-ink);
  background: transparent !important;
  border-left-color: transparent;
  border-bottom-color: color-mix(in srgb, var(--accent) 70%, transparent);
}

html:not(.is-mobile) .nav-link.active {
  color: var(--masthead-ink);
  border-left-color: transparent;
  border-bottom-color: var(--accent);
  background: transparent !important;
  font-weight: 700;
}

html:not(.is-mobile) .header-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0;
  width: auto;
  flex: 0 0 auto;
}

@media (max-width: 1120px) {
  html:not(.is-mobile) .theme-picker-label {
    display: none;
  }
}

html:not(.is-mobile) .header-actions .icon-btn,
html:not(.is-mobile) .theme-picker-btn {
  width: auto;
  justify-content: center;
  border-radius: 0;
  color: var(--masthead-ink);
  border-color: color-mix(in srgb, var(--masthead-ink) 18%, transparent);
  background: transparent;
}

html:not(.is-mobile) .theme-picker {
  width: auto;
  position: relative;
}

html:not(.is-mobile) .theme-dropdown {
  top: calc(100% + 0.4rem);
  bottom: auto;
  left: auto;
  right: 0;
  border-radius: 2px;
}

html:not(.is-mobile) .auth-badge {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--masthead-mute);
  border-radius: 0;
}

/* ----- Page ----- */
html:not(.is-mobile) .stage {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem clamp(1.1rem, 3vw, 2rem) 3rem;
  min-height: calc(100vh - 7rem);
  position: relative;
}

html:not(.is-mobile) .stage::before {
  display: none;
}

html:not(.is-mobile) .footer-strip {
  border-top: 1px solid var(--rule);
  border-left: 0;
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-dim);
}

html:not(.is-mobile) .stage.stage-wide,
html:not(.is-mobile) .stage:has(#view-admin.active),
html:not(.is-mobile) .stage:has(#view-manage.active) {
  max-width: none;
  padding-left: 1.1rem;
  padding-right: 1.1rem;
}

/* ----- Type ----- */
.view-title,
.hero-title,
.post-title,
.section-title,
.fc-title,
.post-row-title,
.news-lead-title {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-bright);
}

.section-kicker,
.hero-kicker,
.blog-sidebar-title,
.panel-title {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.btn-primary {
  box-shadow: none !important;
  letter-spacing: 0.01em;
  text-transform: none;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 2px !important;
}

.accent-text {
  background: none !important;
  color: var(--text-bright) !important;
  font-style: normal;
  font-weight: 700;
}

/* ----- Chrome: paper, not glass ----- */
.panel,
.hero-panel,
.blog-toolbar,
.blog-sidebar-card,
.featured-panel,
.home-focus-panel,
.auth-card,
.post-list {
  border-radius: 0 !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

body[class*="theme-"] .blog-toolbar,
.blog-toolbar,
.feed-rail {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--rule) !important;
  padding: 0 0 1rem !important;
  margin-bottom: 1.25rem;
  gap: 0.85rem;
}

.feed-rail {
  display: flex;
  flex-direction: column;
}

.category-track {
  position: relative;
  overflow: hidden;
  min-height: 2.6rem;
  padding: 0 0 0.15rem;
}

.category-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.1rem;
  margin: 0 !important;
  padding: 0.2rem 0 0.7rem;
  position: relative;
  z-index: 1;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.35) transparent;
}

.category-chip {
  background: transparent;
  border: 0;
  border-radius: 0 !important;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.86rem;
  padding: 0.4rem 0.75rem 0.45rem;
  position: relative;
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.2;
  transform: none !important;
}

.category-chip:hover {
  color: var(--text-bright);
  background: transparent;
  border-color: transparent;
}

.category-chip.active {
  background: transparent;
  color: var(--text-bright);
  border-color: transparent;
  font-weight: 750;
}

html body[class*="theme-"] .category-chip,
html body.theme-black-team .category-chip,
html body.theme-dark .category-chip {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--text-dim);
}

html body[class*="theme-"] .category-chip.active,
html body.theme-black-team .category-chip.active,
html body.theme-dark .category-chip.active {
  background: transparent !important;
  color: var(--text-bright) !important;
}

.query-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  min-width: 0;
}

.query-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 16rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--rule);
  background: var(--bg-elevated);
  position: relative;
}

.query-icon {
  flex: none;
  color: var(--text-dim);
}

.query-field #search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.2rem 0;
  font-size: 0.95rem;
  outline: none;
}

.query-hotkey {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.28rem;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
}

.query-field:focus-within .query-hotkey {
  opacity: 0;
  pointer-events: none;
}

.query-field:focus-within .query-icon {
  color: var(--accent);
}

.query-count {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 0;
  flex: 0 0 auto;
}

.sort-row {
  margin-left: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

#sort-select {
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 0.42rem 0.55rem;
  min-height: 2.35rem;
  font-size: 0.88rem;
}

.btn,
.btn-ghost,
.icon-btn,
.tag-chip,
.admin-vis-chip,
.admin-cat-chip {
  border-radius: 2px !important;
}

/* ----- Lead story (Home) ----- */
.news-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.35rem 1.6rem;
  align-items: stretch;
  padding: 0 0 1.5rem;
  margin: 0 0 0.35rem;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  background: transparent;
  min-width: 0;
  overflow: hidden;
}

.news-lead:hover .news-lead-title {
  color: var(--accent);
}

.news-lead-media {
  min-height: 12rem;
  background: var(--bg);
  overflow: hidden;
}

.news-lead-media img {
  width: 100%;
  height: 100%;
  min-height: 14rem;
  object-fit: cover;
  display: block;
}

.news-lead-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  min-width: 0;
}

.news-lead-cat {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.news-lead-title {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 2.05rem);
  line-height: 1.22;
}

.news-lead-excerpt {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text);
}

.news-lead-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

@media (max-width: 780px) {
  .news-lead {
    grid-template-columns: 1fr;
  }
  .news-lead-media img {
    min-height: 11rem;
  }
}

/* ----- Article list ----- */
.blog-layout {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 2.25rem;
  align-items: start;
}

.post-list {
  counter-reset: none;
  background: transparent !important;
  border: 0 !important;
}

.post-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.85rem 1.05rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--rule);
  animation: none;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}

.post-row::before {
  display: none;
}

.post-row-cover {
  width: 148px;
  height: 92px;
  flex: none;
  border-radius: 0;
  overflow: hidden;
  order: 0;
  grid-column: 1;
  background: var(--bg);
}

.post-row-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-row-main {
  grid-column: 2;
  min-width: 0;
}

.post-row-title {
  overflow-wrap: anywhere;
}

.post-row-aside {
  grid-column: 3;
}

.post-row-title {
  font-size: 1.12rem;
  line-height: 1.3;
  font-weight: 750;
  margin: 0.15rem 0 0.3rem;
}

.post-row:hover .post-row-title {
  color: var(--accent);
}

.post-row-excerpt {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.post-row-arrow {
  font-family: var(--font-sans);
  color: var(--text-dim);
}

.blog-sidebar-card {
  background: var(--bg-panel) !important;
  border: 1px solid var(--rule) !important;
  padding: 1rem 1.05rem !important;
  margin-bottom: 1rem;
}

.recommended-item {
  border-radius: 0;
}

/* ----- Article as a finding sheet ----- */
.post-article.news-article {
  max-width: 42rem;
}

.post-title {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  line-height: 1.22;
}

.post-category {
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}

.news-header {
  border-bottom: 1px solid var(--rule);
}

.post-body.prose {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text);
}

.post-toc-sidebar-inner,
.post-rec-sidebar-inner {
  border-radius: 0 !important;
  backdrop-filter: blur(10px) !important;
  box-shadow: none !important;
  background: var(--bg-panel);
  border: 1px solid var(--rule);
}

/* ----- About / contact ----- */
.about-hero,
.about-block,
.cred-card,
.method-card,
.channel-card {
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.about-hero-side {
  display: none !important;
}

.cred-card,
.channel-card,
.method-card {
  background: var(--bg) !important;
  border: 1px solid var(--rule) !important;
}

input, select, textarea {
  border-radius: 2px !important;
}

.auth-card {
  max-width: 26rem;
  border: 1px solid var(--rule) !important;
  padding: 1.5rem !important;
  background: var(--bg-panel) !important;
}

html.is-mobile .hero-title,
html.is-mobile .view-title,
html.is-mobile .post-title,
html.is-mobile .section-title,
html.is-mobile .post-row-title,
html.is-mobile .fc-title,
html.is-mobile .news-lead-title {
  font-family: var(--font-sans);
  font-weight: 800;
}

html.is-mobile .btn-primary {
  text-transform: none;
  letter-spacing: 0.01em;
  border-radius: 2px !important;
}

html.is-mobile .post-row-aside {
  display: none;
}

body.theme-flash::after {
  display: none !important;
}

body.theme-switching {
  transition: none !important;
}

html.is-mobile .site-header,
html.is-mobile .status-bar {
  background: var(--masthead) !important;
  color: var(--masthead-ink);
  border-bottom: 3px solid var(--accent) !important;
  backdrop-filter: none !important;
}

html.is-mobile .brand-name {
  color: var(--masthead-ink);
}

html.is-mobile .brand-role {
  color: var(--masthead-mute);
}

@media (max-width: 980px) {
  html:not(.is-mobile) .post-row {
    grid-template-columns: 120px minmax(0, 1fr) auto;
  }
  html:not(.is-mobile) .post-row-cover {
    width: 120px;
    height: 78px;
  }
  html:not(.is-mobile) .blog-layout {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title .line,
  .accent-text,
  .post-row,
  .featured-card,
  .news-lead {
    animation: none !important;
  }
}
