:root {
  --text: #161616;
  --text-muted: #767676;
  --bg: #ffffff;
  --border: #e2e2e2;
  --border-strong: #161616;
  --max-width: 1000px;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.25;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--text); }
a:hover { color: var(--text-muted); }

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 24px;
}
.brand {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
}
.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.main-nav a:hover { color: var(--text-muted); }

.main-content { padding: 56px 24px 96px; }

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 40px 0 56px;
}
.hero h1 { font-size: 2.4rem; margin: 0 0 16px; }
.hero p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 32px;
}

.button {
  display: inline-block;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  padding: 12px 28px;
  border: 1px solid var(--border-strong);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.15s ease, color 0.15s ease;
}
.button:hover { background: var(--border-strong); color: var(--bg); }

/* ---- Tag strip ---- */
.tag-strip { margin: 64px 0; }
.tag-strip h2, .hobby-grid-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: var(--font-sans);
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 8px 0 20px;
}
.tag-list a {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 0.85rem;
}
.tag-list a:hover { border-color: var(--border-strong); color: var(--text); }
.tag-description { color: var(--text-muted); }

/* ---- Tag category grouping (public) ---- */
.tag-group-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 16px 0 0;
}
.tag-group-pills { margin: 6px 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--text);
}
.tag-pill:hover { border-color: var(--border-strong); }

/* ---- Hobby grid ---- */
.hobby-grid-section { margin-top: 56px; }
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 40px 32px;
  margin-top: 24px;
}
.hobby-card {
  display: block;
  text-decoration: none;
  color: var(--text);
}
.hobby-card-image {
  aspect-ratio: 16/9;
  background: #f4f4f4;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.hobby-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hobby-card-image-placeholder { width: 100%; height: 100%; background: #f4f4f4; }
.hobby-card-body h3 { margin: 0 0 6px; font-size: 1.15rem; }
.hobby-card:hover .hobby-card-body h3 { text-decoration: underline; }
.hobby-card-body p { margin: 0 0 10px; color: var(--text-muted); font-size: 0.92rem; }
.hobby-card-tags { display: block; }
.hobby-card-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.hobby-card-tag:not(:last-child)::after { content: "\00b7"; margin: 0 6px; }

/* ---- Filter form ---- */
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 32px;
}
.filter-form select, .filter-form input[type="text"] {
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}
.filter-form button {
  padding: 10px 20px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  cursor: pointer;
}
.filter-form button:hover { background: var(--border-strong); color: var(--bg); }

/* ---- Hobby detail ---- */
.hobby-detail-header { margin-bottom: 24px; }
.hobby-detail-tags { margin: 0 0 10px; }
.hobby-detail-tag {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-decoration: none;
}
.hobby-detail-tag:hover { color: var(--text); }
.hobby-detail-tag:not(:last-child)::after { content: "\00b7"; margin: 0 8px; color: var(--border-strong); }
.hobby-detail-header h1 { margin: 4px 0; font-size: 2.1rem; }
.hobby-detail-lede { color: var(--text-muted); font-size: 1.05rem; }
.hobby-detail-hero {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  margin-bottom: 32px;
}
.hobby-detail-section { margin: 48px 0; }
.hobby-detail-section h2,
.link-section h2 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  font-weight: 400;
  margin-bottom: 0;
}
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }

/* ---- Link lists ---- */
.link-section { margin: 48px 0; }
.link-list { list-style: none; padding: 0; margin: 20px 0 0; }
.link-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.link-list a { font-weight: 600; text-decoration: none; }
.link-list a:hover { text-decoration: underline; }
.link-list p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.9rem; }

/* ---- Affiliate items ---- */
.affiliate-disclosure { font-size: 0.85rem; color: var(--text-muted); }
.affiliate-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 32px;
  margin-top: 16px;
}
.affiliate-item-card {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.affiliate-item-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; margin-bottom: 12px; background: #f4f4f4; }
.affiliate-item-card h3 { margin: 0 0 6px; font-size: 1rem; font-family: var(--font-sans); }
.affiliate-item-card p { color: var(--text-muted); font-size: 0.88rem; margin: 0 0 14px; }
.affiliate-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.affiliate-button {
  display: inline-block;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.affiliate-button:hover { background: var(--border-strong); color: var(--bg); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ---- Flash messages ---- */
.flash {
  border: 1px solid var(--border-strong);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 0.92rem;
}
.flash-error { border-width: 2px; }
.flash-error::before { content: "Error — "; font-weight: 600; }

/* ---- Auth ---- */
.auth-page { max-width: 380px; padding-top: 64px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.auth-form input {
  padding: 11px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-sans);
}
.auth-form input:focus, .filter-form select:focus, .filter-form input:focus {
  outline: none;
  border-color: var(--border-strong);
}
.auth-form button {
  padding: 11px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  cursor: pointer;
}
.auth-form button:hover { background: var(--border-strong); color: var(--bg); }

/*
 * Dark mode is a global site setting controlled from the admin panel
 * (Site Settings), not the visitor's OS/browser preference — hence an
 * attribute selector here rather than @media (prefers-color-scheme: dark).
 */
:root[data-theme="dark"] {
  --text: #ededed;
  --text-muted: #9a9a9a;
  --bg: #0d0d0d;
  --border: #2b2b2b;
  --border-strong: #ededed;
}
:root[data-theme="dark"] .hobby-card-image,
:root[data-theme="dark"] .hobby-card-image-placeholder,
:root[data-theme="dark"] .affiliate-item-card img { background: #191919; }

@media (max-width: 640px) {
  .site-header-inner { padding: 20px; }
  .main-content { padding: 40px 20px 72px; }
  .hero h1 { font-size: 1.9rem; }
}
