
/* ==========================================
   YEARBOOK - PANDHEGA JAYA
========================================== */

.dg-yearbook-section {
    position: relative;
    padding: 100px 24px;
    overflow: hidden;
    background: var(--bg-cream);
    color: var(--text-heading);
}

.dg-yearbook-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}

/* HEADER */

.dg-yearbook-header {
    max-width: 760px;
    margin: 0 auto 58px;
    text-align: center;
}

.dg-yearbook-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--primary-red);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2.5px;
}

.dg-yearbook-eyebrow i {
    font-size: 15px;
}

.dg-yearbook-heading {
    margin: 0;
    color: var(--text-heading);
    font-family: inherit;
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1.5px;
}

.dg-yearbook-heading span {
    display: block;
    margin-top: 6px;
    color: var(--primary-red);
}

.dg-yearbook-description {
    max-width: 660px;
    margin: 22px auto 0;
    color: var(--text-body);
    font-size: 15px;
    line-height: 1.9;
}

.dg-yearbook-counter {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    margin-top: 30px;
    padding: 12px 18px;
    border: 1px solid var(--border-line);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.6);
}

.dg-yearbook-counter-number {
    color: var(--primary-red);
    font-size: 27px;
    font-weight: 800;
    line-height: 1;
}

.dg-yearbook-counter-label {
    color: var(--text-body);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-align: left;
}

/* GRID */

.dg-yearbook-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px 28px;
}

/* CARD */

.dg-yearbook-item {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--border-line);
    border-radius: 7px;
    background: var(--surface-white);
    color: inherit;
    text-decoration: none;
    box-shadow: 0 8px 24px var(--shadow-color);
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease;
}

.dg-yearbook-item::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--dg-book-accent);
    content: "";
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.dg-yearbook-item:hover {
    transform: translateY(-7px);
    border-color: rgba(181, 58, 45, 0.25);
    box-shadow: 0 20px 40px var(--shadow-hover-color);
}

.dg-yearbook-item:hover::before {
    transform: scaleX(1);
}

.dg-yearbook-item:focus-visible {
    outline: 3px solid var(--primary-red);
    outline-offset: 5px;
}

/* BOOK MOCKUP */

.dg-yearbook-book {
    position: relative;
    width: 100%;
    aspect-ratio: 0.76;
    padding: 0 0 0 9px;
    perspective: 1000px;
}

.dg-yearbook-pages {
    position: absolute;
    top: 8px;
    right: 0;
    bottom: 8px;
    left: 9px;
    border-radius: 2px 5px 5px 2px;
    background: repeating-linear-gradient(
        to bottom,
        #ffffff 0,
        #ffffff 2px,
        #e7e2dc 3px,
        #ffffff 4px
    );
    box-shadow: 4px 4px 0 #d8d1c8;
}

.dg-yearbook-cover {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    padding: 7%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px 4px 4px 2px;
    background: var(--dg-book-accent);
    color: var(--white);
    box-shadow:
        -4px 0 0 rgba(0, 0, 0, 0.12),
        0 12px 24px rgba(0, 0, 0, 0.12);
    transform-origin: left center;
    transition: transform 0.4s ease;
}

.dg-yearbook-item:hover .dg-yearbook-cover {
    transform: rotateY(-3deg);
}

/* COVER HEADER */

.dg-yearbook-cover-top {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.dg-yearbook-school {
    font-size: clamp(9px, 1vw, 12px);
    font-weight: 900;
    letter-spacing: 2px;
}

.dg-yearbook-edition {
    font-size: clamp(7px, 0.8vw, 9px);
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* IMAGE AREA */

.dg-yearbook-cover-art {
    position: relative;
    flex: 1;
    min-height: 0;
    margin: 16px 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    isolation: isolate;
}

/* FALLBACK: selalu berada di belakang gambar */

.dg-yearbook-fallback {
    position: absolute;
    z-index: 0;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(255, 255, 255, 0.2),
            transparent 55%
        ),
        linear-gradient(
            145deg,
            var(--dg-book-accent),
            var(--text-heading)
        );
    color: var(--white);
    text-align: center;
}

.dg-yearbook-fallback-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 2px;
}

