/* ══════════════════════════════════════════
   PULSANTE CURRICULUM + MODAL CV
   (incolla in fondo a custom.css)
══════════════════════════════════════════ */

/* ── Pulsante ── */
.btn-cv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .9rem 2rem;
  background: transparent;
  border: 1px solid var(--color-brand-300);
  border-radius: 2rem;
  color: var(--color-brand-300);
  font-family: var(--sans-primary);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.6;
  cursor: pointer;
  transition: background .25s, color .25s, transform .2s;
}

.btn-cv:hover,
.btn-cv:focus-visible {
  background: var(--color-brand-300);
  color: #fff;
  transform: translateY(-2px);
}

.btn-cv:focus-visible {
  outline: 2px solid var(--color-brand-500);
  outline-offset: 3px;
}

.btn-cv svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Backdrop nei colori del brand ── */
.modal-backdrop {
  --bs-backdrop-bg: #10324E;
  --bs-backdrop-opacity: .7;
}

/* ── Contenitore modal ── */
.cv-modal .modal-dialog {
  max-width: min(760px, calc(100vw - 2rem));
}

.cv-modal .modal-content {
  background: var(--color-brand-0);
  color: var(--color-brand-700);
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(16, 50, 78, .25);
}

/* ── Header ── */
.cv-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--color-brand-400);
}

.cv-eyebrow {
  margin: 0 0 .5rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--color-brand-200);
}

.cv-name {
  margin: 0;
  font-family: var(--sans-primary);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 500;
  line-height: 1.1;
  color: #fff;
}

.cv-role {
  margin: .5rem 0 0;
  font-size: clamp(.78rem, 2vw, .88rem);
  line-height: 1.4;
  color: rgba(255, 255, 255, .7);
}

/* Tasto chiudi */
.cv-close {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: -.5rem -.5rem 0 0;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s;
}

.cv-close:hover,
.cv-close:focus-visible {
  background: rgba(255, 255, 255, .18);
}

.cv-close:focus-visible {
  outline: 2px solid var(--color-brand-200);
  outline-offset: 2px;
}

.cv-close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.cv-close span:nth-child(1) {
  transform: translate(-50%, -50%) rotate(45deg);
}

.cv-close span:nth-child(2) {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ── Corpo ── */
.cv-body {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.cv-section + .cv-section {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
}

.cv-section-title {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 1rem;
  font-family: var(--sans-primary);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--color-brand-300);
}

.cv-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(135, 165, 193, .5), transparent);
}

.cv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.cv-item {
  display: grid;
  grid-template-columns: minmax(4.5rem, 6rem) 1fr;
  gap: .25rem 1.25rem;
  align-items: baseline;
  padding: clamp(.9rem, 2.5vw, 1.15rem) clamp(1rem, 3vw, 1.4rem);
  background: #fff;
  border: 1px solid rgba(135, 165, 193, .2);
  border-left: 3px solid var(--color-brand-500);
  border-radius: 10px;
}

.cv-year {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--color-brand-500);
  white-space: nowrap;
}

.cv-title {
  margin: 0;
  font-size: clamp(.88rem, 2.2vw, .98rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-brand-400);
  overflow-wrap: anywhere;
}

.cv-desc {
  margin: .3rem 0 0;
  font-size: clamp(.8rem, 2vw, .86rem);
  line-height: 1.6;
  color: var(--color-brand-700);
}

/* ── Footer ── */
.cv-foot {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .75rem;
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem);
  border-top: 1px solid rgba(135, 165, 193, .25);
  background: var(--color-brand-0);
}

/* ── Responsive ── */

/* tablet e giù: pulsante allineato agli altri bottoni del sito */
@media (max-width: 768px) {
  .btn-cv {
    padding: .9rem 1rem;
    font-size: .7rem;
  }
}

/* smartphone: modal a schermo intero (Bootstrap modal-fullscreen-sm-down) */
@media (max-width: 575.98px) {
  .cv-modal .modal-dialog {
    max-width: none;
  }

  .cv-modal .modal-content {
    border-radius: 0;
  }

  .cv-foot {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  .cv-foot > * {
    flex: 1 1 100%;
    text-align: center;
  }
}

/* smartphone stretti: anno sopra il titolo */
@media (max-width: 420px) {
  .cv-item {
    grid-template-columns: 1fr;
  }
}

/* schermi bassi (landscape): header più compatto */
@media (max-height: 520px) {
  .cv-head {
    padding-block: 1rem;
  }

  .cv-name {
    font-size: 1.4rem;
  }
}
