/* ── Typography Utilities ────────────────────────────────────────── */
.text-h1 { font-size: var(--fs-h1); font-family: var(--ff-heading); }
.text-h2 { font-size: var(--fs-h2); font-family: var(--ff-heading); }
.text-h3 { font-size: var(--fs-h3); font-family: var(--ff-heading); }
.text-body { font-size: var(--fs-body); font-family: var(--ff-body); }
.text-small { font-size: var(--fs-small); font-family: var(--ff-body); }
.text-label { font-size: var(--fs-label); font-family: var(--ff-body); }

/* ── Public Profile Styles ────────────────────────────────────────── */

.profile-avatar-wrap {
  position: relative;
  width: fit-content;
  background: transparent;
}
.profile-avatar-icon {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
}

.profile-hero {
    position: relative;
    width: 100%;
    height: max(90vh, 500px) !important;
    padding: 24px;
    overflow: hidden;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

/* Portada de fondo fija (parallax) — perfiles de usuario.
   Sustituye a background-attachment: fixed sobre .content, que Safari iOS
   ignora y trata como scroll (la portada acompañaba el scroll).
   Con position: fixed la capa queda pegada al viewport en todos los navegadores.
   z-index: 0 la pinta por encima del fondo de .content pero por debajo del
   contenido posicionado (.profile-hero relative, .profile-content z-index 20,
   sidebar 100, barra móvil 10002, modales 1000+). */
.profile-cover-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: var(--dark);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.profile-hero--column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.profile-hero--user {
    display: flex;
    gap: 24px;
    height: auto !important;
    min-height: max(90vh, 500px);
    overflow: visible;
}

.profile-hero--user .profile-hero-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.profile-hero--user .profile-giphy-box {
    position: static;
    width: clamp(140px, 20vw, 250px);
    height: auto;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    align-self: flex-end;
}

.profile-hero-zone-a {
    max-width: 400px;
}

/* Glassmorphism shared style */
.glass-box {
    background: rgba(45, 52, 56, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--light);
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Top-Left: Info Box */
.profile-info-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.profile-info-header {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.profile-info-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.5);
    background: transparent;
}

.profile-info-name {
    font-family: var(--ff-heading);
    font-size: var(--fs-h2);
    line-height: 1;
    text-transform: uppercase;
    color: var(--light);
}

.profile-info-country {
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    opacity: 0.8;
}

.profile-social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
}

.profile-social-link {
    color: var(--light);
    font-family: var(--ff-body);
    font-size: var(--fs-label);
    text-decoration: none;
    text-transform: capitalize;
    transition: color var(--t);
}

.profile-social-link + .profile-social-link::before {
    content: '|';
    margin-right: 4px;
    opacity: 0.5;
}

.profile-social-link:hover {
    color: var(--CTA);
}

/* Bottom-Right: Description Box */
.profile-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
    overscroll-behavior-y: contain;
    animation: overlayFadeIn 0.3s ease;
}

.profile-modal-overlay .dash-modal-panel {
    animation: modalFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.profile-modal {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    display: none;
    animation: modalFadeIn 0.3s ease;
    background: var(--light);
    color: var(--dark);
    padding: 24px;
    border-radius: 16px;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}

@keyframes overlayFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.profile-modal.closing {
    animation: modalFadeOut 0.3s ease forwards;
}

.profile-modal-overlay.closing {
    animation: overlayFadeOut 0.3s ease forwards;
}

.profile-modal-close {
    position: sticky;
    top: 8px;
    width: 40px;
    height: 40px;
    margin-left: auto;
    margin-bottom: -40px;
    background: var(--light);
    border: solid 2px var(--dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 11;
}

.profile-modal-close img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.profile-modal-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-modal-title {
    font-family: var(--ff-heading);
    font-size: var(--fs-h2);
    color: var(--dark);
    margin: 0;
    text-align: left;
}

.profile-modal-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
}

.profile-modal-text {
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    line-height: 1.5;
    color: var(--dark);
}

/* Modal de ESTADO (ver estado y editar estado):
   reproductor centrado y tonos --dark2 en borde, icono, línea,
   línea de progreso y números */
#thought-modal .audio-player,
#thought-form .audio-player {
    align-self: center;
    margin-inline: auto;
    border-color: var(--dark2);
}

