/* ── Fonts ────────────────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-v20-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-v20-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-v37-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-v37-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sand:    #f5f0e8;
  --sand-dk: #ece5d6;
  --gold:    #b8902a;
  --gold-lt: #d4a843;
  --ink:     #1a1a1a;
  --muted:   #6b6560;
  --border:  #ddd5c8;
  --white:   #ffffff;
  --radius:  8px;
  --shadow:  0 2px 12px rgba(0,0,0,.08);
  --font-body: 'Inter', system-ui, sans-serif;
  --font-head: 'Lora', Georgia, serif;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.25; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); margin-bottom: .75rem; }
h3 { font-size: 1.1rem; margin-bottom: .5rem; }

/* ── Layout ───────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.main-content { flex: 1; padding: 2rem 0 3rem; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.header-inner {
  display: flex; align-items: center; gap: 2rem;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: .5rem;
  color: var(--ink) !important; text-decoration: none !important;
  font-family: var(--font-body); font-size: 1.05rem;
}
.logo-icon { font-size: 1.4rem; }
.logo-text strong { color: var(--gold); }
.main-nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 1.5rem;
}
.main-nav a {
  color: var(--muted); font-weight: 500; font-size: .9rem;
  padding: .25rem 0; border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--gold); border-color: var(--gold); text-decoration: none;
}
.btn-nav {
  background: var(--gold); color: var(--white) !important;
  padding: .35rem .9rem !important; border-radius: 20px;
  border-bottom: none !important; font-size: .85rem !important;
}
.btn-nav:hover { background: var(--gold-lt) !important; color: var(--white) !important; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* ── Hero / Search ────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--sand) 0%, var(--sand-dk) 100%);
  padding: 4rem 0 3rem;
  text-align: center;
}
.hero h1 { margin-bottom: .5rem; }
.hero p { color: var(--muted); font-size: 1.05rem; margin-bottom: 2rem; }

.search-form {
  display: flex; gap: .5rem; max-width: 560px; margin: 0 auto;
}
.search-form input[type=text] {
  flex: 1;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--white);
}
.search-form input:focus { outline: 2px solid var(--gold); border-color: transparent; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--gold); color: var(--white);
  padding: .75rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; font-size: .9rem; border: none; cursor: pointer;
  transition: background .2s;
}
.btn:hover { background: var(--gold-lt); color: var(--white); text-decoration: none; }
.btn-outline {
  background: transparent; color: var(--gold);
  border: 2px solid var(--gold);
}
.btn-outline:hover { background: var(--gold); color: var(--white); }
.btn-sm { padding: .4rem .8rem; font-size: .82rem; }
.btn-danger { background: #c0392b; }
.btn-danger:hover { background: #e74c3c; }

/* ── Stats bar ────────────────────────────────────────────── */
.stats-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.stats-bar .container {
  display: flex; gap: 2.5rem; justify-content: center; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num { display: block; font-size: 1.6rem; font-weight: 700; color: var(--gold); font-family: var(--font-head); }
.stat-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ── Cards / Grid ─────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: box-shadow .2s, transform .15s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-label {
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); margin-bottom: .4rem;
}
.card-title { font-family: var(--font-head); font-size: 1.15rem; margin-bottom: .3rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--gold); text-decoration: none; }
.card-meta { font-size: .85rem; color: var(--muted); }

/* ── Table ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-top: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead { background: var(--sand); }
th { padding: .65rem .9rem; text-align: left; font-weight: 600; font-size: .8rem;
     text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
     border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: .6rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--sand); }

/* ── Profile Page ─────────────────────────────────────────── */
.profile-header {
  background: var(--sand);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
  margin-bottom: 2rem;
}
.profile-inner { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; }
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--gold); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-family: var(--font-head); flex-shrink: 0;
}
.profile-info h1 { margin-bottom: .25rem; }
.profile-tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.tag {
  display: inline-block; padding: .2rem .65rem;
  background: var(--sand-dk); color: var(--muted);
  border-radius: 20px; font-size: .78rem; font-weight: 500;
}
.tag-gold { background: var(--gold); color: var(--white); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 600px) { .two-col { grid-template-columns: 1fr; } }

.section { margin-bottom: 2.5rem; }
.section-title {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted);
  border-bottom: 1px solid var(--border); padding-bottom: .5rem; margin-bottom: 1rem;
}

/* ── Pedigree ─────────────────────────────────────────────── */
.pedigree { display: flex; gap: 1.5rem; align-items: stretch; flex-wrap: wrap; }
.ped-box {
  flex: 1; min-width: 160px;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
}
.ped-role { font-size: .72rem; font-weight: 700; text-transform: uppercase;
            letter-spacing: .08em; color: var(--muted); margin-bottom: .3rem; }
.ped-name { font-family: var(--font-head); font-size: 1rem; }

/* ── Filter Bar ───────────────────────────────────────────── */
.filter-bar {
  background: var(--sand);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.filter-inner { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: .3rem; }
.filter-group label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.filter-group input, .filter-group select {
  padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .9rem; background: var(--white); min-width: 140px;
}
.filter-group input:focus, .filter-group select:focus { outline: 2px solid var(--gold); border-color: transparent; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-block; padding: .45rem .8rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: .87rem; color: var(--muted);
  transition: background .15s;
}
.pagination a:hover { background: var(--sand); text-decoration: none; }
.pagination .current { background: var(--gold); color: var(--white); border-color: var(--gold); font-weight: 600; }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ── Alert / Messages ─────────────────────────────────────── */
.alert {
  padding: .9rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-size: .9rem;
}
.alert-error { background: #fdf0ee; color: #922b21; border: 1px solid #f5a49a; }
.alert-success { background: #edfaf1; color: #1e7e45; border: 1px solid #a9dfbf; }

/* ── Forms ────────────────────────────────────────────────── */
.form-card {
  max-width: 440px; margin: 3rem auto;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  box-shadow: var(--shadow);
}
.form-card h1 { text-align: center; margin-bottom: 1.5rem; font-size: 1.5rem; }
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: var(--muted); }
.form-group input {
  width: 100%; padding: .65rem .9rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 1rem;
}
.form-group input:focus { outline: 2px solid var(--gold); border-color: transparent; }
.form-card .btn { width: 100%; justify-content: center; margin-top: .5rem; }

/* ── Empty / Result count ─────────────────────────────────── */
.result-info { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }
.empty-state { text-align: center; padding: 3rem 0; color: var(--muted); }
.empty-state p { font-size: 1.1rem; margin-bottom: .5rem; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--sand);
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  margin-top: auto;
}
.footer-inner { display: flex; justify-content: center; font-size: .85rem; color: var(--muted); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 700px) {
  .main-nav { display: none; }
  .main-nav.open { display: flex; flex-direction: column; position: fixed; top: 64px; left: 0; right: 0;
    background: var(--white); padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,.1); gap: .75rem; }
  .nav-toggle { display: block; margin-left: auto; }
  .search-form { flex-direction: column; }
  .stats-bar .container { gap: 1.5rem; }
  .profile-inner { flex-direction: column; }
  .two-col { grid-template-columns: 1fr; }
}
