/* Portfolio / CV sections on public profile */

.profile-portfolio-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 16px 0 0;
}

.profile-portfolio-manage-bar {
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 123, 255, 0.08) 0%, rgba(124, 58, 237, 0.06) 100%);
  border: 1px solid rgba(0, 123, 255, 0.14);
}

.profile-portfolio-manage-bar__hint {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.45;
}

.profile-portfolio-manage-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-portfolio-surface {
  overflow: hidden;
}

.profile-portfolio-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-portfolio-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

@media (min-width: 640px) {
  .profile-portfolio-card:has(.profile-portfolio-card__media) {
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: start;
  }
}

.profile-portfolio-card__media {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: rgba(15, 23, 42, 0.04);
}

.profile-portfolio-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-portfolio-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.profile-portfolio-card__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.profile-portfolio-card__org {
  margin: 4px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #007bff;
}

.profile-portfolio-card__meta {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: #64748b;
}

.profile-portfolio-card__submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #64748b;
}

.profile-portfolio-card__submeta i {
  margin-right: 4px;
  opacity: 0.85;
}

.profile-portfolio-card__desc {
  margin: 10px 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #334155;
}

.profile-portfolio-card__actions {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}

.profile-portfolio-card__edit,
.profile-portfolio-card__delete {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.05);
  color: #64748b;
  cursor: pointer;
}

.profile-portfolio-card__edit:hover {
  background: rgba(0, 123, 255, 0.12);
  color: #007bff;
}

.profile-portfolio-card__delete:hover {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.profile-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

/* —— Progetti: masonry Pinterest/Behance —— */
.profile-progetti-masonry {
  column-count: 1;
  column-gap: 16px;
}

@media (min-width: 560px) {
  .profile-progetti-masonry {
    column-count: 2;
  }
}

@media (min-width: 900px) {
  .profile-progetti-masonry {
    column-count: 2;
  }
}

.profile-progetti-tile {
  break-inside: avoid;
  margin: 0 0 16px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-progetti-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
}

.profile-progetti-tile__visual {
  position: relative;
  line-height: 0;
}

.profile-progetti-tile__visual img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.profile-progetti-tile__badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #b91c1c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.profile-progetti-tile--editorial .profile-progetti-tile__editorial-inner {
  min-height: 120px;
  padding: 20px 18px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.profile-progetti-tile--tone-1 .profile-progetti-tile__editorial-inner {
  background: linear-gradient(145deg, rgba(0, 102, 204, 0.12) 0%, rgba(79, 70, 229, 0.08) 100%);
}

.profile-progetti-tile--tone-2 .profile-progetti-tile__editorial-inner {
  background: linear-gradient(145deg, rgba(15, 118, 110, 0.12) 0%, rgba(0, 102, 204, 0.07) 100%);
}

.profile-progetti-tile--tone-3 .profile-progetti-tile__editorial-inner {
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.1) 0%, rgba(236, 72, 153, 0.07) 100%);
}

.profile-progetti-tile--tone-4 .profile-progetti-tile__editorial-inner {
  background: linear-gradient(145deg, rgba(234, 88, 12, 0.1) 0%, rgba(245, 158, 11, 0.08) 100%);
}

.profile-progetti-tile--tone-5 .profile-progetti-tile__editorial-inner {
  background: linear-gradient(145deg, rgba(2, 132, 199, 0.11) 0%, rgba(14, 165, 233, 0.06) 100%);
}

.profile-progetti-tile__kicker {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.55);
}

.profile-progetti-tile__body {
  position: relative;
  padding: 14px 16px 16px;
}

.profile-progetti-tile--visual .profile-progetti-tile__body {
  padding-top: 12px;
}

.profile-progetti-tile__actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.profile-progetti-tile:hover .profile-progetti-tile__actions {
  opacity: 1;
}

.profile-progetti-tile__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #0f172a;
}

.profile-progetti-tile__subtitle {
  margin: 6px 0 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.4;
}

.profile-progetti-tile__excerpt {
  margin: 8px 0 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #64748b;
}

.profile-progetti-tile__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0066cc;
  text-decoration: none;
}

