/* ============================================================
   Krzysztof Gonia — personal site
   Layout inspired by the AcademicPages Jekyll theme (jfumero.dev)
   ============================================================ */

:root {
  --max-width: 1100px;
  --sidebar-width: 300px;
  --gap: 3rem;

  --color-text: #3f3f46;
  --color-heading: #1f2933;
  --color-muted: #6b7280;
  --color-accent: #2a7ae2;
  --color-accent-dark: #1756a9;
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8fa;
  --color-border: #e5e7eb;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--color-heading);
  line-height: 1.25;
  font-weight: 700;
  margin: 1.6rem 0 0.8rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; }

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

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

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

/* ---------- masthead / top nav ---------- */
.masthead {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.masthead-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}
.site-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-heading);
}
.site-name:hover { text-decoration: none; color: var(--color-accent); }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--color-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--color-accent); text-decoration: none; }
.site-nav a.active {
  color: var(--color-heading);
  border-bottom-color: var(--color-accent);
}

/* hamburger (mobile) */
.nav-toggle-label { display: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle-label span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-heading);
  margin: 4px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- page layout ---------- */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}
.content-grid {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: var(--gap);
  align-items: start;
}

/* ---------- author sidebar ---------- */
.author-sidebar {
  position: sticky;
  top: 90px;
}
.author-card { text-align: center; }
.author-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-bg);
  box-shadow: 0 0 0 1px var(--color-border);
  margin: 0 auto 1rem;
  display: block;
  background: var(--color-bg-alt);
}
.author-name { font-size: 1.35rem; margin: 0.25rem 0 0.5rem; }
.author-bio {
  font-size: 0.92rem;
  color: var(--color-muted);
  margin: 0 0 1.25rem;
}
.author-links {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  display: inline-block;
}
.author-links li { margin: 0.4rem 0; color: var(--color-text); }
.author-links a { color: var(--color-text); font-weight: 600; }
.author-links a:hover { color: var(--color-accent); text-decoration: none; }
.author-links i { color: var(--color-muted); margin-right: 0.6rem; }
.author-links a:hover i { color: var(--color-accent); }
.author-links .hf-icon {
  display: inline-block;
  width: 1.25em;            /* match Font Awesome fa-fw */
  margin-right: 0.6rem;
  text-align: center;
  font-size: 0.95em;
}

/* ---------- main content ---------- */
.main-content { min-width: 0; }
.page-title { margin-top: 0; }

.main-content ul, .main-content ol { padding-left: 1.3rem; }
.main-content li { margin: 0.3rem 0; }

/* ---------- talks listing ---------- */
.talk-list { list-style: none; margin: 0; padding: 0; }
.talk-list-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}
.talk-list-item:first-child { padding-top: 0.5rem; }
.talk-list-item h3 { margin: 0 0 0.35rem; font-size: 1.2rem; }
.talk-list-item h3 a { color: var(--color-heading); }
.talk-list-item h3 a:hover { color: var(--color-accent); }
.talk-list-item .talk-meta,
.talk-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0 0 0.4rem;
}
.talk-sep { margin: 0 0.5rem; }
.talk-list-item p { margin: 0.35rem 0 0; }

/* ---------- single talk ---------- */
.talk-header { margin-bottom: 1.5rem; }
.talk-desc { color: var(--color-muted); }
.talk-body { margin: 1.5rem 0; }
.talk-embed {
  position: relative;
  width: 100%;
  padding-top: 60%;      /* ~5:3 aspect for slide decks */
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}
.talk-embed--video { padding-top: 56.25%; }  /* 16:9 for video */
.talk-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.talk-back { margin-top: 2rem; }

/* ---------- ko-fi button ---------- */
.kofi-button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  border-radius: 6px;
}
.kofi-button:hover { background: var(--color-accent-dark); color: #fff; text-decoration: none; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-muted);
  font-size: 0.85rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  text-align: center;
}
.footer-inner p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .author-sidebar { position: static; }
  .author-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    text-align: left;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
  }
  .author-avatar { width: 110px; height: 110px; margin: 0; }
  .author-name { width: 100%; margin: 0; }
  .author-bio { flex: 1 1 60%; margin: 0; }
  .author-links { text-align: left; }

  /* mobile nav */
  .nav-toggle-label { display: block; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .site-nav ul { flex-direction: column; gap: 0; padding: 0.5rem 1.5rem; }
  .site-nav li { padding: 0.5rem 0; }
  .nav-toggle:checked ~ .site-nav { max-height: 320px; }
}

/* Support callout on project pages */
.support-cta {
  margin: 2.5rem 0 1.5rem;
  padding: 1rem 1.25rem;
  border-left: 4px solid #e4b04a;
  background: rgba(228, 176, 74, 0.08);
  border-radius: 0 6px 6px 0;
  font-size: 0.95rem;
}
.support-cta p { margin: 0; }
