/* ==========================================================================
   Jihad C. Dagher — academic website
   Shared stylesheet.  White page + "pencil" light-grey header.
   Self-contained: no external fonts, no CDNs, no images. GitHub-Pages ready.
   Retune the palette below in one place.
   ========================================================================== */

:root {
  /* Palette — white + pencil grey */
  --paper:        #ffffff;   /* page background (white)            */
  --ink:          #2b2b2b;   /* body text (soft graphite)          */
  --ink-soft:     #555555;   /* secondary text / muted notes       */
  --nav-top:      #f5f5f6;   /* header strip — top of gradient     */
  --nav-bottom:   #ececeb;   /* header strip — bottom of gradient  */
  --nav-rule:     #9a9a9a;   /* pencil-grey hairline under header   */
  --nav-ink:      #3a3a3a;   /* nav link graphite                  */
  --hairline:     #e2e2e0;   /* section-divider hairline           */
  --link:         #33526e;   /* restrained slate-ink link          */
  --link-hover:   #1f3448;   /* link on hover                      */

  --serif: "Garamond", "EB Garamond", Georgia, "Times New Roman", serif;
  --wrap:  820px;
}

/* Resets ------------------------------------------------------------------ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--serif);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
}

/* Header / navigation — the pencil-grey strip ----------------------------- */
nav {
  background: linear-gradient(180deg, var(--nav-top) 0%, var(--nav-bottom) 100%);
  border-bottom: 1px solid var(--nav-rule);
}
nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.55rem 1rem;
}
nav a {
  display: inline-block;
  text-decoration: none;
  color: var(--nav-ink);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.98rem;
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
nav a:hover,
nav a:focus {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.10);   /* faint pencil outline on hover */
}
nav a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 1px;
}

/* Main container ---------------------------------------------------------- */
.container {
  max-width: var(--wrap);
  margin: 2rem auto;
  padding: 0 1.25rem;
}

/* Headings ---------------------------------------------------------------- */
h1 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
  letter-spacing: 0.01em;
}
header p { margin-bottom: 1.25rem; font-style: italic; color: var(--ink-soft); }

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--hairline);
}

h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.3rem; }

p  { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1rem 1.4rem; }
li { margin-bottom: 0.35rem; }

/* Links ------------------------------------------------------------------- */
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--link-hover); }

strong { font-weight: 700; }

/* Section-title variant used on Policy / Teaching ------------------------- */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--nav-rule);
}

/* Inline section heading + adjacent note (Research) ----------------------- */
.section-head { display: inline; }
.section-note {
  font-size: 1rem;
  font-weight: normal;
  margin-left: 0.7rem;
  color: var(--ink-soft);
}

/* Research / Policy list items -------------------------------------------- */
.research-item { margin-bottom: 1.25rem; }
.research-item .text { max-width: 100%; }

.policy-item { margin-bottom: 1.5rem; }

/* Publication / working-paper lists (reset the default list bullets) ------ */
#working-papers ul,
#publications ul { list-style: none; margin-left: 0; }

/* CV — embedded PDF ------------------------------------------------------- */
.pdf-container { margin: 1.5rem 0; text-align: center; }
.pdf-container iframe {
  width: 100%;
  height: 85vh;
  min-height: 640px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
}
.pdf-container p { margin-top: 0.75rem; font-size: 0.95rem; color: var(--ink-soft); }

/* Teaching — course template blocks --------------------------------------- */
.course {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--nav-rule);   /* pencil accent edge */
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
  background: #fcfcfc;
}
.course h2 { border-bottom: none; margin-top: 0; padding-bottom: 0; }
.course p  { margin-bottom: 0; color: var(--ink); }
.course-project {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hairline);
}
.course-project p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
}
.course-project p:last-child { margin-bottom: 0; }
.course-inst {
  font-weight: normal;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.hint {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 1.5rem 0 1rem;
}

/* Seminars — talk cards --------------------------------------------------- */
.subtitle { color: var(--ink-soft); margin-bottom: 0.75rem; }
.talks { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }
@media (min-width: 800px) { .talks { grid-template-columns: 1fr 1fr; } }
.talk {
  background: #fcfcfc;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 1rem;
}
.talk h3 { margin-bottom: 0.3rem; }
.meta { font-size: 0.95rem; color: var(--ink); margin-bottom: 0.25rem; }

/* Collapsible abstract (details / summary) -------------------------------- */
details.abstract { margin-top: 0.5rem; }
details.abstract summary {
  cursor: pointer;
  width: fit-content;
  font-style: italic;
  color: var(--link);
  list-style: none;                 /* hide default disclosure marker */
}
details.abstract summary::-webkit-details-marker { display: none; }
details.abstract summary::before {
  content: "\25B8\00a0";            /* ▸ */
  font-style: normal;
  color: var(--ink-soft);
}
details.abstract[open] summary::before { content: "\25BE\00a0"; }  /* ▾ */
details.abstract summary:hover { color: var(--link-hover); }
details.abstract p {
  margin: 0.5rem 0 0;
  padding-left: 0.9rem;
  border-left: 2px solid var(--hairline);
  color: var(--ink);
}

/* Footer ------------------------------------------------------------------ */
footer {
  max-width: var(--wrap);
  margin: 2.5rem auto;
  padding: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--hairline);
}

/* Small screens ----------------------------------------------------------- */
@media (max-width: 560px) {
  .container { margin: 1.25rem auto; }
  h1 { font-size: 1.5rem; }
  nav ul { padding: 0.5rem 0.75rem; }
}
