/* ============================================
   Pavel Kocourek — pkocourek.com
   Ukraine-inspired palette: blue, yellow, light blue.
   ============================================ */

/* --- Design Tokens --- */
:root {
  --nav-bg:          #0057B7;
  --nav-scrolled:    #004494;
  --banner-bg:       #FFD700;
  --section-cream:   #FFF3CC;
  --section-blue:    #D6EEFB;
  --text:            #000;
  --text-light:      #333;
  --text-nav:        rgba(255,255,255,0.85);
  --text-nav-active: #fff;
  --link:            #1a0dab;
  --link-hover:      #0d0070;
  --white:           #fff;
  --max-width:       891px;
  --font:            'Inter', sans-serif;
  --font-heading:    'EB Garamond', serif;
  --font-mono:       'JetBrains Mono', monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: var(--font);
  background: var(--section-cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  overflow-wrap: break-word;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-heading);
}
h1 {
  font-size: 4rem;
  font-weight: 700;
  text-align: center;
}
h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.8em;
}
h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.2em 0 0.4em;
}

a { color: var(--link); text-decoration: underline; transition: color 0.2s; }
a:hover { color: var(--link-hover); }

p { margin-bottom: 1em; }

ul, ol { margin: 0 0 1em 1.5em; }
li { margin-bottom: 0.5em; }

/* Square bullet markers to match original */
ul { list-style-type: square; }

/* --- Navigation --- */
.site-header {
  background: var(--nav-bg);
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.site-header.scrolled {
  background: var(--nav-scrolled);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  position: relative;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-nav-active);
  text-decoration: none;
}
.nav-brand:hover { color: var(--text-nav-active); opacity: 0.85; text-decoration: none; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-nav);
  font-size: 1rem;
  font-weight: 400;
  text-decoration: none;
  padding: 0.2em 0;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--text-nav-active);
  text-decoration: none;
}
.nav-links a.active {
  color: var(--text-nav-active);
  font-weight: 700;
}

/* Hamburger (pure CSS) */
.nav-toggle { display: none; }
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-nav-active);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* --- Page Banner (blue title area) --- */
.page-banner {
  background: var(--banner-bg);
  padding: 2.5rem 2rem;
  text-align: center;
  width: 100%;
}
.page-banner h1 {
  color: var(--text);
  margin: 0;
}

.banner-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1.5rem;
  background: var(--nav-bg);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
  transition: opacity 0.2s;
}
.banner-btn:hover {
  opacity: 0.85;
  color: var(--white);
  text-decoration: none;
}

/* --- Content Sections (card style — default) --- */
.section {
  width: 100%;
  padding: 1.4rem 3rem;
  background: #f0f0f0;
}
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.section-cream { background: var(--section-cream); }
.section-blue  { background: var(--section-blue); }

/* --- Document-style sections (white + dividers) --- */
.page-document .section {
  background: var(--white);
  padding: 0 3rem;
}
.page-document .section-cream,
.page-document .section-blue {
  background: var(--white);
}
.page-document .section-inner {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 1.5rem 0;
  border-bottom: 1px solid #e0e0e0;
}
.page-document .section:last-of-type .section-inner {
  border-bottom: none;
}

/* --- Home Page --- */
.home-content {
  display: flex;
  gap: 2.5rem;
  align-items: stretch;
}
.home-text {
  flex: 1;
  font-size: 1.05rem;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
}
.home-text .home-links {
  margin-top: auto;
  margin-bottom: 0;
}
.home-photo {
  flex-shrink: 0;
  width: 300px;
  max-width: 32%;
}
.home-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.home-links {
  font-size: 1.05rem;
}

/* --- CV Page --- */
.cv-list {
  list-style-type: square;
  margin-left: 1.5em;
}
.cv-list li {
  display: flex;
  gap: 1.5em;
  margin-bottom: 1em;
  padding-left: 0.5em;
}
.cv-date {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9em;
  min-width: 7.5em;
  flex-shrink: 0;
}
.cv-detail {
  flex: 1;
}
.cv-title-inline {
  font-weight: 400 !important;
}
.details-visible .cv-title-inline {
  font-weight: 700 !important;
}
.cv-title-always-bold {
  font-weight: 700 !important;
}
.cv-subheading {
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1.2em 0 0.5em 0.4em;
  padding-bottom: 0.2em;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* Section-level detail toggle */
.section-toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nav-bg);
  font-size: 0.82rem;
  font-weight: 400;
  font-family: var(--font);
  padding: 0;
  margin-top: 0.1em;
}
.section-toggle:hover { text-decoration: underline; }
.section-toggle .arrow {
  transition: transform 0.2s;
  font-size: 0.6em;
  display: inline-block;
  vertical-align: 1px;
}
.cv-collapsible {
  display: none;
  margin-top: 0.3em;
  color: var(--text-light);
  font-size: 0.95em;
}
.details-visible .cv-collapsible {
  display: block;
}

/* --- Research Page --- */
.paper-entry {
  margin-bottom: 1.8em;
}
.paper-title-link {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--nav-bg);
  text-decoration: none;
}
.paper-title-link:hover {
  text-decoration: underline;
  color: var(--nav-scrolled);
}
.paper-title-plain {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}
.paper-authors {
  color: var(--text-light);
  margin-top: 0.15em;
}
.paper-authors a {
  color: var(--link);
}
.paper-journal {
  font-style: italic;
  color: #555;
  margin-top: 0.1em;
}
.abstract-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nav-bg);
  font-size: 0.9rem;
  padding: 0;
  margin-top: 0.3em;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}
