/* =====================================================================
   Serkan Kocabaş — personal website
   Plain HTML + Bootstrap 5 (CDN) + Inter (Google Fonts)
   Inspired by fairaudo.github.io, tuned for an academic homepage.
   ===================================================================== */

:root {
  --bg:        #fafafa;   /* clean off-white background */
  --surface:   #ffffff;   /* abstract panels, cards */
  --text:      #1a1a1a;   /* primary text */
  --muted:     #555;      /* secondary text */
  --rule:      #e3e3e3;   /* subtle dividers */
  --link:      #0056b3;   /* link blue */
  --link-hov:  #003e80;   /* link hover */
  --accent:    #b71c1c;   /* "on the job market" red */
  --dark:      #2c3e50;   /* abstract toggle border */
  --maxw:      1080px;    /* central content width */
  --pad-x:     1.25rem;   /* horizontal padding shared by navbar + pages */
}

/* ---------- Base ---------- */

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover { color: var(--link-hov); text-decoration: underline; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

h1, h2, h3, h4 { color: var(--text); font-weight: 600; }
h1 { font-size: 1.9rem; margin-top: 1.5rem; }
h2 { font-size: 1.4rem; margin-top: 2.2rem; }
h3 { font-size: 1.15rem; margin-top: 1.6rem; }

/* ---------- Navbar ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem 0;
  --bs-navbar-padding-x: 0;
}
.site-nav .container,
.site-nav > .container {
  max-width: var(--maxw) !important;
  padding-left: var(--pad-x) !important;
  padding-right: var(--pad-x) !important;
  margin-left: auto;
  margin-right: auto;
}
.site-nav .navbar-brand { margin-left: 0; padding-left: 0; }
.site-nav .navbar-brand {
  font-weight: 600;
  color: var(--text);
  font-size: 1.45rem;
}
.site-nav .nav-link {
  color: var(--text);
  font-weight: 500;
  padding: 0.25rem 0.75rem;
}
.site-nav .nav-link:hover,
.site-nav .nav-link.active { color: var(--link); }

@media (min-width: 721px) {
  .site-nav .container,
  .site-nav > .container {
    max-width: none !important;
    width: 100%;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}


/* ---------- Layout ---------- */

main.page {
  max-width: var(--maxw);
  margin: 2rem auto 3rem;
  padding: 0 var(--pad-x);
}

/* ---------- Home hero (left identity column + right bio) ---------- */

.hero {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
.hero-side {
  text-align: center;
  padding-left: 0;
}
.hero-side .avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--rule);
  display: block;
  margin: 0 auto;         
}
.hero-side .name {
  font-size: 1.45rem;
  font-weight: 600;
  margin: 1rem 0 0.25rem;
}
.hero-side .role {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}
.hero-side .affiliation {
  margin: 0 0 0.9rem;
  font-size: 0.88rem;
  line-height: 1.4;
  white-space: nowrap;       /* keep "Universidad Carlos III de Madrid" on one line */
}
.hero-side .affiliation a { color: var(--link); }

.hero-side .social {
  justify-content: center;
  flex-wrap: nowrap;         /* force all icons on one line */
  gap: 0.35rem;
  margin: 0.5rem 0 0.9rem;
}
.hero-side .social a {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

.hero-side .social a i {
  font-size: 1.15rem;
  line-height: 1;
}
.hero-side .cv-button { margin-top: 0; }

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .hero-side .avatar { margin: 0 auto; }
  .hero-side { text-align: center; }
  .hero-side .social { justify-content: center; }
}
/* ---------- Bio block ---------- */

.bio p {
  text-align: justify;
  margin-bottom: 0.85rem;
}
.bio .jmp {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-left: 3px solid var(--link);
  border-radius: 4px;
}
.bio .jmp strong { display: block; margin-bottom: 0.2rem; }
.bio .job-market {
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.5rem;
}

/* ---------- Social icons ---------- */

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0.5rem;
}
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  transition: all 0.15s ease;
  text-decoration: none;
}
.social a:hover {
  color: var(--link);
  border-color: var(--link);
}
.social a i { font-size: 1rem; }

/* CV "pill" button (matches fairaudo's dark CV button) */
.cv-button {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.45rem 1rem;
  background: #2c3e50;
  color: #fff !important;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 500;
}
.cv-button:hover { background: #1a2533; text-decoration: none; }

/* ---------- News list ---------- */

.news h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.news ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.news li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}
.news li:last-child { border-bottom: 0; }
.news li .date {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Publications (Research page) ---------- */

.research-page {
  margin-top: 2.4rem;
}

.research-section {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  column-gap: 2.25rem;
  padding: 1.65rem 0;
  border-bottom: 1px solid var(--rule);
}

.research-section:first-of-type {
  padding-top: 0;
}

.research-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.research-section > h1 {
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  margin: 0;
  padding-right: 1.25rem;
  border-right: 1px solid var(--rule);
  font-size: 1.35rem;
  line-height: 1.25;
}

.research-items {
  min-width: 0;
}

.research-items .pub:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.pub {
  margin-bottom: 1.6rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--rule);
}
.pub:last-child { border-bottom: 0; }
.pub h3 {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}
.pub .authors {
  color: var(--muted);
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}
.pub .venue {
  font-style: italic;
  color: var(--muted);
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
}
.pub .links {
  margin: 0.4rem 0 0.5rem;
  font-size: 0.92rem;
}
.pub .links a {
  margin-right: 0.4rem;
}
.pub .links .sep { color: var(--rule); margin-right: 0.4rem; }

.policy-note p {
  margin: 0;
}

@media (max-width: 720px) {
  .research-page {
    margin-top: 2rem;
  }

  .research-section {
    grid-template-columns: 1fr;
    row-gap: 0.8rem;
    padding: 1.35rem 0;
  }

  .research-section > h1 {
    display: block;
    padding-right: 0;
    border-right: 0;
    font-size: 1.25rem;
  }
}

/* Abstract toggle */
details.abstract {
  margin-top: 0.5rem;
}
details.abstract > summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  padding: 5px 14px;
  border: 1.5px solid var(--dark);
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--dark);
  background: transparent;
  user-select: none;
}
details.abstract > summary::-webkit-details-marker { display: none; }
details.abstract[open] > summary { background: var(--dark); color: #fff; }
details.abstract > .abstract-body {
  margin-top: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  text-align: justify;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ---------- Teaching ---------- */

.course {
  margin-bottom: 1.8rem;
}
.course h3 { margin-bottom: 0.5rem; }
.course ul { padding-left: 1.2rem; }
.course ul li { margin-bottom: 0.35rem; text-align: justify; }
.course .syllabus { margin-top: 0.3rem; font-size: 0.95rem; }

/* ---------- References (people) ---------- */

.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.person {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.25rem;
  text-align: center;
}
.person img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.75rem;
  border: 1px solid var(--rule);
}
.person .name { font-weight: 600; margin: 0; }
.person .role { color: var(--muted); font-size: 0.88rem; margin: 0.2rem 0 0.4rem; }
.person .affil { font-size: 0.85rem; margin: 0 0 0.6rem; }
.person .affil a { color: var(--link); }
.person .social {
  justify-content: center;
  gap: 0.4rem;
  margin: 0.4rem 0 0;
}
.person .social a {
  width: 40px;
  height: 40px;
}

.person .social a i {
  font-size: 1.15rem;
}

.people-group {
  margin-bottom: 2rem;
}
.people-group h2 {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.35rem;
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--bg);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--link); }
