/*
Theme Name: Babak Safaei Academic
Author: Babak Safaei
Description: A clean, multi-page academic website: Home, Research, Teaching, Experience.
Version: 2.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: bsafaei
*/

:root {
  /* Warm, paper-like palette: ivory background, warm charcoal text, deep maroon accent */
  --bg: #fbf8f3;
  --ink: #2b2522;
  --muted: #6c6259;
  --line: #e6ddd1;
  --soft: #f3ece2;
  --accent: #7a2e2a;
  --accent-dark: #5a201d;
  --accent-tint: #f4e8e2;
  --w: 880px;
  --serif: "Source Serif 4", "Source Serif Pro", Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
a:focus-visible, .bs-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; }

h1, h2, h3 { margin: 0; color: var(--ink); line-height: 1.25; }
h1 { font: 600 2.25rem/1.15 var(--serif); letter-spacing: -0.01em; }
h2 { font: 600 1.4rem/1.3 var(--serif); margin-bottom: 18px; }
h3 { font: 600 1.02rem/1.45 var(--sans); }
p { margin: 0 0 14px; }

.bs-wrap, .bs-bar { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
.bs-skip { position: absolute; left: -9999px; }
.bs-skip:focus { left: 12px; top: 12px; z-index: 100; background: #fff; padding: 8px 12px; }
.bs-muted { color: var(--muted); }
.bs-small { font-size: .93rem; color: var(--muted); }

/* Header */
.bs-top { position: sticky; top: 0; z-index: 50; background: rgba(251, 248, 243, .96); border-bottom: 1px solid var(--line); }
.admin-bar .bs-top { top: 32px; }
.bs-top .bs-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 64px; }
.bs-brand { font: 600 1.2rem var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
.bs-brand:hover { color: var(--ink); }
.bs-nav { display: flex; gap: 26px; font-size: .95rem; }
.bs-nav a { color: var(--muted); text-decoration: none; padding: 20px 0; border-bottom: 2px solid transparent; }
.bs-nav a:hover { color: var(--ink); }
.bs-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Buttons */
.bs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.bs-btn { display: inline-flex; align-items: baseline; gap: 8px; padding: 9px 18px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-size: .95rem; font-weight: 600; text-decoration: none; }
.bs-btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.bs-btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.bs-btn.ghost:hover { border-color: var(--ink); color: var(--ink); background: transparent; }

/* Home intro */
.bs-intro { display: grid; grid-template-columns: 190px 1fr; gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 8px; }
.bs-photo { width: 100%; border-radius: 6px; }
.bs-intro h1 { font-size: 2.6rem; }
.bs-titles { margin: 12px 0 0; display: grid; gap: 2px; font-size: 1.05rem; }
.bs-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 18px 0 0; font-size: .95rem; }

/* Sections */
.bs-section { margin-top: 44px; padding-top: 36px; border-top: 1px solid var(--line); }
.bs-page-head { padding-top: 52px; }
.bs-lede { margin: 12px 0 0; font-size: 1.08rem; color: var(--muted); max-width: 64ch; }
.bs-toc { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 20px; font-size: .92rem; }
.bs-prose p { margin-bottom: 16px; }
.bs-more { margin: 18px 0 0; font-size: .95rem; }
.bs-sub { margin: 4px 0 6px; font-size: .95rem; font-weight: 600; color: var(--muted); }
.bs-sub ~ .bs-sub { margin-top: 24px; }

/* Label / value rows */
.bs-pairs { margin: 0; display: grid; gap: 12px; }
.bs-pairs div { display: grid; grid-template-columns: 210px 1fr; gap: 20px; }
.bs-pairs dt { font-weight: 600; font-size: .95rem; }
.bs-pairs dd { margin: 0; }
.bs-emails a { display: block; }

/* References */
.bs-refs { margin: 0; padding-left: 1.2em; list-style: disc; display: grid; gap: 14px; }
.bs-refs li { padding-left: 4px; }
.bs-refs li::marker { color: var(--muted); }
.bs-sub-gap { margin-top: 28px; }
.bs-ref-link { font-size: .88rem; word-break: break-word; }
span.bs-ref-link { color: var(--muted); }

/* Lists of items */
.bs-items { list-style: none; margin: 0; padding: 0; }
.bs-items li { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bs-items li:first-child { padding-top: 0; }
.bs-items li:last-child { border-bottom: 0; }
.bs-items .bs-muted { font-size: .93rem; }

.bs-rows { list-style: none; margin: 0; padding: 0; }
.bs-rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bs-rows li:last-child { border-bottom: 0; }
.bs-rows li > span:first-child { display: grid; gap: 2px; }
.bs-rows li > span.bs-inline { display: block; }

/* Academic service: heading + bullet list per group */
.bs-service { display: grid; gap: 22px; }
.bs-service-group h3 { margin: 0 0 6px; }
.bs-service-group .bs-points { margin-top: 0; }
.bs-rows .bs-muted { font-size: .93rem; }
.bs-when { color: var(--muted); font-size: .9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Dissertation */
.bs-feature { border-left: 3px solid var(--accent); padding: 2px 0 2px 22px; }
.bs-feature h3 { font: 600 1.15rem/1.4 var(--serif); }
.bs-feature .bs-muted { font-size: .95rem; margin: 6px 0 12px; }

/* Teaching award */
.bs-note-award { margin: 32px 0 0; padding: 14px 18px; background: var(--accent-tint); border-radius: 6px; display: grid; gap: 2px; }
.bs-note-award span { font-size: .93rem; color: var(--muted); }

/* Positions */
.bs-entry { padding: 16px 0; border-bottom: 1px solid var(--line); }
.bs-entry:first-of-type { padding-top: 0; }
.bs-entry:last-child { border-bottom: 0; }
.bs-entry header { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; }
.bs-where { margin: 2px 0 0; color: var(--muted); font-size: .95rem; }
.bs-points { margin: 8px 0 0; padding-left: 1.1em; }
.bs-points li { margin-bottom: 4px; font-size: .97rem; }
.bs-entry .bs-small { margin: 8px 0 0; }

/* Footer */
.bs-foot { margin-top: 72px; border-top: 1px solid var(--line); padding: 26px 0 34px; font-size: .9rem; color: var(--muted); }
.bs-foot .bs-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.bs-foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .bs-top .bs-bar { height: auto; flex-wrap: wrap; gap: 4px 20px; padding-top: 12px; }
  .bs-nav { width: 100%; gap: 20px; overflow-x: auto; }
  .bs-nav a { padding: 8px 0 10px; }
  .bs-intro { grid-template-columns: 1fr; gap: 22px; padding-top: 36px; }
  .bs-photo { width: 150px; }
  .bs-intro h1 { font-size: 2.1rem; }
  h1 { font-size: 1.9rem; }
  .bs-pairs div { grid-template-columns: 1fr; gap: 2px; }
  .bs-rows li, .bs-entry header { flex-direction: column; gap: 2px; }
  .admin-bar .bs-top { top: 0; }
}
