:root {
  --container-max-width: 800px;
  --container-half: 400px; /* half of --container-max-width */
  --ad-width: 160px;
  --ad-gap: 40px; /* space between container edge and ad */
  --accent-blue: #007acc;
  --font-main: 'Open Sans', sans-serif;
  --text-color: #333;
  --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body {
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 50px auto;
    padding: 40px 20px;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

h1, h2, h3 {
    color: #111;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
}

h2 {
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    margin-top: 40px;
}

.section {
    margin-bottom: 30px;
}

.job-title {
    font-weight: 600;
}

.institution {
    font-style: italic;
    color: #666;
}

ul {
    padding-left: 20px;
}

a,
.contact-list a,
.nav li a {
    color: var(--accent-blue);
    text-decoration: none;
}

a:hover,
a:focus,
.contact-list a:hover,
.contact-list a:focus,
.nav li a:hover,
.nav li a:focus {
    text-decoration: underline;
}

.nav {
    display: flex;
    gap: 30px;
    justify-content: center;
    padding: 0;
    list-style: none;
}

.cv-button {
    display: inline-block;
    background-color: var(--accent-blue);
    color: white;
    padding: 6px 14px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    margin-top: 10px;
    border: none;
    font-size: 1em;
}

.cv-button:hover,
.cv-button:focus {
    background-color: #005f99;
}

.download-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 20px;
    margin-bottom: 20px;
    background: #f3f7fa;
    border-radius: 8px;
    box-shadow: none;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.download-note {
    font-size: 0.95em;
    color: #555;
    text-align: center;
    white-space: nowrap;
    margin: 0;
}

.contact-list {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 5px;
}

.linkedin-icon {
    fill: #0077b5;
    vertical-align: middle;
    margin-right: 5px;
}

.main-layout {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 32px;
}

/* position ad slots dynamically around centered container
   - calculates distance from viewport center using the container half width
   - falls back to static/stacked layout in the media queries below */
.ad-slot {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--ad-width);
}

.left-ad {
  left: calc((100vw - var(--container-max-width)) / 4 - var(--ad-width) / 2);
}

.right-ad {
  right: calc((100vw - var(--container-max-width)) / 4 - var(--ad-width) / 2);
}

.ad-content {
  width: var(--ad-width);
  height: 600px;
  background: #eee;
  display: flex;
  flex-direction: column; /* Stacks children vertically */
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
  box-shadow: var(--box-shadow);
  padding: 10px;
  text-align: center;
}

.ad-note {
  font-size: 0.8em;
  color: #666;
  margin-top: 10px;
}

/* Hide or reposition ads on mobile */
@media screen and (max-width: 1200px) {
  .ad-content {
    height: 300px;
  }
}

@media screen and (max-width: 900px) {
  .ad-slot {
    position: static;
    transform: none;
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    margin: 20px 0 0 0;
  }
  .ad-content {
    width: 100vw;
    max-width: 350px;
    height: 160px;
  }
}

@media screen and (max-width: 768px) {
    .container {
        margin: 20px auto;
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.3em;
    }

    .nav {
        flex-direction: column;
        gap: 10px;
    }

    .nav li {
        display: block;
        margin: 10px 0;
    }

    .download-box {
        width: 100%;
        max-width: 350px;
        padding: 10px 8px;
        margin: 0 auto 20px auto;
        box-sizing: border-box;
    }

    .download-box .cv-button {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .download-note {
        white-space: normal;
    }

    ul {
        padding-left: 16px;
    }

    .main-layout {
        flex-direction: column;
        align-items: center;
    }
    .ad-slot {
        margin-top: 20px;
    }
}