/* Reset / basics */
/* Base fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Whole body fade-in */
/* body {
    opacity: 0;
    animation: fadeIn 1.5s ease-in-out forwards;
} */

/* Navbar appears first */
.navbar {
    opacity: 0;
    animation: fadeIn 1.2s ease-in-out forwards;
    animation-delay: 0.5s;
}

/* Hero/Banner appears after navbar */
.hero {
    opacity: 0;
    animation: fadeIn 1.2s ease-in-out forwards;
    animation-delay: 1.2s;
}

/* Anthem button on the side */
#sewa-anthem-side {
    opacity: 0;
    animation: fadeIn 1.2s ease-in-out forwards;
    animation-delay: 2s;
}

/* Popup content inside anthem */
#sewa-popup {
    opacity: 0;
    animation: fadeIn 1.2s ease-in-out forwards;
    animation-delay: 0s;
}


*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    opacity: 0;
    animation: fadeIn 1.5s ease-in-out forwards;

    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background: #eeeded;
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* Navbar */
header.navbar {
    background: #003a6a;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header.navbar .logo {
    font-family: 'Merriweather', serif;
    font-size: 1.8rem;
    color: #fff;
}

nav.menu {
    display: flex;
    gap: .01rem;
}

nav.menu a {
    color: #fff;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: background 0.3s, color 0.3s;
}

nav.menu a:hover,
nav.menu a.active {
    background: #fff;
    color: #FF9933;
    border-radius: 4px;
}


/* Hero */
.hero {
    text-align: center;
    position: relative;
    padding: 0px 0;
}

.hero-banner {
    width: 100%;
    /* make banner stretch full width */
    height: auto;
    /* keep aspect ratio */
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    /* optional rounded edges */
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    /* spacing between buttons */
}

.hero-actions .btn {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    /* optional: limit max size */
    margin: 15px;
    /* spacing around */
    padding: 12px 24px;
    background: #003a6a;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 6px;
    transition: 0.3s;
    text-align: center;
}


.btn:hover {
    background: #FF9933;
}

.btn.donate {
    background: #A9A9A9;
    ;
}

.btn.donate:hover {
    background: #FF9933;
}

