/*
 * cv.css — Matthew Schmill Online CV
 * Modern two-column layout | Fully responsive
 */

/* ─── Custom Properties ────────────────────────────────────────────────────── */
:root {
  /* Palette */
  --sidebar-bg:       #1a2744;
  --sidebar-bg-dark:  #111d36;
  --sidebar-text:     #b8c8e0;
  --sidebar-head:     #edf2f8;
  --accent:           #38b2e8;
  --accent-dim:       rgba(56, 178, 232, 0.12);
  --accent-border:    rgba(56, 178, 232, 0.28);
  --accent-highlight: rgba(56, 178, 232, 0.25);

  --main-bg:          #f0f4f8;
  --card-bg:          #ffffff;
  --text-dark:        #1a2744;
  --text-body:        #2d3f5a;
  --text-muted:       #667592;
  --border:           #dde4ee;
  --timeline-line:    #c8d8ea;

  /* Layout */
  --sidebar-w:        285px;
  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        14px;
  --shadow-sm:        0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:        0 4px 16px rgba(0,0,0,0.09);
}

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

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--main-bg);
  color: var(--text-body);
  line-height: 1.6;
}

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

/* ─── Layout Shell ───────────────────────────────────────────────────────────── */
.cv-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  align-items: start;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════════════════════════ */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem 1.4rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;

  /* Thin custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.sidebar::-webkit-scrollbar       { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

/* Profile block */
.profile-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #1a6fa8);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.85rem;
  box-shadow: 0 0 0 3px rgba(56, 178, 232, 0.22);
}

.name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--sidebar-head);
  line-height: 1.25;
  margin-bottom: 0.3rem;
}

.credential {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.tagline {
  font-size: 0.78rem;
  color: var(--sidebar-text);
  opacity: 0.7;
  line-height: 1.4;
}

/* Sidebar sections */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-heading {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

/* Contact list */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.contact-list a {
  color: var(--sidebar-text);
  word-break: break-all;
}
.contact-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Email reveal — <details>/<summary>, no JS */
.email-reveal {
  display: inline;
}

.email-reveal summary {
  display: inline;
  list-style: none;          /* hide the default triangle */
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
}
.email-reveal summary::-webkit-details-marker { display: none; }

.email-reveal summary:hover {
  text-decoration: underline;
}

.email-reveal[open] summary {
  display: none;             /* hide "Email Matt" once the address is shown */
}

.email-reveal[open] a {
  font-size: 0.8rem;
  color: var(--sidebar-text);
  word-break: break-all;
}
.email-reveal[open] a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Skill groups */
.skill-group {
  margin-bottom: 0.85rem;
}

.skill-cat {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--sidebar-head);
  margin-bottom: 0.35rem;
  opacity: 0.88;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 0.12rem 0.42rem;
  font-size: 0.69rem;
  color: var(--sidebar-text);
  line-height: 1.5;
  white-space: nowrap;
}

.chip.highlight {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
  font-weight: 600;
}

/* Education */
.edu-item {
  margin-bottom: 0.9rem;
}
.edu-item:last-child { margin-bottom: 0; }

.edu-degree {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sidebar-head);
}

.edu-field {
  font-size: 0.75rem;
  color: var(--accent);
}

.edu-school {
  font-size: 0.74rem;
  color: var(--sidebar-text);
  opacity: 0.75;
}

.edu-note {
  font-size: 0.7rem;
  color: var(--sidebar-text);
  opacity: 0.55;
  margin-top: 0.2rem;
  line-height: 1.45;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════════════════════════════════ */
.main-content {
  padding: 2.5rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Section */
.cv-section { }

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  letter-spacing: 0.01em;
}

.section-note {
  font-size: 0.79rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.9rem;
}

/* Summary */
.summary-text {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.75;
  max-width: 72ch;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

/* ─── Timeline ───────────────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 1.6rem;
  border-left: 2px solid var(--timeline-line);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
}
.timeline-item:last-child {
  padding-bottom: 0;
}

/* Dot on the timeline line */
.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1.6rem - 5px);   /* align to border-left: half of 10px dot */
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--main-bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.timeline-content:hover {
  box-shadow: var(--shadow-md);
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.job-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dark);
}

.job-org {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  margin-top: 0.1rem;
}

.job-dates {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--main-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.18rem 0.6rem;
  flex-shrink: 0;
}

.job-desc {
  font-size: 0.83rem;
  color: var(--text-body);
  line-height: 1.65;
}

/* ─── Engagement Cards ───────────────────────────────────────────────────────── */
.engagement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 0.9rem;
}

.eng-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}
.eng-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.eng-tag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  padding: 0.12rem 0.48rem;
  align-self: flex-start;
}

.eng-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.35;
}

.eng-desc {
  font-size: 0.78rem;
  color: var(--text-body);
  line-height: 1.65;
}

/* ─── Publications ───────────────────────────────────────────────────────────── */
.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.pub-item {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.9rem;
  align-items: start;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-sm);
}

.pub-year {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  padding-top: 0.12rem;
  line-height: 1.3;
}

.pub-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.12rem;
}

.pub-venue {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.3rem;
}

.pub-abstract {
  font-size: 0.77rem;
  color: var(--text-body);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet
═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root {
    --sidebar-w: 250px;
  }
  .main-content {
    padding: 2rem 1.5rem 2.5rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile
═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  .cv-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow-y: visible;
    padding: 1.5rem 1.25rem 1.25rem;
    /* On mobile the sidebar stacks above the main content */
  }

  .profile-block {
    /* horizontal on mobile to save vertical space */
    flex-direction: row;
    text-align: left;
    gap: 1rem;
    align-items: center;
  }

  .avatar {
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    font-size: 1.1rem;
    margin-bottom: 0;
  }

  .main-content {
    padding: 1.5rem 1rem 2rem;
    gap: 2rem;
  }

  .engagement-grid {
    grid-template-columns: 1fr;
  }

  .job-header {
    flex-direction: column;
    gap: 0.35rem;
  }

  .pub-item {
    grid-template-columns: 2.2rem 1fr;
  }
}

@media (max-width: 440px) {
  html { font-size: 14px; }

  .main-content {
    padding: 1rem 0.75rem 1.5rem;
  }

  .timeline {
    padding-left: 1.2rem;
  }

  .timeline-item::before {
    left: calc(-1.2rem - 5px);
  }

  .chips {
    gap: 0.22rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PRINT
═══════════════════════════════════════════════════════════════════════════════ */
@media print {
  :root { --sidebar-w: 210px; }

  html { font-size: 13px; }

  .cv-layout {
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 0;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    background: var(--sidebar-bg) !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .eng-card:hover,
  .timeline-content:hover {
    box-shadow: var(--shadow-sm);
    transform: none;
  }

  .main-content {
    padding: 1.5rem 1.25rem;
  }
}
