/* ============================================================
   Fadi Al-Ghawanmeh — Academic Portfolio
   "Centered Minimal": single centered column, black on white,
   deep-teal accent, IBM Plex Sans + IBM Plex Mono.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #ffffff;
  --panel: #fafafa;
  --surface: #ffffff;
  --line: #e2e2e2;
  --ink: #111111;
  --muted: #666666;
  --body: #222222;
  --accent: #0e7c7b;
  --accent-dark: #0a5f5e;
  --accent-soft: #e7f2f2;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.22;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover { border-bottom-color: currentColor; color: var(--accent-dark); }

ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: 0.4em; }
img { max-width: 100%; display: block; }
em { color: inherit; }

.wrap { max-width: 680px; margin: 0 auto; padding: 64px 24px 48px; }

/* ---------- Hero ---------- */

.hero { text-align: center; margin-bottom: 44px; }
.hero .photo {
  display: block;
  width: 168px; height: 168px; border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 24px; border: 1px solid var(--line);
}
.hero .photo img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 46% 45%;
  transform: scale(1.45);
  transform-origin: 46% 45%;
}
.hero h1 { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.hero h1 a { color: var(--ink); border: none; }
.hero h1 a:hover { color: var(--accent); }
.hero .tagline {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 12px;
}
.hero .affil { font-size: 0.88rem; color: var(--muted); line-height: 1.55; margin-bottom: 20px; }
.hero-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.hero-links a {
  font-family: var(--mono); font-size: 0.74rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 3px; padding: 6px 13px;
}
.hero-links a:hover { color: var(--accent); border-color: var(--accent); }

/* Compact hero for interior pages */
.hero--compact { margin-bottom: 36px; }
.hero--compact .photo { width: 104px; height: 104px; margin-bottom: 16px; }
.hero--compact h1 { font-size: 1.6rem; }
.hero--compact .tagline { margin-bottom: 0; }

/* ---------- Top nav ---------- */

.top-nav {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 26px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 14px 0; margin-bottom: 48px;
}
.top-nav a { font-family: var(--mono); font-size: 0.85rem; font-weight: 500; color: var(--ink); border: none; }
.top-nav a:hover { color: var(--accent); }
.top-nav a.active { color: var(--accent); font-weight: 600; }
.top-nav a.active::before { content: "» "; }

/* ---------- Page header (interior pages) ---------- */

.page-header { text-align: center; margin-bottom: 12px; }
.page-header h1 { font-size: 2rem; letter-spacing: -0.02em; margin-bottom: 0.4em; }
.page-header p.lede { color: var(--muted); font-size: 1rem; max-width: 56ch; margin: 0 auto 1em; }

/* ---------- Bio / pull quote ---------- */

.bio p { color: var(--body); }
.bio .pull, .pull {
  border-left: 3px solid var(--accent); padding-left: 1rem;
  font-size: 1.15rem; font-weight: 500; color: var(--ink); margin: 1.6em 0;
}
.pull em { color: var(--accent); font-style: italic; }

/* ---------- Section label ---------- */

.feed-label {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
  text-align: center; margin: 48px 0 26px;
}
.feed-label::before { content: "> "; }

/* ---------- Blocks / sections ---------- */

section.block { padding: 30px 0; border-bottom: 1px solid var(--line); }
section.block:last-of-type { border-bottom: none; }

section.block > h2 {
  font-size: 1.3rem;
  border-left: 3px solid var(--accent);
  padding-left: 0.7rem;
  margin-bottom: 1.3rem;
}
section.block h3 { font-size: 1.06rem; margin: 1.6rem 0 0.4rem; }
section.block p { color: var(--body); }

/* ---------- Domains list ---------- */

.domains { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 26px; margin: 6px 0 0; padding: 0; list-style: none; }
.domains li { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 0.95rem; color: var(--body); }
.domains li::before { content: "▸"; color: var(--accent); font-weight: 700; flex: none; }

/* ---------- Feed cards ---------- */

a.card {
  display: grid; grid-template-columns: 168px 1fr; gap: 20px;
  border: 1px solid var(--line); border-radius: 4px;
  padding: 16px; margin-bottom: 18px; align-items: center;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
a.card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(14,124,123,0.12); }
.card .thumb { width: 100%; height: 112px; object-fit: cover; border-radius: 3px; }
.card .meta { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.card .meta .kind { color: var(--accent); font-weight: 600; }
.card h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.card p { font-size: 0.9rem; color: var(--muted); margin: 0; line-height: 1.55; }

/* ---------- Tools / tags ---------- */

.tag-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 8px 0 0; padding: 0; list-style: none; justify-content: flex-start; }
.tag-row li {
  margin: 0;
  font-family: var(--mono);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  padding: 6px 13px;
  border-radius: 3px;
  font-size: 0.82rem;
  font-weight: 500;
}

/* ---------- CV entry rows ---------- */

.entry {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 0.3rem 1.5rem;
  padding: 0.85rem 0;
  margin: 0;
  align-items: baseline;
  border-top: 1px solid var(--line);
}
.entry:first-of-type { border-top: none; padding-top: 0; }
.entry .year {
  font-family: var(--mono);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}
.entry .content { color: var(--body); font-size: 0.96rem; }
.entry .content strong { color: var(--ink); }
.entry .content .sub { display: block; color: var(--muted); font-size: 0.89rem; margin-top: 0.3rem; line-height: 1.55; }

/* ---------- Institution groups (teaching) ---------- */

.inst { border: 1px solid var(--line); border-radius: 4px; padding: 20px 24px; margin-bottom: 18px; }
.inst h3 { margin: 0 0 4px; font-size: 1rem; }
.inst .inst-meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}
.course-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.course-list li { margin: 0; font-size: 0.92rem; color: var(--body); padding-left: 1.1em; position: relative; }
.course-list li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }
.course-list li .detail { color: var(--muted); font-size: 0.85em; }

