/* Loud Margins — site.css (v2 dashboard) */

:root {
  --bg:           #f6f3ee;
  --surface:      #ffffff;
  --surface-2:    #f6f3ee;
  --ink:          #1a1a1a;
  --ink-soft:     #555;
  --ink-faint:    #888;
  --ink-ghost:    #aaa;
  --line:         #ece8df;
  --accent:       #ff8a3d;
  --accent-ink:   #1a1a1a;
  --serif:        'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius:       24px;
  --radius-sm:    16px;
  --radius-xs:    12px;
  --shadow-card:  0 1px 2px rgba(0,0,0,0.03), 0 6px 18px rgba(0,0,0,0.04);
  --shadow-lift:  0 2px 4px rgba(0,0,0,0.05), 0 16px 32px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* =========================================
   APP SHELL — sidebar + main
   ========================================= */
.lm-app {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  padding: 18px;
  min-height: 100vh;
  max-width: 1480px;
  margin: 0 auto;
}

/* =========================================
   SIDEBAR
   ========================================= */
.lm-sidebar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 14px;
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: auto;
}

.lm-sidebar__top { display: flex; flex-direction: column; }

.lm-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  margin-bottom: 22px;
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: background 0.18s ease;
}
.lm-profile:hover { background: var(--surface-2); }
.lm-profile__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-weight: 600; font-size: 16px;
  flex-shrink: 0;
}
.lm-profile__name { font-size: 13px; font-weight: 500; line-height: 1.2; }
.lm-profile__role { font-size: 11px; color: var(--ink-faint); }

.lm-sidebar__group { margin-bottom: 18px; }
.lm-sidebar__heading {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-ghost);
  padding: 0 12px;
  margin-bottom: 6px;
}

.lm-sidebar__nav { display: flex; flex-direction: column; gap: 1px; }

.lm-navitem {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}
.lm-navitem:hover { background: var(--surface-2); color: var(--ink); }
.lm-navitem.is-active {
  background: var(--ink);
  color: #fff;
}
.lm-navitem.is-active .lm-navitem__count { color: rgba(255,255,255,0.5); }

.lm-navitem__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lm-navitem__label { flex: 1; }
.lm-navitem__count {
  font-size: 11px;
  color: var(--ink-ghost);
  font-variant-numeric: tabular-nums;
}

/* Light/Dark toggle pill */
.lm-sidebar__bottom { padding-top: 14px; }
.lm-toggle {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 4px;
  display: flex;
  gap: 4px;
}
.lm-toggle__btn {
  flex: 1;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-faint);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.18s, color 0.18s;
}
.lm-toggle__btn:hover { color: var(--ink); }
.lm-toggle__btn.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.lm-toggle__btn:disabled { cursor: not-allowed; opacity: 0.5; }

/* =========================================
   MAIN — top bar + grid
   ========================================= */
.lm-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.lm-topbar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lm-search {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  padding: 9px 14px;
  border-radius: var(--radius-xs);
  color: var(--ink-faint);
}
.lm-search__icon { flex-shrink: 0; }
.lm-search__input {
  background: transparent; border: 0; outline: 0;
  font-family: inherit; font-size: 13px;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}
.lm-search__input::placeholder { color: var(--ink-faint); }

.lm-toggle--sort { padding: 3px; }
.lm-toggle--sort .lm-toggle__btn { padding: 7px 14px; font-size: 12px; }

/* =========================================
   CONTEXT BAR (when filtering)
   ========================================= */
.lm-context {
  display: flex; align-items: center; gap: 14px;
  padding: 4px 8px;
  font-size: 13px;
}
.lm-context__label {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}
.lm-context__count {
  color: var(--ink-faint);
  font-size: 12px;
}
.lm-context__clear {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-faint);
  text-decoration: underline;
}
.lm-context__clear:hover { color: var(--ink); }

/* =========================================
   BENTO GRID
   ========================================= */
.lm-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 200px;
  gap: 14px;
}

/* =========================================
   CARDS — base
   ========================================= */
.lm-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.25, 1),
              box-shadow 0.32s cubic-bezier(0.2, 0.8, 0.25, 1);
  overflow: hidden;
  position: relative;
  will-change: transform;
}
.lm-card:hover, .lm-card:focus-visible {
  transform: translateY(-8px) scale(1.018);
  box-shadow: var(--shadow-lift);
  outline: none;
  z-index: 2;
}
.lm-card:active {
  transform: translateY(-4px) scale(1.005);
  transition-duration: 0.12s;
}

/* Title edges forward slightly on hover for layered feel */
.lm-card__title,
.lm-card__title-hero {
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.25, 1);
}
.lm-card:hover .lm-card__title,
.lm-card:hover .lm-card__title-hero {
  transform: translateY(-2px);
}