.abstract-toggle:hover {
  text-decoration: underline;
}
.abstract-toggle .arrow {
  transition: transform 0.2s;
  font-size: 0.7em;
}
.abstract-toggle.open .arrow {
  transform: rotate(90deg);
}
.paper-abstract {
  display: none;
  margin-top: 0.5em;
  padding: 0.8em 1em;
  background: rgba(0,0,0,0.03);
  border-left: 3px solid var(--nav-bg);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: justify;
}
.paper-abstract.show {
  display: block;
}
.paper-links {
  margin-top: 0.4em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
  font-size: 0.9rem;
}
.paper-links a {
  color: var(--nav-bg);
  text-decoration: none;
}
.paper-links a:hover {
  text-decoration: underline;
}
.paper-links .sep {
  color: #999;
  margin: 0 0.2em;
}

/* --- Teaching Page --- */
.teaching-list {
  list-style-type: square;
  margin-left: 1.5em;
}
.teaching-list li {
  margin-bottom: 0.6em;
}

/* Course highlights */
.course-highlight {
  margin-bottom: 1.2em;
  padding-bottom: 1em;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.course-highlight:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.course-title {
  font-family: var(--font-heading);
  font-size: 1.12em;
  font-weight: 700;
  color: var(--text);
}
.course-meta {
  font-size: 0.92em;
  color: var(--text-light);
  margin-top: 0.15em;
}
.course-annotation {
  font-size: 0.92em;
  font-style: italic;
  color: var(--text-light);
  margin-top: 0.2em;
}
.course-info-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--nav-bg);
  font-family: var(--font);
  padding: 0;
  margin-top: 0.3em;
  display: block;
}
.course-info-btn:hover { text-decoration: underline; }
.course-details {
  margin-top: 0.5em;
  padding: 0.8em 1em;
  background: rgba(0,0,0,0.03);
  border-radius: 4px;
  font-size: 0.9em;
  line-height: 1.6;
}
.course-details p { margin: 0.2em 0; }

/* Show-all button */
.show-all-btn {
  display: inline-block;
  background: none;
  border: 1px solid var(--nav-bg);
  color: var(--nav-bg);
  font-family: var(--font);
  font-size: 0.88rem;
  padding: 0.5em 1.2em;
  cursor: pointer;
  border-radius: 3px;
}
.show-all-btn:hover {
  background: var(--nav-bg);
  color: #fff;
}


/* Coursework toggle (CV Education) */
.cv-detail .coursework-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--nav-bg);
  font-family: var(--font);
  padding: 0;
  margin-top: 0.3em;
  display: none !important;
}
.details-visible .cv-detail .coursework-btn {
  display: block !important;
}
.coursework-btn:hover { text-decoration: underline; }
.cw-content {
  display: none;
  margin-top: 0.4em;
  padding: 0.6em 0.8em;
  background: rgba(0,0,0,0.03);
  border-radius: 4px;
  font-size: 0.9em;
  line-height: 1.7;
}
.cw-visible .cw-content { display: block; }

/* --- Contact Page --- */
.contact-grid {
  display: flex;
  gap: 3rem;
  align-items: stretch;
}
.contact-info {
  flex: 1;
  font-size: 1.05rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}
.contact-info h2 {
  margin-bottom: 0.2em;
}
.contact-affiliation {
  color: var(--text-light);
  margin-bottom: 0.3em;
}
.contact-email {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--text);
  margin-top: 1em;
}
.contact-links {
  margin-top: auto;
  font-size: 0.95rem;
}
.contact-sep {
  color: #999;
  margin: 0 0.1em;
}
.contact-photo-wrap {
  flex-shrink: 0;
  width: 420px;
  max-width: 45%;
}
.contact-photo-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* --- Personal Page --- */
.personal-top {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}
.personal-text {
  flex: 1;
  font-size: 1.05rem;
  line-height: 1.65;
}
.personal-photo-wrap {
  flex-shrink: 0;
  width: 228px;
  max-width: 25%;
}
.personal-photo-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  max-width: 640px;
}
.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

blockquote {
  border-left: 3px solid var(--nav-scrolled);
  padding: 0.8em 1.2em;
  margin: 1.5em 0;
  color: var(--text-light);
  font-style: italic;
}

/* --- Footer --- */
.site-footer {
  background: var(--nav-bg);
  padding: 1.2rem 2rem;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}
.footer-inner > span {
  font-size: 0.75rem;
  font-style: italic;
  color: rgba(255,255,255,0.4);
  margin-left: 0.8rem;
}
.footer-links {
  display: flex;
  gap: 1.2rem;
}
.footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--white);
}

/* --- Responsive: Tablet & Hamburger (768px) --- */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    padding: 0.8rem 2rem 1rem;
    gap: 0;
    z-index: 200;
  }
  .site-header.scrolled .nav-links { background: var(--nav-scrolled); }
  .nav-links li { padding: 0.5rem 0; }
  .nav-toggle:checked ~ .nav-links { display: flex; }

  .nav-toggle:checked ~ .hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle:checked ~ .hamburger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .home-content {
    flex-direction: column;
  }
  .home-photo {
    width: 100%;
    max-width: 400px;
  }
  .personal-top {
    flex-direction: column;
  }
  .personal-photo-wrap {
    width: 100%;
    max-width: 280px;
  }
  .contact-grid {
    flex-direction: column;
  }
  .contact-photo-wrap {
    width: 100%;
    max-width: 400px;
  }
}

/* --- Responsive: Phone (479px) --- */
@media (max-width: 479px) {
  html { font-size: 16px; }
  h1 { font-size: 2.2rem; }
  .section { padding: 1.2rem 1rem; }
  .page-document .section { padding: 0 1rem; }
  .page-banner { padding: 1.5rem 1rem; }
  .nav-inner { padding: 0 1rem; }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