/* ---------- Publication list ---------- */

.pub-list { list-style: none; padding: 0; }
.pub-list li { margin-bottom: 0.9rem; font-size: 0.93rem; color: var(--body); }
.pub-list .pyear { font-family: var(--mono); color: var(--accent); font-weight: 600; }

/* ---------- Figures / galleries ---------- */

.figure { margin: 1.5rem 0; }
.figure img { border-radius: 4px; border: 1px solid var(--line); }
.figure figcaption, .gallery figcaption, .page-figure figcaption {
  font-family: var(--mono); font-size: 0.8rem; color: var(--muted);
  margin-top: 0.5rem; line-height: 1.6;
}

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; margin: 1.5rem 0; }
.gallery figure { margin: 0; }
.gallery img { border-radius: 4px; border: 1px solid var(--line); width: 100%; height: 200px; object-fit: cover; }

.page-figure {
  display: grid; grid-template-columns: 210px 1fr; gap: 1.4rem; align-items: center;
  border: 1px solid var(--line); border-radius: 4px; padding: 16px; margin: 0 0 1.8rem;
}
.page-figure img { width: 100%; border-radius: 3px; }

/* ---------- Notes ---------- */

.note {
  font-family: var(--mono);
  font-size: 0.8rem; color: var(--muted);
  border-left: 2px solid var(--line); padding-left: 0.9rem; margin: 0.7rem 0;
  line-height: 1.6;
}

/* ---------- Video embeds ---------- */

.video-embed {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  border-radius: 4px; border: 1px solid var(--line); margin: 1.1rem 0 1.5rem;
  background: var(--panel);
}
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.video-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  font-family: var(--mono); font-size: 0.85rem; color: var(--muted);
}
.video-placeholder::before { content: "▶"; font-size: 2rem; color: var(--accent); }

/* ---------- Native video ---------- */

.video-native { margin: 1.1rem 0 1.5rem; }
.video-native video {
  width: 100%; display: block;
  border-radius: 4px; border: 1px solid var(--line);
  background: var(--panel);
}

/* ---------- Floating section nav ---------- */

/* Narrow / default: sticky horizontal pill bar */
.section-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  padding: 10px 4px; margin: 0 0 24px;
  scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav-label {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  flex: none; margin-right: 4px;
}
.section-nav a {
  flex: none;
  font-family: var(--mono); font-size: 0.76rem; font-weight: 500;
  color: var(--muted); border: 1px solid var(--line); border-radius: 3px;
  padding: 4px 10px; white-space: nowrap;
}
.section-nav a:hover { color: var(--accent); border-color: var(--accent); }
.section-nav a.active {
  color: var(--accent-dark); background: var(--accent-soft);
  border-color: var(--accent); font-weight: 600;
}

/* Wide: fixed sidebar in the left margin beside the column */
@media (min-width: 1150px) {
  .section-nav {
    position: fixed; top: 140px; left: calc(50% - 340px - 216px);
    width: 192px; display: block;
    overflow: visible; background: none;
    border: none; border-left: 1px solid var(--line);
    padding: 2px 0 2px 16px; margin: 0;
  }
  .section-nav-label { margin: 0 0 10px; }
  .section-nav a {
    display: block; border: none; border-radius: 0;
    padding: 3px 0; margin-left: -17px; padding-left: 17px;
    border-left: 2px solid transparent;
  }
  .section-nav a.active {
    background: none; border-left-color: var(--accent);
  }
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  text-align: center; font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }
.footer .footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .wrap { padding: 44px 18px 40px; }
  a.card { grid-template-columns: 1fr; }
  .card .thumb { height: 160px; }
  .gallery { grid-template-columns: 1fr; }
  .domains { grid-template-columns: 1fr; }
  .course-list { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr; gap: 0.1rem; }
  .page-figure { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .page-header h1 { font-size: 1.7rem; }
}
