/* lede: dashboard styles. Mirrors the personal site's design system
   (DESIGN.md in ankitsxchdeva.github.io): ink-plum on lavender paper,
   signal indigo as the one voice, Lato, flat, hairline borders. */

/* ─── Fonts ──────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Lato Regular'), local('Lato-Regular'), url('fonts/lato-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Lato Regular'), local('Lato-Regular'), url('fonts/lato-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Lato Bold'), local('Lato-Bold'), url('fonts/lato-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Lato Bold'), local('Lato-Bold'), url('fonts/lato-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── Theme ──────────────────────────────────────────────────────────────── */
:root {
  --bg: #f5f4fa;
  --fg: #30292f;
  --link: #355691;
  --link-hover: #5F5AA2;
  --muted: #6a6884;
  --border: #d8d6e8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1c22;
    --fg: #e8e4f4;
    --link: #8b87c8;
    --link-hover: #9db8dc;
    --muted: #8e8aab;
    --border: #413F54;
  }
}

/* ─── Base ───────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--fg);
  margin: 0;
}

body {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  animation: fadeIn 0.3s ease;
}

::selection {
  background: var(--link);
  color: var(--bg);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ─── Links ──────────────────────────────────────────────────────────────── */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--link-hover);
  padding-bottom: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='4'%3E%3Cpath d='M0 2 A3 2 0 0 1 6 2 A3 2 0 0 0 12 2' stroke='currentColor' stroke-width='1.2' fill='none'/%3E%3C/svg%3E");
  background-size: 12px 4px;
  background-repeat: repeat-x;
  background-position: 0 100%;
  animation: squiggle 0.3s linear infinite;
}
@keyframes squiggle {
  from { background-position: 0 100%; }
  to   { background-position: 12px 100%; }
}
a:focus-visible {
  outline: 2px solid var(--link-hover);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.main-wrapper {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 2.25em 2em 3em;
}

/* ─── Masthead ───────────────────────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5em;
  flex-wrap: wrap;
}

.masthead-left {
  display: flex;
  align-items: baseline;
  gap: 1.5em;
}

.wordmark {
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin: 0;
}

/* view tabs: quiet labels with the growing 1px underline */
.tabs {
  display: flex;
  gap: 1.1em;
}

.tab {
  background: none;
  border: none;
  padding: 0 0 3px;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}
.tab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: currentColor;
  transition: width 0.25s ease;
}
.tab:hover,
.tab.active { color: var(--fg); }
.tab:hover::after,
.tab.active::after { width: 100%; }
.tab:focus-visible {
  outline: 2px solid var(--link-hover);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ─── Search (top right) ─────────────────────────────────────────────────── */
.search-wrapper {
  position: relative;
  width: min(300px, 100%);
  margin-bottom: 0.2em;
}

#search {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.4em 2.2em 0.4em 0.7em;
  transition: border-color 0.15s ease;
}
#search::placeholder { color: var(--muted); opacity: 0.8; }
#search:hover { border-color: var(--muted); }
#search:focus {
  outline: none;
  border-color: var(--link);
}
#search:focus-visible {
  outline: 2px solid var(--link-hover);
  outline-offset: 2px;
}
#search::-webkit-search-cancel-button { margin-right: 0.25em; }

.search-kbd {
  position: absolute;
  right: 0.7em;
  top: 50%;
  transform: translateY(-50%);
  font-family: monospace;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0 5px;
  pointer-events: none;
}
#search:focus ~ .search-kbd { display: none; }

/* ─── Notices ────────────────────────────────────────────────────────────── */
.notice {
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.5em 0.75em;
  margin: 1.25em 0 0;
}

.empty-state {
  font-size: 15px;
  color: var(--muted);
  margin: 2.5em 0;
  text-align: center;
}

/* ─── Board: one column per source ───────────────────────────────────────── */
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  column-gap: 3em;
  row-gap: 2.25em;
  align-items: start;
  margin-top: 2em;
}

.group-header {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.45em;
}

.group-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0;
}

.group-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.column-empty {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin: 0.8em 0 0;
}

/* ─── Entries: headline + quiet meta row ─────────────────────────────────── */
.entry {
  padding: 0.65em 0;
  border-bottom: 1px solid var(--border);
}

.entry-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
}

.entry-title a { color: var(--fg); }
.entry-title a:hover { color: var(--link-hover); }
.entry.read .entry-title a { color: var(--muted); font-weight: 400; }

.entry-meta {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 11px;
  color: var(--muted);
  margin-top: 0.3em;
}

.entry-domain { opacity: 0.75; }

.new-badge {
  font-size: 10px;
  line-height: 1.6;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0 4px;
}

.save-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  margin-left: auto;
  transition: color 0.15s ease;
}
.save-btn:hover { color: var(--link-hover); }
.save-btn.saved { color: var(--link); }
.save-btn:focus-visible {
  outline: 2px solid var(--link-hover);
  outline-offset: 2px;
  border-radius: 2px;
}

/* entrance: fade in and lift, staggered per entry within a column */
.entry {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.45s ease forwards;
  animation-delay: var(--stagger, 0s);
}
@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* filtering must be instant: no re-entrance on toggle */
.entry.hidden { display: none; }
.group.hidden { display: none; }

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  a:hover { animation: none; }
  .entry {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ─── Small screens ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .main-wrapper { padding: 1.5em 1.25em 3em; }
  .masthead-row { align-items: stretch; }
  .board { margin-top: 1.5em; row-gap: 1.75em; }
}
