/* ============================================================
   GRACE HARMONY HOME — style.css
   PSCCA Non-Profit Elderly Home, George Town, Penang
   ============================================================ */

/* ── RESET & BASE ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Noto Sans', system-ui, -apple-system,
                 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #ffffff;
    color: #2c2418;
    line-height: 1.6;
}

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

a {
    color: inherit;
    transition: color 0.2s;
}

/* ── LAYOUT ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    margin: 4rem 0;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2a5f4b;
    border-left: 7px solid #c9925b;
    padding-left: 20px;
    margin-bottom: 2rem;
    line-height: 1.3;
}

hr {
    margin: 2rem 0;
    border: 0;
    height: 1px;
    background: linear-gradient(to right, #ecd9bf, transparent);
}

/* ── NAVBAR ── */
.navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    gap: 20px;
    border-bottom: 2px solid #eae0d0;
    margin-bottom: 0.5rem;
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.logo-img {
    height: 110px;
    width: auto;
    border-radius: 20px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
    background: white;
    padding: 6px;
    object-fit: contain;
}

.logo-img:hover { transform: scale(1.02); }

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.org-name-en {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #2a5f4b;
    line-height: 1.2;
}

.org-name-zh {
    font-size: 1.8rem;
    font-weight: 700;
    color: #b87c4a;
    letter-spacing: 2px;
}

.org-pscca {
    font-size: 1rem;
    font-weight: 700;
    background: #f5efe5;
    display: inline-block;
    width: fit-content;
    padding: 5px 16px;
    border-radius: 40px;
    color: #4a6b5a;
    border: 1.5px solid #d4b48c;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    gap: 1.8rem;
    list-style: none;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    font-weight: 600;
    color: #3a2c1e;
    font-size: 1.05rem;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover,
.nav-links a:focus {
    color: #b4642c;
    border-bottom-color: #b4642c;
    outline: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #2a5f4b;
    padding: 4px 8px;
}

.lang-btn {
    background: #2a5f4b;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.lang-btn:hover { background: #1f4637; transform: scale(1.02); }

/* ── HERO ── */
.hero {
    border-radius: 2rem;
    margin: 1.5rem 0 2rem;
    padding: 4rem 2.5rem;
    position: relative;
    overflow: hidden;
    min-height: 460px;
    display: flex;
    align-items: center;
    background: #f8f4ed;
}

.hero-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: brightness(0.68) contrast(1.05);
    border-radius: 2rem;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
    background: rgba(0,0,0,0.58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 2rem 2.2rem;
    border-radius: 2rem;
    color: white;
    border-left: 6px solid #f5c28e;
}

.hero-content h1 {
    font-size: 2.6rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.35);
}

.hero-tagline {
    font-size: 1.3rem;
    color: #ffefcf;
    margin-bottom: 1rem;
    font-style: italic;
    font-weight: 500;
}

.mission-text {
    font-size: 1.05rem;
    max-width: 540px;
    background: rgba(0,0,0,0.4);
    padding: 0.9rem 1.4rem;
    border-radius: 50px;
    margin: 1.2rem 0;
    font-weight: 500;
    border-left: 4px solid #f5c28e;
}

.btn-donate {
    display: inline-block;
    background: #e2a142;
    color: #2c2418;
    padding: 12px 30px;
    border-radius: 60px;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.2s, transform 0.2s;
    margin-top: 8px;
    font-size: 1.05rem;
}

.btn-donate:hover {
    background: #c9862c;
    transform: translateY(-2px);
    color: white;
}

/* ── ABOUT ── */
.about-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.about-card {
    flex: 2 1 300px;
    background: white;
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 6px 14px rgba(0,0,0,0.04);
    border: 1px solid #f0e2cf;
}

.about-lead {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.about-quote {
    margin-top: 1rem;
    font-style: italic;
    color: #4a3724;
}

.about-reg {
    margin-top: 20px;
    background: #fcf5ea;
    border-radius: 40px;
    padding: 12px 20px;
    font-size: 0.9rem;
    border-left: 4px solid #b4642c;
}

.nonprofit-card {
    flex: 1 1 220px;
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    padding: 2rem 1.8rem;
    text-align: center;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 12px 24px -12px rgba(0,0,0,0.15);
}

.nonprofit-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    filter: brightness(0.75) contrast(1.1);
    transition: transform 0.4s ease;
}

.nonprofit-card:hover .nonprofit-bg { transform: scale(1.03); }

.nonprofit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.48);
    z-index: 1;
}

