.ct-news {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 26rem));
    gap: clamp(1rem, 2.5vw, 2rem);
    justify-content: center;
}

.ct-news-card {
    width: 100%;
    max-width: 26rem;
    overflow: hidden;
    margin: 0;
    border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
    border-radius: 0.75rem;
    background: var(--wp--preset--color--base, #fff);
    box-shadow: 0 0.25rem 1.25rem rgb(0 0 0 / 8%);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.ct-news-card:hover {
    transform: translateY(-0.2rem);
    box-shadow: 0 0.6rem 1.7rem rgb(0 0 0 / 13%);
}

.ct-news-card__link {
    display: flex;
    height: 100%;
    color: inherit;
    text-decoration: none;
    flex-direction: column;
}

.ct-news-card__image,
.ct-news-card__placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: color-mix(in srgb, currentColor 7%, transparent);
}

.ct-news-card__body {
    display: flex;
    padding: 1.25rem;
    flex: 1;
    flex-direction: column;
    gap: 0.55rem;
}

.ct-news-card__title {
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    font-weight: 700;
    line-height: 1.25;
}

.ct-news-detail {
    max-width: 52rem;
    margin-inline: auto;
}

.ct-news-detail__back {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.ct-news-detail__header h1 {
    margin-bottom: 0.35rem;
}

.ct-news-detail__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 11rem));
    gap: 1rem;
    max-width: 47rem;
    margin-block: 1.5rem;
    margin-inline: auto;
    justify-content: center;
}

.ct-news-detail__gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #eee;
    cursor: pointer;
}

.ct-news-detail__image {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 220ms ease, filter 220ms ease;
}

.ct-news-detail__gallery-item:hover .ct-news-detail__image,
.ct-news-detail__gallery-item:focus-visible .ct-news-detail__image {
    transform: scale(1.04);
    filter: brightness(0.82);
}

.ct-news-lightbox {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: grid;
    padding: clamp(1rem, 4vw, 3rem);
    background: rgb(0 0 0 / 88%);
    cursor: default;
    opacity: 0;
    place-items: center;
    transition: opacity 220ms ease;
}

.ct-news-lightbox[hidden] {
    display: none;
}

.ct-news-lightbox.is-open {
    opacity: 1;
}

.ct-news-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 4rem);
    border-radius: 0.5rem;
    cursor: pointer;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 220ms ease, transform 220ms ease;
}

.ct-news-lightbox:not(.has-multiple) .ct-news-lightbox__image {
    cursor: default;
}

.ct-news-lightbox__image.is-changing {
    opacity: 0;
    transform: scale(0.98);
}

.ct-news-lightbox.is-open .ct-news-lightbox__image {
    opacity: 1;
    transform: scale(1);
}

.ct-news-lightbox__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgb(255 255 255 / 15%);
    cursor: pointer;
    font: 400 2rem/1 sans-serif;
}

.ct-news-lightbox__close:hover,
.ct-news-lightbox__close:focus-visible {
    background: rgb(255 255 255 / 28%);
}

.ct-news-lightbox__navigation {
    position: absolute;
    top: 50%;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgb(255 255 255 / 15%);
    cursor: pointer;
    font: 400 2rem/1 sans-serif;
    transform: translateY(-50%);
}

.ct-news-lightbox__navigation--previous {
    left: 0.75rem;
}

.ct-news-lightbox__navigation--next {
    right: 0.75rem;
}

.ct-news-lightbox__navigation:hover,
.ct-news-lightbox__navigation:focus-visible {
    background: rgb(255 255 255 / 28%);
}

.ct-news-lightbox__navigation[hidden] {
    display: none;
}

body.ct-news-lightbox-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .ct-news-detail__image,
    .ct-news-lightbox,
    .ct-news-lightbox__image {
        transition: none;
    }
}

.ct-news-detail__content {
    line-height: 1.75;
}

.ct-news-detail__content img {
    max-width: 100%;
    height: auto;
}

.ct-news-detail__content blockquote {
    margin-inline: 0;
    padding: 0.25rem 1.25rem;
    border-left: 0.25rem solid color-mix(in srgb, currentColor 30%, transparent);
}

.ct-news-detail__content pre {
    overflow-x: auto;
    padding: 1rem;
    border-radius: 0.5rem;
    background: color-mix(in srgb, currentColor 7%, transparent);
}

.ct-news-detail__content code {
    padding: 0.12em 0.3em;
    border-radius: 0.25rem;
    background: color-mix(in srgb, currentColor 7%, transparent);
}

.ct-news-detail__content pre code {
    padding: 0;
    background: transparent;
}

.ct-news-detail__content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.ct-news-detail__content th,
.ct-news-detail__content td {
    padding: 0.6rem 0.8rem;
    border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
    text-align: left;
}

.ct-news-detail__content hr {
    margin-block: 2rem;
    border: 0;
    border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent);
}
