/* Shared feed UI system: Claude-inspired warmth with GeoInvesting's soft editorial blue. */
:root {
  --parchment: #F5F4ED;
  --ivory: #faf9f5;
  --pure-white: #ffffff;
  --warm-sand: #e8e6dc;
  --border-cream: #f0eee6;
  --border-warm: #e8e6dc;
  --ring-warm: #d1cfc5;
  --ring-deep: #c2c0b6;
  --dark: #141413;
  --near-black: #141413;
  --dark-surface: #30302e;
  --charcoal-warm: #4d4c48;
  --olive-gray: #5e5d59;
  --stone-gray: #87867f;
  --warm-silver: #b0aea5;
  --terracotta: #C96442;
  --coral: #D97757;
  --accent: #5B8DEF;
  --accent-soft: rgba(91, 141, 239, .10);
  --focus-blue: #3898ec;
  --green-pos: #2f8f5b;
  --blue: var(--accent);
  --blue-dark: #4674c6;
  --blue-light: #7fa8f3;
  --blue-pale: #c6d9fb;
  --blue-muted: #6d95d9;
  --dark-soft: var(--olive-gray);
  --text-muted: var(--olive-gray);
  --text-light: var(--stone-gray);
  --border: var(--border-warm);
  --border-dark: var(--ring-deep);
  --shadow-sm: 0 0 0 1px var(--border-cream), 0 8px 26px rgba(20, 20, 19, .045);
  --shadow-md: 0 0 0 1px var(--ring-warm), 0 14px 34px rgba(20, 20, 19, .08);
  --shadow-whisper: 0 4px 24px rgba(20, 20, 19, .05);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-xxl: 32px;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Public Sans', Arial, sans-serif;
  --nav-h: 62px;
}

@view-transition {
  navigation: none;
}

::view-transition-old(root) {
  animation: feed-fade-out 160ms ease both;
}

::view-transition-new(root) {
  animation: feed-fade-in 260ms cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes feed-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: .76; transform: translateY(-4px); }
}

@keyframes feed-fade-in {
  from { opacity: .01; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

html {
  background: var(--parchment);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 8%, rgba(201, 100, 66, .10), transparent 28rem),
    linear-gradient(180deg, var(--parchment) 0%, #f3f1e8 52%, var(--parchment) 100%);
  color: var(--near-black);
  font-family: var(--font-sans);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  text-decoration-thickness: .07em;
  text-underline-offset: .18em;
}

button,
input {
  font: inherit;
}

/* Shared feed navigation */
body > .nav-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 245, .93);
  border-bottom: 1px solid var(--border-cream);
  box-shadow: 0 1px 0 rgba(209, 207, 197, .34);
  backdrop-filter: blur(18px) saturate(1.08);
}

body > .nav-wrap nav {
  width: min(100%, 1240px);
  max-width: 1240px;
  min-height: var(--nav-h);
  height: auto;
  margin: 0 auto;
  padding: 0 22px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  position: relative;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--near-black);
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.nav-logo-mark {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--near-black);
  color: var(--ivory);
  box-shadow: 0 0 0 1px var(--dark-surface), inset 0 0 0 1px rgba(250, 249, 245, .08);
  font-family: var(--font-sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
}

.nav-links {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  position: static;
  left: auto;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a,
.nav-links > a,
.nav-dropdown > a {
  position: relative;
  min-height: 38px;
  height: auto;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 999px;
  color: var(--olive-gray);
  font-size: .84rem;
  font-weight: 500;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.nav-links a:hover,
.nav-links > a:hover,
.nav-dropdown:hover > a,
.nav-links a.active,
.nav-links > a.active,
.nav-dropdown.is-active > a,
.nav-dropdown > a.active {
  color: var(--near-black);
  background: rgba(232, 230, 220, .66);
  box-shadow: 0 0 0 1px var(--ring-warm);
  border-bottom: 0;
  border-radius: 999px;
}

.nav-links > a.active::after,
.nav-dropdown.is-active > a::before,
.nav-dropdown > a.active::before {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  opacity: .88;
}

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: default;
}

.nav-dropdown > a::after {
  content: '';
  width: 0;
  height: 0;
  margin-left: 1px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .46;
  transform: translateY(1px);
}

.nav-dropdown-panel {
  display: block;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 226px;
  padding: 6px;
  border: 1px solid var(--border-warm);
  border-radius: 16px;
  background: rgba(250, 249, 245, .98);
  box-shadow: 0 0 0 1px rgba(209, 207, 197, .38), 0 18px 42px rgba(20, 20, 19, .10);
  overflow: hidden;
  z-index: 220;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.98);
  transform-origin: top left;
  transition: opacity 150ms ease, visibility 150ms ease, transform 150ms ease;
}

