/**
 * Altezza uniforme per le card "Potrebbero interessarti" / articoli correlati.
 * Caricare DOPO il CSS specifico di sezione (articoli_correlati_*, pagina_blog43, ecc.).
 */

/* --- Blog ver1 (articoli correlati, blog_articoli_correlati, partial PHP) ---
 * a.blog-ver1-card--linked e' display:block nel CSS correlati: senza flex
 * la card non si allunga e "Leggi di piu'" resta a quote diverse.
 * margin-block-start:0 !important sul link annulla margin-top:auto: serve auto su entrambi.
 */
section.blog-ver1-section .blog-ver1-row {
    align-items: stretch;
}

section.blog-ver1-section .blog-ver1-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

section.blog-ver1-section .blog-ver1-card,
section.blog-ver1-section a.blog-ver1-card--linked {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

section.blog-ver1-section .blog-ver1-image-container {
    flex: 0 0 auto;
}

section.blog-ver1-section .blog-ver1-content {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
}

section.blog-ver1-section .blog-ver1-link {
    margin-top: auto !important;
    margin-block-start: auto !important;
    margin-bottom: 0 !important;
    margin-block-end: 0 !important;
}

/* --- Eventi: card direttamente in .eventi-grid --- */
section.evento-ver1-section .eventi-grid {
    align-items: stretch;
}

section.evento-ver1-section .eventi-grid > .evento-ver1-card,
section.evento-ver1-section .eventi-grid > a.evento-ver1-card {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0;
    height: 100%;
}

section.evento-ver1-section .evento-ver1-image-container {
    flex: 0 0 auto;
}

section.evento-ver1-section .evento-ver1-content {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
}

section.evento-ver1-section .evento-ver1-link {
    margin-top: auto !important;
    margin-block-start: auto !important;
    margin-bottom: 0 !important;
    margin-block-end: 0 !important;
}

/* --- Ebook: griglia colonne --- */
section.ebook-ver1-section .row {
    align-items: stretch;
}

section.ebook-ver1-section .row > [class*="col-"],
section.ebook-ver1-section .ebook-ver1-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

section.ebook-ver1-section .ebook-sidebar-section {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

section.ebook-ver1-section .ebook-ver1-card {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

section.ebook-ver1-section .ebook-ver1-content,
section.ebook-ver1-section .colonna,
section.ebook-ver1-section .colonna2 {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
}

section.ebook-ver1-section .ebook-ver1-link {
    margin-top: auto !important;
    margin-block-start: auto !important;
    margin-bottom: 0 !important;
    margin-block-end: 0 !important;
}

/* --- Griglia "blog_related" (bodyblog, blog-sezioni-finali) --- */
.blog_related-articles .blog_related-grid {
    align-items: stretch;
    gap: 10px;
}

.blog_related-articles .blog_related-item {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.blog_related-articles .blog_related-image {
    flex: 0 0 auto;
}

.blog_related-articles .blog_related-content {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    padding: 10px !important;
    gap: 10px;
}

.blog_related-articles .blog_related-link {
    margin-top: auto;
    align-self: flex-start;
}

/**
 * Spaziature interne blocco "Potrebbero interessarti" / correlati: 10px (margini, padding contenuti, gap griglia).
 * Caricato dopo articoli_correlati_* / pagina_*.
 */
section.blog-ver1-section .blog-ver1-title {
    padding-bottom: 30px;
    padding-top: 20px;
}

section.blog-ver1-section .blog-ver1-row {
    gap: 30px;
}

section.blog-ver1-section .blog-ver1-content {
    padding: 25px 40px !important;
}

section.blog-ver1-section .blog-ver1-card-title {
    margin-bottom: 20px;
}

section.blog-ver1-section .blog-ver1-description {
    margin-bottom: 20px;
}

section.blog-ver1-section .blog_divider-line-final {
    margin: 10px auto;
}

section.ebook-ver1-section .ebook-ver1-title {
    padding-bottom: 10px;
}

section.ebook-ver1-section .row {
    gap: 10px;
}

section.ebook-ver1-section .ebook-ver1-content {
    padding: 10px !important;
}

section.ebook-ver1-section .ebook-ver1-card-title {
    margin-bottom: 10px;
}

section.ebook-ver1-section .ebook-ver1-description,
section.ebook-ver1-section .ebook-article-description1 {
    margin-bottom: 10px;
    padding-bottom: 10px !important;
}

section.ebook-ver1-section .ebook-category-badge1 {
    padding-bottom: 10px;
}

section.ebook-ver1-section .ebook_divider-line-final {
    margin: 10px auto;
}

section.evento-ver1-section .evento-ver1-title {
    padding-bottom: 10px;
}

section.evento-ver1-section .eventi-grid {
    gap: 10px;
}

section.evento-ver1-section .evento-ver1-content {
    padding: 10px !important;
}

section.evento-ver1-section .evento-ver1-card-title {
    margin-bottom: 10px;
}

section.evento-ver1-section .evento-ver1-description {
    margin-bottom: 10px;
}

.blog_related-articles .blog_related-title {
    margin: 0 0 10px 0;
}

.blog_related-articles .blog_related-article-title {
    margin-bottom: 10px;
}

/* ============================================
   CARD INTERAMENTE CLICCABILI (stretched link)
   ============================================ */

/* --- 1. Card sidebar "In primo piano" --- */
.blog-ver1-card {
    position: relative;
    cursor: pointer;
    transition: /* box-shadow 0.25s ease, */ transform 0.25s ease;
}

.blog-ver1-card .blog-ver1-link {
    /* Il link resta visibile ma il suo ::after copre tutta la card */
    position: static;
}

.blog-ver1-card .blog-ver1-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.blog-ver1-card:hover {
    /* box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10); */
    transform: translateY(-2px);
}

.blog-ver1-card:hover .blog-ver1-link {
    text-decoration: underline;
}

/* Placeholder non cliccabile */
.blog-ver1-card--placeholder {
    cursor: default;
    pointer-events: none;
}
.blog-ver1-card--placeholder:hover {
    box-shadow: none;
    transform: none;
}

/* --- 2. Card articolo nella lista blog/ebook --- */
.bloglist-article-wrapper {
    position: relative;
    cursor: pointer;
    transition: /* box-shadow 0.25s ease, */ transform 0.25s ease;
}

.bloglist-article-wrapper .bloglist-read-more::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.bloglist-article-wrapper:hover {
    transform: translateY(-2px);
}

.bloglist-article-wrapper:hover .bloglist-read-more {
    text-decoration: none;
}

/* Badge categoria: restano cliccabili sopra lo stretched-link */
.bloglist-article-wrapper .bloglist-category-badge {
    position: relative;
    z-index: 2;
}


/* ============================================
   CARD INTERAMENTE CLICCABILI (stretched link)
   ============================================ */

/* --- 1. Card sidebar "In primo piano" --- */
.ebook-ver1-card {
    position: relative;
    cursor: pointer;
    transition: /* box-shadow 0.25s ease , */transform 0.25s ease;
}

.ebook-ver1-card .ebook-ver1-link {
    /* Il link resta visibile ma il suo ::after copre tutta la card */
    position: static;
}

.ebook-ver1-card .ebook-ver1-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.ebook-ver1-card:hover {
    /* box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10); */
    transform: translateY(-2px);
}

.ebook-ver1-card:hover .ebook-ver1-link {
    text-decoration: underline;
}

/* Placeholder non cliccabile */
.ebook-ver1-card--placeholder {
    cursor: default;
    pointer-events: none;
}
.ebook-ver1-card--placeholder:hover {
    box-shadow: none;
    transform: none;
}

/* --- 2. Card articolo nella lista blog/ebook --- */
.ebooklist-article-wrapper {
    position: relative;
    cursor: pointer;
    transition: /* box-shadow 0.25s ease, */ transform 0.25s ease;
}

.ebooklist-article-wrapper .ebooklist-read-more::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.ebooklist-article-wrapper:hover {
    transform: translateY(-2px);
}

.ebooklist-article-wrapper:hover .ebooklist-read-more {
    text-decoration: none;
}

/* Badge categoria: restano cliccabili sopra lo stretched-link */
.ebooklist-article-wrapper .ebooklist-category-badge {
    position: relative;
    z-index: 2;
}
