/* ============================================================
   style.css — Johannes Emmerling personal website
   Edit colours and sizes via the :root variables below.
   ============================================================ */

:root {
  --accent:       #1d5c8a;
  --accent-dark:  #134069;
  --text:         #1a1a1a;
  --text-muted:   #5a5a5a;
  --bg:           #ffffff;
  --bg-alt:       #f4f6f9;
  --border:       #dde2e8;
  --max-w:        920px;
  --font:         system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --radius:       6px;
}

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  margin: 0;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

ul, ol { padding-left: 1.4rem; }

/* ── Layout container ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Site header ── */
.site-header {
  background: var(--accent);
  color: #fff;
  padding: 2rem 0 1.4rem;
  position: relative;
  overflow: hidden;
}

/* Header background image */
.site-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../images/background_bright_new_header.png') center center / cover no-repeat;
  opacity: 0.28;
  pointer-events: none;
}

.site-header .container {
  position: relative;
  z-index: 1;
}

.site-header h1 {
  margin: 0 0 0.2rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.site-header h1 a {
  color: #fff;
  text-decoration: none;
}

.site-header h1 a:hover {
  text-decoration: none;
  opacity: 0.85;
}

.site-header .tagline {
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  opacity: 0.85;
  color: #fff;
}

/* ── Site nav ── */
.site-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.2rem;
  overflow-x: auto;
}

.site-nav a {
  color: rgba(255,255,255,0.9);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  background: rgba(255,255,255,0.22);
  text-decoration: none;
  color: #fff;
}

/* ── Social icons in headings ── */
.social-icon {
  width: 0.95em;
  height: 0.95em;
  vertical-align: -0.12em;
  margin-right: 0.35em;
  flex-shrink: 0;
}

/* ── Home: two-column grid ── */
.home-grid {
  display: grid;
  grid-template-columns: 1fr minmax(0, 400px);
  gap: 2.5rem;
  margin: 2.5rem 0 1.5rem;
  align-items: start;
}

.home-grid > aside {
  min-width: 0;
  overflow: hidden;
}

/* Prevent LinkedIn badge iframe from breaking aside width */
.aside-section .badge-base {
  max-width: 100%;
  overflow: hidden;
}
.aside-section .badge-base iframe {
  max-width: 100% !important;
}

@media (max-width: 740px) {
  .home-grid { grid-template-columns: 1fr; }
}

/* ── Section headings shared style ── */
.section-heading--spaced { margin-top: 1.5rem; }

.section-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.35rem;
  margin: 0 0 1rem;
}

/* ── Profile pills ── */
.profiles-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.5rem 0 1.25rem;
}

.profile-pill {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.profile-pill:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* ── Bluesky feed ── */
.bsky-post {
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.65rem;
  background: var(--bg-alt);
  font-size: 0.87rem;
}

.bsky-text {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.bsky-date {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.bsky-date a {
  color: var(--text-muted);
}

.bsky-date a:hover {
  color: var(--accent);
}

.bsky-more {
  font-size: 0.85rem;
  display: inline-block;
  margin-top: 0.25rem;
}

/* ── Aside sections (concert, app, linkedin) ── */
.aside-section {
  margin-bottom: 1.5rem;
}

.aside-section .section-heading {
  margin-bottom: 0.6rem;
}

.bsky-post,
.concert-card,
.app-card,
.linkedin-card {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.concert-card,
.app-card,
.linkedin-card {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  font-size: 0.88rem;
}

.concert-card p,
.app-card p,
.linkedin-card p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.concert-card strong { color: var(--text); }

.concert-site-link { margin: 0.4rem 0 0; }

.app-card a { font-weight: 600; }

.linkedin-card a {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.83rem;
}

/* ── LinkedIn post embed ── */
.linkedin-embed-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
}

.linkedin-embed-wrap iframe {
  width: 100%;
  display: block;
  border: none;
}

/* ── Nav cards ── */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 1rem;
  margin: 0 0 3rem;
}

.card {
  display: block;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.card:hover {
  box-shadow: 0 3px 14px rgba(0,0,0,0.09);
  border-color: var(--accent);
  text-decoration: none;
}

.card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  color: var(--accent);
}

.card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Page content (research, teaching, cv) ── */
.page-content {
  padding: 2rem 1rem 3.5rem;
}

@media (max-width: 600px) {
  .page-content { padding-left: 0.5rem; padding-right: 0.5rem; }
}

.page-content h1 {
  font-size: 1.5rem;
  color: var(--accent);
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
  margin: 0 0 1.5rem;
}

.page-content h2 {
  font-size: 1.1rem;
  color: var(--accent);
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
  margin: 2.2rem 0 0.9rem;
}

/* ── Profiles bar on research page ── */
.page-profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}

/* ── Publication list ── */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pub-entry {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9rem 0;
}

.pub-citation {
  flex: 1;
  font-size: 0.93rem;
  line-height: 1.6;
}

.pub-citation strong { color: var(--text); }

.pub-citation em { color: var(--text-muted); }

.pub-badge {
  width: 72px;
  min-width: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0.2rem;
}

/* ── Teaching courses ── */
.course-block {
  margin-bottom: 2.2rem;
}

.course-block h2 {
  margin-bottom: 0.3rem;
}

.course-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  font-style: italic;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.pdf-table td {
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.pdf-table tr:last-child td { border-bottom: none; }

.pdf-table .pdf-title { width: 100%; }

.pdf-table .pdf-link { white-space: nowrap; text-align: right; }

/* ── Site footer ── */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 1.4rem 0;
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ── CV iframe ── */
.cv-embed {
  width: 100%;
  height: calc(100vh - 148px);
  min-height: 500px;
  border: none;
  display: block;
}

/* ── Responsive tweaks ── */
@media (max-width: 600px) {
  .container { padding: 0 0.75rem; }
  .site-header { padding: 1.4rem 0 1rem; }
  .site-header h1 { font-size: 1.5rem; }
  .site-header .tagline { font-size: 0.82rem; margin-bottom: 0.75rem; }
  .site-nav a { padding: 0.2rem 0.5rem; font-size: 0.78rem; }
  .pub-badge { display: none; }
  .pdf-table .pdf-link { display: none; }
  .cv-embed { height: calc(100vh - 120px); }
  .nav-cards { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .page-content { padding: 1.2rem 0.75rem 2.5rem; }
}