.profile-portfolio-project {
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-portfolio-project:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.profile-portfolio-project__visual {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #e8f1ff 0%, #f3e8ff 100%);
}

.profile-portfolio-project__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-portfolio-project__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(15, 23, 42, 0.25);
  font-size: 2rem;
}

.profile-portfolio-project__overlay-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.profile-portfolio-project:hover .profile-portfolio-project__overlay-actions {
  opacity: 1;
}

.profile-portfolio-project__body {
  padding: 12px 14px 14px;
}

.profile-portfolio-project__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
}

.profile-portfolio-project__subtitle {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: #64748b;
}

.profile-portfolio-project__desc {
  margin: 8px 0 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #475569;
}

.profile-portfolio-project__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #007bff;
  text-decoration: none;
}

.profile-portfolio-google-place {
  width: 100%;
}

.profile-portfolio-google-place gmp-place-autocomplete,
.profile-portfolio-place-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ccd6e0;
  border-radius: 12px;
  background-color: #fff;
  color-scheme: light;
  font-family: inherit;
  font-size: 0.95rem;
  min-height: 42px;
}

.profile-portfolio-place-toggle {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: #007bff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.profile-portfolio-place-toggle:hover {
  text-decoration: underline;
}

.profile-portfolio-url-input {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #ccd6e0;
  background-color: #fff;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.profile-portfolio-url-input:focus-within {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.profile-portfolio-url-input i {
  color: #64748b;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.profile-portfolio-url-input input[type="url"] {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 10px 0;
  background: transparent;
  font-size: 0.95rem;
  font-family: inherit;
  box-shadow: none;
}

.profile-portfolio-url-input input[type="url"]:focus {
  outline: none;
  box-shadow: none;
}

.profile-portfolio-place-manual {
  margin-top: 8px;
}

.profile-portfolio-project__attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.profile-portfolio-project__thumb {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.profile-portfolio-project__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-portfolio-project__pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

#profile-portfolio-modal .profile-portfolio-google-place {
  position: relative;
  z-index: 2;
}

.profile-section-header--with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-portfolio-section-sub {
  font-weight: 500;
  font-size: 0.82em;
  color: #64748b;
}

.profile-portfolio-ac-wrap {
  position: relative;
}

.portfolio-ac-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 25000;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  max-height: 220px;
  overflow-y: auto;
}

.portfolio-ac-dropdown__item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.35;
}

.portfolio-ac-dropdown__item strong {
  display: block;
  color: #0f172a;
  font-weight: 600;
}

.portfolio-ac-dropdown__item span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 0.8rem;
}

.portfolio-ac-dropdown__item:hover,
.portfolio-ac-dropdown__item:focus {
  background: rgba(0, 123, 255, 0.08);
}

.profile-portfolio-modal__dialog {
  max-width: 560px;
  max-height: min(92vh, 760px);
  overflow-y: auto;
}

@media (max-width: 991px) {
  .profile-portfolio-modal__dialog {
    max-width: none;
    max-height: 100%;
    height: 100%;
    overflow: hidden;
  }
}

.profile-portfolio-form-panels .portfolio-ac-wrap {
  position: relative;
}


.profile-portfolio-upload__preview {
  margin-top: 8px;
  border-radius: 10px;
  overflow: hidden;
  max-height: 160px;
}

.profile-portfolio-upload__preview img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Upload file — stesso pattern community (np-post-images) */
.np-post-images {
  margin-top: 14px;
}

.np-post-images__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: #444;
}

.np-post-images__add {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px dashed rgba(0, 102, 204, 0.45);
  background: rgba(0, 102, 204, 0.06);
  color: #0066cc;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.np-post-images__add:hover {
  background: rgba(0, 102, 204, 0.12);
  border-color: rgba(0, 102, 204, 0.65);
}

.np-post-images__add-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.np-post-images__add-badge {
  margin-left: 2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #0066cc;
  color: #fff;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.np-post-images__hint {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 0.78rem;
}

.np-post-images__input {
  display: none;
}