/* Stats */
.stats {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.stats .stat-card {
    background: #fff;
    padding: 2rem 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.stats .stat-card h2 {
    font-size: 2.5rem;
    color: #003a6a;
    margin-bottom: 0.5rem;
}

.stats .stat-card p {
    font-size: 1rem;
    color: #666;
}

/* Sections */
.section {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.section h2 {
    font-family: 'Merriweather', serif;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #003a6a;
}

.section .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.section .cards .card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.section .cards .card img {
    max-height: 150px;
    /* smaller height */
    width: auto;
    /* don’t stretch */
    margin: 0 auto;
    /* center the image */
    object-fit: contain;
    /* keep full image */
}

.section .cards .card .card-body {
    padding: 1rem;
    flex-grow: 1;
}

.section .cards .card .card-body h3 {
    margin-bottom: 0.5rem;
    color: #222;
}

.section .cards .card .card-body p {
    flex-grow: 1;
    color: #555;
    margin-bottom: 1rem;
}

.section .cards .card .card-body a {
    align-self: start;
    background: #003a6a;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.section .cards .card .card-body a:hover {
    background: #FF9933;
}

/* Footer */
footer {
    background: #003a6a;
    color: #fff;
    text-align: center;
    padding: 2rem 1rem;
}

footer .social {
    margin: 1rem 0;
}

footer .social a {
    margin: 0 0.5rem;
    display: inline-block;
    color: #fff;
}

footer .social a:hover {
    color: #FF9933;
}

/* Responsive */
@media (max-width: 768px) {
    nav.menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        height: 40vh;
    }
}

.royal-letter {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 30px;
    font-family: 'Merriweather', serif;
    font-size: 18px;
    line-height: 1.8;
    color: #2c2c2c;
    text-align: justify;


    /* Royal background */
    background: radial-gradient(circle at center, #D3D3D3 70%, #A9A9A9 100%);
    border: 3px solid #030509;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);

    /* Scroll/Letter unfold animation */
    overflow: hidden;
    max-height: none;
    /* collapsed */
    transition: max-height 1.2s ease-in-out, padding 0.5s ease;
    position: relative;
}

.royal-letter.expanded {
    max-height: none;
    /* enough to show full text */
    padding: 40px;
}

.royal-letter h2 {
    text-align: center;
    font-family: 'Cinzel Decorative', serif;
    font-size: 28px;
    color: #003a6a;
    margin-bottom: 20px;
}

.hidden-text {
    display: none;
}

.royal-letter.expanded .hidden-text {
    display: block;
    animation: unfold 1.2s ease;
}

@keyframes unfold {
    from {
        opacity: 0;
        transform: scaleY(0.8);
    }

    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #A9A9A9;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
}

.read-more:hover {
    background: #FF9933;
}

.notice-board {
    width: 370px;
    height: 200px;
    border: 2px solid #A9A9A9;
    border-radius: 8px;
    background: #f9f9f9;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
}

.board-header {
    background: #003a6a;
    color: #fff;
    text-align: center;
    font-weight: bold;
    padding: 10px;
    font-size: 16px;
    flex-shrink: 0;
    /* header stays fixed */
}

.notices-wrapper {
    flex: 1;
    overflow: hidden;
    /* hide overflowing content */
    position: relative;
}

.notices {
    display: flex;
    flex-direction: column;
    position: absolute;
    width: 100%;
    animation: scrollUp 12s linear infinite;
}

.notices p {
    margin: 10px;
    padding: 5px;
    background: #e6f0ff;
    border-left: 4px solid #A9A9A9;
    border-radius: 4px;
}

/* Animation for smooth upward scroll */
@keyframes scrollUp {
    0% {
        top: 100%;
    }

    100% {
        top: -100%;
    }
}



/* Floating side button container */
#sewa-anthem-side {
    position: fixed;
    right: 0;
    /* visible at start */
    padding: 0px 0px;
    margin: 0px;
    z-index: 9999;
    font-family: 'Verdana, Arial, sans-serif';
}

/* Button */
#sewa-button {
    background: #ab0909;
    color: #fff;
    padding: 12px 18px;
    border-radius: 50px 0 0 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#sewa-button:hover {
    background: #ff9933;
    transform: scale(1.05);
}

/* Popup panel */
#sewa-popup {
    display: none;
    right: 0;
    /* hidden initially */
    top: 10%;
    /* keep some space at top */
    width: 650px;
    /* wider */
    height: auto;
    /* allow content height */
    max-height: none;
    /* remove restriction */
    overflow-y: auto;
    /* still scroll if too long */
    background: #fff;
    box-shadow: -2px 5px 20px rgba(0, 0, 0, 0.3);
    border-radius: 10px 0 0 10px;
    padding: 20px;
    transition: right 0s;
    text-align: left;
    font-size: 14px;
}


/* Close button */
#sewa-popup .close {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 22px;
    cursor: pointer;
    color: #333;
}

/* English & Hindi side by side */
.anthem-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px 0;
    margin-bottom: 2em;
    /* was 10em – reduce */
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
}


.anthem-english {
    flex: 2 1 43%;
    /* takes more space */
}

.anthem-hindi {
    flex: 1 1 37%;
    /* takes less space */
}

/* Remove border for the last box */
.anthem-hindi {
    border-right: none;
}

/* Paragraph spacing inside each language */
.anthem-english p,
.anthem-hindi p {
    margin-bottom: 1em;
    /* adds spacing between paragraphs */
}

/* Slide-in animation for button (optional) */
@keyframes slideIn {
    0% {
        right: -200px;
    }

    100% {
        right: 0;
    }
}

/* Initial hidden state */
.cards .card {
    opacity: 0;
    transform: translateY(50px);
    transition: all 2.8s ease-in-out;
}

