/*
  Assignment: Part B - My Resume
  Name: Matteo Iacono
*/

:root {
  --purple: #8b2189;        /* main purple from the template */
  --dark-grey: #555555;     /* colour of the large name */
  --mid-grey: #777777;      /* job titles */
  --light-grey: #8a8a8a;    /* body paragraphs */
  --white: #ffffff;
  /* Century Gothic first; Questrial is the free look-alike loaded from Google Fonts */
  --font: "Century Gothic", "Questrial", "Avenir", sans-serif;
}


/* box-sizing makes padding count inside an element's width */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* The grey background behind the "paper" page */
body {
  background-color: #e6e6e6;
  font-family: var(--font);
  padding: 30px 0;
}

/* Links inherit the text colour instead of default blue */
a {
  color: inherit;
  text-decoration: none;
}

.page {
  width: 950px;
  min-height: 1230px;
  margin: 0 auto;                       /* centres the page on screen */
  background-color: var(--white);
  display: grid;
  grid-template-columns: 327px 1fr;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);   /* soft "paper" shadow */
}

.sidebar {
  background-color: var(--purple);
  color: var(--white);
  overflow: hidden;            /* hides the chevron edges that stick out */
}

/* Photo box: the purple background shows through the blended image */
.photo {
  height: 397px;
  background-color: var(--purple);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;           /* fills the box without stretching */
  object-position: top;        /* keeps the face in view when cropping */
  display: block;
  filter: grayscale(100%) brightness(1.15);
  mix-blend-mode: luminosity;
  opacity: 0.85;
}

/* Section titles in the sidebar: spaced-out capital letters with a line under them */
.sidebar-heading {
  font-weight: normal;
  font-size: 24px;
  letter-spacing: 6px;          /* the wide "C O N T A C T" spacing */
  text-transform: uppercase;
  text-align: center;
  margin: 0 47px 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.contact {
  padding-top: 28px;
}

/* The list of email / phone / website, without bullet points */
.contact-list {
  list-style: none;
  padding: 0 0 0 33px;
}

/* Each contact row lines up the icon and text side by side */
.contact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  margin-bottom: 20px;
}

/* Shared style for the thin outline icons in the sidebar */
.icon,
.pin,
.cap {
  fill: none;
  stroke: var(--white);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Small contact icons */
.icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;               /* stops the icon from squishing on long text */
}

/* Relative positioning lets the chevron sit behind the city text */
.location {
  position: relative;
  height: 150px;
  text-align: center;
  margin-top: 8px;
}

.chevron {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background-color: var(--white);
  clip-path: polygon(
    0 0,
    50% calc(100% - 22px),
    100% 0,
    100% 22px,
    50% 100%,
    0 22px
  );
}

/* City name, placed just inside the top of the V */
.city {
  position: relative;          /* keeps the text above the chevron */
  padding-top: 8px;
  font-weight: bold;
  font-size: 17px;
}

/* Map pin under the city name */
.pin {
  position: relative;
  width: 34px;
  height: 34px;
  margin-top: 6px;
  stroke-width: 1.4;
}

.education {
  padding-top: 20px;
  position: relative;
}

/* Each school is indented with room on the left for the cap icon */
.school {
  position: relative;
  padding-left: 68px;
  margin-bottom: 18px;
  font-size: 17px;
  line-height: 1.5;
}

/* Graduation cap icon placed to the left of the school name */
.cap {
  position: absolute;
  left: 37px;
  top: 0;
  width: 26px;
  height: 26px;
}

/* School name in bold capitals */
.school h3 {
  font-size: 17px;
  text-transform: uppercase;
}

/* Graduation year in italics, like the template */
.school .year {
  font-style: italic;
}

/* The lower chevron sits in normal flow so it follows the last school */
.chevron-bottom {
  position: relative;
  margin-top: 0;
}

.content {
  padding: 34px 31px 40px 29px;
  color: var(--light-grey);
}

/* Header holds the name and title, with the thin grey line beneath */
.header {
  border-bottom: 1px solid var(--dark-grey);
  padding-bottom: 20px;
  margin-bottom: 38px;
}

/* Large name at the top, thin and uppercase */
.name {
  font-weight: normal;
  font-size: 54px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dark-grey);
  line-height: 1.1;
}

/* Job title under the name, in purple */
.job-title {
  font-size: 29px;
  text-transform: uppercase;
  color: var(--purple);
  margin-top: 10px;
}

/* Space between the main sections (Objective, Experience, Skills) */
.block {
  margin-bottom: 36px;
}

/* Purple section headings on the right side */
.section-heading {
  font-weight: normal;
  font-size: 31px;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 10px;
}

/* All paragraphs in the main column share the same size and line height */
.content p {
  font-size: 17.5px;
  line-height: 25px;
}

.job {
  margin-bottom: 14px;
}

/* Job title in grey uppercase */
.job h3 {
  font-weight: normal;
  font-size: 24px;
  text-transform: uppercase;
  color: var(--mid-grey);
  margin-bottom: 4px;
}

/* Dates shown in italics in brackets */
.content .dates {
  font-style: italic;
}

.skills {
  list-style: none;
}

/* Each skill row: the bar on the left, the skill name on the right */
.skills li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 17.5px;
  margin-bottom: 7px;
}

/* The empty outline of the bar */
.bar {
  position: relative;
  width: 235px;
  height: 18px;
  border: 1px solid var(--purple);
  flex-shrink: 0;
}

/* The purple fill; its width comes from the --level value on each bar */
.bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--level, 50%);     /* 50% if no level is given */
  background-color: var(--purple);
}

@media (max-width: 960px) {
  body {
    padding: 0;
  }

  .page {
    width: 100%;
    grid-template-columns: 1fr;   /* one column instead of two */
    box-shadow: none;
  }

  .name {
    font-size: 40px;
  }

  .bar {
    width: 45%;
  }
}

@media print {
  body {
    background: none;
    padding: 0;
  }

  .page {
    box-shadow: none;
  }

  /* Tells the browser to print background colours instead of dropping them */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
