[x-cloak] { display: none !important; }

/* ─── Sidebar: mobile overlay, desktop static column ─────────────── */
/*
 * On mobile: sidebar starts off-screen (transform), Alpine toggles .sidebar-is-open.
 * On desktop (lg+): no transform applied — sidebar is a normal static flex child.
 * No x-show/x-cloak used to avoid Alpine-vs-CSS conflicts.
 */

@media (max-width: 1023px) {
  /* Mobile: slide in as overlay */
  #feeds-col {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
  }

  #feeds-col.sidebar-is-open {
    transform: translateX(0);
  }
}

@media (min-width: 1024px) {
  /* Desktop: normal flex child; hide when sidebarOpen is false */
  #feeds-col:not(.sidebar-is-open) {
    display: none;
  }

  /* Fixed width for feed column */
  #feed-body {
    width: 400px;
    flex: none;
  }
}

/* ─── Reader pane: mobile full-screen overlay, desktop static column  */
/*
 * On mobile: hidden by default (display:none removes from flex flow),
 *            shown as fixed overlay when .reader-is-open is added.
 * On desktop (lg+): always visible as flex-1 column — no special rules needed.
 */

@media (max-width: 1023px) {
  #reader-pane {
    display: none;
  }

  #reader-pane.reader-is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 70;
    overflow-y: auto;
    animation: slideInRight 0.25s ease-out;
  }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* ─── Reader pane article container ─────────────────────────────── */

.eko-reader-article {
  max-width: 68ch;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

@media (min-width: 1280px) {
  .eko-reader-article {
    max-width: 72ch;
  }
}

@media (min-width: 640px) {
  .eko-reader-article {
    padding: 2.5rem 2rem 4rem;
  }
}

/* ─── Article header ─────────────────────────────────────────────── */

.eko-article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid hsl(var(--border) / 0.5);
}

.eko-article-title {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.025em;
}

@media (min-width: 640px) {
  .eko-article-title {
    font-size: 1.75rem;
  }
}

/* ─── Article body typography ────────────────────────────────────── */

.eko-content {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;

  h1 {
    font-size: 1.75rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
  }
  h2 {
    font-size: 1.375rem;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
  }
  h3 {
    font-size: 1.125rem;
    line-height: 1.4;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.25rem;
  }
  h4 {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 600;
    margin-top: 1.25rem;
  }
  p {
    font-size: 1.0625rem;
    line-height: 1.75;
  }
  p:not(:first-child) {
    margin-top: 1.25rem;
  }
  a {
    font-weight: 500;
    text-decoration-line: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
  }
  img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
  blockquote {
    border-left: 3px solid hsl(var(--border));
    padding-left: 1rem;
    margin-left: 0;
    color: hsl(var(--muted-foreground));
    font-style: italic;
  }
  ul, ol {
    padding-left: 1.5rem;
    margin-top: 1rem;
  }
  li {
    margin-top: 0.375rem;
    line-height: 1.65;
  }
  pre, code {
    font-size: 0.875rem;
  }
  pre {
    background: hsl(var(--muted));
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-top: 1rem;
  }
}

/* ─── Unread dot ─────────────────────────────────────────────────── */

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Text clamping ──────────────────────────────────────────────── */

.clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

@media (min-width: 640px) {
  .sm\:clamp-1 {
    -webkit-line-clamp: 1;
  }
}

/* ─── HTMX loading states ────────────────────────────────────────── */

.htmx-show-on-request {
  display: none;
}
.htmx-request .htmx-show-on-request {
  display: inline-block;
}
.htmx-request .htmx-hide-on-request {
  display: none;
}

/* ─── Auto-fade toast ────────────────────────────────────────────── */

.eko-autofade {
  animation: autofade 5s ease-out forwards;
}
@keyframes autofade {
  0%, 80% { opacity: 1; }
  100%     { opacity: 0; }
}

/* ─── Keyboard-focused entry ─────────────────────────────────────── */

[data-entry-id].eko-focused {
  background-color: hsl(var(--accent));
  outline: 2px solid hsl(var(--primary));
  outline-offset: -2px;
  border-radius: 0.375rem;
}

/* ─── Toast notifications ────────────────────────────────────────── */

.eko-toast {
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-left: 3px solid hsl(var(--primary));
  max-width: 300px;
  min-width: 180px;
}

.eko-toast-success {
  border-left-color: hsl(142 71% 45%);
}

.eko-toast-error {
  border-left-color: hsl(var(--destructive));
}

.eko-toast-warning {
  border-left-color: hsl(38 92% 50%);
}

.eko-toast-info {
  border-left-color: hsl(210 90% 60%);
}

/* ─── Keyboard shortcut keys (empty state) ───────────────────────── */

.eko-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-family: ui-monospace, monospace;
  font-weight: 500;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 0 hsl(var(--border)), 0 1px 3px rgba(0,0,0,0.06);
}
