.thp-auto-gallery {
    clear: both;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.thp-gallery-inline {
    margin: 24px 0;
    padding: 0;
}

.thp-gallery-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    border-radius: 8px;
    object-fit: cover;
}

.thp-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 14px;
    margin: 26px 0 8px;
}

.thp-gallery-grid .thp-gallery-item {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border-radius: 8px;
}

.thp-gallery-grid .thp-gallery-image {
    width: 100%;
    height: 100%;
    min-height: 190px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.thp-gallery-count-1 {
    grid-template-columns: 1fr;
}

@media (max-width: 600px) {
    .thp-gallery-inline {
        margin: 18px 0;
    }

    .thp-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 20px;
    }

    .thp-gallery-grid .thp-gallery-image {
        min-height: 120px;
    }

    .thp-gallery-count-1 {
        grid-template-columns: 1fr;
    }
}

.thp-gallery-grid .thp-gallery-slide {
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}

.thp-slider-open,
.thp-slider-open body {
    overflow: hidden;
}

.thp-slider-overlay[hidden] {
    display: none !important;
}

.thp-slider-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .88);
    box-sizing: border-box;
}

.thp-slider-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(1100px, 100%);
    height: min(90vh, 820px);
}

.thp-slider-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    flex: 1;
}

.thp-slider-image {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 110px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}

.thp-slider-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.thp-slider-status {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    max-width: calc(100% - 32px);
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(0,0,0,.62);
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
}

.thp-slider-caption {
    overflow: hidden;
    text-overflow: ellipsis;
}

.thp-slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding-top: 14px;
}

.thp-slider-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 112px;
    min-height: 44px;
    padding: 9px 16px;
    border: 1px solid rgba(255,255,255,.42);
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

.thp-slider-controls button:hover,
.thp-slider-controls button:focus-visible,
.thp-slider-close:hover,
.thp-slider-close:focus-visible {
    background: rgba(255,255,255,.28);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .thp-slider-overlay {
        padding: 10px;
    }

    .thp-slider-dialog {
        height: 94vh;
    }

    .thp-slider-image {
        max-height: calc(94vh - 96px);
    }

    .thp-slider-controls {
        gap: 6px;
    }

    .thp-slider-controls button {
        min-width: 0;
        flex: 1;
        padding: 9px 8px;
        font-size: 14px;
    }

    .thp-slider-close {
        top: 4px;
        right: 4px;
    }
}

/* v1.7: Bölüm başlığı altındaki görseller başlığa daha yakın görünür. */
.thp-gallery-under-heading {
    margin-top: 12px;
    margin-bottom: 28px;
}

.thp-gallery-between-paragraphs {
    margin-top: 24px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .thp-gallery-under-heading {
        margin-top: 10px;
        margin-bottom: 22px;
    }
}