#thought-modal .audio-player-btn,
#thought-form .audio-player-btn {
    background: var(--dark2);
    color: var(--light);
}

#thought-modal .audio-player-rail,
#thought-form .audio-player-rail {
    background: rgba(71, 70, 69, 0.25); /* --dark2 al 25% */
}

#thought-modal .audio-player-progress,
#thought-form .audio-player-progress {
    background: var(--dark2);
}

#thought-modal .audio-player-time,
#thought-form .audio-player-time {
    color: var(--dark2);
    opacity: 1;
}

.profile-modal-body textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    color: var(--dark);
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    resize: none;
    outline: none;
    box-sizing: border-box;
}

.profile-modal-body textarea::placeholder {
    color: #aaa;
}

.profile-modal-body button[type="submit"] {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: var(--dark);
    color: var(--light);
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    font-weight: bold;
    cursor: pointer;
    transition: background var(--t);
}

.profile-modal-body button[type="submit"]:hover {
    background: var(--CTA);
}

.dash-modal-body button[type="submit"] {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: var(--dark);
    color: var(--light);
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    font-weight: bold;
    cursor: pointer;
    transition: background var(--t), opacity var(--t);
}

.dash-modal-body button[type="submit"]:hover:not(:disabled) {
    background: var(--CTA);
}

.dash-modal-body button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── dash-modal (bio/postea) ─────────────────────────────
   mirror of dashboard.css:852-914 — keep in sync */
.dash-modal-panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 512px;
  margin: auto;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

html.legacy-dark .dash-modal-panel {
  background: #27272a;
}

.dash-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--bg-dark);
}

html.legacy-dark .dash-modal-header {
  border-color: #3f3f46;
}

.dash-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  min-height: 0;
  padding: 16px;
}

.dash-modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--bg-light);
  font-size: 20px;
  cursor: pointer;
  transition: background var(--t);
}

.dash-modal-close:hover {
  background: var(--bg-dark);
  color: var(--dark);
}


.profile-action-box form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.profile-action-box textarea {
    width: 100%;
    min-height: 60px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    resize: vertical;
    outline: none;
    transition: border var(--t);
    box-sizing: border-box;
}

.profile-action-box textarea::placeholder {
    color: var(--light);
}

.profile-action-box textarea:focus {
    border-color: var(--CTA);
}

.profile-action-box button[type="submit"] {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    background: var(--dark);
    color: var(--light);
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--t);
}

.profile-action-box button[type="submit"]:hover {
    background: var(--CTA);
}

.profile-action-auth-hint {
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    opacity: 0.7;
    text-align: center;
}

/* Follow buttons */
.btn-primary,
.btn-secondary {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: background var(--t), opacity var(--t);
}

.btn-primary {
    background: var(--dark);
    color: var(--light);
}

.btn-secondary {
    background: var(--dark);
    color: var(--light);
    border: 1px solid var(--dark);
}

.btn-primary:hover,
.btn-secondary:hover {
    background: var(--CTA);
}

.btn-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

.profile-info-action-btn {
    background: transparent;
    border: none;
    color: var(--light);
    font-family: var(--ff-body);
    font-size: var(--fs-label);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    transition: color var(--t);
}

.profile-info-action-btn:hover {
    color: var(--CTA);
}

.profile-info-action-btn--ghost {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 6px 14px;
    color: var(--light);
}

.profile-info-action-btn--ghost:hover {
    border-color: var(--CTA);
    color: var(--CTA);
}

.profile-action-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

.profile-info-actions form {
    display: contents;
}

