/* =============================================================================
   AMPIRELINK — page publique d'une personne (aussi utilisée pour l'aperçu du tableau de bord)
   Le balisage est produit par inc/vue.php (al_page_publique_html) et assets/js/publicpage.js.
   Thèmes : ocean, royal, sunset, light — Boutons : rounded, pill, square.
   La couleur d'accent teinte les pastilles, bordures et halos ; le texte et les icônes gardent
   toujours la couleur du thème : la page reste lisible quelle que soit la couleur choisie.
   ============================================================================= */
.pp {
  --pp-bg: radial-gradient(1200px 640px at 50% -12%, #14467a 0%, #061b36 56%, #03111e 100%);
  --pp-text: #eaf3fb;
  --pp-muted: rgba(234, 243, 251, .72);
  --pp-faint: rgba(234, 243, 251, .55);
  --pp-card: rgba(255, 255, 255, .07);
  --pp-card-hover: rgba(255, 255, 255, .13);
  --pp-line: rgba(255, 255, 255, .15);
  --pp-shadow: 0 12px 30px rgba(0, 0, 0, .25);
  --accent: #5598dd;
  --accent-rgb: 85, 152, 221;
  --pp-radius: 16px;
  --pp-tile-radius: 12px;

  position: relative; width: 100%; min-height: 100%;
  display: flex; justify-content: center;
  padding: 48px 18px 28px;
  background: var(--pp-bg); color: var(--pp-text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5; text-align: left;
  -webkit-font-smoothing: antialiased;
}
.pp.theme-royal {
  --pp-bg: linear-gradient(165deg, #3a2390 0%, #1a1048 52%, #0b0724 100%);
  --pp-card: rgba(255, 255, 255, .09);
  --pp-card-hover: rgba(255, 255, 255, .15);
}
.pp.theme-sunset {
  --pp-bg: linear-gradient(165deg, #a52f1c 0%, #932768 48%, #3d1255 100%);
  --pp-text: #ffffff;
  --pp-muted: rgba(255, 255, 255, .98);
  --pp-faint: rgba(255, 255, 255, .85);
  --pp-card: rgba(255, 255, 255, .14);
  --pp-card-hover: rgba(255, 255, 255, .18);
  --pp-line: rgba(255, 255, 255, .3);
}
.pp.theme-light {
  --pp-bg: linear-gradient(180deg, #f7f9fc 0%, #e8eef7 100%);
  --pp-text: #0b1f33;
  --pp-muted: rgba(11, 31, 51, .72);
  --pp-faint: rgba(11, 31, 51, .68);
  --pp-card: #ffffff;
  --pp-card-hover: #ffffff;
  --pp-line: rgba(11, 31, 51, .13);
  --pp-shadow: 0 8px 24px rgba(11, 31, 51, .08);
}
/* Photo d'arrière-plan choisie par la personne : voile sombre réglable (--pp-voile) pour garder les liens lisibles.
   Sur une photo, le texte est toujours clair et les liens sont des cartes translucides, quel que soit le thème. */
.pp.has-photo {
  --pp-bg: linear-gradient(rgba(3, 8, 18, var(--pp-voile, .45)), rgba(3, 8, 18, var(--pp-voile, .45))), var(--pp-photo) center / cover no-repeat;
  --pp-text: #ffffff;
  --pp-muted: rgba(255, 255, 255, .9);
  --pp-faint: rgba(255, 255, 255, .78);
  --pp-card: rgba(8, 14, 26, .42);
  --pp-card-hover: rgba(8, 14, 26, .58);
  --pp-line: rgba(255, 255, 255, .24);
  --pp-shadow: 0 12px 30px rgba(0, 0, 0, .3);
  background-color: #050b16;
}
.pp.has-photo .pp-link { -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); }
.pp.has-photo .pp-name, .pp.has-photo .pp-bio, .pp.has-photo .pp-stat { text-shadow: 0 1px 12px rgba(0, 0, 0, .45); }
.pp.btn-pill { --pp-radius: 999px; --pp-tile-radius: 50%; }
.pp.btn-square { --pp-radius: 6px; --pp-tile-radius: 4px; }

.pp *, .pp *::before, .pp *::after { box-sizing: border-box; }
.pp a { color: inherit; }
.pp-inner { width: 100%; max-width: 540px; display: flex; flex-direction: column; align-items: stretch; }

/* En-tête : photo à gauche, nom + @adresse + bio à droite (comme le profil Ampirezoya) */
.pp-inner { container-type: inline-size; }
.pp-head { display: flex; align-items: center; gap: clamp(14px, 5cqi, 24px); text-align: left; margin-bottom: 18px; }
.pp-avatar {
  flex: none; width: clamp(68px, 23cqi, 112px); height: clamp(68px, 23cqi, 112px);
  border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-weight: 800; font-size: clamp(1.4rem, 7cqi, 2.2rem); letter-spacing: .02em;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .6), rgba(var(--accent-rgb), .2));
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18), 0 14px 34px rgba(0, 0, 0, .28);
}
.pp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pp-id { min-width: 0; flex: 1; container-type: inline-size; }
/* Nom TOUJOURS sur une ligne : la taille se calcule d'après la largeur disponible et le nombre de caractères (--n) */
.pp-name {
  margin: 0; line-height: 1.15;
  /* même police que le nom des profils AMPIREZOYA (identité AMPIRE) */
  font-family: "Archivo Black", "Arial Black", Impact, sans-serif; font-weight: 400; letter-spacing: -.005em;
  font-size: clamp(.95rem, calc(100cqi / (var(--n, 14) * .66)), 1.6rem);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pp-bio { margin: 8px 0 0; color: var(--pp-muted); font-size: clamp(.84rem, 3.7cqi, 1rem); line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }

/* Compteur : uniquement le nombre de liens */
.pp-stats { display: flex; gap: 32px; margin: 4px 0 22px; padding: 0 2px; }
.pp-stat { margin: 0; display: grid; gap: 2px; }
.pp-stat strong { font-size: clamp(1.1rem, 5cqi, 1.35rem); font-weight: 800; line-height: 1.1; }
.pp-stat span { font-size: clamp(.8rem, 3.6cqi, .95rem); color: var(--pp-muted); }

.pp-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pp-empty { margin: 0; text-align: center; color: var(--pp-muted); padding: 28px 0; }

.pp-link {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  min-height: 68px; padding: 11px 16px 11px 11px;
  border-radius: var(--pp-radius); background: var(--pp-card); border: 1px solid var(--pp-line);
  color: var(--pp-text); text-decoration: none; box-shadow: var(--pp-shadow);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.pp.btn-pill .pp-link { padding-right: 22px; }
.pp-link:hover {
  transform: translateY(-2px); background: var(--pp-card-hover); text-decoration: none; color: var(--pp-text);
  border-color: rgba(var(--accent-rgb), .75);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28), 0 0 0 1px rgba(var(--accent-rgb), .28);
}
.pp-link:active { transform: translateY(0); }
.pp-link:focus-visible { outline: 3px solid var(--pp-text); outline-offset: 3px; }
.pp-link-icon {
  width: 46px; height: 46px; border-radius: var(--pp-tile-radius); display: grid; place-items: center;
  background: rgba(var(--accent-rgb), .22); border: 1px solid rgba(var(--accent-rgb), .42); color: var(--pp-text);
}
.pp-link-text { min-width: 0; display: grid; gap: 2px; }
.pp-link-title { font-weight: 700; font-size: 1.02rem; line-height: 1.25; overflow-wrap: anywhere; }
.pp-link-desc {
  font-size: .85rem; color: var(--pp-muted); line-height: 1.35; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pp-link-arrow { color: var(--pp-faint); display: grid; transition: transform .18s, color .18s; }
.pp-link:hover .pp-link-arrow { color: var(--pp-text); transform: translateX(3px); }

.pp-foot { margin-top: 34px; text-align: center; font-size: .8rem; }
.pp-foot a { color: var(--pp-faint); text-decoration: none; letter-spacing: .04em; }
.pp-foot a:hover { color: var(--pp-text); text-decoration: none; }
.pp-foot strong { font-weight: 800; letter-spacing: .1em; }
.pp-foot .pp-report { display: block; margin-top: 10px; font-size: .74rem; letter-spacing: .02em; color: var(--pp-faint); opacity: .8; text-decoration: underline; text-underline-offset: 3px; }
.pp-foot .pp-report:hover { opacity: 1; }

/* Page publique en plein écran */
body.public-page { margin: 0; background: #03111e; }
.public-page .pp {
  min-height: 100vh; min-height: 100dvh;
  padding-top: max(48px, env(safe-area-inset-top));
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}
@media (min-width: 700px) {
  .public-page .pp { padding-top: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-link, .pp-link-arrow { transition: none; }
  .pp-link:hover { transform: none; }
}

/* Tuiles de liens plus généreuses (comme le profil Ampirezoya) */
.pp-link { min-height: 76px; padding: 12px 18px 12px 12px; gap: 16px; border-radius: max(var(--pp-radius), 18px); }
.pp.btn-square .pp-link { border-radius: 6px; }
.pp-link-icon { width: 52px; height: 52px; border-radius: var(--pp-tile-radius, 14px); }
.pp-link-title { font-size: 1.08rem; }

/* Icônes des réseaux : tuile aux couleurs de la marque, pictogramme officiel (Simple Icons) */
.pp-link-icon.is-brand { background: var(--brand); border-color: rgba(255, 255, 255, .14); color: var(--brand-fg); }
.pp-link-icon.brand-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.pp-link-icon.is-brand .icon-brand { width: 26px; height: 26px; }
.pp.theme-light .pp-link-icon.is-brand { border-color: rgba(0, 0, 0, .06); }