.lm-card__head {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.lm-pill {
  display: inline-flex; align-items: center;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(0,0,0,0.05);
  color: var(--ink-soft);
  font-weight: 500;
}
.lm-pill--accent {
  background: var(--accent);
  color: var(--accent-ink);
}
.lm-pill--ghost {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
}
.lm-pill--quiet {
  background: rgba(0,0,0,0.04);
  color: var(--ink-faint);
}
.lm-pill--ext {
  background: rgba(107,140,255,0.15);
  color: #2a48a8;
}

/* Card titles & body */
.lm-card__title {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.22;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}
.lm-card__summary {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}
.lm-card__foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px;
}
.lm-card__meta {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

/* =========================================
   CARD VARIANTS
   ========================================= */

/* HERO — big black card, latest article, spans 4×2 */
.lm-card--hero {
  grid-column: span 4;
  grid-row: span 2;
  background: var(--ink);
  color: #fff;
  padding: 32px;
}
.lm-card--hero:hover { background: #000; }
.lm-card__title-hero {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.08;
  margin: 0 0 14px;
  font-weight: 500;
  letter-spacing: -0.02em;
  max-width: 90%;
}
.lm-card__summary-hero {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255,255,255,0.7);
  margin: 0;
  max-width: 88%;
}
.lm-card__foot-hero {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 24px;
}
.lm-card__meta-hero {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em;
}
.lm-card__cta-hero {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500;
  color: #fff;
}
.lm-card__cta-arrow {
  display: inline-flex;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  align-items: center; justify-content: center;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.25, 1);
}
.lm-card--hero:hover .lm-card__cta-arrow {
  transform: translateX(8px) scale(1.08);
}

/* SIDE — narrow column next to the hero, spans 2×2 */
.lm-card--side {
  grid-column: span 2;
  grid-row: span 2;
}
.lm-card--side .lm-card__title { font-size: 19px; }

/* THIRD — standard card, spans 2×1 */
.lm-card--third {
  grid-column: span 2;
  grid-row: span 1;
}

/* HALF — wider card, spans 3×1 */
.lm-card--half,
.lm-card--half-color {
  grid-column: span 3;
  grid-row: span 1;
}
.lm-card--half-color .lm-card__title { font-size: 19px; }

/* DARK — inverted card */
.lm-card--dark {
  background: var(--ink);
  color: #fff;
}
.lm-card--dark .lm-card__summary { color: rgba(255,255,255,0.65); }
.lm-card--dark .lm-card__meta    { color: rgba(255,255,255,0.45); }
.lm-card--dark .lm-pill          { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }
.lm-card--dark .lm-pill--quiet   { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); }

/* =========================================
   EMPTY STATE
   ========================================= */
.lm-empty {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
}
.lm-empty h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  margin: 0 0 12px;
}
.lm-empty p { color: var(--ink-soft); font-size: 14px; }

/* =========================================
   ARTICLE READER PAGE
   ========================================= */

/* Top nav bar (replaces sidebar/topbar on reader pages) */
.lm-readbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 22px;
  margin: 18px auto;
  max-width: 1480px;
}
.lm-readbar__back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 100px;
  transition: background 0.18s, color 0.18s;
}
.lm-readbar__back:hover { background: var(--ink); color: #fff; }
.lm-readbar__brand {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.lm-readbar__spacer {
  /* keeps the brand visually centered between back and right edge */
  display: inline-block;
  width: 96px;
}

/* Reader column — narrow for readability, no panel container */
.lm-reader {
  max-width: 720px;
  margin: 24px auto 60px;
  padding: 0 28px;
}
.lm-reader__pills {
  display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap;
}
.lm-reader__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 4.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.lm-reader__meta {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.lm-reader__body {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.72;
  color: var(--ink);
}
.lm-reader__body p { margin: 0 0 1.2em; }
.lm-reader__body h1 { font-size: 28px; margin: 1.6em 0 0.6em; font-weight: 500; font-family: var(--serif); letter-spacing: -0.015em; }
.lm-reader__body h2 { font-size: 24px; margin: 1.6em 0 0.6em; font-weight: 500; font-family: var(--serif); }
.lm-reader__body h3 { font-size: 20px; margin: 1.4em 0 0.5em; font-weight: 500; font-family: var(--serif); }
.lm-reader__body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.4em 0;
  padding: 0.2em 0 0.2em 1.2em;
  color: var(--ink-soft);
  font-style: italic;
}
.lm-reader__body a { color: var(--accent); }
.lm-reader__body a:hover { text-decoration: underline; }
.lm-reader__body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 1em 0; }
.lm-reader__body ul, .lm-reader__body ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.lm-reader__body code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
}
.lm-reader__body pre {
  background: var(--surface);
  padding: 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 13px;
  font-family: ui-monospace, monospace;
}
.lm-reader__body pre code { background: transparent; padding: 0; }

