
/*
==========================================
YOUTH PARLIAMENT OF GHANA
PROFESSIONAL BIRTHDAY CELEBRATION SYSTEM
==========================================
*/

/* ==========================================
   BIRTHDAY SECTION
========================================== */

#ypg-birthday-section {
    padding: 24px 15px;
    background: #f5f7fb;
}

#ypg-birthday-section[hidden] {
    display: none !important;
}

/* ==========================================
   SECTION HEADING
========================================== */

.ypg-birthday-heading {
    text-align: center;
    margin: 0 auto 18px;
}

.ypg-birthday-heading h2 {
    color: #123b2a;
    font-size: clamp(1.35rem, 3vw, 1.9rem);
    font-weight: 800;
    line-height: 1.3;
    margin: 0 0 6px;
}

.ypg-birthday-heading p {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* ==========================================
   RESPONSIVE BIRTHDAY CARD GRID
========================================== */

.ypg-birthday-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(min(100%, 280px), 320px)
    );
    justify-content: center;
    align-items: start;
    gap: 18px;
}

/* ==========================================
   SQUARE BIRTHDAY CARD WITH SCROLLING
========================================== */

.ypg-birthday-card {
    position: relative;
    width: 100%;
    max-width: 320px;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;

    padding: 12px 12px 14px;
    text-align: center;

    /* Allow visitors to scroll through the card */
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;

    border: 1.5px solid #d7b35a;
    border-radius: 14px;

    background: linear-gradient(
        145deg,
        #ffffff 0%,
        #fffdf7 55%,
        #fff8e7 100%
    );

    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.07);

    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* ==========================================
   GHANA COLOUR ACCENT
========================================== */

.ypg-birthday-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;

    background: linear-gradient(
        90deg,
        #006b3f 0%,
        #fcd116 50%,
        #ce1126 100%
    );

    pointer-events: none;
}

/* ==========================================
   CUSTOM SCROLLBAR
========================================== */

/* Chrome, Edge and Safari */
.ypg-birthday-card::-webkit-scrollbar {
    width: 6px;
}

.ypg-birthday-card::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.ypg-birthday-card::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.ypg-birthday-card::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ==========================================
   YPG LOGO
========================================== */

.ypg-birthday-logo {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
    margin: 3px auto 4px;
    flex: 0 0 auto;
}

/* ==========================================
   CELEBRATION DECORATION
========================================== */

.ypg-birthday-confetti {
    margin: 0 auto 3px;
    font-size: 0.95rem;
    line-height: 1.2;
    flex-shrink: 0;
}

/* ==========================================
   ORGANISATION NAME
========================================== */

.ypg-birthday-label {
    color: #8a6b22;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.35;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    flex-shrink: 0;
}

/* ==========================================
   BIRTHDAY HEADLINE
========================================== */

.ypg-birthday-title {
    color: #123b2a;
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.2;
    margin: 4px 0 6px;
    flex-shrink: 0;
}

/* ==========================================
   EXTRA-LARGE MEMBER PHOTO
========================================== */

.ypg-birthday-photo {
    display: block;

    /* Large desktop portrait */
    width: 120px;
    height: 120px;
    min-width: 120px;
    min-height: 120px;

    max-width: none;

    object-fit: cover;
    object-position: center;
    border-radius: 50%;

    margin: 7px auto;

    /* Prevent the photo from shrinking */
    flex: 0 0 120px;

    border: 3px solid #d4af37;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* ==========================================
   MEMBER NAME
========================================== */

.ypg-birthday-name {
    color: #173d2c;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 3px 0;
    overflow-wrap: anywhere;
    flex-shrink: 0;
}

/* ==========================================
   PARLIAMENTARY POSITION
========================================== */

.ypg-birthday-position {
    color: #8a6b22;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 2px 0 5px;
    overflow-wrap: anywhere;
    flex-shrink: 0;
}

/* ==========================================
   FORMAL BIRTHDAY MESSAGE
========================================== */

.ypg-birthday-message {
    max-width: 270px;
    margin: 5px auto 0;
    padding: 0;

    color: #3d4641;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;

    overflow-wrap: break-word;
    flex-shrink: 0;
}

/* ==========================================
   INSTITUTIONAL SIGNATURE
========================================== */

.ypg-birthday-signature {
    max-width: 280px;
    margin: 7px auto 0;
    padding-top: 5px;

    border-top: 1px solid #e3d4a6;

    color: #123b2a;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;

    overflow-wrap: anywhere;
    flex-shrink: 0;
}

/* ==========================================
   ADDITIONAL ORGANISATION SIGNATURE
========================================== */

.ypg-birthday-signature-org {
    margin: 3px auto 0;

    color: #987322;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    line-height: 1.4;
    text-align: center;

    overflow-wrap: anywhere;
    flex-shrink: 0;
}

/* ==========================================
   TABLET
========================================== */

@media (min-width: 481px) and (max-width: 768px) {
    #ypg-birthday-section {
        padding: 22px 14px;
    }

    .ypg-birthday-grid {
        grid-template-columns: repeat(
            auto-fit,
            minmax(min(100%, 270px), 320px)
        );
        gap: 14px;
    }

    .ypg-birthday-card {
        padding: 12px 11px 14px;
    }

    .ypg-birthday-photo {
        width: 112px;
        height: 112px;
        min-width: 112px;
        min-height: 112px;
        flex-basis: 112px;
    }
}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 480px) {
    #ypg-birthday-section {
        padding: 18px 10px;
    }

    .ypg-birthday-heading {
        margin-bottom: 14px;
    }

    .ypg-birthday-heading h2 {
        font-size: 1.35rem;
    }

    .ypg-birthday-heading p {
        font-size: 0.82rem;
    }

    .ypg-birthday-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .ypg-birthday-card {
        width: min(100%, 320px);
        max-width: 320px;
        justify-self: center;
        padding: 12px 11px 14px;
        border-radius: 12px;
    }

    .ypg-birthday-logo {
        width: 32px;
        height: 32px;
    }

    .ypg-birthday-label {
        font-size: 0.6rem;
        letter-spacing: 0.8px;
    }

    .ypg-birthday-title {
        font-size: 1rem;
    }

    /* Large portrait on mobile */
    .ypg-birthday-photo {
        width: 105px;
        height: 105px;
        min-width: 105px;
        min-height: 105px;
        flex-basis: 105px;
        margin: 6px auto;
    }

    .ypg-birthday-name {
        font-size: 0.86rem;
    }

    .ypg-birthday-position {
        font-size: 0.7rem;
    }

    .ypg-birthday-message {
        max-width: 100%;
        font-size: 0.68rem;
        line-height: 1.35;
    }

    .ypg-birthday-signature {
        max-width: 100%;
        font-size: 0.64rem;
    }

    .ypg-birthday-signature-org {
        font-size: 0.56rem;
        letter-spacing: 0.5px;
    }
}

/* ==========================================
   CARD ENTRANCE ANIMATION
========================================== */

@media (prefers-reduced-motion: no-preference) {
    .ypg-birthday-card {
        animation: ypgBirthdayAppear 0.35s ease-out;
    }

    @keyframes ypgBirthdayAppear {
        from {
            opacity: 0;
            transform: translateY(8px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ==========================================
   RESPECT REDUCED-MOTION PREFERENCES
========================================== */

@media (prefers-reduced-motion: reduce) {
    .ypg-birthday-card {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto;
    }
}
