/* =====================================================================
   Troy L. Cox, PhD — Teaching Portfolio
   styles.css
   Palette: "Modern Minimal" — black / off-white / muted gray / bold blue
   Built for accessibility (WCAG 2.2 AA), responsiveness, and print.
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f8f7f4;
  --color-bg-dark: #111111;
  --color-bg-dark-alt: #1c1c1e;
  --color-text: #16171a;
  --color-text-muted: #4b4f56;
  --color-text-on-dark: #f8f7f4;
  --color-text-on-dark-muted: #c7c9cd;
  --color-accent: #2563eb;
  --color-accent-dark: #1d4ed8;
  --color-accent-on-dark: #7ba8ff;
  --color-border: #d8dadd;
  --color-border-dark: #33343a;
  --color-focus: #c2410c;
  --color-card-bg: #ffffff;
  --color-tag-bg: #eef2ff;
  --color-tag-text: #1d3fae;

  --font-sans: "Segoe UI", Avenir, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;

  --max-width: 72rem;
  --radius: 0.75rem;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;

  --shadow-soft: 0 1px 3px rgba(17, 17, 17, 0.08), 0 8px 24px rgba(17, 17, 17, 0.06);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-alt);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  margin-top: 0;
}

h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem); margin-bottom: var(--space-sm); }
h3 { font-size: 1.25rem; margin-bottom: var(--space-xs); }
h4 { font-size: 1.05rem; margin-bottom: var(--space-xs); }

p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.4rem; }
li { margin-bottom: 0.4rem; }

a {
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 0.08em;
}
a:hover { color: var(--color-bg-dark); }

/* Strong, visible focus indicator everywhere (WCAG 2.4.7 / 2.4.11) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--color-accent); color: #fff; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-bg-dark);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 0.5rem 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Layout shell ---------- */
.site-header {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border-dark);
}

.nav-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  text-decoration: none;
  line-height: 1.25;
}
.site-title:hover { color: var(--color-accent-on-dark); }
.site-title small {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--color-text-on-dark-muted);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border-dark);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--color-text-on-dark-muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 0.5rem 0.7rem;
  border-radius: 0.5rem;
  display: inline-block;
  border: 1px solid transparent;
}
.main-nav a:hover {
  color: #fff;
  background: var(--color-bg-dark-alt);
}
.main-nav a[aria-current="page"] {
  color: #fff;
  background: var(--color-accent-dark);
}
.main-nav a.nav-philosophy {
  border: 1px solid var(--color-accent-on-dark);
}

main { flex: 1 0 auto; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--color-bg-dark) 0%, #1c2333 100%);
  color: var(--color-text-on-dark);
  padding: var(--space-xl) 0 var(--space-lg);
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent-on-dark);
  margin-bottom: 0.75rem;
}
.hero h1 { color: #fff; margin-bottom: 0.6rem; }
.hero-title { font-size: 1.15rem; color: var(--color-text-on-dark-muted); margin-bottom: 1.25rem; font-weight: 600; }
.hero p.lede { font-size: 1.1rem; color: var(--color-text-on-dark-muted); max-width: 42rem; }

.hero-photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border-dark);
  background: var(--color-bg-dark-alt);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: 0.6rem;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); color: #fff; }

.btn-secondary {
  background: transparent;
  color: #fff;
  border-color: var(--color-text-on-dark-muted);
}
.btn-secondary:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.08); }

.btn-light {
  background: #fff;
  color: var(--color-bg-dark);
  border-color: var(--color-border);
}
.btn-light:hover { background: var(--color-bg-alt); }

/* ---------- Sections & cards ---------- */
.section {
  padding: var(--space-lg) 0;
}
.section-alt { background: var(--color-bg); }
.section-header { max-width: 46rem; margin-bottom: var(--space-md); }
.section-header p { color: var(--color-text-muted); font-size: 1.05rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: var(--space-md);
}

.card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: var(--shadow-soft);
}
.card::after {
  content: "";
  display: table;
  clear: both;
}
.student-photo {
  float: left;
  width: 9rem;
  height: 6.75rem;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  margin: 0 1.25rem 0.5rem 0;
}
@media (max-width: 30rem) {
  .student-photo {
    float: none;
    display: block;
    width: 100%;
    height: auto;
    max-height: 14rem;
    margin: 0 0 0.75rem;
  }
}

