.tvf-socials { display:flex; flex-wrap:wrap; gap:.75rem; justify-content:center; margin:1rem 0 2rem; }
.tvf-socials a { display:inline-flex; align-items:center; gap:.55rem; min-height:44px; padding:.7rem 1rem; background:#173b43; color:#fff!important; border-radius:.65rem; text-decoration:none!important; font:600 1rem/1.3 system-ui,sans-serif; }
.tvf-icon { display:inline-block; flex:none; vertical-align:middle; fill:currentColor; stroke:none; }
.tvf-legacy-social { display:inline-flex!important; gap:.5rem; align-items:center; }
.tvf-socials a:hover { background:#075f69; }
.tvf-socials a:focus-visible,.tva select:focus-visible { outline:3px solid #b21662; outline-offset:4px; }
.tvf-no-portrait .profile-photo { display:none!important; }
.tvf-no-portrait .profile-hero-grid { grid-template-columns:1fr!important; }
.tvf-custom-portrait .profile-photo>div { aspect-ratio:auto!important; overflow:visible!important; }
.tvf-custom-portrait .profile-photo img { position:static!important; display:block!important; inset:auto!important; width:100%!important; max-width:100%!important; height:auto!important; max-height:none!important; aspect-ratio:auto!important; object-fit:contain!important; object-position:center!important; border-radius:4px!important; }
.tvf-custom-portrait .profile-photo figcaption { display:none; }
.tvf-photos,.tvf-photo-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap:1.5rem; margin:2rem 0; }
.tvf-photos figure { margin:0; }
.tvf-photos img { display:block; max-width:100%; width:100%; height:auto; object-fit:contain; }
.tva .tvf-image-preview { display:block; max-width:100%; width:auto; height:auto; max-height:20rem; object-fit:contain; border-radius:.5rem; }
.tva .tvf-social-row { border:1px solid #b8c9c7; border-radius:.75rem; margin:1.25rem 0; padding:1rem; min-width:0; }
.tva .tvf-social-row legend { padding:0 .5rem; font-weight:700; }
.tva select { width:100%; min-height:48px; border:1px solid #b8c9c7; padding:.75rem 2.5rem .75rem .75rem; background:#fff; color:#173b43; border-radius:.5rem; font:inherit; }
.tva .tvf-secondary { background:#fff; color:#075f69; border:1px solid #087d89; margin-top:.7rem; }
.tva .tvf-secondary:hover { background:#edf5f3; }
.tva button:disabled { opacity:.55; cursor:default; }
.tvf-author-videos .tva-videos-empty h3,
.tvf-author-videos .tva-video-body h3 { color:#fff3d6!important; }

/* Shared book layout: the image must reserve its real space before the text. */
:is(.profile-book,.profile-featured-book,.book-card,.libro-card) figure {
    position:relative!important;
    inset:auto!important;
    float:none!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    aspect-ratio:auto!important;
    flex:0 0 auto!important;
    display:flex!important;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    overflow:visible!important;
}
:is(.profile-book,.profile-featured-book,.book-card,.libro-card) figure > a {
    display:block;
    width:100%;
    height:auto!important;
}
:is(.profile-book,.profile-featured-book,.book-card,.libro-card) figure img,
:is(.profile-book,.profile-featured-book,.book-card,.libro-card) > img {
    position:static!important;
    inset:auto!important;
    float:none!important;
    display:block!important;
    width:auto!important;
    max-width:100%!important;
    height:auto!important;
    max-height:22rem!important;
    aspect-ratio:auto!important;
    object-fit:contain!important;
    object-position:center!important;
    margin-inline:auto;
    transform:none!important;
}
:is(.profile-book,.profile-featured-book,.book-card,.libro-card) .profile-book-body {
    position:static!important;
    inset:auto!important;
    transform:none!important;
    clear:both;
    min-width:0;
}

/* One continuous, responsive book shelf for editorial and owner-added books. */
.personal-page .profile-book-grid,
.profile-book-grid.tvf-unified-grid,
.tvf-public .profile-book-grid {
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:1.5rem!important;
    align-items:stretch;
    width:100%;
    min-width:0;
}
.profile-book-grid > .wp-block-group__inner-container { display:contents!important; }
.profile-book-grid .profile-book {
    display:flex!important;
    flex-direction:column!important;
    position:relative;
    min-width:0;
    width:auto!important;
    max-width:none!important;
    margin:0!important;
    padding:1rem!important;
    box-sizing:border-box;
    background:#fff;
    border:1px solid #e1ded3;
    border-radius:.8rem;
}
.profile-book-grid .profile-book > .wp-block-group__inner-container {
    display:flex!important;
    flex-direction:column;
    min-width:0;
    height:100%;
}
.profile-book-grid .profile-book figure {
    flex:0 0 auto!important;
    width:100%!important;
    max-width:16rem!important;
    height:auto!important;
    aspect-ratio:148 / 210!important;
    margin:0 auto 1.25rem!important;
    background:transparent!important;
    overflow:visible!important;
}
.profile-book-grid .profile-book figure > a {
    display:flex!important;
    align-items:center;
    justify-content:center;
    width:100%;
    height:100%!important;
}
.profile-book-grid .profile-book figure img {
    width:100%!important;
    height:100%!important;
    max-width:100%!important;
    max-height:100%!important;
    object-fit:contain!important;
    box-shadow:0 5px 14px #173b4314;
}
.profile-book-grid .profile-book .profile-book-body { flex:1; }
.profile-book-grid .profile-book h3 { margin:0 0 .8rem; line-height:1.3; }
.profile-book-grid .profile-book p { overflow-wrap:anywhere; }
@media(max-width:900px) {
    .personal-page .profile-book-grid,.profile-book-grid.tvf-unified-grid,.tvf-public .profile-book-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
}
@media(max-width:600px) {
    .personal-page .profile-book-grid,.profile-book-grid.tvf-unified-grid,.tvf-public .profile-book-grid { grid-template-columns:minmax(0,1fr)!important; }
}

/* Purchase actions form the footer of each equal-height book card. */
.profile-book-grid .profile-book .profile-book-body {
    display:flex;
    flex-direction:column;
    min-height:0;
}
.profile-book-grid .profile-book > .wp-block-group__inner-container {
    flex:1;
    height:auto;
}
.profile-book-grid .profile-book-body > a:last-child,
.profile-book-grid .profile-book > a:last-child,
.profile-book-grid .profile-book > .wp-block-group__inner-container > a:last-child,
.profile-book-grid .profile-book :is(.profile-book-body,.wp-block-group__inner-container) > p:has(> a:only-child):not(p:has(> a:only-child) + p),
.profile-book-grid .profile-book :is(.profile-book-body,.wp-block-group__inner-container) > :is(.profile-book-actions,.wp-block-buttons) {
    margin-top:auto!important;
    align-self:flex-start;
    flex-shrink:0;
}
.profile-book-grid .profile-book-body > a:last-child,
.profile-book-grid .profile-book > a:last-child,
.profile-book-grid .profile-book > .wp-block-group__inner-container > a:last-child {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:fit-content;
    max-width:100%;
    min-height:44px;
    padding:.75rem 1.15rem;
    box-sizing:border-box;
    border:0;
    border-radius:999px;
    background:#173b43;
    color:#fff!important;
    font:600 1rem/1.3 system-ui,sans-serif;
    text-decoration:none!important;
}
.profile-book-grid .profile-book a:focus-visible { outline:3px solid #b21662; outline-offset:3px; }