.nonprofit-content {
    position: relative;
    z-index: 2;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.nonprofit-content h3 {
    font-size: 1.7rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.nonprofit-content p { font-size: 1.05rem; font-weight: 500; }

.badge-quote {
    margin-top: 14px;
    font-size: 0.88rem;
    font-style: italic;
    opacity: 0.92;
}

/* ── SERVICE CARDS ── */
.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.card {
    flex: 1 1 260px;
    border-radius: 28px;
    padding: 1.6rem;
    box-shadow: 0 10px 24px -12px rgba(0,0,0,0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
    color: white;
    min-height: 270px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border: 1px solid rgba(255,255,200,0.25);
}

.card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -12px rgba(0,0,0,0.18); }

.card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    transition: transform 0.4s ease;
}

.card:hover .card-bg { transform: scale(1.04); }

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.52) 0%, rgba(0,0,0,0.72) 100%);
    z-index: 1;
    border-radius: 28px;
}

.card-content {
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.card-icon {
    font-size: 2.6rem;
    margin-bottom: 0.7rem;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff8e7;
    font-weight: 700;
}

.card p { color: #fef0df; font-weight: 500; }

/* Support cards (white bg) */
.support-card {
    background: white;
    color: #2c2418;
    border: 1px solid #f0e2cf;
    justify-content: flex-start;
}

.support-card h3 { color: #4b3a28; font-size: 1.4rem; margin-bottom: 0.5rem; }
.support-card p  { color: #5f4e38; }
.bank-info { margin-top: 12px; font-weight: 600; font-size: 0.95rem; color: #3a2c1e; }

.support-quote {
    background: #fff0e0;
    border-radius: 28px;
    margin-top: 28px;
    padding: 20px 28px;
    text-align: center;
    font-size: 1.05rem;
}

/* ── GALLERY ── */
.gallery-section { margin: 3rem 0 4rem; }

.gallery-container {
    position: relative;
    width: 100%;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 14px 32px rgba(0,0,0,0.09);
    background: #f0ebe2;
    user-select: none;
}

.gallery-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.85s ease-in-out;
    pointer-events: none;
}

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

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── CAPTION ANIMATION ── */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.72), transparent);
    color: white;
    padding: 28px 24px 14px;
    font-size: 1.05rem;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.3px;
    /* Start hidden below */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Caption slides up only on active slide, after photo fades in */
.gallery-slide.active .gallery-caption {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.55s;
}

.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.48);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
    font-weight: bold;
    line-height: 1;
}

.gallery-btn:hover  { background: rgba(0,0,0,0.78); transform: translateY(-50%) scale(1.06); }
.gallery-btn:focus  { outline: 2px solid #f5c28e; }
.btn-prev { left: 18px; }
.btn-next { right: 18px; }

.gallery-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: #f0ebe2;
}

.dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #c9b48b;
    cursor: pointer;
    transition: background 0.2s, width 0.25s, border-radius 0.25s;
    border: none;
}

.dot.active {
    background: #e2a142;
    width: 26px;
    border-radius: 20px;
}

/* ── NEWS ── */
.news-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.news-card {
    flex: 1 1 360px;
    background: white;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.07);
    transition: transform 0.22s;
    border: 1px solid #f0e2cf;
}

.news-card:hover { transform: translateY(-4px); }