.profile-info-actions .btn-primary,
.profile-info-actions .btn-secondary {
    background: transparent;
    border: none;
    color: var(--light);
    font-family: var(--ff-body);
    font-size: var(--fs-label);
    font-weight: 400;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color var(--t);
}

.profile-info-actions .btn-primary:hover,
.profile-info-actions .btn-secondary:hover {
    background: transparent;
    color: var(--CTA);
}

/* Bottom-Right: Description Box */
.profile-description-box {
    max-width: 400px;
    z-index: 10;
}

.profile-giphy-box {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 250px;
    height: 250px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.profile-giphy-img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    object-position: center;
}

.profile-description-label {
    font-family: var(--ff-heading);
    font-size: var(--fs-h2);
    line-height: 1;
    margin-bottom: 8px;
    color: var(--light);
    display: block;
}

.profile-description-text {
    font-family: var(--ff-body);
    font-size: var(--fs-body);
    line-height: 1.4;
    opacity: 0.9;
}

/* Content Area */
.profile-content {
    width: 100%;
    margin: 30px 0 40px;
    padding: 0 20px;
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: var(--space);
}

.profile-content > * {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.profile-section {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.profile-section > * + * {
    margin-top: var(--space);
}

.profile-section > .profile-section-title + * {
    margin-top: 8px;
}

.profile-section--comments > * + * {
    margin-top: 16px;
}

.profile-section--comments .comment-module {
    margin-bottom: 0;
}

.profile-card {
    width: 100%;
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--bg-light);
    transition: opacity 0.32s ease, transform 0.32s ease;
}

.profile-card-fade-out {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
    pointer-events: none;
}

.profile-card-inner {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.profile-card p.text-label {
    color: var(--dark);
}

/* ── TikTok embed frame (Reels-style: 9/16 capped by height on desktop) ── */
.tiktok-embed-frame {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 9 / 16;
    margin: 0 auto;
    background: #000;             /* pillarbox color */
    border-radius: 12px;
    overflow: hidden;
}

.tiktok-embed-frame > iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Variante PHOTO: recorta el embed clásico /embed/{id} ───────────
   player/v1 no sirve posts de tipo foto, así que las fotos usan el
   embed clásico, que trae debajo del slideshow un panel de metadatos
   (autor + caption) y el botón "Watch on TikTok". Para que tenga el
   mismo aspecto "limpio" que el player de video, el iframe se ancla
   arriba con un ALTO MAYOR al del frame: el media (siempre arriba en
   el embed clásico) se ve completo y overflow:hidden del frame recorta
   todo lo que queda por debajo (metadatos + botón).

   TUNABLE: --photo-frame-h es la altura "virtual" del iframe. Si con
   tus fotos se ve algo de panel de metadatos, subilo; si el slideshow
   sale cortado, bajalo. No afecta al iframe de video (otra clase). */
.tiktok-embed-frame--photo {
    --photo-frame-h: 1400px;
}

.tiktok-embed-frame--photo > iframe {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    width: 100%;
    height: var(--photo-frame-h, 1400px);
    border: 0;
}

@supports not (aspect-ratio: 9 / 16) {
    .tiktok-embed-frame::before {
        content: "";
        display: block;
        padding-top: 177.78%;
    }
}

@media (min-width: 769px) {
    .tiktok-embed-frame {
        height: min(600px, 70vh);
        width: auto;
        max-width: 100%;
    }
}

/* ── MÓDULO: Profile Post Card ──────────────────────────────
   Autocontenido bajo prefijo .profile-post-* (card pública + modal
   de edición). No usar estas clases fuera de este módulo.
   Componentes: profile-post-card / -body / -row / -content / -head /
   -update-btn / -icon / -title / -cover / -img / -text / -date /
   -modal-body. Cambios acá solo afectan este módulo. */
.profile-post-card {
    width: 100%;
    overflow: hidden;
    padding: 20px !important;
    border-radius: 16px;
    background-color: #ffffff;
    border: 1px solid var(--bg-dark);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.profile-post-body {
    padding: 4px 16px 0;
}

.profile-post-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.profile-post-content {
    flex: 1;
    min-width: 0; /* permite truncate del título dentro de flex */
    padding: 8px 8px 0;
}

.profile-post-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 4px;
}

.profile-post-update-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: none;
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--dark2);
    font-family: var(--ff-body);
    font-size: var(--fs-label);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--t);
}

