/* Post card grid */
.post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 1rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease-in-out;
}

.post-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.post-card-image {
    height: 220px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-color: #eee;
}

.post-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
}

.post-card-footer .post-card-categories {
    margin-top: 0;
}

.post-card-footer .post-card-category {
    margin-bottom: 0;
}

.post-card-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-card-intro {
    font-size: 1rem;
    color: #555;
}

.post-card-categories {
    margin-top: 0.5rem;
}

.post-card-category {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
    border-radius: 1rem;
    background-color: #eee;
    color: #333;
}

.posts-empty {
    width: 100%;
    text-align: center;
    color: #777;
    padding: 2rem 0;
}

/* Search */
.posts-search-form {
    display: flex;
    margin: 1.5rem 0;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.posts-search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid #ccc;
}

.posts-search-button {
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    border: none;
    background-color: #333;
    color: #fff;
    cursor: pointer;
}

/* Pagination */
.posts-pagination {
    margin: 2rem 0;
}

/* Post detail blocks */
.post-hero-image {
    width: 100%;
    border-radius: 1rem;
    margin: 1rem 0;
}

.post-body {
    margin-top: 1rem;
}

.post-block {
    margin-bottom: 2rem;
}

.post-block-image img {
    max-width: 100%;
    border-radius: 1rem;
}

.post-block-image-text {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.post-block-image-text.image-right {
    flex-direction: row-reverse;
}

.post-block-image-text img {
    max-width: 100%;
    flex: 1 1 40%;
    border-radius: 1rem;
}

.post-block-image-text-content {
    flex: 1 1 50%;
}

.post-block-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.post-block-gallery-item {
    width: calc(33.333% - 0.5rem);
    margin: 0;
}

.post-block-gallery-item img {
    width: 100%;
    border-radius: 0.5rem;
}

@media (max-width: 767px) {
    .post-block-image-text img,
    .post-block-image-text-content {
        flex: 1 1 100%;
    }

    .post-block-gallery-item {
        width: calc(50% - 0.5rem);
    }
}

@media (max-width: 480px) {
    .post-block-gallery-item {
        width: 100%;
    }
}

/* Image block: size + fit */
.post-block-image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 0 auto;
}

.post-block-image-full {
    width: 100%;
}

.post-block-image-wide {
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.post-block-image-contained {
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.post-block-image-fit-cover img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.post-block-image-fit-contain img {
    object-fit: contain;
}

/* Styled text presets */
.post-block-text-accent {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.25rem;
    color: #8a5a3b;
}

.post-block-text-quote {
    font-style: italic;
    font-size: 1.3rem;
    padding-left: 1.25rem;
    border-left: 4px solid #ccc;
    color: #555;
}

/* Carousel */
.post-block-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background-color: #eee;
}

.post-block-carousel-track {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.post-block-carousel-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out;
}

.post-block-carousel-slide.is-active {
    opacity: 1;
    visibility: visible;
}

.post-block-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-block-carousel-slide figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    color: #fff;
}

.post-block-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
}

.post-block-carousel-prev {
    left: 0.75rem;
}

.post-block-carousel-next {
    right: 0.75rem;
}

.post-block-carousel-dots {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.post-block-carousel-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0;
}

.post-block-carousel-dot.is-active {
    background: #fff;
}

/* Metrics */
.post-block-metrics {
    display: flex;
    gap: 2rem;
}

.post-block-metrics-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    text-align: center;
}

.post-block-metrics-vertical {
    flex-direction: column;
    text-align: center;
}

.post-block-metrics-grid {
    display: grid;
    grid-template-columns: repeat(var(--metrics-columns, 3), 1fr);
    text-align: center;
}

.post-block-metric-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
}

.post-block-metric-label {
    font-size: 1rem;
    color: #666;
    margin-top: 0.25rem;
}

@media (max-width: 767px) {
    .post-block-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Percentage donut */
.post-block-percentage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.post-block-donut {
    --donut-size: 160px;
    --donut-thickness: 18px;
    width: var(--donut-size);
    height: var(--donut-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--donut-color, #333) calc(var(--donut-value, 0) * 1%), #eee 0);
    transition: background 1s ease-in-out;
}

.post-block-donut-value {
    width: calc(var(--donut-size) - var(--donut-thickness) * 2);
    height: calc(var(--donut-size) - var(--donut-thickness) * 2);
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.post-block-donut-primary {
    --donut-color: #333;
}

.post-block-donut-accent {
    --donut-color: #8a5a3b;
}

.post-block-donut-dark {
    --donut-color: #111;
}

.post-block-percentage-label {
    font-size: 1rem;
    color: #666;
    text-align: center;
}

.post-date {
    font-size: 14px;
    opacity: 0.7;
}

.post-card-date {
    margin-left: auto;
    font-size: 0.8rem;
    color: #777;
    white-space: nowrap;
}

.post-date {
    margin-bottom: 16px;
}
