/* Modern polish for the Glance board */

:root {
  --card-bg: rgba(255, 255, 255, 0.028);
  --card-border: rgba(255, 255, 255, 0.065);
  --muted: hsl(240 8% 62%);
  --row-hover: rgba(255, 255, 255, 0.035);
  --radius: 16px;
}

html { background: hsl(240 14% 6%); }

body,
.body-content {
  background:
    radial-gradient(1100px 520px at 12% -8%, hsl(240 22% 13%) 0%, transparent 60%),
    radial-gradient(900px 480px at 105% 0%, hsl(280 18% 11%) 0%, transparent 55%),
    hsl(240 14% 6%) !important;
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter,
    "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
}

/* Cards: style Glance's own content box instead of wrapping it twice */
.widget-content {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  transition: border-color 160ms ease;
}

.widget-content:hover {
  border-color: rgba(255, 255, 255, 0.11);
}

/* Section titles */
.widget-header {
  margin-bottom: 10px;
}

.widget-header h2,
.widget-header a {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Headlines and links */
.widget-content a {
  color: hsl(240 6% 90%);
  transition: color 120ms ease;
}

.widget-content a:hover {
  color: hsl(38 92% 64%);
}

/* List rows */
.widget-content li {
  padding-block: 6px;
  border-radius: 10px;
  transition: background 120ms ease;
}

.widget-content li:hover {
  background: var(--row-hover);
}

/* Muted metadata */
.widget-content .color-base-60,
.widget-content .size-h5,
.widget-content .color-base-70 {
  color: var(--muted);
}

/* Header: keep the clock/date compact, drop visual noise */
.header-container {
  padding-top: 6px;
}

.header-container h1,
.header-container .size-h2 {
  font-weight: 650;
  letter-spacing: -0.015em;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* Roomier columns on wide screens */
@media (min-width: 1100px) {
  .page-column {
    gap: 18px;
  }
}

@media (max-width: 700px) {
  .widget-content {
    border-radius: 14px;
  }
}

/* ---------- Feed cards (center column) ---------- */
.fx-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.fx-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.fx-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.045);
}

.fx-img {
  aspect-ratio: 16 / 9;
  max-height: 140px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, hsl(240 22% 14%), hsl(285 22% 12%));
}

.fx-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.fx-card:hover .fx-img img {
  transform: scale(1.03);
}

.fx-img span {
  font-size: 2.4rem;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.3;
}

.fx-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 11px 11px;
  min-width: 0;
}

.fx-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.64rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.fx-src {
  color: hsl(38 92% 64%);
  font-weight: 600;
}

.fx-title {
  font-size: 0.86rem;
  font-weight: 620;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: hsl(240 6% 94%);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fx-sum {
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fx-tags:empty {
  display: none;
}

.fx-tags span {
  font-size: 0.62rem;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

/* First card is the featured story */
#fx-all:checked ~ .fx-grid .fx-lead {
  grid-column: 1 / -1;
  flex-direction: row;
}

#fx-all:checked ~ .fx-grid .fx-lead .fx-img {
  width: 42%;
  aspect-ratio: auto;
  max-height: none;
  min-height: 170px;
  flex-shrink: 0;
}

#fx-all:checked ~ .fx-grid .fx-lead .fx-body {
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
}

#fx-all:checked ~ .fx-grid .fx-lead .fx-title {
  font-size: 1.1rem;
  -webkit-line-clamp: 3;
}

#fx-all:checked ~ .fx-grid .fx-lead .fx-sum {
  font-size: 0.8rem;
  -webkit-line-clamp: 3;
}

@media (max-width: 1250px) {
  .fx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .fx-grid { grid-template-columns: 1fr; }
  #fx-all:checked ~ .fx-grid .fx-lead { flex-direction: column; }
  #fx-all:checked ~ .fx-grid .fx-lead .fx-img { width: 100%; aspect-ratio: 16 / 9; min-height: 0; }
}

/* ---------- Product Hunt compact list ---------- */
.ph-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ph-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px;
  border-radius: 10px;
  text-decoration: none;
}

.ph-row:hover {
  background: var(--row-hover);
}

.ph-ico {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.ph-name {
  font-size: 0.86rem;
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ph-list li { padding-block: 0; }
.ph-list li:hover { background: none; }

/* Product Hunt: name + one-line tagline */
.ph-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ph-tag {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-row { align-items: center; }

/* ---------- Single tabbed panel ---------- */
.me-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.me-h { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
@media (max-width: 900px) { .me-grid { grid-template-columns: 1fr; } }
.ph-wide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
@media (max-width: 900px) { .ph-wide { grid-template-columns: 1fr; } }


/* ---------- Topic filter (CSS-only) ---------- */
.fx-r { position: absolute; opacity: 0; pointer-events: none; }

.fx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.fx-chips label {
  cursor: pointer;
  user-select: none;
  font-size: 0.78rem;
  font-weight: 560;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--muted);
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.fx-chips label:hover { color: hsl(240 6% 90%); border-color: rgba(255,255,255,0.14); }

#fx-all:checked ~ .fx-chips label[for="fx-all"],
#fx-ai:checked ~ .fx-chips label[for="fx-ai"],
#fx-founder:checked ~ .fx-chips label[for="fx-founder"],
#fx-dd:checked ~ .fx-chips label[for="fx-dd"] {
  background: hsl(38 92% 62%);
  border-color: hsl(38 92% 62%);
  color: hsl(240 14% 8%);
}

#fx-all:checked ~ .fx-grid .fx-card:not([data-home="1"]),
#fx-ai:checked ~ .fx-grid .fx-card:not([data-cat="ai"]),
#fx-founder:checked ~ .fx-grid .fx-card:not([data-cat="founder"]),
#fx-dd:checked ~ .fx-grid .fx-card:not([data-cat="dd"]) {
  display: none;
}

/* right-column "Mine" list */
.me-sec { margin-bottom: 14px; }

/* feed panel sits directly on the page (no box around chips + cards) */
.widget-content:has(.fx-wrap) { border: none; padding: 0; background: none; }

/* side columns: tighter, smaller list text */
.page-column-small .widget-content a.size-title-dynamic,
.page-column-small .widget-content .size-title-dynamic,
.page-column-small .widget-type-rss a {
  font-size: 0.88rem;
  line-height: 1.35;
}
.page-column-small .widget-type-rss li { padding-block: 3px; }
.page-column-small .widget-type-rss .list-horizontal-text { font-size: 0.72rem; }
