/* Gloss - Blog Platform */

:root,
[data-theme="light"] {
  --bg: #f2f1ef;
  --surface: #ffffff;
  --green: #1a3a2a;
  --green-mid: #2d5a3d;
  --green-soft: #e8ede9;
  --coral: #c4674a;
  --coral-soft: #f5ede9;
  --text: #1a1a18;
  --text-muted: #6b6b67;
  --text-light: #9b9b97;
  --border: #e2e0dc;
  --tag-bg: #efefed;
}

[data-theme="dark"] {
  --bg: #131311;
  --surface: #1e1e1c;
  --green: #3a7a50;
  --green-mid: #6aad7a;
  --green-soft: #1c2e22;
  --coral: #e09878;
  --coral-soft: #2e2119;
  --text: #ededea;
  --text-muted: #b0b0ab;
  --text-light: #8a8a85;
  --border: #353532;
  --tag-bg: #2a2a27;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--text);
  text-decoration: none;
}

.nav-logo-mark {
  width: 22px;
  height: 22px;
  background: var(--green);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-logo-mark svg { width: 12px; height: 12px; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: var(--green);
  color: #fff !important;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px !important;
  letter-spacing: 0.04em;
  transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--green-mid) !important; color: #fff !important; }

.nav-user {
  font-family: 'DM Mono', monospace;
  font-size: 11px !important;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-muted); }

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* HERO HEADER */
.blog-header {
  padding: 72px 40px 48px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.blog-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(48px, 6vw, 80px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--text);
}

.blog-title em {
  font-style: italic;
  color: var(--green-mid);
}

.search-wrap { flex-shrink: 0; }

.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 10px 18px;
  gap: 10px;
  width: 240px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(45,90,61,0.08);
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text);
  width: 100%;
}

.search-box input::placeholder { color: var(--text-light); }
.search-icon { color: var(--text-light); flex-shrink: 0; }

/* FILTERS */
.filters {
  padding: 0 40px 36px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
  display: inline-block;
}

.filter-pill:hover {
  border-color: var(--green-mid);
  color: var(--green-mid);
}

.filter-pill.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* FEATURED POST */
.featured-wrap {
  padding: 0 40px 48px;
  max-width: 1200px;
  margin: 0 auto;
}

a.featured-card {
  text-decoration: none;
  color: inherit;
}

.featured-card {
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 380px;
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s ease forwards;
  animation-delay: 0.1s;
  transition: box-shadow 0.3s;
}

.featured-card:hover {
  box-shadow: 0 16px 48px rgba(26,26,24,0.1);
}

.featured-img {
  position: relative;
  overflow: hidden;
}

.grad-teal { background: linear-gradient(135deg, #0a2a35 0%, #1a5a6a 50%, #2a9a8a 100%); }
.grad-purple { background: linear-gradient(135deg, #2a1a3a 0%, #5a3a7a 50%, #8a5ab0 100%); }
.grad-slate { background: linear-gradient(135deg, #1a2a3a 0%, #2a4a6a 50%, #4a7aaa 100%); }
.grad-green { background: linear-gradient(135deg, #1a3a2a 0%, #2d5a3d 50%, #4a8a5a 100%); }
.grad-warm { background: linear-gradient(135deg, #3a1a1a 0%, #7a3a2a 50%, #c4674a 100%); }
.grad-gold { background: linear-gradient(135deg, #2a2010 0%, #6a5020 50%, #c0962a 100%); }

.featured-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.6;
}

.blob1 {
  width: 200px; height: 200px;
  background: rgba(196,103,74,0.5);
  top: -40px; left: -40px;
}

.blob2 {
  width: 150px; height: 150px;
  background: rgba(122,191,138,0.5);
  bottom: 20px; right: 20px;
}

.featured-img-label {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 2;
}

.featured-img-label .eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
}

.featured-img-label .name {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: #fff;
  line-height: 1.2;
}

.featured-content {
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 10px;
  background: var(--tag-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
}

.tag.green { background: var(--green-soft); color: var(--green-mid); border-color: rgba(45,90,61,0.15); }
.tag.coral { background: var(--coral-soft); color: var(--coral); border-color: rgba(196,103,74,0.15); }

.meta-date {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.04em;
}

.featured-content h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 16px;
}

.featured-content p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.featured-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.author-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatars { display: flex; }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
}

.avatar:not(:first-child) { margin-left: -8px; }
.av1 { background: var(--green); }
.av2 { background: var(--coral); }

.author-name {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.read-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-mid);
  text-decoration: none;
  transition: gap 0.2s;
}
.read-link:hover { gap: 10px; }

/* GRID */
.grid-wrap {
  padding: 0 40px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

a.card {
  text-decoration: none;
  color: inherit;
}

.card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.22s, box-shadow 0.22s;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.5s ease forwards;
}

.card.ad-card {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: default;
  min-height: 250px;
}
.card.ad-card.ad-loaded {
  display: flex;
}
.card.ad-card:hover {
  transform: none;
  box-shadow: none;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(26,26,24,0.08);
}

.card-img {
  height: 180px;
  position: relative;
  overflow: hidden;
}

.card-img-inner {
  width: 100%;
  height: 100%;
  transition: transform 0.4s;
}

.card:hover .card-img-inner { transform: scale(1.04); }

.card-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.5;
}

.cb1 { width: 120px; height: 120px; background: rgba(255,255,255,0.15); top: -20px; right: -20px; }
.cb2 { width: 80px; height: 80px; background: rgba(196,103,74,0.4); bottom: 10px; left: 10px; }

.card-body { padding: 22px 24px 24px; }

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 10px;
}

.card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.read-time {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-light);
  letter-spacing: 0.06em;
}

.card-link {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-mid);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}
.card-link:hover { gap: 8px; }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 16px;
}
.empty-state a {
  color: var(--green-mid);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ANIMATIONS */
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

footer p {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.06em;
}

footer nav {
  position: static;
  backdrop-filter: none;
  border: none;
  background: transparent;
  height: auto;
  padding: 0;
  gap: 24px;
  display: flex;
}

footer nav a {
  font-size: 11px;
  color: var(--text-light);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
}
footer nav a:hover { color: var(--text); }

/* DARK MODE OVERRIDES */
[data-theme="dark"] .featured-card:hover {
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
[data-theme="dark"] .card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
[data-theme="dark"] .tag.green {
  border-color: rgba(106,173,122,0.2);
}
[data-theme="dark"] .tag.coral {
  border-color: rgba(224,152,120,0.2);
}
[data-theme="dark"] .search-box input {
  color: var(--text);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .featured-card { grid-template-columns: 1fr; }
  .featured-img { min-height: 200px; }
}

@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  nav { padding: 0 20px; }
  .blog-header { padding: 48px 20px 32px; flex-direction: column; align-items: flex-start; }
  .filters { padding: 0 20px 24px; }
  .featured-wrap { padding: 0 20px 36px; }
  .grid-wrap { padding: 0 20px 60px; }
  footer { padding: 20px; }
  .featured-content { padding: 24px; }
}
