:root {
  --accent: #0f766e;
  --muted: #6b7280;
  --card: #ffffff;
}

* { box-sizing: border-box; }

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  line-height: 1.5;
  margin: 0;
  background: #f8fafc;
  color: #0f172a;
}

.container {
  max-width: 1060px;
  margin: 32px auto;
  padding: 0 20px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #0369a1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}

h1 { font-size: 20px; margin: 0; }

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 18px;
  font-size: 14px;
}

.hero {
  background: linear-gradient(90deg, rgba(15,118,110,0.06), rgba(3,105,161,0.03));
  padding: 22px;
  border-radius: 12px;
  display: flex;
  gap: 20px;
  align-items: center;
}

.hero .left { flex: 1; }
.hero h2 { margin: 0 0 6px 0; font-size: 22px; }
.hero p { margin: 0; color: var(--muted); }

.cta {
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.searchbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
  position: sticky;
  top: 0;
  background: #f8fafc;
  padding: 10px 0;
  z-index: 10;
}

input[type="search"] {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e6eef6;
}

select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e6eef6;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.card {
  background: var(--card);
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(12,18,31,0.06);
  border: 1px solid rgba(2,6,23,0.04);
  display: flex;
  flex-direction: column;
  word-break: break-word; /* ensures long strings don’t overflow */
}

.card h3 { margin: 0 0 8px 0; font-size: 16px; }
.meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  background: #eef2f7;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #0b1220;
}

.btn {
  align-self: flex-start;
  margin-top: 10px;
  background: var(--accent);
  color: white;
  border: 0;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.details {
  display: none;
  margin-top: 10px;
  border-top: 1px solid #eef2f6;
  padding-top: 10px;
  color: #0b1220;
}

.empty { grid-column: 1/-1; color: var(--muted); }

#categories { margin-top: 20px; }
#categories h3 { margin-bottom: 8px; }
#categoryList .tag { cursor: default; }

.subscribe { margin-top: 22px; }
.subscribe .card p { margin: 6px 0 12px 0; }

footer {
  margin-top: 28px;
  padding: 20px 0;
  color: #6b7280;
  font-size: 13px;
  border-top: 1px solid #eef2f6;
  text-align: center;
}

/* --- Fix for pre/code blocks --- */
.card pre,
.card code {
  white-space: pre-wrap;      /* wrap lines */
  word-break: break-word;     /* break long words/numbers */
  overflow-wrap: anywhere;
  max-width: 100%;
  overflow-x: auto;           /* fallback horizontal scroll */
  background: #f1f5f9;
  padding: 8px;
  border-radius: 8px;
  margin-top: 8px;
}

@media (max-width:640px){
  header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
