/* Homepress — Single post block styles (subtitle, date+share, box autore)
   ---------------------------------------------------------------------
   Vars (con defaults sensati):
     --hp-author-box-bg      : sfondo box autore
     --hp-author-box-text    : colore nome autore
     --hp-author-box-role    : colore ruolo/qualifica
     --hp-author-box-rows    : numero righe short bio visibili prima del collapse
*/

/* ============ Spacing compatto featured image → content ============ */
.hp-single .inside-article .featured-image,
.hp-single .inside-article .post-image,
.hp-single .inside-article > .featured-image,
.hp-single .inside-article > .post-image {
    margin-bottom: 0.6em !important;
}
.hp-single .entry-content {
    margin-top: 0.4em !important;
}
.hp-single .entry-content > *:first-child {
    margin-top: 0 !important;
}

/* ============ SUBTITLE ============ */
.hp-post-subtitle {
    margin: 0.5em 0 1em !important;
    font-size: clamp(1.05rem, 0.5vw + 0.95rem, 1.25rem);
    line-height: 1.5;
    color: #4b5563; /* grigio neutro, WCAG AA */
    font-weight: 400;
    font-style: normal;
}

/* ============ DATE + SHARE ============ */
.hp-post-dateshare {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0.9em 0 1.2em;
    padding: 0.6em 0;
    border-top: 1px solid rgba(0,0,0,0.06);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 0.9rem;
    color: #4b5563;
}
.hp-post-dateshare-date {
    margin: 0 !important;
    line-height: 1.3;
}
.hp-post-dateshare-label {
    color: #6b7280;
    margin-right: 2px;
}
.hp-post-dateshare time {
    color: inherit;
    font-weight: 500;
}

/* Bottone Condividi: icona nuda, trasparente, line-height=0 così non allunga il container */
.hp-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: transparent !important;
    border: 0;
    color: #4b5563;
    cursor: pointer;
    line-height: 0;
    vertical-align: middle;
    transition: color 0.15s ease;
}
.hp-share-btn:hover,
.hp-share-btn:focus {
    color: #111827;
    background: transparent !important;
    outline: none;
}
.hp-share-btn svg { display: block; }
.hp-share-btn.hp-share-copied {
    position: relative;
}
.hp-share-btn.hp-share-copied::after {
    content: 'Copiato!';
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    font-size: 0.72rem;
    color: #059669;
    font-weight: 600;
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    pointer-events: none;
    white-space: nowrap;
    z-index: 5;
}

/* ============ BOX AUTORE (stile dilei: avatar piccolo, titolo MAIUSCOLO accent, + top-right) ============ */
.hp-author-box {
    --hp-author-box-bg: transparent;
    --hp-author-box-text: #111;
    /* Magenta scuro WCAG-AA friendly (contrasto 5.12:1 su bianco). Il --hp-hot del tema è
       #e91e63 che fallisce AA per testo piccolo. */
    --hp-author-box-role: #c2185b;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0.8em 0 0.6em;
    padding: 0;
    background: var(--hp-author-box-bg);
}
.hp-author-box-avatar {
    flex-shrink: 0;
    margin: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #f3f4f6;
}
.hp-author-box-avatar img,
.hp-author-box-avatar-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}
.hp-author-box-info {
    flex: 1;
    min-width: 0;
    padding-right: 36px; /* spazio per il bottone + absolute */
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.hp-author-box-name {
    font-weight: 700 !important;
    color: var(--hp-author-box-text) !important;
    text-decoration: none !important;
    font-size: 0.95rem;
    line-height: 1.25;
}
.hp-author-box-name:hover { text-decoration: underline !important; }
.hp-author-box-role {
    margin: 0 !important;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hp-author-box-role);
    line-height: 1.3;
    font-weight: 600;
}

/* Bio collapsed: bottone + in alto a destra del box, indipendente dalla posizione
   della bio (che compare sotto nome/titolo quando aperta). */
.hp-author-box-bio-wrap {
    /* position: static — lasciato nel flow per far crescere il box quando aperto */
    margin-top: 0;
}
.hp-author-box-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.18);
    background: transparent;
    cursor: pointer;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.hp-author-box-toggle::-webkit-details-marker { display: none; }
.hp-author-box-toggle::marker { content: ''; }
.hp-author-box-toggle::before {
    content: '';
    width: 10px;
    height: 10px;
    background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
    background-size: 100% 2px, 2px 100%;
    background-position: center;
    background-repeat: no-repeat;
    color: #666;
    transition: transform 0.2s ease;
}
.hp-author-box-bio-wrap[open] .hp-author-box-toggle::before {
    /* nascondi la linea verticale → resta solo la linea orizzontale = "−" */
    background-size: 100% 2px, 0 0;
}
.hp-author-box-toggle:hover {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.3);
}

.hp-author-box-bio {
    margin-top: 8px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #374151;
}
.hp-author-box-bio p {
    margin: 0 0 0.5em !important;
}
.hp-author-box-bio p:last-child { margin-bottom: 0 !important; }
.hp-author-box-bio a { color: inherit; text-decoration: underline; }

/* Riga titolo + social (stile dilei: inline accanto al titolo) */
.hp-author-box-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

/* Social icons (piccoli inline accanto al titolo) */
.hp-author-box-social {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}
.hp-author-box-social li { margin: 0 !important; padding: 0 !important; }
.hp-author-box-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #c2185b; /* magenta WCAG-AA friendly */
    background: transparent;
    text-decoration: none !important;
    transition: color 0.15s, background 0.15s;
}
.hp-author-box-social a:hover {
    color: #ad1457;
    background: rgba(0,0,0,0.04);
}
.hp-author-box-social svg { width: 14px; height: 14px; }

/* Mobile */
@media (max-width: 480px) {
    .hp-author-box { gap: 10px; }
    .hp-author-box-avatar { width: 36px; height: 36px; }
    .hp-author-box-name { font-size: 0.9rem; }
    .hp-author-box-role { font-size: 0.7rem; }
}