.profile-post-update-btn:hover {
    background: var(--light);
}

.profile-post-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.profile-post-title {
    font-family: var(--ff-body);
    font-size: var(--fs-h3);
    font-weight: 800;
    line-height: 1.3;
    margin: 0 0 4px;
    color: var(--dark2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-post-cover {
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    margin-top: 12px;
    margin-bottom: 20px;
}

.profile-post-img {
    display: block;
    width: 100%;
    height: auto;
}

.profile-post-text {
    font-size: 22.5px;
    line-height: 1.6;
}

.profile-post-date {
    margin: 0;
    color: var(--dark2);
    font-size: var(--fs-label);
    text-align: right;
}

/* Modal de edición (forma parte del módulo: solo lo consume este card) */
.profile-post-modal-body {
    padding: var(--space);
}

.profile-post-modal-body .dash-post-upload-zone,
.profile-post-modal-body .dash-post-preview-img {
    margin-left: auto;
    margin-right: auto;
}

.profile-post-modal-body .dash-post-preview-img {
    max-width: 100%;
}

/* — Espejo mínimo (scoped) para el form del modal —
   profile-post-form.blade.php usa clases dash-* y utilidades Tailwind
   que en perfiles públicos no están cargadas. Se replican SOLO dentro
   de .profile-post-modal-body para no afectar otros contextos.
   keep in sync con dashboard.css si el form cambia. */
.profile-post-modal-body .dash-flex {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-post-modal-body .dash-section-title {
    font-family: var(--ff-heading);
    font-size: var(--fs-h3);
    color: var(--dark);
    line-height: 1;
    margin: 0;
}

.profile-post-modal-body .dash-text-muted {
    color: var(--bg-light);
    font-size: var(--fs-small);
}

.profile-post-modal-body .dash-post-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    cursor: pointer;
    border: 2px dashed var(--bg-dark);
    border-radius: 8px;
    transition: background var(--t);
    box-sizing: border-box;
}

.profile-post-modal-body .dash-post-upload-zone:hover {
    background: rgba(0, 0, 0, 0.03);
}

.profile-post-modal-body .dash-post-preview-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.profile-post-modal-body .dash-cover-change-icon,
.profile-post-modal-body .dash-cover-delete-icon {
    width: 32px;
    height: 32px;
    display: block;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.8));
}