/* Animate when in-view */
.cards .card.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Specific animations */
.cards .card.slide-left.in-view {
    transform: translateX(0);
    opacity: 1;
}

.cards .card.slide-right.in-view {
    transform: translateX(0);
    opacity: 1;
}

.cards .card.fade-up.in-view {
    transform: translateY(0);
    opacity: 1;
}

/* Starting offsets for directions */
.cards .card.slide-left {
    transform: translateX(-100px);
}

.cards .card.slide-right {
    transform: translateX(100px);
}

.cards .card.fade-up {
    transform: translateY(100px);
}


/* Base hidden state */
.stat-card,
.notice-board {
    opacity: 0;
    transition: all 2.8s ease-in-out;
}

/* Starting positions */
.slide-left {
    transform: translateX(-100px);
}

.slide-right {
    transform: translateX(100px);
}

.fade-up {
    transform: translateY(100px);
}

/* Animate when in view */
.in-view {
    opacity: 1;
    transform: translate(0, 0);
}

table td,
table th {
    word-break: break-word;
    /* allow breaking long text */
    white-space: normal;
    /* wrap text normally */
    overflow-wrap: break-word;
    /* fallback for older browsers */
}

@media (max-width: 768px) {
    header.navbar {
        flex-direction: column;
        padding: 1rem 0.5rem;
        align-items: flex-start;
    }

    .navbar .logo {
        font-size: 1.3rem;
        margin-bottom: 0.7rem;
    }

    nav.menu {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.1rem;
    }

    .hero {
        padding: 1.5rem 0.5rem;
        height: auto;
    }

    .hero-banner {
        border-radius: 5px;
        max-width: 100vw;
        height: auto;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .hero-actions .btn {
        max-width: 100%;
        min-width: 0;
        margin: 6px 0;
        font-size: 1rem;
        padding: 12px;
    }

    .stats,
    .section .cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stats .stat-card,
    .section .cards .card {
        padding: 1rem 0.5rem;
    }

    .section {
        padding: 0 0.5rem;
    }

    .royal-letter {
        padding: 15px;
        font-size: 1rem;
    }

    .royal-letter.expanded {
        padding: 22px;
    }

    .anthem-container {
        flex-direction: column;
        border-left: none;
        border-right: none;
        gap: 10px;
    }

    .anthem-english,
    .anthem-hindi {
        flex: 1 1 100%;
        border-right: none;
        min-width: 0;
    }

    /* Side popup and board tweaks */
    #sewa-anthem-side {
        top: unset;
        right: 0;
        bottom: 10px;
        width: 100vw;
        padding-right: 0;
        max-width: 98vw;
    }

    #sewa-popup {
        width: 98vw;
        left: 1vw;
        right: unset;
        top: 2%;
        border-radius: 8px;
        padding: 12px;
        font-size: 13px;
        max-width: 98vw;
    }

    .notice-board {
        width: 97vw;
        min-width: 0;
        max-width: 97vw;
        height: auto;
        margin: 0 auto 15px auto;
    }
}

/* EVEN SMALLER DEVICES: <500px fine-tune */
@media (max-width: 500px) {
    .royal-letter {
        font-size: 0.97rem;
        padding: 8px;
        min-width: 0;
    }

    .royal-letter.expanded {
        padding: 12px;
    }

    .navbar .logo {
        font-size: 1rem;
    }

    .section h2 {
        font-size: 0.96rem;
    }

    .hero-actions .btn {
        font-size: 0.93rem;
        padding: 9px;
    }

    .board-header {
        font-size: 13px;
        padding: 7px;
    }
}

@media (max-width: 768px) {
    .notice-board {
        opacity: 1 !important;
        transform: none !important;
    }

    .notices-wrapper {
        max-height: none !important;
        overflow: visible !important;
    }

    .notices {
        display: block !important;
        position: static !important;
        /* remove relative/absolute */
        animation: none !important;
        /* disable scroll animation */
    }

    .notices p {
        display: block;
        margin: 10px 0;
        font-size: 15px;
    }
}