.dg-yearbook-fallback-number {
    font-size: clamp(64px, 8vw, 110px);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -5px;
    opacity: 0.92;
}

.dg-yearbook-fallback-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.dg-yearbook-fallback-generation {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.9;
}

.dg-yearbook-fallback-line {
    width: 36px;
    height: 2px;
    margin-top: 6px;
    background: var(--white);
    opacity: 0.8;
}

/* REAL ANYFLIP COVER */

.dg-yearbook-cover-image {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.dg-yearbook-cover-image.dg-yearbook-image-loaded {
    opacity: 1;
}

/* Shade agar nomor cover tetap terbaca */

.dg-yearbook-image-shade {
    position: absolute;
    z-index: 2;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.04) 40%,
        rgba(0, 0, 0, 0.48) 100%
    );
    pointer-events: none;
}

.dg-yearbook-preview-number {
    position: absolute;
    z-index: 3;
    right: 12px;
    bottom: 10px;
    color: var(--white);
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

/* COVER FOOTER */

.dg-yearbook-cover-bottom {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.dg-yearbook-cover-label {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1.5px;
    opacity: 0.8;
}

.dg-yearbook-cover-bottom strong {
    font-size: clamp(15px, 1.7vw, 22px);
    font-weight: 800;
    line-height: 1.2;
}

.dg-yearbook-cover-line {
    width: 38px;
    height: 2px;
    margin: 3px 0;
    background: var(--white);
    opacity: 0.75;
}

.dg-yearbook-cover-bottom small {
    font-size: clamp(6px, 0.7vw, 8px);
    font-weight: 700;
    letter-spacing: 0.8px;
    line-height: 1.5;
    opacity: 0.85;
}

/* CARD INFORMATION */

.dg-yearbook-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 22px;
}

.dg-yearbook-info-text {
    min-width: 0;
}

.dg-yearbook-index {
    display: block;
    margin-bottom: 7px;
    color: var(--primary-red);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.dg-yearbook-info h3 {
    margin: 0;
    color: var(--text-heading);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
}

.dg-yearbook-open-icon {
    display: flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-line);
    border-radius: 50%;
    color: var(--text-body);
    transition:
        background 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease;
}

.dg-yearbook-item:hover .dg-yearbook-open-icon {
    border-color: var(--primary-red);
    background: var(--primary-red);
    color: var(--white);
    transform: rotate(45deg);
}

/* OPEN BOOK LABEL */

.dg-yearbook-open-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 20px;
    padding: 13px 12px;
    border-radius: 3px;
    background: var(--bg-cream);
    color: var(--text-heading);
    font-size: 12px;
    font-weight: 800;
    transition:
        background 0.3s ease,
        color 0.3s ease;
}

.dg-yearbook-item:hover .dg-yearbook-open-label {
    background: var(--primary-red);
    color: var(--white);
}

/* SECTION FOOTER */

.dg-yearbook-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 60px;
    padding-top: 28px;
    border-top: 1px solid var(--border-line);
    text-align: left;
}

.dg-yearbook-footer-icon {
    display: flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-white);
    color: var(--primary-red);
}

.dg-yearbook-footer p {
    margin: 0;
    color: var(--text-body);
    font-size: 13px;
    line-height: 1.8;
}

.dg-yearbook-footer strong {
    color: var(--text-heading);
}

/* RESPONSIVE: TABLET */

@media (max-width: 900px) {
    .dg-yearbook-section {
        padding: 78px 22px;
    }

    .dg-yearbook-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }

    .dg-yearbook-item {
        padding: 18px;
    }

    .dg-yearbook-book {
        aspect-ratio: 0.78;
    }

    .dg-yearbook-fallback-number {
        font-size: clamp(58px, 12vw, 100px);
    }

    .dg-yearbook-cover-bottom strong {
        font-size: clamp(16px, 2.8vw, 22px);
    }

    .dg-yearbook-preview-number {
        font-size: clamp(34px, 7vw, 48px);
    }
}

