.page {
    padding: 20px 0 30px;
}

.card {
    border: 2px solid rgba(35, 79, 57, 0.24);
    border-radius: var(--radius);
    background: rgba(255, 249, 239, 0.92);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 18px;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.08;
    margin-bottom: 6px;
    margin-top: 6px;
}

.entry-list {
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 14px;
    display: grid;
}

.entry {
    border: 4px solid #4b5892;
    border-radius: 0;
    background: #ffffff;
    padding: 14px;
    display: grid;
    gap: 12px;
}

.entry__layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
}

.entry__media {
    display: grid;
    gap: 8px;
    width: fit-content;
    max-width: min(100%, 340px);
    justify-self: start;
}

.entry__media a {
    text-decoration: none;
    display: inline-flex;
}

.entry__main-image {
    width: auto;
    height: auto;
    max-width: min(100%, 340px);
    max-height: 340px;
    object-fit: contain;
    display: block;
    border: 1px solid #ccc;
    background: #fff;
}

.entry__thumbs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.entry__thumbs a {
    display: inline-block;
}

.entry__thumb {
    width: 74px;
    height: 74px;
    object-fit: cover;
    display: block;
    border: 1px solid #c8c8c8;
}

.entry__body {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.entry__title {
    font-size: clamp(1.5rem, 2.2vw, 1.95rem);
    font-weight: 400;
    line-height: 1.1;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.entry__description {
    line-height: 1.45;
    font-size: 1.02rem;
    color: #111;
}

.entry__description b,
.entry__description strong {
    display: inline-block;
    margin: 2px 0;
}

.entry__description a {
    color: #0d2f6f;
    text-decoration: underline;
    word-break: break-word;
}

.entry__actions {
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.entry__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #0f5d3a;
    border-radius: 0;
    padding: 0.55rem 0.95rem;
    text-decoration: none;
    background: #14643e;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
}

.entry__button:hover {
    background: #0f5635;
}

.entry__missing {
    color: #6d5d14;
    font-size: 0.9rem;
    margin-top: 6px;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 60;
    padding: 18px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 0s linear 220ms;
}

.gallery-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 220ms ease;
}

.gallery-modal__panel {
    width: fit-content;
    max-width: 96vw;
    max-height: 92vh;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    display: grid;
    grid-template-rows: 1fr auto;
    opacity: 0;
    transform: translateY(8px) scale(0.985);
    transition: opacity 220ms ease, transform 220ms ease;
}

.gallery-modal.is-open .gallery-modal__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.gallery-modal__image-wrap {
    position: relative;
    background: #1f1f1f;
    min-height: 240px;
    padding: 10px;
    display: flex;
    justify-content: center;
}

.gallery-modal__image-shell {
    border: 8px solid #ffffff;
    border-radius: 12px;
    background: #1f1f1f;
    overflow: hidden;
    position: relative;
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    min-height: 220px;
    max-width: min(92vw, 1200px);
    max-height: min(72vh, 760px);
}

.gallery-modal__image {
    position: relative;
    z-index: 1;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    opacity: 1;
    transition: opacity 140ms ease;
}

.gallery-modal__image.is-loading {
    opacity: 0;
}

.gallery-modal__loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(31, 31, 31, 0.38);
}

.gallery-modal__loading.is-visible {
    display: flex;
}

.gallery-modal__loading img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.gallery-modal__nav {
    position: static;
    border: 0;
    width: 25px;
    height: 25px;
    padding: 0;
    background-color: transparent;
    background-image: url('../images/ui/controls.png');
    background-repeat: no-repeat;
    color: transparent;
    font-size: 0;
    text-indent: -9999px;
    cursor: pointer;
    flex: 0 0 25px;
}

.gallery-modal__nav--prev {
    background-position: -75px 0;
}

.gallery-modal__nav--prev:hover {
    background-position: -75px -25px;
}

.gallery-modal__nav--next {
    background-position: -50px 0;
}

.gallery-modal__nav--next:hover {
    background-position: -50px -25px;
}

.gallery-modal__nav:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.gallery-modal__footer {
    display: grid;
    grid-template-columns: 25px 1fr 25px;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-top: 1px solid #e1e1e1;
    background: #ffffff;
    color: #3a3a3a;
    font-size: 0.98rem;
}

.gallery-modal__counter {
    text-align: center;
}

@media (max-width: 760px) {
    .entry__layout {
        grid-template-columns: 1fr;
    }

    .entry__main-image {
        max-width: 360px;
    }
}