.lm-reader__back-bottom {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: none;
  margin-top: 48px;
  padding: 8px 14px;
  background: var(--surface);
  border-radius: 100px;
  transition: background 0.18s, color 0.18s;
}
.lm-reader__back-bottom:hover { background: var(--ink); color: #fff; }

/* =========================================
   AD SLOTS
   ========================================= */
.lm-ad {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  margin: 32px 0;
  text-align: center;
  color: var(--ink-ghost);
}
.lm-ad__label {
  font-size: 10px;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  color: var(--ink-faint);
}
.lm-ad ins { display: block; min-height: 90px; }

/* Inline mid-article ad — softer panel that sits inside the prose */
.lm-ad--inline {
  background: var(--surface);
  margin: 36px 0;
  padding: 18px 22px;
}
.lm-ad--end {
  margin-top: 40px;
  margin-bottom: 0;
}

/* Sponsored card on homepage — looks like a real card */
.lm-card--ad {
  background: var(--surface);
  /* Subtle striped pattern hint (very faint) so it reads as different on closer look,
     but still part of the family. */
  background-image: linear-gradient(
    135deg,
    var(--surface) 0%,
    var(--surface) 49.5%,
    rgba(0,0,0,0.015) 49.5%,
    rgba(0,0,0,0.015) 50.5%,
    var(--surface) 50.5%
  );
  background-size: 18px 18px;
}
.lm-card--ad:hover { transform: none; box-shadow: var(--shadow-card); cursor: default; }
.lm-card__ad-slot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  overflow: hidden;
}
.lm-card__ad-slot ins { width: 100%; min-height: 120px; }

/* =========================================
   FOOTER
   ========================================= */
.lm-footer {
  margin-top: 18px;
  padding: 20px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 1480px;
  margin: 18px auto;
}
.lm-footer__inner {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
  color: var(--ink-faint);
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 8px;
}
.lm-footer__brand {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.lm-footer__links { font-size: 11px; letter-spacing: 0.04em; }
.lm-footer__links a { color: var(--ink-faint); text-decoration: none; margin: 0 4px; }
.lm-footer__links a:hover { color: var(--ink); text-decoration: underline; }

/* =========================================
   STATIC PAGES (about, contact, privacy, terms)
   ========================================= */
.lm-page {
  max-width: 720px;
  margin: 24px auto 60px;
  padding: 0 28px;
}
.lm-page__back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--ink-faint);
  text-decoration: none;
  margin-bottom: 24px;
  padding: 8px 14px;
  background: var(--surface);
  border-radius: 100px;
}
.lm-page__back:hover { background: var(--ink); color: #fff; }
.lm-page__panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px;
}
.lm-page__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.015em;
  margin: 0 0 18px;
}
.lm-page__panel p,
.lm-page__panel ul,
.lm-page__panel ol { margin: 0 0 1em; line-height: 1.65; color: var(--ink-soft); font-size: 15px; }
.lm-page__panel h2 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin: 1.6em 0 0.5em; color: var(--ink); }
.lm-page__panel a { color: var(--accent); }

/* =========================================
   MOBILE
   ========================================= */
@media (max-width: 960px) {
  .lm-app {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }
  .lm-sidebar {
    position: static;
    height: auto;
    padding: 18px 14px;
  }
  .lm-sidebar__bottom { display: none; }
  .lm-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
    gap: 12px;
  }
  .lm-card,
  .lm-card--hero,
  .lm-card--side,
  .lm-card--third,
  .lm-card--half,
  .lm-card--half-color {
    grid-column: span 2;
    grid-row: auto;
    min-height: 160px;
  }
  .lm-card--hero { padding: 24px; }
  .lm-card__title-hero { font-size: 26px; }
  .lm-topbar { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .lm-search { flex: 1 1 100%; }
  .lm-toggle--sort { flex: 1; }
  .lm-reader, .lm-page { padding: 0 16px; }
  .lm-page__panel { padding: 24px; }
  .lm-readbar { margin: 12px; padding: 10px 14px; }
  .lm-readbar__spacer { display: none; }
  .lm-footer__inner { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 540px) {
  .lm-grid { grid-template-columns: 1fr; gap: 10px; }
  .lm-card,
  .lm-card--hero,
  .lm-card--side,
  .lm-card--third,
  .lm-card--half,
  .lm-card--half-color { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .lm-card, .lm-card:hover, .lm-card:active { transform: none !important; transition: none !important; }
  .lm-card__title, .lm-card__title-hero,
  .lm-card:hover .lm-card__title, .lm-card:hover .lm-card__title-hero { transform: none !important; transition: none !important; }
  .lm-card__cta-arrow,
  .lm-card--hero:hover .lm-card__cta-arrow { transform: none !important; transition: none !important; }
}