.about-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: var(--space-sm, 0.75rem);
  margin: 0 0 var(--space-md) 0;
}
.about-photo-grid img {
  width: 100%;
  height: 9rem;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  display: block;
}
@media (max-width: 30rem) {
  .about-photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.card h3 { margin-bottom: 0.5rem; }
.card .card-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.tag {
  display: inline-block;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin: 0 0.35rem 0.35rem 0;
}

/* ---------- Page header (non-home pages) ---------- */
.page-header {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  padding: var(--space-lg) 0 var(--space-md);
}
.page-header h1 { color: #fff; margin-bottom: 0.5rem; }
.page-header p { color: var(--color-text-on-dark-muted); max-width: 44rem; font-size: 1.05rem; margin-bottom: 0; }
.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-on-dark-muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--color-accent-on-dark); }

/* ---------- Philosophy quote / pull quote ---------- */
.pull-quote {
  border-left: 4px solid var(--color-accent);
  background: var(--color-bg);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--color-text);
  margin: var(--space-md) 0;
}
.pull-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

/* ---------- Principle / numbered list styling ---------- */
.principle-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}
.principle-list li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.principle-number {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

/* ---------- Resume / CV ---------- */
.resume-section { margin-bottom: var(--space-lg); }
.resume-section h2 {
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
}
.resume-entry { margin-bottom: 1.1rem; }
.resume-entry .role { font-weight: 700; }
.resume-entry .org { color: var(--color-text-muted); }
.resume-entry .dates {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  font-weight: 600;
}
.download-panel {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: var(--space-lg);
}
.download-panel p { margin: 0; color: var(--color-text-on-dark-muted); }
.download-panel h2 { color: #fff; margin: 0 0 0.35rem; }

/* ---------- Tables (real tabular data only) ---------- */
.table-scroll { overflow-x: auto; margin-bottom: var(--space-md); border: 1px solid var(--color-border); border-radius: var(--radius); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
  min-width: 32rem;
}
caption {
  text-align: left;
  font-weight: 700;
  padding: 0.75rem 1rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
th, td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
thead th {
  background: var(--color-bg-dark);
  color: #fff;
  font-weight: 700;
}
tbody tr:nth-child(even) { background: var(--color-bg); }

/* ---------- Tag filter toolbar (Scholarly Writings page) ---------- */
.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1.25rem 0 0.5rem;
}
.filter-toolbar-label {
  font-weight: 700;
  margin-right: 0.25rem;
}
.filter-btn {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}
.filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}
.filter-btn[aria-pressed="true"] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.filter-status {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 1.5rem;
}

/* ---------- Multi-select filter group (Mentored Students page) ---------- */
.filter-select-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-end;
  margin: 1.25rem 0 0.5rem;
}
.filter-select-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.filter-select-field label {
  font-weight: 700;
  font-size: 0.85rem;
}
.filter-select-field select {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.9rem;
  font-family: inherit;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  min-width: 10rem;
  cursor: pointer;
}
.filter-select-field select:hover {
  border-color: var(--color-accent);
}
.filter-reset-btn {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  cursor: pointer;
  height: fit-content;
}
.filter-reset-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

/* ---------- Placeholder / forthcoming notice ---------- */
.placeholder-panel {
  border: 2px dashed var(--color-border);
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: var(--space-lg);
  text-align: left;
}
.status-tag {
  display: inline-block;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}
.card .status-tag {
  margin-bottom: 0;
  margin-right: 0.6rem;
  vertical-align: middle;
}
.placeholder-panel h2 { margin-bottom: 0.5rem; }

/* ---------- Contact ---------- */
.contact-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.contact-list li {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}
.contact-list .label { font-weight: 700; min-width: 8rem; }

/* ---------- Footer ---------- */
.site-footer {
  flex-shrink: 0;
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark-muted);
  padding: var(--space-lg) 0 var(--space-md);
  margin-top: var(--space-xl);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.footer-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  padding: 0;
  margin: 0 0 1.25rem;
}
.footer-nav a { color: var(--color-text-on-dark-muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.footer-nav a:hover { color: #fff; }
.footer-meta { font-size: 0.85rem; border-top: 1px solid var(--color-border-dark); padding-top: 1rem; }
.footer-meta a { color: var(--color-accent-on-dark); }

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.text-muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 62rem) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo { max-width: 18rem; margin: 0 auto; order: -1; }
}

@media (max-width: 48rem) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 0.4rem; }
  .main-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; padding: 0.5rem 0 0.75rem; }
  .main-nav a { display: block; }
  .nav-wrap { flex-wrap: wrap; }
}

/* ---------- Print styles ---------- */
@media print {
  .site-header, .site-footer, .nav-toggle, .hero-actions, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
  .hero, .page-header { background: none !important; color: #000 !important; padding: 0.5rem 0; }
  .hero h1, .page-header h1 { color: #000 !important; }
  .card, .placeholder-panel, .download-panel { box-shadow: none; border: 1px solid #999; }
  .container { max-width: 100%; }
}