/* RESPONSIVE: MOBILE */

@media (max-width: 560px) {
    .dg-yearbook-section {
        padding: 62px 16px;
    }

    .dg-yearbook-header {
        margin-bottom: 36px;
    }

    .dg-yearbook-heading {
        font-size: clamp(29px, 8vw, 38px);
        letter-spacing: -1px;
    }

    .dg-yearbook-description {
        margin-top: 17px;
        font-size: 13px;
        line-height: 1.8;
    }

    .dg-yearbook-eyebrow {
        font-size: 9px;
        letter-spacing: 1.8px;
    }

    .dg-yearbook-counter {
        margin-top: 23px;
    }

    .dg-yearbook-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 12px;
    }

    .dg-yearbook-item {
        padding: 10px;
        border-radius: 5px;
    }

    .dg-yearbook-book {
        aspect-ratio: 0.72;
        padding-left: 5px;
    }

    .dg-yearbook-pages {
        left: 5px;
    }

    .dg-yearbook-cover {
        padding: 6%;
    }

    .dg-yearbook-cover-top {
        gap: 4px;
    }

    .dg-yearbook-school {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .dg-yearbook-edition {
        font-size: 6px;
        letter-spacing: 0.5px;
    }

    .dg-yearbook-cover-art {
        margin: 10px 0;
    }

    .dg-yearbook-fallback {
        gap: 6px;
        padding: 5px;
    }

    .dg-yearbook-fallback-label {
        font-size: 6px;
        letter-spacing: 1px;
    }

    .dg-yearbook-fallback-number {
        font-size: clamp(42px, 13vw, 70px);
        letter-spacing: -3px;
    }

    .dg-yearbook-fallback-title {
        font-size: 7px;
        letter-spacing: 0.5px;
    }

    .dg-yearbook-fallback-generation {
        font-size: 9px;
    }

    .dg-yearbook-cover-label {
        font-size: 6px;
        letter-spacing: 0.8px;
    }

    .dg-yearbook-cover-bottom {
        gap: 5px;
    }

    .dg-yearbook-cover-bottom strong {
        font-size: clamp(12px, 3.3vw, 17px);
    }

    .dg-yearbook-cover-bottom small {
        font-size: 5px;
        letter-spacing: 0.3px;
    }

    .dg-yearbook-preview-number {
        right: 7px;
        bottom: 6px;
        font-size: clamp(27px, 8vw, 38px);
        letter-spacing: -1px;
    }

    .dg-yearbook-info {
        gap: 5px;
        padding-top: 14px;
    }

    .dg-yearbook-index {
        margin-bottom: 5px;
        font-size: 7px;
        letter-spacing: 0.7px;
    }

    .dg-yearbook-info h3 {
        font-size: clamp(12px, 3.5vw, 16px);
    }

    .dg-yearbook-open-icon {
        width: 27px;
        height: 27px;
        flex-basis: 27px;
        font-size: 10px;
    }

    .dg-yearbook-open-label {
        gap: 6px;
        margin-top: 12px;
        padding: 10px 5px;
        font-size: 10px;
    }

    .dg-yearbook-footer {
        align-items: flex-start;
        gap: 12px;
        margin-top: 38px;
        padding-top: 23px;
    }

    .dg-yearbook-footer-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        font-size: 13px;
    }

    .dg-yearbook-footer p {
        font-size: 11px;
    }
}

/* REDUCE MOTION */

@media (prefers-reduced-motion: reduce) {
    .dg-yearbook-item,
    .dg-yearbook-item::before,
    .dg-yearbook-cover,
    .dg-yearbook-cover-image,
    .dg-yearbook-open-icon,
    .dg-yearbook-open-label {
        transition: none;
    }
}
