/* ============================================================
   taylorbegley.com — all of the site's styling
   Part 1: foundation (fonts, colors, how paper entries work)
   Part 2: the page design
   ============================================================ */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-wght-italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

/* ---------- Palette: University of Kentucky brand colors ---------- */
:root {
  --blue: #0033A0;        /* Wildcat Blue */
  --blue-deep: #002678;   /* hover / pressed */
  --midnight: #1B365D;    /* Midnight */
  --sky: #B1C9E8;         /* Sky */
  --wash: #EFF4FD;        /* pale blue background */
  --paper: #F9F9F5;       /* Warm Neutral, 20% */
  --ink: #1A1A1A;
  --muted: #515664;
  --rule: #E3E6EB;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Newsreader", Georgia, "Times New Roman", serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, ul, dl, dd, dt { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
cite { font-style: italic; }

a { color: var(--blue); text-decoration-thickness: 0.06em; text-underline-offset: 0.2em; transition: color 0.15s; }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; padding: 8px 14px; background: #fff; border-radius: 4px; }

/* ---------- Paper entries: shared mechanics ---------- */
.paper-year { display: none; }
.paper-actions::after { content: ""; display: block; clear: both; }
.paper-links { float: left; display: flex; align-items: baseline; gap: 1.1em; margin-right: 1.1em; }

/* BibTeX: a quiet button in the links row opens a card with the entry to copy.
   The card uses the browser's built-in "popover", so it opens, closes on Esc or
   a click outside, and stays keyboard-friendly without any script. */
.paper-cite { padding: 0; border: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; }
.paper-cite:hover { color: var(--blue); }
.bib {
  display: none;
  width: min(43rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto;
  margin: auto; padding: 1.4rem 1.5rem 1.25rem;
  border: 1px solid var(--rule); border-radius: 10px; background: #fff; color: var(--ink);
  box-shadow: 0 18px 50px rgba(20, 30, 60, 0.28);
  font-family: var(--sans); font-size: 0.9375rem; line-height: 1.5; font-weight: 400;
}
.bib:popover-open { display: block; }
.bib::backdrop { background: rgba(20, 24, 36, 0.38); }
.bib-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; color: var(--blue); }
.bib-title { margin-top: 0.3rem; font-weight: 600; }
.bib-entry {
  margin: 0.9rem 0 1rem; padding: 0.9rem 1rem; border-radius: 6px; background: #F3F5F9;
  font: 0.8125rem/1.6 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
  -webkit-user-select: all; user-select: all; cursor: text;
}
.bib-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.bib-buttons button {
  padding: 0.5rem 1.05rem; border-radius: 6px; border: 1.5px solid var(--blue);
  font: inherit; font-size: 0.875rem; font-weight: 600; color: var(--blue); background: #fff; cursor: pointer;
}
.bib-buttons button:hover { background: var(--wash); }
.bib-buttons .bib-copy { min-width: 10.5rem; color: #fff; background: var(--blue); }
.bib-buttons .bib-copy:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.bib-hint { font-size: 0.8125rem; color: var(--muted); }

/* small "opens elsewhere" arrow drawn as an icon so it looks the same everywhere */
.paper-link::after {
  content: ""; display: inline-block; width: 0.6em; height: 0.6em; margin-left: 0.3em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 1.5h7v7M10.5 1.5 1.5 10.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 1.5h7v7M10.5 1.5 1.5 10.5' fill='none' stroke='black' stroke-width='1.7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.abstract summary { display: inline-block; cursor: pointer; list-style: none; user-select: none; }
.abstract summary::-webkit-details-marker { display: none; }
.abstract summary::after {
  content: ""; display: inline-block; width: 0.42em; height: 0.42em; margin-left: 0.55em;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.22em) rotate(45deg); transition: transform 0.15s;
}
.abstract[open] summary::after { transform: translateY(0.05em) rotate(225deg); }
.abstract > p { clear: both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}


/* ============================================================
   Part 2: the page design
   One page, one centered column, on warm white.
   Newsreader (serif) for the name and titles, Inter (sans-serif)
   for everything else. A slim Wildcat Blue menu bar on top;
   below it, blue appears only in links and small labels.
   ============================================================ */

:root { --rule: #E2DFD5; }          /* hairlines, tuned for the warm background */

html { background: var(--paper); }
body {
  font-family: var(--sans);
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.62;
  background: var(--paper);
}

.wrap { max-width: 47rem; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Blue menu bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--blue); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 3.5rem; }
.brand { padding: 0.6rem 0; white-space: nowrap; font-family: var(--display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.005em; color: #fff; text-decoration: none; }
.brand:hover { color: var(--sky); }
/* the padding makes each menu link a comfortable target for a thumb without changing how it looks */
.topbar nav { display: flex; gap: 0.75rem; margin-right: -0.5rem; }
.topbar nav a { padding: 0.95rem 0.5rem; font-size: 0.875rem; font-weight: 500; letter-spacing: 0.01em; color: rgba(255, 255, 255, 0.86); text-decoration: none; }
.topbar nav a:hover { color: #fff; }
.topbar :focus-visible { outline-color: #fff; }

/* ---------- Introduction: name on the left, tall photo on the right ---------- */
.intro {
  display: grid; grid-template-columns: 1fr 220px; gap: 2.5rem; align-items: center;
  padding: 3rem 0 2.25rem;
}
.portrait { order: 2; width: 220px; height: 275px; border-radius: 6px; object-fit: cover; }
.intro h1 { font-family: var(--display); font-size: 3.25rem; line-height: 1.04; font-weight: 500; letter-spacing: -0.022em; }
.titles { margin-top: 0.75rem; font-size: 1.0625rem; line-height: 1.45; font-weight: 500; text-wrap: balance; }
.affil { margin-top: 0.35rem; color: var(--muted); font-size: 0.96875rem; line-height: 1.45; }
.contact { margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; font-size: 0.9375rem; font-weight: 500; }

/* ---------- Small blue labels ---------- */
.label {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--blue);
  margin-bottom: 0.6rem;
}

.interests { padding: 1.75rem 0 0.5rem; border-top: 1px solid var(--rule); }
.interests p { font-family: var(--display); font-size: 1.375rem; line-height: 1.42; }

/* ---------- Sections and papers ---------- */
/* when a link jumps to a section or a paper, stop below the blue bar instead of under it */
section[id], .section-title, .paper { scroll-margin-top: 4.5rem; }

.section-title {
  margin-top: 2.75rem; padding-bottom: 0.55rem;
  font-family: var(--display); font-size: 1.875rem; line-height: 1.2; font-weight: 500; letter-spacing: -0.016em;
  border-bottom: 2px solid var(--ink);
}

.paper { padding: 1.15rem 0 0.75rem; border-bottom: 1px solid var(--rule); }
.paper:last-child { border-bottom: 0; padding-bottom: 0; }
.paper-title { font-family: var(--display); font-size: 1.25rem; line-height: 1.24; font-weight: 500; letter-spacing: -0.012em; }
.paper-title a { color: var(--ink); text-decoration: none; }
.paper-title a:hover { color: var(--blue); }
.paper-authors { margin-top: 0.15rem; color: var(--muted); font-size: 0.96875rem; }
.paper-venue { margin-top: 0.15rem; color: var(--muted); font-size: 0.96875rem; }
.paper-venue cite { font-style: normal; font-weight: 650; color: var(--ink); }

/* notes: a working paper's status in bold, like a journal name; "Editor's Choice" in italics after the page numbers */
.tag-status { font-weight: 650; color: var(--ink); }
.tag-note { font-style: italic; color: var(--ink); }
.tag-note:not(:first-child)::before { content: "·"; margin: 0 0.45em 0 0.3em; font-style: normal; color: var(--muted); }

.paper-actions { margin-top: 0.05rem; font-size: 0.875rem; font-weight: 500; }
.paper-link, .paper-cite, .abstract summary { padding: 0.4rem 0; }   /* taller click and tap area */
.abstract summary { color: var(--muted); }
.abstract summary:hover { color: var(--blue); }
.abstract > p {
  margin: 0.45rem 0 0.4rem; padding: 0.1rem 0 0.1rem 1.1rem; border-left: 2px solid var(--sky);
  font-size: 0.96875rem; font-weight: 400; line-height: 1.66; color: #2b2d33;
}

/* ---------- Personal links: present, but quiet ---------- */
.personal { margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--rule); }
.personal-row { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: 0.22rem 0; font-size: 0.96875rem; }
.personal-row dt { color: var(--muted); }

/* ---------- Footer ---------- */
.footer { margin-top: 4rem; padding: 2rem 0 3rem; border-top: 1px solid var(--rule); font-size: 0.8125rem; line-height: 1.7; color: var(--muted); }
.footer a { color: inherit; }
.footer a:hover { color: var(--blue); }

/* ---------- "Page not found" page ---------- */
.notfound { padding-top: 5rem; padding-bottom: 6rem; }
.notfound h1 { margin: 0.4rem 0 1rem; font-family: var(--display); font-size: 2.75rem; line-height: 1.08; font-weight: 500; letter-spacing: -0.02em; }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .wrap { padding: 0 1.25rem; }
  .topbar nav { gap: 0.15rem; }
  /* name on the left with a small portrait beside it; titles and links run the full width below */
  .intro { grid-template-columns: 1fr 96px; gap: 0 1.25rem; padding: 1.75rem 0 1.75rem; }
  .intro-text { display: contents; }
  .intro h1 { grid-column: 1; grid-row: 1; }
  .portrait { grid-column: 2; grid-row: 1; order: 0; width: 96px; height: 120px; }
  .titles, .affil, .contact { grid-column: 1 / -1; }
  .titles { margin-top: 1.1rem; }
  .intro h1 { font-size: 2.625rem; }
  .titles { font-size: 0.9375rem; }      /* lets each title fit on one line on most phones */
  .interests p { font-size: 1.1875rem; }
  .section-title { margin-top: 2.5rem; font-size: 1.625rem; }
  .personal-row { grid-template-columns: 1fr; gap: 0; padding: 0.4rem 0; }
  .personal-row dt { font-size: 0.875rem; }
}

/* ---------- Very narrow phones: keep the name and the menu on one line ---------- */
@media (max-width: 360px) {
  .wrap { padding: 0 1rem; }
  .brand { font-size: 1.125rem; }
  .topbar nav a { padding-left: 0.3rem; padding-right: 0.3rem; font-size: 0.8125rem; }
  .topbar nav { margin-right: -0.3rem; }
}

/* ---------- Printing: a clean list of papers, without menus or buttons ---------- */
@media print {
  html, body { background: #fff; }
  body { font-size: 10.5pt; }
  .topbar, .skip, .paper-actions, .bib { display: none; }
  .intro { padding-top: 0; }
  .section-title { break-after: avoid; }
  .paper { break-inside: avoid; padding-bottom: 0.9rem; }
  .personal { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .footer { margin-top: 2rem; padding-bottom: 0; }
}
