/* ── Rector page ─────────────────────────────────── */

.main:has(.rector) {
    background: url("../images/background.png") center top / cover no-repeat fixed;
    max-width: 100%;
    padding: 0;
}

.rector {
    max-width: 100%;
    padding: 0;
}

/* ── Section Carousel ──────────────────────────── */

.rector__carousel {
    position: relative;
    height: calc(100vh - var(--top-offset));
    overflow: hidden;
}

.rector__sections {
    position: relative;
    height: 100%;
}

.rector__section {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 140px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.rector__section.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Section Card ──────────────────────────────── */

.rector__section-card {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: 20px;
    border: 1px solid rgba(73, 73, 73, 0.07);
}

/* angel — top left */
.rector__section-card::before {
    content: "";
    position: absolute;
    top: -40px;
    left: -60px;
    width: 260px;
    height: 260px;
    background: url("../images/angel1.png") center / contain no-repeat;
    z-index: 3;
    pointer-events: none;
}

/* flowers — bottom right */
.rector__section-card::after {
    content: "";
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 280px;
    height: 280px;
    background: url("../images/flowers1.png") center / contain no-repeat;
    z-index: 3;
    pointer-events: none;
}

/* ── Two-column body ───────────────────────────── */

.rector__section-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Left column: heading + text + button */

.rector__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 40px 40px 30px 20px;
}

.rector__heading {
    font-family: "Amagro", serif;
    text-align: left;
    font-size: 2.2rem;
    font-weight: 700;
    color: #0e2540;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 6px 0 24px 24px;
    flex-shrink: 0;
}

.rector__text-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 12px;
}

/* custom scrollbar */
.rector__text-content::-webkit-scrollbar {
    width: 5px;
}

.rector__text-content::-webkit-scrollbar-track {
    background: transparent;
}

.rector__text-content::-webkit-scrollbar-thumb {
    background: rgba(26, 58, 92, 0.15);
    border-radius: 10px;
}

.rector__text-content::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 58, 92, 0.3);
}

/* Firefox */
.rector__text-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(26, 58, 92, 0.15) transparent;
}

.rector__text p {
    font-family: "Eastman", sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #2a2a2a;
    margin-bottom: 14px;
}

.rector__text p:last-child {
    margin-bottom: 0;
}

/* Nav buttons */

.rector__nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    margin-top: 20px;
}

.rector__next-btn,
.rector__prev-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: none;
    background: none;
    font-family: "Amagro", serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #3a6b35;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
}

.rector__next-btn:hover {
    color: #4a8b42;
    transform: translateX(4px);
}

.rector__prev-btn:hover {
    color: #4a8b42;
    transform: translateX(-4px);
}

/* Right column: image slider */

.rector__slider {
    width: 400px;
    flex-shrink: 0;
    display: flex;
    overflow: hidden;
    border-radius: 16px 20px 20px 16px;
    margin: 20px 20px 20px 0;
}

.rector__slides {
    position: relative;
    width: 100%;
    flex: 1;
    overflow: hidden;
    background: #e8eef4;
}

/* hide raw images before JS initializes them */
.rector__slides > img:not(.bg):not(.slide) {
    display: none;
}

.rector__slides img.bg {
    position: absolute;
    inset: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    object-fit: cover;
    filter: blur(20px) brightness(.85);
    opacity: 0;
    transition: opacity .6s ease;
    z-index: 0;
}

.rector__slides img.bg.active {
    opacity: 1;
}

.rector__slides img.slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transition: opacity .6s ease;
    z-index: 1;
}

.rector__slides img.slide.active {
    opacity: 1;
}

.rector__slider-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .4));
    z-index: 2;
}

.rector__slider-btn {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.rector__slider-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.rector__slider-dots {
    display: flex;
    gap: 8px;
}

.rector__slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .45);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s;
}

.rector__slider-dot.active {
    background: #fff;
    transform: scale(1.4);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* ── Responsive ─────────────────────────────────── */

@media (max-width: 1024px) {
    .rector__slider {
        width: 300px;
    }

    .rector__section {
        padding: 50px 40px;
    }

    .rector__section-card::before {
        width: 180px;
        height: 180px;
    }

    .rector__section-card::after {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 768px) {
    .rector__carousel {
        height: auto;
        min-height: calc(100vh - var(--top-offset));
    }

    .rector__section {
        position: relative;
        padding: 24px 16px;
    }

    .rector__section:not(.active) {
        display: none;
    }

    .rector__section-body {
        flex-direction: column;
    }

    .rector__text {
        padding: 20px;
    }

    .rector__heading {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }

    .rector__slider {
        width: 100%;
        height: 300px;
        border-radius: 16px;
        margin: 0;
    }

    .rector__section-card {
        border-radius: 16px;
    }

    .rector__section-card::before {
        width: 100px;
        height: 100px;
        top: -20px;
        left: -20px;
    }

    .rector__section-card::after {
        width: 120px;
        height: 120px;
        bottom: -20px;
        right: -20px;
    }

    .rector__text p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .rector__section {
        padding: 16px 10px;
    }

    .rector__heading {
        font-size: 1.1rem;
    }

    .rector__text {
        padding: 16px;
    }

    .rector__text p {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .rector__section-card::before {
        width: 70px;
        height: 70px;
        top: -14px;
        left: -14px;
    }

    .rector__section-card::after {
        width: 80px;
        height: 80px;
        bottom: -14px;
        right: -14px;
    }
}

/* ── Lightbox ───────────────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox__img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(0, 0, 0, .5);
}

.lightbox__close {
    position: absolute;
    top: 20px;
    right: 28px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, .7);
    font-size: 2.4rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s;
}

.lightbox__close:hover {
    color: #fff;
    transform: rotate(90deg);
}

.lightbox__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.lightbox__btn:hover {
    background: rgba(255, 255, 255, .25);
    transform: translateY(-50%) scale(1.1);
}

.lightbox__btn--prev { left: 24px; }
.lightbox__btn--next { right: 24px; }

.lightbox__counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .6);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .lightbox__btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    .lightbox__btn--prev { left: 8px; }
    .lightbox__btn--next { right: 8px; }
    .lightbox__close {
        top: 12px;
        right: 16px;
        font-size: 2rem;
    }
}
