/* Site-specific styles on top of the onlyati-ui library: the CV page, the project stack and the
   few pieces the library has no component for. Colors and spacing come from the library tokens. */

.lead {
  color: var(--text-secondary);
  max-width: var(--measure);
}

.project .lead {
  color: var(--text-primary);
  font-size: 1.05rem;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
}

/* Photos are square-cropped files; object-fit keeps them square even if a non-square one is configured. */
.portrait,
.cv-photo {
  flex: none;
  aspect-ratio: 1;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-muted);
  background: var(--bg-surface-alt);
}

.cv-photo {
  width: 112px;
}

.stack {
  list-style: none;
  padding: var(--sp-3) var(--sp-4);
  margin: 0;
  max-width: var(--measure);
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--sp-2) var(--sp-4);
  background: var(--bg-surface-alt);
  border-radius: var(--radius-control);
}

.stack li {
  display: contents;
}

/* ---------- CV ---------- */
.cv {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  max-width: 820px;
}

.cv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.cv-identity {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  min-width: 0;
}

@media (min-width: 721px) {
  .cv-identity {
    flex: 1 1 0;
  }
}

.cv-title {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.cv-years {
  font-weight: 700;
  color: var(--accent-primary);
}

.cv-updated {
  margin-top: var(--sp-2);
  font-size: 0.8rem;
}

.cv-downloads {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.cv-aside {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-3);
}

.cv-qr {
  margin: 0;
  flex: none;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.cv-qr svg {
  display: block;
  width: 22mm;
  height: 22mm;
  border-radius: 4px;
  color: var(--text-primary);
}

.cv-contacts {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-6);
}

.cv-contacts li {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.cv-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-muted);
}

/* Section titles must stand out clearly from the entry titles (h3) inside them. */
.cv-section h2 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--accent-primary);
}

.cv-section ul {
  padding-inline-start: 1.2em;
}

.cv-entry {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.cv-entry + .cv-entry {
  margin-top: var(--sp-3);
}

.cv-more {
  margin-top: var(--sp-3);
}

/* Date and duration go on their own line under the title. */
.cv-entry-head {
  display: flex;
  flex-direction: column;
}

.cv-skills {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--sp-1) var(--sp-4);
}

.cv-skills dt {
  font-weight: 700;
}

.cv-skills dd {
  margin: 0;
}

@media (max-width: 720px) {
  .cv-aside {
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .cv-identity {
    gap: var(--sp-4);
  }

  .cv-photo {
    width: 88px;
  }

  .stack {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .stack span {
    margin-bottom: var(--sp-2);
  }

  .cv-skills {
    grid-template-columns: 1fr;
  }

  .cv-skills dd {
    margin-bottom: var(--sp-2);
  }
}