.news-header {
    background: #2a5f4b;
    color: white;
    padding: 12px 20px;
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-content {
    padding: 20px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.social-placeholder {
    background: #f5f0e8;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    color: #6e5a44;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.youtube-embed {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
}

.youtube-embed iframe {
    width: 100%;
    height: 210px;
    border: none;
    display: block;
}

.yt-caption { color: #4a3724; font-size: 0.9rem; }

.btn {
    display: inline-block;
    background: #e2a142;
    color: #2c2418;
    padding: 9px 18px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}

.btn:hover { background: #c9862c; color: white; }

/* ── CONTACT ── */
.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    background: #ffffff;
    border-radius: 32px;
    padding: 2rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);
    border: 1px solid #f0e2cf;
}

.contact-details {
    flex: 1.2 1 260px;
    font-style: normal;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 1.5rem;
}

.contact-icon {
    font-size: 1.7rem;
    width: 44px;
    text-align: center;
    flex-shrink: 0;
    padding-top: 2px;
}

.contact-text {
    font-size: 1.02rem;
    line-height: 1.5;
    word-break: break-word;
}

.contact-text a { color: #2a5f4b; text-decoration: none; }
.contact-text a:hover { color: #b4642c; text-decoration: underline; }

.map-wrapper { flex: 1.8 1 260px; }

.map-container {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e2d4c2;
    height: 320px;
}

.map-container iframe { width: 100%; height: 100%; border: 0; display: block; }

.map-note {
    font-size: 0.75rem;
    margin-top: 8px;
    text-align: center;
    color: #6e5a44;
}

/* ── THANK YOU ── */
.thankyou-banner { text-align: center; margin: 2rem 0 1rem; }

.thankyou-pill {
    background: #f7eedf;
    border-radius: 100px;
    display: inline-block;
    padding: 9px 28px;
    font-size: 0.95rem;
    font-weight: 500;
}

/* ── FOOTER ── */
footer {
    background: #2e271f;
    color: #e9dfcf;
    padding: 2.2rem 0;
    margin-top: 3rem;
    border-radius: 2rem 2rem 0 0;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.grace-note { font-size: 0.9rem; max-width: 280px; line-height: 1.7; }

.footer-info p { margin-bottom: 4px; font-size: 0.95rem; }

.footer-copy {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.82rem;
    color: #c9b48b;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1.2rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .org-name-en { font-size: 1.9rem; }
    .org-name-zh { font-size: 1.5rem; }
    .hero-content h1 { font-size: 2rem; }
}

@media (max-width: 680px) {
    .navbar { flex-direction: column; align-items: flex-start; }

    .nav-toggle { display: block; }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
        width: 100%;
        padding: 0.8rem 0;
    }

    .nav-links.open { display: flex; }

    .logo-img { height: 80px; }
    .org-name-en { font-size: 1.5rem; }
    .org-name-zh { font-size: 1.2rem; }
    .section-title { font-size: 1.65rem; }
    .hero { padding: 2rem 1.2rem; min-height: auto; }
    .hero-content h1 { font-size: 1.6rem; }
    .hero-tagline { font-size: 1rem; }
    .mission-text { font-size: 0.95rem; }
    .map-container { height: 240px; }
    .gallery-btn { width: 36px; height: 36px; font-size: 1.2rem; }
    .btn-prev { left: 10px; }
    .btn-next { right: 10px; }
    .news-card { flex: 1 1 100%; }
    .gallery-slide { aspect-ratio: 4/3; }
    .gallery-slider { aspect-ratio: 4/3; }
}

/* ── ACCESSIBILITY: reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .gallery-slide,
    .gallery-caption,
    .card-bg,
    .nonprofit-bg,
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ── PRINT ── */
@media print {
    .navbar, .gallery-btn, .gallery-dots, .lang-btn, .nav-toggle, footer { display: none; }
    .hero { min-height: auto; }
    .section { margin: 2rem 0; }
}