/* Utilidades Tailwind usadas por el form (scoped) */
.profile-post-modal-body .flex { display: flex; }
.profile-post-modal-body .flex-col { flex-direction: column; }
.profile-post-modal-body .items-center { align-items: center; }
.profile-post-modal-body .justify-between { justify-content: space-between; }
.profile-post-modal-body .gap-1 { gap: 4px; }
.profile-post-modal-body .gap-2 { gap: 8px; }
.profile-post-modal-body .mb-2 { margin-bottom: 8px; }
.profile-post-modal-body .mb-3 { margin-bottom: 12px; }
.profile-post-modal-body .mb-4 { margin-bottom: 16px; }
.profile-post-modal-body .mt-1 { margin-top: 4px; }
.profile-post-modal-body .w-7 { width: 28px; }
.profile-post-modal-body .h-7 { height: 28px; }
.profile-post-modal-body .hidden { display: none; }
.profile-post-modal-body .text-xs { font-size: var(--fs-label); }
.profile-post-modal-body .text-red-500 { color: #dc2626; }
.profile-post-modal-body .text-orange-500 { color: #ea580c; }

/* Mobile: card a padding var(--space) como los modales; cover más compacto */
@media (max-width: 767px) {
    .profile-post-card {
        padding: var(--space) !important;
    }
    .profile-post-body {
        padding: 0;
    }
    .profile-post-cover {
        margin-top: var(--space);
        margin-bottom: var(--space);
    }
    .profile-post-modal-body {
        padding: var(--space);
    }
}

.profile-section-title {
    font-family: var(--ff-heading);
    font-size: var(--fs-h2);
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.profile-hero .profile-section-title {
    color: var(--light) !important;
}

.profile-section-title--light {
    color: var(--light);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.text-label--light {
    color: var(--light) !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.profile-footer-nav {
    text-align: center;
    margin-top: 40px;
}

.profile-footer-link {
    color: var(--light);
    font-size: var(--fs-small);
    text-decoration: underline;
}

html.dark .profile-card,
html.dark .profile-post-card {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}

html.dark .profile-card p.text-label,
html.dark .profile-post-title,
html.dark .profile-post-date,
html.dark .profile-section-title {
    color: var(--theme-text);
}

html.dark .profile-post-content > div {
    color: var(--theme-text) !important;
}

html.dark .profile-post-update-btn {
    background: var(--theme-raised);
    color: var(--theme-text);
}

html.dark .profile-post-update-btn:hover {
    background: var(--theme-border);
}

html.dark .profile-modal,
html.dark .dash-modal-panel {
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    color: var(--theme-text);
}

html.dark .profile-modal-close {
    background: var(--theme-raised);
    border-color: var(--theme-border);
}

html.dark .profile-modal-title,
html.dark .profile-modal-text {
    color: var(--theme-text);
}

html.dark .dash-modal-header {
    border-color: var(--theme-border);
}

html.dark .dash-modal-header :is(h1, h2, h3, h4, h5, h6) {
    color: var(--theme-text) !important;
}

html.dark .dash-modal-body input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]),
html.dark .dash-modal-body textarea,
html.dark .dash-modal-body select,
html.dark .profile-modal-body textarea {
    background: var(--theme-raised) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
}

html.dark .dash-modal-body :is(input, textarea)::placeholder,
html.dark .profile-modal-body textarea::placeholder {
    color: var(--theme-secondary);
}

.mobile-btn-wrapper {
    background: transparent;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .dash-modal {
        padding: 8px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px) + 8px);
        overscroll-behavior-y: contain;
    }
    .profile-hero-zone-a {
        display: contents;
    }
.profile-avatar-wrap {
  position: relative;
  width: fit-content;
  background: transparent;
}
.profile-avatar-icon {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
}

.profile-hero {
        height: auto !important;
        min-height: auto !important;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 24px;
        gap: 8px;
    }

    .profile-info-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-info-header img:not(.profile-avatar-icon) {
        width: 150px;
        height: 150px;
        object-fit: cover;
        background: transparent;
    }

    .profile-avatar-icon {
        width: 28px;
        height: 28px;
    }

    .profile-info-box {
        width: 100%;
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        padding: 24px;
        position: relative;
        top: auto;
        bottom: auto;
        left: auto;
        right: auto;
        margin: 0;
        max-width: 100%;
        order: 1;
    }

    .profile-giphy-box {
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        padding: var(--space);
        align-self: center;
        order: 3;
    }
    .profile-description-box {
        display: none;
    }

    .profile-hero--user .profile-hero-main {
        width: 100%;
        justify-content: flex-start;
        align-items: center;
        gap: 16px;
    }

    .profile-hero--user .profile-giphy-box {
        position: relative;
        width: 100%;
        align-self: center;
    }

    .profile-hero--user .rank-skin-wrap {
        order: 2;
    }

    .profile-content {
        margin-top: 20px;
    }

    /* Keep desktop layout for the info card on mobile */
    .profile-info-header {
        flex-direction: row;
        text-align: left;
    }

    .profile-info-header img:not(.profile-avatar-icon) {
        width: 80px;
        height: 80px;
    }

    .profile-info-box {
        width: 100%;
        max-width: 100%;
        padding: 20px;
    }

    /* Marquesina de regalos debajo de la ficha (avatar, redes, bio) en mobile */
    .profile-hero > .gift-marquee {
        order: 2;
        width: 100%;
    }

    .profile-card {
        padding: 8px;
    }

}

/* ── Rango / Skin (contenedor 16:9) ──────────────────────────────── */
.rank-skin-wrap {
    width: 100%;
    max-width: 533px;
    margin: 0 auto;
}

.profile-content .rank-skin-wrap {
    width: 100%;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 769px) {
    .profile-content .rank-skin-wrap {
        max-width: 600px;
    }
}

.rank-skin-wrap {
    transition: opacity 0.32s ease, transform 0.32s ease;
}

.rank-skin-wrap.rank-skin-fade-out {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
    pointer-events: none;
}

.rank-skin-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 2px solid var(--dark2);
    border-radius: 16px;
}

