/* Arctander Online — stylesheet */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
    --navy:       #1B3A5E;
    --gold:       #B8935F;
    --gold-light: #D4A97A;
    --cream:      #FAF7F2;
    --paper:      #F5F0E8;
    --text:       #2C2C2C;
    --text-light: #666;
    --border:     #DDD5C8;
    --white:      #FFFFFF;
    --green:      #2E7D4F;
    --amber:      #C47A1A;
    --red:        #9E2A2B;
    --font:       Georgia, 'Times New Roman', serif;
    --font-ui:    -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius:     4px;
    --shadow:     0 1px 3px rgba(0,0,0,0.08);
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--font-ui); color: var(--text); background: var(--cream); line-height: 1.6; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold); }
ul { list-style: none; }
input, select, button { font-family: var(--font-ui); font-size: 1rem; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
    background: var(--navy);
    padding: 0.9rem 0;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: baseline; gap: 0; }
.logo-main { font-family: var(--font); font-size: 1.5rem; color: var(--white); font-weight: normal; }
.logo-sub  { font-family: var(--font-ui); font-size: 0.75rem; color: var(--gold); letter-spacing: 0.1em; text-transform: uppercase; margin-left: 0.3rem; }
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a { color: rgba(255,255,255,0.8); font-size: 0.9rem; letter-spacing: 0.03em; }
.site-nav a:hover { color: var(--gold-light); }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer { background: var(--navy); padding: 1.5rem 0; margin-top: 4rem; }
.site-footer p { color: rgba(255,255,255,0.5); font-size: 0.8rem; text-align: center; }
.site-footer em { color: rgba(255,255,255,0.7); }