.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.nav-dropdown-panel a,
.nav-dropdown-panel a.active {
  min-height: 40px;
  height: auto !important;
  width: 100%;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  border: 0 !important;
  border-radius: 10px;
  color: var(--olive-gray);
  background: transparent;
  box-shadow: none;
  font-size: .84rem;
}

.nav-dropdown-panel a:hover,
.nav-dropdown-panel a.active {
  color: var(--near-black);
  background: var(--warm-sand);
}

.nav-dropdown-panel a.active::after,
.nav-dropdown-panel a + a {
  border-top: 0;
}

.nav-actions {
  margin-left: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.btn,
.btn-sm,
.btn-share,
.load-more-btn,
.tag-btn,
.btn-follow,
.btn-subscribe {
  border-radius: 12px;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.btn:hover,
.btn-share:hover,
.load-more-btn:hover,
.tag-btn:hover,
.btn-follow:hover,
.btn-subscribe:hover,
.account-card:hover,
.post-card:hover,
.pub-card:hover {
  transform: translateY(-1px);
}

.btn-sm {
  min-height: 34px;
  padding: 8px 14px;
  font-size: .82rem;
  font-weight: 600;
}

.btn-primary {
  background: var(--accent);
  color: var(--pure-white);
  box-shadow: 0 0 0 1px rgba(91, 141, 239, .80);
}

.btn-primary:hover {
  background: var(--blue-dark);
  color: var(--pure-white);
}

.btn-ghost,
.btn-share,
.load-more-btn {
  background: rgba(250, 249, 245, .72);
  border: 1px solid var(--border-warm);
  color: var(--charcoal-warm);
  box-shadow: 0 0 0 1px rgba(209, 207, 197, .22);
}

.btn-ghost:hover,
.btn-share:hover,
.load-more-btn:hover {
  background: var(--warm-sand);
  border-color: var(--ring-warm);
  color: var(--near-black);
}

.btn-share {
  min-height: 34px;
  margin-left: 0;
  padding: 7px 12px;
  gap: 7px;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn-share svg {
  width: 15px;
  height: 15px;
}

/* Editorial page headers */
.page-hero,
.feed-header,
.page-header {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  max-width: none;
  margin: 0;
  padding: 72px 24px 38px;
  border-bottom: 1px solid var(--border-cream);
  background:
    radial-gradient(circle at 78% 20%, rgba(201, 100, 66, .10), transparent 21rem),
    linear-gradient(180deg, rgba(250, 249, 245, .78), rgba(245, 244, 237, .88));
  overflow: hidden;
}

.page-hero::before,
.feed-header::before,
.page-header::before {
  content: '';
  position: absolute;
  inset: 16px 24px auto auto;
  width: min(32vw, 360px);
  height: min(20vw, 220px);
  border: 1px solid rgba(201, 100, 66, .24);
  border-radius: 52% 48% 54% 46%;
  background:
    radial-gradient(circle at 22% 34%, rgba(201, 100, 66, .14) 0 5px, transparent 6px),
    radial-gradient(circle at 68% 62%, rgba(91, 141, 239, .16) 0 7px, transparent 8px),
    linear-gradient(135deg, rgba(232, 230, 220, .22), transparent);
  transform: rotate(-5deg);
  z-index: -1;
}

.page-hero,
.feed-header-inner,
.page-header-inner {
  width: min(100%, 1200px);
  margin-inline: auto;
}

.feed-header-inner,
.page-header-inner {
  max-width: 960px;
  padding: 0;
}

.page-hero .eyebrow,
.feed-eyebrow,
.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: var(--terracotta);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.6;
  text-transform: uppercase;
}

.page-hero .eyebrow::before,
.feed-eyebrow::before,
.page-eyebrow::before {
  content: '';
  width: 18px;
  height: 2px;
  display: block;
  background: var(--terracotta);
  border-radius: 999px;
}

.page-hero h1,
.feed-title,
.page-title {
  max-width: 780px;
  margin: 0 0 14px;
  color: var(--near-black);
  font-family: var(--font-serif);
  font-size: clamp(2.45rem, 6vw, 4rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.1;
}

.page-hero p:not(.eyebrow),
.feed-subtitle,
.page-subtitle {
  max-width: 650px;
  margin: 0;
  color: var(--olive-gray);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.6;
}

.feed-subtitle,
.page-subtitle {
  margin-bottom: 22px;
}

.controls,
.status-bar,
.accounts-grid,
.feed-area,
.publications-grid,
.pub-list {
  width: min(100%, 1200px);
  margin-inline: auto;
}

.controls {
  padding: 28px 24px 24px;
}

.search-wrap {
  max-width: 460px;
}

.search-wrap input,
.search-input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border-warm);
  border-radius: 16px;
  background: rgba(250, 249, 245, .92);
  color: var(--near-black);
  box-shadow: 0 0 0 1px rgba(240, 238, 230, .75), var(--shadow-whisper);
  outline: none;
}

.search-wrap input:focus,
.search-input:focus {
  border-color: var(--focus-blue);
  box-shadow: 0 0 0 3px rgba(56, 152, 236, .16), 0 0 0 1px var(--focus-blue);
}

.search-icon,
.search-wrap svg {
  color: var(--stone-gray);
}

.results-count,
.status-bar {
  color: var(--stone-gray);
  font-size: .84rem;
}

.accounts-grid {
  padding: 0 24px 84px;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 18px;
}

.account-card,
.post-card,
.pub-card {
  background: rgba(250, 249, 245, .90);
  border: 1px solid var(--border-cream);
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(232, 230, 220, .42), var(--shadow-whisper);
}

.account-card {
  padding: 20px;
  gap: 13px;
  min-width: 0;
  width: 100%;
}

.account-card:hover,
.post-card:hover,
.pub-card:hover {
  background: var(--pure-white);
  border-color: var(--border-warm);
  box-shadow: 0 0 0 1px var(--ring-warm), 0 14px 34px rgba(20, 20, 19, .07);
}

.avatar-wrap {
  width: 52px;
  height: 52px;
  border: 1px solid var(--border-warm);
  background: var(--warm-sand);
  box-shadow: inset 0 0 0 2px rgba(250, 249, 245, .7);
}

.avatar-fallback {
  color: var(--terracotta);
  font-family: var(--font-serif);
  font-weight: 500;
}

.card-name,
.post-title,
.feed-empty h3 {
  color: var(--near-black);
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -.012em;
}

.card-name {
  font-size: 1.05rem;
  line-height: 1.18;
}

.card-handle,
.card-bio,
.post-excerpt,
.post-pub-date {
  color: var(--olive-gray);
}

.card-handle,
.post-pub-name,
.post-read-link,
.pub-meta,
.pub-link {
  color: var(--accent);
}

.card-bio {
  font-size: .9rem;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.btn-follow {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--near-black);
  color: var(--ivory);
  box-shadow: 0 0 0 1px var(--dark-surface);
  font-weight: 600;
}

.btn-follow:hover {
  background: var(--dark-surface);
  color: var(--pure-white);
}

.tag-bar {
  gap: 8px;
}

.tag-btn {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px solid #c8c6bc;
  background: #ffffff;
  color: #141413;
  box-shadow: none;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tag-btn:hover {
  border-color: #141413;
  background: #e8e6dc;
  color: #141413;
}

.tag-btn.active,
.tag-btn[aria-pressed="true"] {
  border-color: #141413;
  background: #141413;
  color: #ffffff;
  font-weight: 700;
}

.progress-bar-wrap {
  height: 3px;
  background: var(--border-cream);
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--terracotta), var(--accent));
}