@supports not (aspect-ratio: 16 / 9) {
    .rank-skin-container {
        height: 0;
        padding-bottom: 56.25%;
    }
}

.rank-skin-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rank-skin-layer--1 { z-index: 1; }
.rank-skin-layer--2 { z-index: 2; }
.rank-skin-layer--3 { z-index: 3; display: flex; align-items: center; justify-content: center; }
.rank-skin-layer--4 { z-index: 4; }

.rank-skin-layer--3 img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rank-skin-name {
    position: absolute;
    right: 12px;
    bottom: 10px;
    z-index: 5;
    color: var(--highlight);
    font-size: var(--fs-label);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.6);
}

/* Nombre de la skin y texto sin anchor sobre el arte (el link conserva su color) */
.rank-skin-name .skin-credit {
    color: var(--highlight) !important;
}

.profile-skin-claim-link {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--ff-body);
    font-size: var(--fs-label);
    color: var(--light);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.profile-skin-claim-link:hover {
    color: var(--CTA);
}

.rank-skin-toggle-btn:hover {
    background: var(--dark2);
    color: #fff;
    border-color: var(--dark2);
}

@media (min-width: 769px) {
    .rank-skin-wrap {
        margin-left: 0;
        margin-right: auto;
    }
}

/* ── dash-btn / btn-default / dash-pill ──────────────────────
   espejo mínimo de dashboard.css — keep in sync (perfiles públicos
   solo cargan este archivo cuando el visitante no es el dueño). */
.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: background var(--t), color var(--t), opacity var(--t);
  white-space: nowrap;
}

.dash-btn-sm {
  padding: 6px 14px;
  font-size: var(--fs-small);
  border-radius: 8px;
}

.btn-default {
  background: var(--dark) !important;
  color: var(--light) !important;
  font-weight: 400 !important;
  padding: 6px 14px !important;
  transition: all 0.3s ease;
  border: none !important;
  cursor: pointer;
  border-radius: 8px;
}

.btn-default:hover {
  background: var(--CTA) !important;
  color: var(--light) !important;
}

.dash-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: var(--fs-label);
  font-weight: 700;
  line-height: 1.4;
}

/* ── Card de evento compartido (perfil público + feed), estilo Facebook ── */
.event-card-title {
  margin: 0;
  font-weight: bold;
  color: var(--CTA);
  font-size: 28px;
  line-height: 1.2;
}

.event-card-cover {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
}

.event-card-cover img {
  display: block;
  width: 100%;
  height: auto;
}

.event-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
}

.event-card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  color: var(--dark2);
  line-height: 1.3;
}

.event-card-meta-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--dark2);
  opacity: 0.8;
}

.event-card-price {
  margin-top: 2px;
  white-space: nowrap;
}

.event-card-desc {
  margin: 12px 0 0;
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  color: var(--dark);
  line-height: 1.5;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card-desc.is-expanded {
  -webkit-line-clamp: none;
}

.event-card-more {
  margin-top: 4px;
  padding: 0;
  background: none;
  border: none;
  font-family: var(--ff-body);
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--CTA);
  cursor: pointer;
}