/* ── Main ───────────────────────────────────────────────────────────────────── */
.site-main { padding: 2rem 0; min-height: calc(100vh - 200px); }

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 3rem 0 2rem; }
.hero h1 { font-family: var(--font); font-size: 2.2rem; color: var(--navy); font-weight: normal; margin-bottom: 0.75rem; }
.hero-sub { color: var(--text-light); font-size: 1.05rem; margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-search { display: flex; max-width: 560px; margin: 0 auto; gap: 0; }
.hero-search input { flex: 1; padding: 0.75rem 1rem; border: 2px solid var(--border); border-right: none; border-radius: var(--radius) 0 0 var(--radius); font-size: 1rem; background: var(--white); }
.hero-search input:focus { outline: none; border-color: var(--navy); }
.hero-search button { padding: 0.75rem 1.5rem; background: var(--navy); color: var(--white); border: none; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; font-size: 1rem; }
.hero-search button:hover { background: var(--gold); }

/* ── Stats row ──────────────────────────────────────────────────────────────── */
.stats-row { display: flex; justify-content: center; gap: 3rem; padding: 2rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 2rem 0; }
.stat { text-align: center; }
.stat-number { display: block; font-family: var(--font); font-size: 2.5rem; color: var(--navy); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.08em; }

/* ── Browse entry ───────────────────────────────────────────────────────────── */
.browse-entry { margin: 2rem 0; }
.browse-entry h2 { font-family: var(--font); font-size: 1.3rem; color: var(--navy); font-weight: normal; margin-bottom: 1rem; }
.browse-link { color: var(--gold); font-size: 0.9rem; }

/* ── Chip cloud ─────────────────────────────────────────────────────────────── */
.chip-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip-cloud--small .chip { font-size: 0.8rem; padding: 0.25rem 0.6rem; }
.chip { display: inline-block; padding: 0.35rem 0.75rem; background: var(--paper); border: 1px solid var(--border); border-radius: 2rem; font-size: 0.85rem; color: var(--text); transition: all 0.15s; cursor: pointer; }
.chip:hover, .chip--active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.chip-count { font-size: 0.75em; opacity: 0.7; margin-left: 0.25rem; }

/* ── Tags ───────────────────────────────────────────────────────────────────── */
.tag { display: inline-block; padding: 0.2rem 0.5rem; border-radius: var(--radius); font-size: 0.75rem; font-weight: 500; }
.tag--small { font-size: 0.7rem; }
.tag-type { background: #E8EEF5; color: var(--navy); }
.tag-odour { background: #F0EBE0; color: #5C4A2A; }
.tag-avail--readily_available { background: #E6F4EA; color: #1B5E20; }
.tag-avail--available_limited_quantities { background: #FFF8E1; color: #6D4C00; }
.tag-avail--irregular_rare { background: #FFF3E0; color: #8D4E00; }
.tag-avail--on_order_only { background: #E8EAF6; color: #283593; }
.tag-avail--not_commercial { background: #FCE4EC; color: #880E4F; }
.tag-avail--historical_obsolete { background: #ECEFF1; color: #455A64; }

/* ── Search page ────────────────────────────────────────────────────────────── */
.search-bar-wrap { background: var(--white); padding: 1.25rem; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.5rem; border: 1px solid var(--border); }
.search-bar { display: flex; gap: 0; margin-bottom: 0.75rem; }
.search-bar input { flex: 1; padding: 0.65rem 1rem; border: 1px solid var(--border); border-right: none; border-radius: var(--radius) 0 0 var(--radius); }
.search-bar input:focus { outline: none; border-color: var(--navy); }
.search-bar button { padding: 0.65rem 1.25rem; background: var(--navy); color: var(--white); border: none; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
.search-bar button:hover { background: var(--gold); }
.filter-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.filter-row select, .filter-row input[type="text"] { padding: 0.45rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; background: var(--white); color: var(--text); flex: 1; min-width: 140px; }
.filter-row select:focus, .filter-row input:focus { outline: none; border-color: var(--navy); }

/* ── Results ────────────────────────────────────────────────────────────────── */
.results-header { margin-bottom: 1rem; }
.results-count { color: var(--text-light); font-size: 0.9rem; }
.no-results { color: var(--text-light); font-style: italic; }
.results-list { display: flex; flex-direction: column; gap: 0.75rem; }
.result-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; display: block; transition: box-shadow 0.15s, border-color 0.15s; }
.result-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); border-color: var(--gold); color: var(--text); }
.result-main { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.4rem; }
.result-name { font-family: var(--font); font-size: 1.1rem; color: var(--navy); font-weight: normal; }
.result-organism { font-size: 0.8rem; color: var(--text-light); font-style: italic; }
.result-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.result-desc { font-size: 0.85rem; color: var(--text-light); line-height: 1.5; }

/* ── Pagination ─────────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-top: 2rem; }
.page-btn { padding: 0.5rem 1rem; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); color: var(--navy); }
.page-btn:hover { background: var(--navy); color: var(--white); }
.page-info { color: var(--text-light); font-size: 0.9rem; }

/* ── Material detail ────────────────────────────────────────────────────────── */
.material-page { }
.material-header { padding: 1.5rem 0 1rem; border-bottom: 2px solid var(--gold); margin-bottom: 2rem; }
.breadcrumb { font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.5rem; }
.breadcrumb a { color: var(--gold); }
.material-header h1 { font-family: var(--font); font-size: 2rem; color: var(--navy); font-weight: normal; margin-bottom: 0.35rem; }
.organism { font-style: italic; color: var(--text-light); margin-bottom: 0.75rem; }
.family { font-style: normal; }
.material-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.material-body { display: grid; grid-template-columns: 280px 1fr; gap: 2.5rem; align-items: start; }

/* Sidebar */
.material-sidebar { position: sticky; top: 5rem; }
.sidebar-section { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; }
.sidebar-section h4 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-light); margin-bottom: 0.5rem; font-weight: 600; font-family: var(--font-ui); }
.sidebar-section p { font-size: 0.9rem; }
.plain-list li { font-size: 0.9rem; padding: 0.15rem 0; }
.plain-list a { color: var(--navy); }
.plain-list a:hover { color: var(--gold); }
.group-link { display: block; font-size: 0.85rem; color: var(--navy); padding: 0.2rem 0; }
.group-link:hover { color: var(--gold); }
.small-text { font-size: 0.8rem; color: var(--text-light); line-height: 1.5; }

/* Content */
.material-content { }
.content-section { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.content-section:last-child { border-bottom: none; }
.content-section h2 { font-family: var(--font); font-size: 1.2rem; color: var(--navy); font-weight: normal; margin-bottom: 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--gold); display: inline-block; }
.arctander-prose { font-family: var(--font); font-size: 1rem; line-height: 1.8; color: var(--text); }

/* Blend list */
.blend-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.blend-partner { display: inline-block; padding: 0.3rem 0.7rem; border-radius: 2rem; font-size: 0.85rem; }
.blend-partner--linked { background: #E8EEF5; color: var(--navy); border: 1px solid #C5D3E8; }
.blend-partner--linked:hover { background: var(--navy); color: var(--white); }
.blend-partner--unlinked { background: var(--paper); color: var(--text-light); border: 1px dashed var(--border); }

/* Adulterants */
.adulterant-list { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; }
.adulterant-list li { background: #FFF8E1; color: #6D4C00; border: 1px solid #FFE0A0; border-radius: var(--radius); padding: 0.25rem 0.6rem; font-size: 0.85rem; }

/* Raw text */
.content-section--raw details { }
.content-section--raw summary { cursor: pointer; color: var(--text-light); font-size: 0.85rem; padding: 0.5rem 0; }
.raw-text { font-family: var(--font); font-size: 0.9rem; line-height: 1.8; color: var(--text); margin-top: 1rem; white-space: pre-wrap; background: var(--paper); padding: 1.25rem; border-radius: var(--radius); border: 1px solid var(--border); max-height: 500px; overflow-y: auto; }

/* ── Browse ──────────────────────────────────────────────────────────────────── */
.browse-page h1 { font-family: var(--font); font-size: 1.8rem; color: var(--navy); font-weight: normal; margin-bottom: 1.5rem; }
.browse-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.browse-tab { padding: 0.6rem 1.25rem; font-size: 0.9rem; color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.browse-tab.active, .browse-tab:hover { color: var(--navy); border-bottom-color: var(--gold); }
.alphabet-nav { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 1.5rem; }
.alpha-link { display: inline-block; width: 2.2rem; height: 2.2rem; line-height: 2.2rem; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; color: var(--text); background: var(--white); }
.alpha-link.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.alpha-link:hover { border-color: var(--gold); color: var(--gold); }
.browse-list { display: flex; flex-direction: column; }
.browse-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.browse-item:hover { background: var(--paper); }
.browse-name { color: var(--navy); font-weight: 500; min-width: 220px; }
.browse-organism { color: var(--text-light); font-size: 0.85rem; font-style: italic; flex: 1; }

/* Group grid */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; margin-bottom: 2rem; }
.group-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.25rem; transition: all 0.15s; }
.group-card:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.group-number { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-light); }
.group-desc { font-size: 0.9rem; color: var(--navy); font-weight: 500; }
.group-count { font-size: 0.8rem; color: var(--text-light); }

/* Origin cloud */
.origin-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }

/* ── Group page ──────────────────────────────────────────────────────────────── */
.group-page { }
.group-header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 2px solid var(--gold); }
.group-header h1 { font-family: var(--font); font-size: 1.8rem; color: var(--navy); font-weight: normal; }
.group-description { font-style: italic; color: var(--text-light); font-size: 1.05rem; margin-top: 0.25rem; }
.group-materials h3, .related-groups h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-light); margin-bottom: 0.75rem; font-weight: 600; }
.related-groups { margin-bottom: 1.5rem; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .material-body { grid-template-columns: 1fr; }
    .material-sidebar { position: static; }
    .stats-row { gap: 1.5rem; }
    .stat-number { font-size: 1.8rem; }
    .filter-row { flex-direction: column; }
    .filter-row select, .filter-row input { min-width: 100%; }
    .hero h1 { font-size: 1.6rem; }
}
