/* ---------------------------------------------------------------------------
   Site overrides for the HTML5 UP "Editorial" theme.
   Loaded after main.css.
   --------------------------------------------------------------------------- */

/* Main posts grid ("Ipsum sed dolor"): uniform image height + buttons pinned to the bottom of each card */
.posts {
    -moz-align-items: stretch;
    -webkit-align-items: stretch;
    -ms-align-items: stretch;
    align-items: stretch;
}

.posts article {
    display: -moz-flex;
    display: -webkit-flex;
    display: -ms-flex;
    display: flex;
    -moz-flex-direction: column;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
}

.posts article > a.image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.posts article > a.image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.posts article > ul.actions {
    margin-top: auto;
    margin-bottom: 0;
}

/* Mini posts (sidebar "Ante interdum"): uniform thumbnail size */
.mini-posts article > a.image {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.mini-posts article > a.image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Rich-text paragraph styling: keep typical document spacing for headings/lists/quotes inside post paragraphs. */
.post-paragraph p {
    margin: 0 0 1em 0;
}

.post-paragraph h2,
.post-paragraph h3,
.post-paragraph h4 {
    margin: 1em 0 0.5em 0;
}

.post-paragraph ul,
.post-paragraph ol {
    margin: 0 0 1em 1.5em;
}

.post-paragraph blockquote {
    border-left: solid 4px rgba(210, 215, 217, 0.75);
    font-style: italic;
    margin: 0 0 1em 0;
    padding: 0.5em 0 0.5em 1.5em;
}

.post-paragraph a {
    border-bottom: dotted 1px rgba(0, 0, 0, 0.35);
}

/* Page-builder table block */
.post-table-wrap {
    margin: 0 0 2em 0;
    overflow-x: auto;
}

.post-table-caption {
    margin: 0 0 0.75em 0;
    font-size: 1.05em;
}

table.post-table {
    width: 100%;
    border-collapse: collapse;
    background: #fafafa;
    border: solid 1px rgba(210, 215, 217, 0.75);
    border-radius: 4px;
    overflow: hidden;
}

table.post-table thead th {
    text-align: left;
    font-weight: 600;
    background: #f3f3f3;
    padding: 0.85em 1.25em;
    border-bottom: solid 1px rgba(210, 215, 217, 0.75);
    vertical-align: top;
}

table.post-table tbody td {
    padding: 0.85em 1.25em;
    border-top: solid 1px rgba(210, 215, 217, 0.5);
    vertical-align: top;
}

table.post-table tbody tr:first-child td {
    border-top: 0;
}

/* Page-builder gallery block — carousel */
.post-carousel {
    position: relative;
    margin: 0 0 2em 0;
    background: #eef0f2;
    border: solid 1px rgba(210, 215, 217, 0.75);
    border-radius: 6px;
    overflow: hidden;
}

.post-carousel-viewport {
    overflow: hidden;
    width: 100%;
}

.post-carousel-track {
    display: flex;
    transition: transform 0.4s ease;
    will-change: transform;
}

.post-carousel-slide {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60vh;
    max-height: 600px;
    min-height: 320px;
    padding: 1.5em;
    cursor: zoom-in;
    border-bottom: none !important;
    background: transparent;
    box-sizing: border-box;
}

.post-carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 3px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.post-carousel-prev,
.post-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff !important;
    color: #4a4f54 !important;
    border: solid 1px rgba(0, 0, 0, 0.08) !important;
    width: 2.5em !important;
    height: 2.5em !important;
    border-radius: 50% !important;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    font-family: inherit !important;
    font-size: 1.1em !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.post-carousel-prev:hover,
.post-carousel-next:hover {
    background: #f7f8f9 !important;
    color: #1f2326 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-50%) scale(1.05);
}

.post-carousel-prev:active,
.post-carousel-next:active {
    transform: translateY(-50%) scale(0.97);
}

.post-carousel-prev { left: 1em; }
.post-carousel-next { right: 1em; }

.post-carousel-counter {
    position: absolute;
    bottom: 0.9em;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.92);
    color: #4a4f54;
    padding: 0.25em 0.75em;
    border-radius: 999px;
    border: solid 1px rgba(0, 0, 0, 0.05);
    font-size: 0.75em;
    letter-spacing: 0.05em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    z-index: 2;
}

@media screen and (max-width: 736px) {
    .post-carousel-slide {
        height: 50vh;
        min-height: 220px;
        padding: 0.75em;
    }
    .post-carousel-prev,
    .post-carousel-next {
        width: 2.1em;
        height: 2.1em;
        font-size: 0.85em;
    }
    .post-carousel-prev { left: 0.5em; }
    .post-carousel-next { right: 0.5em; }
}

/* Lightbox overlay */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 20, 0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2em;
}

.lightbox.is-open {
    display: flex;
}

.lightbox-figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75em;
}

.lightbox-image {
    max-width: 92vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 12px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85em;
    letter-spacing: 0.05em;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: #ffffff !important;
    color: #1f2326 !important;
    border: solid 1px rgba(0, 0, 0, 0.08) !important;
    width: 2.75em !important;
    height: 2.75em !important;
    border-radius: 50% !important;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    font-family: inherit !important;
    font-size: 1.2em !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: #f7f8f9 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

.lightbox-close {
    top: 1em;
    right: 1em;
    font-size: 1.5em !important;
}

.lightbox-prev {
    left: 1em;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 1em;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover { transform: translateY(-50%) scale(1.06); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.06); }
.lightbox-close:hover { transform: scale(1.06); }

@media screen and (max-width: 736px) {
    .lightbox { padding: 0.5em; }
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        width: 2.4em !important;
        height: 2.4em !important;
        font-size: 1em !important;
    }
    .lightbox-close { top: 0.5em; right: 0.5em; font-size: 1.2em !important; }
    .lightbox-prev  { left: 0.5em; }
    .lightbox-next  { right: 0.5em; }
}