.event-card-more:hover {
  text-decoration: underline;
}

.event-card-actions {
  margin-top: 14px;
}

.event-card-tickets {
  width: 100%;
}

.event-card-tickets-icon {
  width: 16px;
  height: 16px;
}

/* ── Texto expandible reutilizable (feed / comunidad / perfiles) ──
   .is-expanded cubre navegadores sin :has(); :has() conserva el fallback sin JS.
   Botón a la izquierda. */
.rcr-expandable {
  min-width: 0;
  width: 100%;
}

.rcr-expandable .rcr-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
  overflow-wrap: break-word;
  word-break: break-word;
  margin: 0;
}

@supports selector(:has(.rcr-details[open])) {
  .rcr-expandable:not(:has(.rcr-details[open])) .rcr-clamp {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .rcr-expandable:has(.rcr-details[open]) .rcr-clamp {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
    max-height: none;
  }

  .rcr-expandable:has(.rcr-details[open]) .lbl-less {
    display: inline;
  }

  .rcr-expandable:has(.rcr-details[open]) .lbl-more {
    display: none;
  }
}

.rcr-expandable:not(.is-expanded) .rcr-clamp {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.rcr-expandable.is-expanded .rcr-clamp {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
  max-height: none;
}

/* Medición temporal de altura real (la usa el JS) */
.rcr-expandable.measuring .rcr-clamp {
  display: block !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
}

.rcr-details {
  margin: 4px 0 0;
}

.rcr-details[hidden] {
  display: none;
}

.rcr-details > summary {
  list-style: none;
  display: inline-block;
  padding: 0;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--ff-body);
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--CTA);
  cursor: pointer;
  line-height: 1.4;
}

.rcr-details > summary::-webkit-details-marker {
  display: none;
}

.rcr-details > summary::marker {
  content: none;
}

.rcr-details > summary:hover {
  text-decoration: underline;
}

.rcr-details > summary:focus-visible {
  outline: 2px solid var(--CTA);
  outline-offset: 2px;
  border-radius: 4px;
}

.rcr-expandable .lbl-less {
  display: none;
}

.rcr-expandable.is-expanded .lbl-less {
  display: inline;
}

.rcr-expandable.is-expanded .lbl-more {
  display: none;
}

/* ── Marquesina de regalos ── */
.gift-marquee {
  margin: 16px 0 0;
}
.gift-marquee-title {
  font-size: var(--fs-label);
  font-weight: 700;
  margin: 0 0 8px;
}
.gift-marquee-viewport {
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  scrollbar-width: thin;
}
.gift-marquee-track {
  display: flex;
  gap: 12px;
  width: max-content;
  max-width: none;
}
.gift-marquee-item {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  padding: 6px;
  border: 1px solid var(--bg-dark);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.gift-marquee-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@media (max-width: 768px) {
  .gift-marquee-item {
    width: 96px;
    height: 96px;
  }
}
@media (min-width: 769px) {
  .gift-marquee-item {
    width: 96px;
    height: 96px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gift-marquee-viewport {
    scroll-behavior: auto;
  }
}

.share-profile-trigger,
.share-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: var(--dark);
    font: inherit;
    font-size: var(--fs-label);
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.share-profile-trigger img {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.share-profile-trigger:hover,
.share-menu-item:hover {
    background: rgba(71, 70, 69, 0.08);
}

.share-menu[x-cloak] {
    display: none !important;
}

.share-menu {
    display: grid;
    width: 100%;
    border-top: 1px solid var(--bg-dark);
    background: #fff;
}

.share-menu-item + .share-menu-item {
    border-top: 1px solid rgba(71, 70, 69, 0.08);
}

.share-menu-item:disabled {
    cursor: wait;
    opacity: 0.65;
}

.profile-hero--share-menu {
    overflow: visible;
    z-index: 21;
}
