/* Toy Australian Shepherd World Database */
:root {
  --blue: #1d6fa5; --blue-dark: #0d3b5e; --blue-light: #e3eef6;
  --gold: #c9a227; --gold-light: #f4ead0;
  --bg: #f6f4ef; --card: #ffffff; --ink: #2b3947; --muted: #77869a;
  --line: #e4e0d6; --red: #b03a2e; --green: #3e7d4f;
  --radius: 14px; --shadow: 0 2px 10px rgba(20,40,60,.08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15.5px; line-height: 1.55;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); color: var(--blue-dark); line-height: 1.25; }
h1 { font-size: 1.9rem; margin: .2em 0 .5em; }
h2 { font-size: 1.35rem; margin: 1.4em 0 .5em; border-bottom: 2px solid var(--gold-light); padding-bottom: .25em;}
h3 { font-size: 1.1rem; margin: 1.2em 0 .4em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

/* ---------- header ---------- */
.topbar { background: var(--blue-dark); color: #fff; font-size: .85rem; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; padding: 6px 18px; flex-wrap: wrap; gap: 6px;}
.langs a { color: #cfe3f2; margin-inline-start: 12px; white-space: nowrap; }
.langs a.on { color: var(--gold); font-weight: 700; border-bottom: 2px solid var(--gold); }
header.hero {
  background: linear-gradient(rgba(13,59,94,.55), rgba(13,59,94,.25)), url("/static/img/hero.jpg") center 38%/cover no-repeat;
  color: #fff; padding: 0;
}
header.hero .wrap { padding-top: 26px; padding-bottom: 0; }
.brandbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brandbar img.logo { width: 62px; height: 62px; border-radius: 50%; background:#fff; padding:2px; box-shadow: var(--shadow);}
.brandbar .brand h1 { color: #fff; margin: 0; font-size: 1.65rem; text-shadow: 0 2px 8px rgba(0,0,0,.45); }
.brandbar .brand .tag { color: #ffe9a8; font-style: italic; font-family: var(--serif); text-shadow: 0 1px 6px rgba(0,0,0,.5); }
nav.main { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 2px; }
nav.main a {
  color: #fff; padding: 9px 16px; border-radius: 10px 10px 0 0; font-weight: 600; font-size: .93rem;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
nav.main a:hover, nav.main a.on { background: var(--bg); color: var(--blue-dark); text-decoration: none; }
.searchform { margin-inline-start: auto; display: flex; gap: 6px; align-items:center; padding: 8px 0; }
.searchform input {
  border: none; border-radius: 20px; padding: 8px 16px; min-width: 210px; font-size: .9rem;
}
.searchform button {
  border: none; background: var(--gold); color: #3a2c00; font-weight: 700; border-radius: 20px;
  padding: 8px 18px; cursor: pointer;
}
.searchform button:hover { filter: brightness(1.07); }

/* ---------- layout blocks ---------- */
.cols { display: grid; grid-template-columns: 2.2fr 1fr; gap: 22px; margin: 24px 0; }
.cols > .main, .cols > .side { min-width: 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px;
}
.card h2, .card h3 { margin-top: 0; }

/* ---------- hero welcome ---------- */
.welcome { padding: 26px 26px 30px; }
.welcome h2 { border: none; margin: 0 0 .4em; font-size: 1.6rem; }
.btn {
  display: inline-block; background: var(--gold); color: #3a2c00 !important; font-weight: 700;
  padding: 10px 22px; border-radius: 24px; text-decoration: none; border: none; cursor: pointer; font-size: .95rem;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.blue { background: var(--blue); color: #fff !important; }
.btn.ghost { background: transparent; border: 2px solid var(--blue); color: var(--blue) !important; padding: 8px 20px; }

/* ---------- dog grids / lists ---------- */
.doggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 16px; }
.dogcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; display: flex; flex-direction: column;
}
.dogcard:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(20,40,60,.14); text-decoration:none; }
.dogcard img.ph { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--blue-light); }
.dogcard .body { padding: 10px 13px 13px; }
.dogcard .name { font-weight: 700; color: var(--blue-dark); line-height: 1.3; }
.dogcard .meta { font-size: .84rem; color: var(--muted); margin-top: 4px; }
.dogcard .badges { padding: 0 13px 12px; display: flex; flex-wrap: wrap; gap: 5px; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 12px; padding: 2px 9px;
  background: var(--blue-light); color: var(--blue-dark); border: 1px solid #c5d9e8; white-space: nowrap;
}
.badge.gold { background: var(--gold-light); color: #7a5c00; border-color: #e2cf96; }
.badge.red { background: #f9e3e0; color: var(--red); border-color: #eac2bc; }
.badge.green { background: #e2f0e6; color: var(--green); border-color: #bcdcc5; }
.sexicon { font-weight: 700; }
.sexicon.male { color: var(--blue); }
.sexicon.female { color: #b05a7e; }

/* ---------- dog page ---------- */
.doghead { display: grid; grid-template-columns: 330px 1fr; gap: 22px; align-items: start; }
.doghead .photo img { border-radius: var(--radius); border: 1px solid var(--line); width: 100%; }
.dtable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.dtable th { text-align: start; color: var(--muted); font-weight: 600; padding: 5px 10px 5px 0; width: 34%; vertical-align: top; }
.dtable td { padding: 5px 0; }
h1.dogname { margin-bottom: .1em; }
.callname { font-style: italic; color: var(--gold); font-family: var(--serif); font-size: 1.15rem; margin-bottom: .4em; }
.titlechips { margin: .4em 0 .8em; display: flex; flex-wrap: wrap; gap: 5px; }

/* health table */
.health { width: 100%; border-collapse: collapse; font-size: .9rem; }
.health th, .health td { border: 1px solid var(--line); padding: 8px 10px; text-align: start; vertical-align: top; }
.health th { background: var(--blue-light); color: var(--blue-dark); }
.health td.res { font-weight: 700; white-space: nowrap; }
.pos { color: var(--green); }
.carr { color: #a06a00; }
.aff { color: var(--red); }
.progressbar { background: #e8e2d4; border-radius: 10px; height: 12px; width: 160px; display: inline-block; vertical-align: middle; overflow: hidden;}
.progressbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #e0b83c); }

/* pedigree tree */
.pedtree { overflow-x: auto; padding: 6px 0; }
.pedrow { display: flex; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.pedcell {
  background: #fbfaf6; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  min-width: 205px; flex: 1; font-size: .88rem;
}
.pedcell.same { background: #fffbea; border-color: #e2cf96; }
.pedcell b a { color: var(--blue-dark); }
.pedcell .p { color: var(--muted); font-size: .8rem; }
.pedcell .gen { font-size: .72rem; color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .4px;}
.pedphoto { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; float: inline-end; margin-inline-start: 8px; border: 1px solid var(--line);}

/* tables generic */
table.list { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.list th, table.list td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: start; vertical-align: middle;}
table.list th { color: var(--blue-dark); background: var(--blue-light); font-size: .85rem; text-transform: uppercase; letter-spacing: .3px;}
table.list tr:hover td { background: #faf8f3; }

/* alphabet pager */
.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0; }
.az a, .az span.cur {
  min-width: 30px; text-align: center; padding: 4px 7px; border-radius: 8px; background: #fff;
  border: 1px solid var(--line); font-weight: 600; font-size: .9rem;
}
.az span.cur { background: var(--blue-dark); color: #fff; border-color: var(--blue-dark); }
.az a:hover { background: var(--blue-light); text-decoration: none; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); gap: 3px; }
.filters select, .filters input, .styled {
  border: 1px solid #cfd8e0; border-radius: 9px; padding: 8px 10px; font-size: .92rem; background: #fff; color: var(--ink);
}
.filters .apply { background: var(--blue); color: #fff; border: none; border-radius: 9px; padding: 9px 18px; font-weight: 700; cursor: pointer; }

.pager { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0; }
.pager a, .pager span.cur { padding: 6px 12px; background: #fff; border: 1px solid var(--line); border-radius: 9px; font-weight: 600; }
.pager span.cur { background: var(--gold); border-color: var(--gold); color: #3a2c00; }
.pager a:hover { background: var(--blue-light); text-decoration: none; }

/* litter blocks */
.litter { border: 1px dashed #d5cdbc; border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; background: #fcfbf7; }
.litter .lm { color: var(--muted); font-size: .88rem; margin-bottom: 6px; }

/* photos strip */
.albumstrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; }
.albumstrip img { border-radius: 9px; border: 1px solid var(--line); aspect-ratio: 1; object-fit: cover; width: 100%; cursor: zoom-in; }

/* sale cards */
.salecard { display: grid; grid-template-columns: 230px 1fr; gap: 18px; }
.salecard img { border-radius: 12px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.price { font-size: 1.25rem; font-weight: 800; color: var(--green); }
.sireline { font-size: .88rem; color: var(--muted); margin: 2px 0; }

/* kennel */
.kennelcard { display: flex; gap: 16px; align-items: flex-start; }
.kennelcard img { width: 74px; height: 74px; border-radius: 14px; border: 1px solid var(--line); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat { background: var(--blue-light); border-radius: 12px; text-align: center; padding: 14px 8px; }
.stat b { display: block; font-size: 1.45rem; color: var(--blue-dark); font-family: var(--serif); }
.stat span { font-size: .8rem; color: var(--muted); }

/* news */
.newsitem { border-inline-start: 3px solid var(--gold); padding: 6px 12px; margin-bottom: 12px; }
.newsitem .nd { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px;}

/* champions */
.champgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.champ { background:#fff; border:1px solid var(--line); border-radius:12px; padding:14px; }
.champ .cn { font-weight: 700; color: var(--blue-dark); }
.champ .ct { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }

/* RTL */
html[dir="rtl"] body { font-family: "Segoe UI", Tahoma, Arial, sans-serif; }
.rtl-only { display: none; }
html[dir="rtl"] .rtl-only { display: inline; }

/* footer */
footer.site { background: var(--blue-dark); color: #b9cdda; margin-top: 40px; padding: 26px 0 30px; font-size: .9rem; }
footer.site .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
footer.site h4 { color: #fff; margin: 0 0 8px; font-family: var(--serif); }
footer.site a { color: #ffd968; }
footer.site .copy { text-align: center; margin-top: 22px; color: #7f9ab0; font-size: .82rem; }

.lightbox { position: fixed; inset: 0; background: rgba(10,25,40,.85); display: none; align-items: center; justify-content: center; z-index: 50; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 10px; }

@media (max-width: 960px) {
  .cols { grid-template-columns: 1fr; }
  .doghead { grid-template-columns: 1fr; }
  .salecard { grid-template-columns: 1fr; }
  footer.site .wrap { grid-template-columns: 1fr; }
  .searchform { margin-inline-start: 0; width: 100%; }
  .searchform input { flex: 1; }
}

/* ---------- auth ---------- */
.rightgroup { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.autharea { display: flex; align-items: center; gap: 10px; }
.autharea a { color: #ffd968; font-weight: 700; }
.autharea .goldlink { color: #fff; background: rgba(255,255,255,.12); padding: 3px 12px; border-radius: 12px; }
.autharea .goldlink:hover { background: var(--gold); color: #3a2c00 !important; text-decoration: none; }
.inlineform { display: inline; }
.linkbtn { background: none; border: none; color: #cfe3f2; cursor: pointer; font-size: .85rem; padding: 0; font-family: inherit; }
.linkbtn:hover { color: #fff; text-decoration: underline; }
.flash { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; font-weight: 600; }
.flash.ok { background: #e2f0e6; color: #2c5e3a; border: 1px solid #bcdcc5; }
.flash.err { background: #f9e3e0; color: #8f2f24; border: 1px solid #eac2bc; }
.authcard { max-width: 480px; margin: 34px auto 30px; padding: 26px 30px; }
.authcard h1 { margin-top: 0; }
.authcard form { display: flex; flex-direction: column; gap: 13px; margin-top: 14px; }
.authcard label { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; color: var(--muted); font-weight: 700; }
.authcard .styled { width: 100%; }
.authcard .btn { margin-top: 6px; align-self: flex-start; }

/* ---------- add / edit dog form ---------- */
.dogform { max-width: 860px; margin: 26px auto 30px; }
.dogform h1 { margin-top: 0; }
.dogform form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-top: 14px; }
.dogform .full { grid-column: 1 / -1; }
.dogform label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 700; }
.dogform .hint { font-weight: 400; opacity: .8; }
.dogform textarea.styled { resize: vertical; font-family: inherit; }
.parentbox { position: relative; }
.suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20,40,60,.16); max-height: 280px; overflow: auto; display: none;
}
.sugitem { padding: 8px 12px; cursor: pointer; font-size: .9rem; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sugitem:hover { background: var(--blue-light); }
.sugitem.none { color: var(--muted); cursor: default; }
@media (max-width: 760px) { .dogform form { grid-template-columns: 1fr; } }

/* ---------- confirm banner / uploads / moderation ---------- */
.confirmbar { background: #fff3cd; border-bottom: 1px solid #e2cf96; color: #7a5c00; text-align: center; padding: 9px 16px; font-size: .9rem; }
.confirmbar a { color: var(--blue); }
.uploadbox { margin-top: 10px; border: 1px dashed #d5cdbc; border-radius: 10px; padding: 8px 12px; background: #fcfbf7; }
.uploadbox summary { cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--blue-dark); }
.uploadbox form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.healthform label { font-size: .78rem; color: var(--muted); font-weight: 700; display: flex; flex-direction: column; gap: 3px; }
.thumb { position: relative; display: inline-block; }
.thumbacts { position: absolute; top: 3px; inset-inline-end: 3px; display: flex; gap: 3px; }
.thumbacts button { border: none; background: rgba(255,255,255,.9); border-radius: 6px; cursor: pointer; font-size: .72rem; padding: 2px 4px; line-height: 1; }
.thumbacts button.staron { background: var(--gold); }
.thumbacts button:hover { filter: brightness(.92); }
.dangerbtn { border: 1px solid #eac2bc; background: #f9e3e0; color: var(--red); border-radius: 20px; padding: 6px 16px; font-weight: 700; cursor: pointer; font-size: .85rem; }
.dangerbtn:hover { filter: brightness(.96); }

.sizeset { display: flex; gap: 6px; margin-top: 8px; }
.sizeset select.styled { flex: 1; padding: 6px 8px; font-size: .82rem; }
.sizeset button { border: 1px solid var(--line); background: var(--blue-light); color: var(--blue-dark); border-radius: 8px; padding: 6px 10px; font-size: .78rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.sizeset button:hover { filter: brightness(.95); }

.delbtn { background: none; border: 1px solid var(--line); color: #b00; border-radius: 6px; cursor: pointer; font-size: .72rem; padding: 1px 6px; vertical-align: middle; }
.delbtn:hover { background: #fff2f2; }