.feed-area {
  padding: 2px 24px 86px;
}

.feed-area #feed-list {
  display: grid;
  gap: 12px;
}

.post-card {
  padding: 20px;
  border-bottom: 1px solid var(--border-cream);
}

.post-card:first-child {
  border-top: 1px solid var(--border-cream);
}

.post-title {
  font-size: 1.18rem;
  line-height: 1.28;
}

.post-pub-logo,
.post-thumb-wrap {
  border: 1px solid var(--border-warm);
  background: var(--warm-sand);
}

.post-thumb-wrap {
  width: 122px;
  height: 88px;
  border-radius: 14px;
}

.post-tag {
  border: 1px solid rgba(201, 100, 66, .22);
  border-radius: 999px;
  background: rgba(201, 100, 66, .08);
  color: var(--terracotta);
}

.share-overlay {
  background: rgba(20, 20, 19, .48);
  backdrop-filter: blur(5px);
}

.share-modal {
  border: 1px solid var(--border-warm);
  border-radius: 20px;
  background: var(--ivory);
  box-shadow: 0 0 0 1px rgba(209, 207, 197, .4), 0 22px 64px rgba(20, 20, 19, .18);
}

.share-modal h2,
.share-modal-title {
  color: var(--near-black);
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
}

.share-url,
.share-modal-url {
  border: 1px solid var(--border-warm);
  border-radius: 12px;
  background: var(--warm-sand);
  color: var(--olive-gray);
}

