/* static/css/years.css */
/* Years page styles (scoped) */

/* Local tokens */
.years-page {
  --section-max: 640px; /* matches person-grid width */
}

/* Base */
.years-page * { box-sizing: border-box; }
.years-page a { color:#0b57d0; text-decoration:none; }
.years-page a:hover { text-decoration: underline; }
/* muted color provided globally */

/* Chips subnav */
.years-page .subnav { max-width: var(--wrap); margin:0 auto; padding:8px 16px 0; }
.years-page .chips { display:flex; gap:10px; overflow:auto; padding:8px 0 4px; }
.years-page .chip{
  --c:#0b57d0;
  --cd: color-mix(in srgb, var(--c) 92%, black);
  appearance:none;
  --chip-border: 1px solid var(--c);
  --chip-ink: var(--cd);
  --chip-bg: color-mix(in srgb, var(--c) 7%, white);
  --chip-py: 8px;
  --chip-px: 14px;
  --chip-fz: 13px;
  line-height:1; gap:8px; white-space:nowrap;
  box-shadow:0 1px 0 rgba(0,0,0,.04), inset 0 0 0 1px color-mix(in srgb, var(--c) 8%, transparent);
  transition:background .15s, color .15s, border-color .15s, box-shadow .15s;
  text-decoration:none;
}
.years-page .chip:hover{ background:color-mix(in srgb, var(--c) 14%, white) }
.years-page .chip:focus-visible{ outline:none; box-shadow:0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent) }
.years-page .chip[data-active="true"]{ background:var(--c); color:#fff; border-color:var(--c); box-shadow:0 2px 8px color-mix(in srgb, var(--c) 25%, transparent) }
@media (prefers-reduced-motion: reduce){ .years-page .chip{ transition:none } }

/* Page wrapper */
/* wrap layout provided globally */
.years-page .summary { color:var(--muted); margin:8px 0 16px; }

/* Sections */
.years-page .section {
  padding:18px 0; margin:22px 0 10px;
  background:transparent; border:0; border-radius:0; box-shadow:none;
}

/* --- FIXED HEADER WIDTH + LAYOUT --- */
/* Constrain header to section width and center it, like the grid */
.years-page .section-header{
  position:relative;
  display:flex; align-items:center; gap:8px;
  max-width: var(--section-max);
  margin-left:auto; margin-right:auto;
  padding-bottom:4px;      /* tighter space above the rule */
  margin-bottom:8px;       /* tighter than before */
}

/* The underline now matches the header width (== person grid width) */
.years-page .section-header::after{
  content:"";
  position:absolute; left:0; right:0; bottom:0;
  height:1px; border-radius:1px;
  background: color-mix(in srgb, var(--color) 28%, transparent);
}

/* Heavier underline when targeted */
.years-page .section:target .section-header::after{
  height:3px; background: var(--color);
}

/* Dot + title + copy link sit to the left, aligned with grid */
.years-page .section-header .stripe{
  width:10px; height:10px; border-radius:999px; flex:none;
}
.years-page .section-header .title{
  margin:0;
  font-weight:700;
  /* if you use a heading font scale, it will apply here */
}
.years-page .section-header .copylink{
  margin-left:8px;
  border:0; background:transparent; padding:2px 4px; cursor:pointer;
  line-height:1; font-size:14px;
}
.years-page .section-header .copylink:hover{ opacity:.7 }

/* Person cards */
.years-page .person-grid{
  display:grid; grid-template-columns:1fr; gap:24px; margin:8px 0 6px;
  width:100%; max-width:var(--section-max); margin-inline:auto;
}
.years-page .pcard{ width:100%; text-decoration:none; color:inherit; }
/* Avatar links should never underline on hover */
.years-page .pcard .avatar-link{ text-decoration:none; }
.years-page .pcard .avatar-link:hover{ text-decoration:none; }

/* Use highest-office color for avatar border (provided via inline CSS var) */
.years-page .avatar-wrap{
  /* Central knobs for year avatars */
  /* Prefer inline --office-color (from DB via template), then section --color, then neutral */
  --avatar-bg: var(--office-color, var(--color, #9ca3af));   /* full background tint */
  --avatar-border: 1px solid var(--avatar-bg);  /* border same as background */
  --avatar-text: #fff;                          /* white initial */
}
.years-page .pcard:hover{
  transform:translateY(-1px);
  box-shadow:0 2px 10px rgba(0,0,0,.06);
  border-color:color-mix(in srgb, var(--color) 30%, var(--line))
}

/* Avatars inherit global rounded-rectangle shape and 44px size */
.years-page .pmeta{ min-width:0 }
.years-page .name-row{ display:flex; align-items:center; gap:8px }
.years-page .pname{ font-weight:700; line-height:1.25; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.years-page .psub{ font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.years-page .pcard__bench-add{
  border:0;
  background:transparent;
  padding:0;
  margin:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:24px;
  height:24px;
  border-radius:999px;
  color:var(--muted);
  cursor:pointer;
  transition: color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.years-page .pcard__bench-add svg{
  width:14px;
  height:14px;
}
.years-page .pcard__bench-add:hover,
.years-page .pcard__bench-add:focus-visible{
  outline:none;
  color:var(--ink);
  background:color-mix(in srgb, var(--color, #9ca3af) 10%, #f3f4f6);
  box-shadow:0 0 0 1px color-mix(in srgb, var(--color, #9ca3af) 35%, var(--line));
  transform:translateY(-0.5px);
}

/* Bench (desktop compare helper) */
.years-page .year-bench{
  position: fixed;
  top: calc(var(--topbar-offset, 64px) + 8px);
  left: calc(50% + (var(--section-max) / 2) + 16px);
  width: min(260px, calc((100vw - var(--section-max)) / 2 - 24px));
  max-width: 260px;
  z-index: 40;
}
.years-page .year-bench[hidden]{ display:none; }
@media (max-width:900px){
  .years-page .year-bench{
    display:none !important;
  }
}

.years-page .year-bench__box{
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  box-shadow:0 12px 30px rgba(0,0,0,.14);
  padding:10px 12px;
  display:grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  row-gap:6px;
  column-gap:8px;
  font-size: var(--fs-small);
}

.years-page .year-bench__heading{
  grid-column: 1 / -1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:2px;
}
.years-page .year-bench__title{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
}
.years-page .year-bench__heading-actions{
  display:flex;
  align-items:center;
}
.years-page .year-bench__hide{
  border:0;
  background:transparent;
  padding:2px 6px;
  margin:0;
  font-size:11px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--muted);
  border-radius:999px;
  cursor:pointer;
  transition: color .15s ease, background-color .15s ease;
}
.years-page .year-bench__hide:hover,
.years-page .year-bench__hide:focus-visible{
  outline:none;
  color:var(--ink);
  background:color-mix(in srgb, var(--color, #9ca3af) 8%, #f3f4f6);
}

.years-page .year-bench__name{
  min-width:0;
  font-size:13px;
  line-height:1.3;
  color:var(--ink);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  align-self:center;
}
.years-page .year-bench__name--empty{
  color:var(--muted);
  font-style:italic;
}

.years-page .year-bench__label{
  display:inline;
}

.years-page .year-bench__inspect,
.years-page .year-bench__remove{
  border:0;
  background:transparent;
  padding:0;
  margin:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  border-radius:999px;
  color:var(--muted);
  cursor:pointer;
  transition: color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.years-page .year-bench__inspect svg{
  width:16px;
  height:16px;
}
.years-page .year-bench__inspect:hover,
.years-page .year-bench__inspect:focus-visible{
  outline:none;
  color:var(--ink);
  background:color-mix(in srgb, var(--color, #9ca3af) 10%, #f3f4f6);
  box-shadow:0 0 0 1px color-mix(in srgb, var(--color, #9ca3af) 35%, var(--line));
  transform: translateY(-0.5px);
}
.years-page .year-bench__remove span{
  font-size:16px;
  line-height:1;
}
.years-page .year-bench__remove:hover:not(:disabled),
.years-page .year-bench__remove:focus-visible:not(:disabled){
  outline:none;
  color:var(--danger);
  background:color-mix(in srgb, var(--danger) 5%, #fef2f2);
  box-shadow:0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent);
  transform: translateY(-0.5px);
}
.years-page .year-bench__remove:disabled{
  opacity:.3;
  cursor:default;
}

.years-page .year-bench__search-input{
  width:100%;
}

.years-page .year-bench__suggest{
  grid-column: 1 / -1;
  margin-top:6px;
}
.years-page .year-bench__suggest-panel{
  border-radius:10px;
  overflow:hidden;
}
.years-page .year-bench__suggest-panel .year-bench__suggest-item{
  border:0;
  background:transparent;
  width:100%;
  text-align:left;
  padding:6px 8px; /* a bit more compact than topbar */
  font-size: var(--fs-small);
}
.years-page .year-bench__suggest-panel .year-bench__suggest-item span{
  pointer-events:none;
}
.years-page .year-bench__suggest-panel .year-bench__suggest-item:hover,
.years-page .year-bench__suggest-panel .year-bench__suggest-item:focus-visible{
  background:#f3f4f6;
}

.years-page .year-bench.year-bench--highlight .year-bench__box{
  box-shadow:0 0 0 2px color-mix(in srgb, var(--ink) 40%, transparent), 0 16px 40px rgba(0,0,0,.18);
}

.years-page .year-bench__compare{
  grid-column: 1 / -1;
  margin-top:4px;
  display:flex;
  justify-content:flex-end;
}
.years-page .year-bench__compare-btn{
  width:100%;
}

.years-page .year-bench__message{
  margin-top:6px;
  padding:6px 8px;
  font-size:12px;
  line-height:1.3;
  color:#92400e;
  background:#fffbeb;
  border-radius:10px;
  border:1px solid color-mix(in srgb,#fbbf24 45%, white);
  box-shadow:0 1px 4px rgba(0,0,0,.04);
  opacity:0;
  transform:translateY(2px);
  transition:opacity .25s ease, transform .25s ease;
}
.years-page .year-bench__message.is-visible{
  opacity:1;
  transform:translateY(0);
}

/* Badges */
/* badges now use global styles from site.css */
.years-page .badge{ margin-left:0 }

/* Misc */
.years-page .hidden-row{ display:none }
.years-page .toggle{
  display:inline-block; margin:8px 4px 6px; padding:6px 10px;
  border:1px solid var(--line); border-radius:10px; font-size:13px; color:#374151; background:#f9fafb;
  width:100%; max-width:var(--section-max); margin-inline:auto;
}
.years-page .notes{ color:var(--muted); font-size:14px; margin:6px auto 10px; width:100%; max-width:var(--section-max) }

/* Dock */
.years-page .dock{
  position:sticky; top:54px; z-index:10; background:rgba(255,255,255,.9);
  backdrop-filter:saturate(180%) blur(8px); border:1px solid var(--line);
  border-radius:12px; padding:8px 12px; margin:8px 0 12px;
}
.years-page .dock-row{ display:flex; justify-content:space-between; gap:12px; align-items:center; flex-wrap:wrap }
.years-page .dock-left, .years-page .dock-right{ display:flex; gap:12px; align-items:center; flex-wrap:wrap }
.years-page .dock-item{ color:#374151; font-size:14px }
.years-page .era-chip{
  --c: var(--era);
  border:1px solid var(--c);
  color:color-mix(in srgb, var(--c) 90%, black);
  background:color-mix(in srgb, var(--c) 10%, white);
  padding:4px 8px; border-radius:999px; font-size:12px
}
.years-page .year-nav .navbtn{ border:1px solid var(--line); border-radius:8px; padding:4px 8px; background:#fff; font-size:13px }
.years-page .year-nav .navbtn:hover{ text-decoration:none; border-color:#cbd5e1 }

/* Accessibility */
/* reviewed tick uses global .reviewed and .reviewed-icon */
/* sr-only helper provided globally */


/* === Vertical spacing tuning between office sections === */

/* Default (desktop) — keep moderate breathing */
.years-page .section {
  margin-top: 18px;
  margin-bottom: 16px;
  padding-top: 0;
  padding-bottom: 0;
}

/* === Mobile spacing override (wins vs site.css) === */
@media (max-width: 700px) {
  .years-page .year-view .section {
    margin-top: 8px !important;
    margin-bottom: 4px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .years-page .year-view .section-header {
    margin-bottom: 6px !important;   /* was bigger before */
    padding-bottom: 3px !important;  /* tighter gap above the rule */
  }

  .years-page .year-view .person-grid {
    margin-top: 4px !important;      /* tighter gap after the header */
    margin-bottom: 6px !important;
  }

  /* If you also have .office-section/.year-section in site.css, cover them too: */
  .years-page .year-view .office-section,
  .years-page .year-view .year-section {
    margin-top: 10px !important;
    margin-bottom: 6px !important;
  }
}



.person-grid .pcard{
  position: relative;
  display: grid !important;
  grid-template-columns: 1fr;             /* stack head + body */
  gap: 8px;                               /* a tad more space between head/body */
}

/* Head row: three columns (avatar | meta | goto) */
.person-grid .pc-head{
  display: grid;
  grid-template-columns: auto 1fr auto;   /* avatar | meta | actions */
  gap: 14px;
  align-items: start;                      /* top-align so avatar/goto don't shift on expand */
}

/* Ensure side columns stick to the top even if a specific item overrides grid alignment */
.person-grid .pcard__avatar{ align-self: start; }
.person-grid .pcard__goto-wrap{
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* Make sure text column can shrink on narrow screens */
.years-page .head-meta{ min-width: 0; }

/* Subtle separator between head and body */
.years-page .pc-body{
  border-top: 1px solid color-mix(in srgb, var(--color) 22%, var(--line));
  padding-top: 6px; /* breathing room after the rule */
}

/* Match person page term-sources spacing + list formatting */
.years-page .term-sources[open] summary{ margin-bottom: .25rem; }
.years-page .term-sources .sources-list{ margin: .25rem 0 0 1rem; color:#555; line-height:1.4; }
/* Slightly increase gap when summaries collapse inline */
.years-page .term-summary-wrap.is-collapsed-inline + .term-sources{
  margin-top: .25rem;
}

/* Unified link styling inside term-sources (sources + overlap) */
.years-page .term-sources a{
  font-family: "EB Garamond", serif;
  font-weight: 600;
  letter-spacing: .01em;
  color: #2a2f36;            /* elegant dark ink */
  text-decoration: none;
}
.years-page .term-sources a:hover{
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Office-overlap details: indent like sources */
.years-page .term-overlap .term-summary{
  margin-left: 1rem;
}
.years-page .term-overlap__name--related{
  color: #b91c1c; /* blood red for related overlaps */
}
.years-page .term-overlap a{
  font-size: 0.9em; /* a tad smaller for year links */
}
/* Office-overlap helper text */
.years-page .term-overlap__hint{
  font-size: 0.8em;
  font-weight: 400;
  color: #6b7280; /* gray-500 */
  margin-left: 6px;
}
/* Small score button next to overlap summary */
.years-page .term-overlap__score-btn{
  border:0;
  background:transparent;
  padding:0 4px;
  margin-left:4px;
  font-size: 0.8em;
  color: var(--muted);
  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:2px;
}
.years-page .term-overlap__score-btn:hover,
.years-page .term-overlap__score-btn:focus-visible{
  color: var(--ink);
  background: color-mix(in srgb, var(--color, #9ca3af) 10%, #f3f4f6);
  border-radius:999px;
}

/* Inline message next to score link */
.years-page .term-overlap__score-msg{
  margin-left:6px;
  font-size: 0.8em;
  color:#4b5563; /* gray-600 */
  opacity:0;
  transition: opacity .18s ease;
}
.years-page .term-overlap__score-msg.is-visible{
  opacity:1;
}

@media (max-width:700px){
  .years-page .pcard .head-meta{ min-width: 0; }
}