.np-post-images__preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.np-post-images__preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.np-post-images__tile {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f8fafc;
}

.np-post-images__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

.np-post-images__tile--pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b91c1c;
  font-size: 1.35rem;
}

.np-post-images__tile-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-portfolio-cover-upload {
  margin-top: 4px;
}

.profile-portfolio-attachments {
  margin-top: 0;
}

.profile-portfolio-gallery-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.profile-portfolio-gallery-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fafafa;
}

.profile-portfolio-gallery-row__thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #eef2ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-portfolio-gallery-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-portfolio-gallery-row__thumb--pdf {
  color: #b91c1c;
  font-size: 1.5rem;
}

.profile-portfolio-gallery-row__field {
  margin: 0;
}

.profile-portfolio-gallery-row__field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

.profile-portfolio-gallery-row__name {
  width: 100%;
}

.profile-portfolio-gallery-row__remove {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  padding: 6px;
}

.profile-portfolio-current-toggle {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 14px;
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}

.profile-portfolio-current-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile-portfolio-current-toggle--prominent {
  width: 100%;
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 102, 204, 0.28);
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-portfolio-current-toggle--prominent:hover {
  border-color: rgba(0, 102, 204, 0.45);
  background: rgba(0, 102, 204, 0.04);
}

.profile-portfolio-current-toggle__box {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid rgba(0, 102, 204, 0.42);
  background: #ffffff;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-portfolio-current-toggle__box::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 9px;
  border-right: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: translate(-50%, -62%) rotate(45deg) scale(0.5);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.profile-portfolio-current-toggle__text {
  display: flex;
  align-items: center;
  min-width: 0;
}

.profile-portfolio-current-toggle__text strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: #004999;
}

.profile-portfolio-current-toggle--prominent:has(input:checked),
.profile-portfolio-current-toggle--prominent:has(input:checked):hover {
  border-color: rgba(0, 102, 204, 0.5);
  background: rgba(0, 102, 204, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 102, 204, 0.08);
}

.profile-portfolio-current-toggle--prominent:has(input:checked) .profile-portfolio-current-toggle__box {
  border-color: #0066cc;
  background: #0066cc;
}

.profile-portfolio-current-toggle--prominent:has(input:checked) .profile-portfolio-current-toggle__box::after {
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
  opacity: 1;
  transform: translate(-50%, -62%) rotate(45deg) scale(1);
}

.profile-portfolio-end-dates[hidden] {
  display: none !important;
}

.profile-portfolio-degree-other {
  margin-top: 10px;
}

.profile-portfolio-degree-other[hidden] {
  display: none !important;
}

.profile-portfolio-community-share {
  margin: 4px 0 14px;
}

.profile-portfolio-community-share__hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #64748b;
}

.profile-portfolio-community-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 102, 204, 0.28);
  background: #ffffff;
  color: #0066cc;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.profile-portfolio-community-share__check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0, 102, 204, 0.42);
  background: #ffffff;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.profile-portfolio-community-share__check::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 9px;
  border-radius: 0;
  background: transparent;
  border-right: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: translate(-50%, -62%) rotate(45deg) scale(0.5);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.profile-portfolio-community-share__btn:hover {
  border-color: rgba(0, 102, 204, 0.45);
  background: rgba(0, 102, 204, 0.04);
}

.profile-portfolio-community-share__btn.is-active {
  border-color: rgba(0, 102, 204, 0.5);
  background: rgba(0, 102, 204, 0.12);
  color: #004999;
  box-shadow: inset 0 0 0 1px rgba(0, 102, 204, 0.08);
}

.profile-portfolio-community-share__btn.is-active .profile-portfolio-community-share__check {
  border-color: #0066cc;
  background: #0066cc;
}

.profile-portfolio-community-share__btn.is-active .profile-portfolio-community-share__check::after {
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
  opacity: 1;
  transform: translate(-50%, -62%) rotate(45deg) scale(1);
}

.profile-portfolio-community-share__btn:focus-visible {
  outline: 2px solid rgba(0, 102, 204, 0.45);
  outline-offset: 2px;
}

.profile-portfolio-form-panels .address-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