.share-btn,
.share-action-btn {
  border: 1px solid var(--border-warm);
  border-radius: 14px;
  background: rgba(250, 249, 245, .75);
  color: var(--charcoal-warm);
}

.share-btn:hover,
.share-action-btn:hover {
  background: var(--warm-sand);
  color: var(--near-black);
}

.share-close,
.share-modal-close {
  color: var(--stone-gray);
}

@media (max-width: 1120px) {
  body > .nav-wrap nav {
    grid-template-columns: auto 1fr auto;
    row-gap: 8px;
    padding: 10px 18px 11px;
  }

  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    padding: 2px 0 1px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
  }

  .nav-dropdown {
    display: contents;
  }

  .nav-dropdown > a::after {
    content: none;
  }

  .nav-dropdown-panel {
    display: contents;
    position: static;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-dropdown-panel a {
    min-height: 36px;
    width: auto;
    padding: 0 10px;
    border-radius: 999px;
    scroll-snap-align: start;
  }

  .nav-dropdown-panel a:first-child {
    display: none;
  }

  .nav-links a,
  .nav-links > a,
  .nav-dropdown > a {
    min-height: 36px;
    scroll-snap-align: start;
  }

  .nav-actions {
    justify-self: end;
  }
}

@media (max-width: 760px) {
  :root { --nav-h: 58px; }

  body > .nav-wrap nav {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    padding-inline: 14px;
  }

  .nav-logo {
    font-size: 1.08rem;
  }

  .nav-logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .nav-actions {
    display: none;
  }

  .btn-share {
    width: 38px;
    min-height: 38px;
    justify-self: end;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .btn-share svg {
    width: 16px;
    height: 16px;
  }

  .page-hero,
  .feed-header,
  .page-header {
    width: 100%;
    max-width: 100%;
    padding: 46px 18px 28px;
  }

  .page-hero::before,
  .feed-header::before,
  .page-header::before {
    width: 220px;
    height: 142px;
    inset: 18px -58px auto auto;
  }

  .page-hero h1,
  .feed-title,
  .page-title {
    width: 100%;
    max-width: 100%;
    font-size: clamp(2rem, 11vw, 2.75rem);
    text-wrap: balance;
    overflow-wrap: break-word;
  }

  .page-hero p:not(.eyebrow),
  .feed-subtitle,
  .page-subtitle {
    width: 100%;
    max-width: 100%;
  }

  .controls,
  .accounts-grid,
  .feed-area,
  .status-bar {
    width: 100%;
    max-width: 100%;
    padding-inline: 18px;
  }

  .account-card,
  .post-card,
  .pub-card {
    max-width: 100%;
  }

  .accounts-grid {
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
  }

  .post-card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}
