{% assign cv = site.data.cv %}

<style>
  .archive {
    width: 80%;
    margin: 0 auto;
    float: none;
    padding-right: 0;
  }
  
  @media (min-width: 80em) {
    .archive {
      width: 70%;
    }
  }
</style>

<div class="cv-container">
  <!-- Basic Information -->
  <div class="cv-section cv-header">
    <h1>{{ cv.basics.name }}</h1>
    {% if cv.basics.label %}
    <h2>{{ cv.basics.label }}</h2>
    {% endif %}
    
    <div class="cv-contact">
      {% if cv.basics.email %}
      <div class="cv-contact-item">
        <i class="fas fa-envelope"></i> {{ cv.basics.email }}
      </div>
      {% endif %}
      
      {% if cv.basics.phone %}
      <div class="cv-contact-item">
        <i class="fas fa-phone"></i> {{ cv.basics.phone }}
      </div>
      {% endif %}
      
      {% if cv.basics.website %}
      <div class="cv-contact-item">
        <i class="fas fa-globe"></i> <a href="{{ cv.basics.website }}" target="_blank">{{ cv.basics.website }}</a>
      </div>
      {% endif %}
      
      {% if cv.basics.location.city %}
      <div class="cv-contact-item">
        <i class="fas fa-map-marker-alt"></i> {{ cv.basics.location.city }}{% if cv.basics.location.region %}, {{ cv.basics.location.region }}{% endif %}{% if cv.basics.location.countryCode %}, {{ cv.basics.location.countryCode }}{% endif %}
      </div>
      {% endif %}
    </div>
    
    {% if cv.basics.profiles.size > 0 %}
    <div class="cv-profiles">
      {% for profile in cv.basics.profiles %}
      <a href="{{ profile.url }}" target="_blank" class="cv-profile-link">
        <i class="fab fa-{{ profile.network | downcase }}"></i> {{ profile.network }}
      </a>
      {% endfor %}
    </div>
    {% endif %}
  </div>
  
  {% if cv.basics.summary %}
  <!-- Summary -->
  <div class="cv-section">
    <h2>Summary</h2>
    <p>{{ cv.basics.summary }}</p>
  </div>
  {% endif %}
  
  {% if cv.education.size > 0 %}
  <!-- Education -->
  <div class="cv-section">
    <h2>Education</h2>
    <ul class="cv-list">
      {% for education in cv.education %}
      <li class="cv-item">
        <div class="cv-item-header">
          <div class="cv-item-title">{{ education.area }}</div>
          <div class="cv-item-date">{{ education.endDate }}</div>
        </div>
        <div class="cv-item-content">
          <div class="cv-item-subtitle">{{ education.institution }}</div>
          {% if education.gpa %}
          <div class="cv-item-detail">GPA: {{ education.gpa }}</div>
          {% endif %}
          {% if education.courses.size > 0 %}
          <div class="cv-item-detail">
            <strong>Courses:</strong> {{ education.courses | join: ", " }}
          </div>
          {% endif %}
        </div>
      </li>
      {% endfor %}
    </ul>
  </div>
  {% endif %}
  
  {% if cv.work.size > 0 %}
  <!-- Work Experience -->
  <div class="cv-section">
    <h2>Work Experience</h2>
    <ul class="cv-list">
      {% for work in cv.work %}
      <li class="cv-item">
        <div class="cv-item-header">
          <div class="cv-item-title">{{ work.position }}</div>
          <div class="cv-item-date">{{ work.startDate }}{% if work.endDate %} - {{ work.endDate }}{% endif %}</div>
        </div>
        <div class="cv-item-content">
          <div class="cv-item-subtitle">{{ work.company }}</div>
          {% if work.summary %}
          <div class="cv-item-detail">{{ work.summary }}</div>
          {% endif %}
          {% if work.highlights.size > 0 %}
          <ul class="cv-highlights">
            {% for highlight in work.highlights %}
            <li>{{ highlight }}</li>
            {% endfor %}
          </ul>
          {% endif %}
        </div>
      </li>
      {% endfor %}
    </ul>
  </div>
  {% endif %}
  
  {% if cv.skills.size > 0 %}
  <!-- Skills -->
  <div class="cv-section">
    <h2>Skills</h2>
    <div class="cv-skills">
      {% for skill in cv.skills %}
      <div class="cv-skill-category">
        <h3>{{ skill.name }}</h3>
        <ul class="cv-skill-list">
          {% for keyword in skill.keywords %}
          <li>{{ keyword }}</li>
          {% endfor %}
        </ul>
      </div>
      {% endfor %}
    </div>
  </div>
  {% endif %}
  
  {% if cv.publications.size > 0 %}
  <!-- Publications -->
  <div class="cv-section">
    <h2>Publications</h2>
    <ul class="cv-list">
      {% for publication in cv.publications %}
      <li class="cv-item">
        <div class="cv-item-header">
          <div class="cv-item-title">{{ publication.name }}</div>
          <div class="cv-item-date">{{ publication.releaseDate | slice: 0, 4 }}</div>
        </div>
        <div class="cv-item-content">
          <div class="cv-item-subtitle">{{ publication.publisher }}</div>
          {% if publication.summary %}
          <div class="cv-item-detail">{{ publication.summary }}</div>
          {% endif %}
          {% if publication.website %}
          <div class="cv-item-detail">
            <a href="{{ publication.website }}" target="_blank">View Publication</a>
          </div>
          {% endif %}
        </div>
      </li>
      {% endfor %}
    </ul>
  </div>
  {% endif %}
  
  {% if cv.presentations.size > 0 %}
  <!-- Presentations/Talks -->
  <div class="cv-section">
    <h2>Presentations</h2>
    <ul class="cv-list">
      {% for talk in cv.presentations %}
      <li class="cv-item">
        <div class="cv-item-header">
          <div class="cv-item-title">{{ talk.name }}</div>
          <div class="cv-item-date">{{ talk.date | slice: 0, 4 }}</div>
        </div>
        <div class="cv-item-content">
          <div class="cv-item-subtitle">{{ talk.event }}</div>
          {% if talk.location %}
          <div class="cv-item-detail">{{ talk.location }}</div>
          {% endif %}
          {% if talk.description %}
          <div class="cv-item-detail">{{ talk.description }}</div>
          {% endif %}
        </div>
      </li>
      {% endfor %}
    </ul>
  </div>
  {% endif %}
  
  {% if cv.teaching.size > 0 %}
  <!-- Teaching -->
  <div class="cv-section">
    <h2>Teaching</h2>
    <ul class="cv-list">
      {% for teaching in cv.teaching %}
      <li class="cv-item">
        <div class="cv-item-header">
          <div class="cv-item-title">{{ teaching.course }}</div>
          <div class="cv-item-date">{{ teaching.date | slice: 0, 4 }}</div>
        </div>
        <div class="cv-item-content">
          <div class="cv-item-subtitle">{{ teaching.institution }}</div>
          {% if teaching.role %}
          <div class="cv-item-detail">Role: {{ teaching.role }}</div>
          {% endif %}
          {% if teaching.description %}
          <div class="cv-item-detail">{{ teaching.description }}</div>
          {% endif %}
        </div>
      </li>
      {% endfor %}
    </ul>
  </div>
  {% endif %}
  
  {% if cv.portfolio.size > 0 %}
  <!-- Portfolio -->
  <div class="cv-section">
    <h2>Portfolio</h2>
    <ul class="cv-list">
      {% for item in cv.portfolio %}
      <li class="cv-item">
        <div class="cv-item-header">
          <div class="cv-item-title">{{ item.name }}</div>
          <div class="cv-item-date">{{ item.date | slice: 0, 4 }}</div>
        </div>
        <div class="cv-item-content">
          <div class="cv-item-subtitle">{{ item.category | capitalize }}</div>
          {% if item.description %}
          <div class="cv-item-detail">{{ item.description }}</div>
          {% endif %}
          {% if item.url %}
          <div class="cv-item-detail">
            <a href="{{ item.url }}" target="_blank">View Project</a>
          </div>
          {% endif %}
        </div>
      </li>
      {% endfor %}
    </ul>
  </div>
  {% endif %}
  
  {% if cv.languages.size > 0 %}
  <!-- Languages -->
  <div class="cv-section">
    <h2>Languages</h2>
    <ul class="cv-list">
      {% for language in cv.languages %}
      <li class="cv-item">
        <div class="cv-item-content">
          <div class="cv-item-title">{{ language.language }}</div>
          <div class="cv-item-detail">{{ language.fluency }}</div>
        </div>
      </li>
      {% endfor %}
    </ul>
  </div>
  {% endif %}
  
  {% if cv.interests.size > 0 %}
  <!-- Interests -->
  <div class="cv-section">
    <h2>Interests</h2>
    <ul class="cv-list">
      {% for interest in cv.interests %}
      <li class="cv-item">
        <div class="cv-item-content">
          <div class="cv-item-title">{{ interest.name }}</div>
          {% if interest.keywords.size > 0 %}
          <div class="cv-item-detail">{{ interest.keywords | join: ", " }}</div>
          {% endif %}
        </div>
      </li>
      {% endfor %}
    </ul>
  </div>
  {% endif %}
  
  {% if cv.references.size > 0 %}
  <!-- References -->
  <div class="cv-section">
    <h2>References</h2>
    <ul class="cv-list">
      {% for reference in cv.references %}
      <li class="cv-item">
        <div class="cv-item-content">
          <div class="cv-item-title">{{ reference.name }}</div>
          {% if reference.reference %}
          <div class="cv-item-detail">{{ reference.reference }}</div>
          {% endif %}
        </div>
      </li>
      {% endfor %}
    </ul>
  </div>
  {% endif %}
</div>
