/* site/css/style.css — B.I.A.S. Stylesheet
   Calm color palette: warm off-whites, earth tones, sage green accent.
   Typography: Georgia serif for headlines, system sans for body.
   Mobile-responsive at 600px breakpoint.
*/

/* -------------------------------------------------------------------------
   Variables
------------------------------------------------------------------------- */
:root {
  --bg:           #faf9f6;
  --surface:      #ffffff;
  --text:         #2c2c2c;
  --text-muted:   #6b6560;
  --text-faint:   #9a9590;
  --accent:       #4a7c59;
  --accent-dark:  #3a6347;
  --border:       #e8e5df;
  --tag-bg:       #f0ede6;
  --tag-text:     #5a5249;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 3px 8px rgba(0,0,0,0.09);
  --radius:       10px;
}

/* -------------------------------------------------------------------------
   Reset + base
------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* -------------------------------------------------------------------------
   Layout
------------------------------------------------------------------------- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

main { flex: 1; padding: 1.75rem 0 2.5rem; }

/* -------------------------------------------------------------------------
   Header
------------------------------------------------------------------------- */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0 1.25rem;
  text-align: center;
}

.wordmark {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: normal;
  letter-spacing: 0.12em;
  color: var(--text);
  text-decoration: none;
}
.wordmark:hover { text-decoration: none; color: var(--text); }

.site-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  letter-spacing: 0.02em;
}

.site-tagline {
  font-size: 0.78rem;
  color: var(--accent);
  font-style: italic;
  margin-top: 0.15rem;
}

/* -------------------------------------------------------------------------
   Toolbar (search + tag filter — index only)
------------------------------------------------------------------------- */
.toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.search-input {
  flex: 1;
  min-width: 160px;
  padding: 0.38rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.search-input::placeholder { color: var(--text-faint); }
.search-input:focus { border-color: var(--accent); }

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-pill {
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--border);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}
.tag-pill:hover,
.tag-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

/* -------------------------------------------------------------------------
   Result count
------------------------------------------------------------------------- */
.result-count {
  font-size: 0.78rem;
  color: var(--text-faint);
  min-height: 1.2rem;
  margin-bottom: 0.75rem;
}

/* -------------------------------------------------------------------------
   Story card
------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  flex: 1;
}

.card-tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.card-tag:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.card-score {
  font-size: 0.68rem;
  color: var(--text-faint);
  white-space: nowrap;
  padding-top: 0.2rem;
}

.card h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  line-height: 1.4;
  font-weight: normal;
  color: #1a1a1a;
  margin-bottom: 0.65rem;
}

.card-summary {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #3a3835;
  margin-bottom: 1rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-source {
  font-size: 0.77rem;
  color: var(--text-faint);
}
.card-source .source-country {
  color: #bab8b4;
}

.read-link {
  font-size: 0.84rem;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}
.read-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}
.read-link::after { content: " →"; }

/* -------------------------------------------------------------------------
   Empty state
------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 4rem 1rem;
  font-size: 0.92rem;
  line-height: 1.7;
}
.empty-state p + p { margin-top: 0.5rem; }

/* -------------------------------------------------------------------------
   Page header (archive, about)
------------------------------------------------------------------------- */
.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-bottom: 0.4rem;
}
.breadcrumb a { color: var(--accent); }

.page-header h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: normal;
  color: var(--text);
}

/* -------------------------------------------------------------------------
   Archive index
------------------------------------------------------------------------- */
.archive-list {
  list-style: none;
}
.archive-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.archive-list li:last-child { border-bottom: none; }
.archive-list a {
  font-size: 1rem;
  color: var(--text);
}
.archive-list a:hover { color: var(--accent); text-decoration: none; }
.archive-count {
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* -------------------------------------------------------------------------
   About page
------------------------------------------------------------------------- */
.about-content h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: normal;
  color: var(--text);
  margin-bottom: 1rem;
}

.about-content p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #3a3835;
  margin-bottom: 0.9rem;
}

.about-content p:last-child { margin-bottom: 0; }

.about-content .rubric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1rem 0;
  font-size: 0.875rem;
  line-height: 1.8;
  color: #3a3835;
}

.about-content .rubric strong {
  color: var(--accent);
  font-weight: 600;
}

/* -------------------------------------------------------------------------
   AdSense
------------------------------------------------------------------------- */
.ad-container {
  margin: 1.5rem 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.75rem;
}

/* -------------------------------------------------------------------------
   Footer
------------------------------------------------------------------------- */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.1rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-faint);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 0.5rem;
}
footer a:hover { color: var(--accent); text-decoration: none; }
footer .sep { color: var(--border); }

/* -------------------------------------------------------------------------
   Utilities
------------------------------------------------------------------------- */
.hidden { display: none !important; }

/* -------------------------------------------------------------------------
   Responsive
------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .wordmark { font-size: 1.6rem; }

  .toolbar-inner { flex-direction: column; align-items: stretch; }
  .search-input { min-width: 0; }

  .card { padding: 1.1rem; }
  .card h2 { font-size: 1.1rem; }
  .card-footer { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  .page-header h1 { font-size: 1.25rem; }
}
