/* THAIFA Foundation — public page polish (inner-page heroes + restrained motion)
   CI: #d9e7ef light · #303a56 navy · #353688→#2b75a3 gradient · #3357a3 blue · #ffffff · #d51d3c red (used sparingly)
   Loaded site-wide from thaifaRenderPublicHeader(). No dependencies. */
:root {
    --tf-navy: #303a56;
    --tf-blue: #3357a3;
    --tf-light: #d9e7ef;
    --tf-paper: #eef4f8; /* #d9e7ef at ~50% on white */
    --tf-red: #d51d3c;
    --tf-gradient: linear-gradient(135deg, #353688 0%, #2b75a3 100%);
    --tf-ease: cubic-bezier(.22, .61, .36, 1);
    --tf-shadow-soft: 0 10px 30px -12px rgba(48, 58, 86, .22);
    --tf-shadow-lift: 0 18px 40px -16px rgba(48, 58, 86, .28);
}

/* ------------------------------------------------------------------
   Header: smoother nav links + compact shadow once the page scrolls
------------------------------------------------------------------ */
.tf-site-nav { transition: box-shadow .3s var(--tf-ease), background-color .3s var(--tf-ease); }
.tf-site-nav.is-scrolled { box-shadow: 0 6px 20px -10px rgba(48, 58, 86, .25); }
.tf-nav-link { position: relative; }
.tf-nav-link::after {
    content: ""; position: absolute; left: 1rem; right: 1rem; bottom: .3rem; height: 2px; border-radius: 2px;
    background: var(--tf-blue); transform: scaleX(0); transform-origin: left center;
    transition: transform .3s var(--tf-ease);
}
.tf-nav-link:hover::after, .tf-nav-link:focus-visible::after { transform: scaleX(1); }

/* Buttons / links: consistent, gentle transitions and visible focus */
main a, main button, main input[type="submit"] {
    transition-property: color, background-color, border-color, box-shadow, transform, opacity;
    transition-duration: .22s; transition-timing-function: var(--tf-ease);
}
main a:focus-visible, main button:focus-visible, .tf-btn:focus-visible { outline: 3px solid rgba(51, 87, 163, .45); outline-offset: 2px; }

/* ------------------------------------------------------------------
   Inner-page hero system
   .tf-hero + one mood modifier: --donate | --volunteer | --stories | --contact
------------------------------------------------------------------ */
.tf-hero { position: relative; overflow: hidden; }
/* Everything in the new heroes uses the site's font (Prompt) */
.tf-hero, .tf-hero *, .tf-btn { font-family: 'Prompt', sans-serif; }
.tf-hero__inner { position: relative; z-index: 1; max-width: 80rem; margin: 0 auto; padding: clamp(2.75rem, 6vw, 4.75rem) 1rem; }
@media (min-width: 640px) { .tf-hero__inner { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .tf-hero__inner { padding-left: 2rem; padding-right: 2rem; } }
.tf-hero__grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); align-items: center; }
@media (min-width: 1024px) { .tf-hero__grid { grid-template-columns: 1.05fr .95fr; } }

.tf-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.1rem;
    padding: .4rem 1rem; border-radius: 999px; font-size: .9rem; letter-spacing: .02em;
    color: var(--tf-blue); background: rgba(51, 87, 163, .08); border: 1px solid rgba(51, 87, 163, .16);
}
.tf-eyebrow::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; opacity: .7; }
.tf-eyebrow--light { color: #fff; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .32); }
.tf-hero__title { font-size: clamp(2.1rem, 4.4vw, 3.35rem); line-height: 1.22; margin: 0 0 1rem; color: var(--tf-navy); font-weight: 500; } /* same weight as the site's existing headings */
.tf-hero__lead { font-size: clamp(1.02rem, 1.4vw, 1.15rem); line-height: 1.8; font-weight: 400; color: rgba(48, 58, 86, .78); max-width: 36rem; margin: 0; }
.tf-phrase { display: inline-block; } /* keep Thai phrases from breaking mid-phrase on small screens */
.tf-hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.tf-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px;
    padding: .7rem 1.4rem; border-radius: 999px; font-size: 1rem; text-decoration: none; border: 1px solid transparent;
    transition: background-color .22s var(--tf-ease), color .22s var(--tf-ease), border-color .22s var(--tf-ease), box-shadow .22s var(--tf-ease), transform .22s var(--tf-ease);
}
.tf-btn svg { width: 1.1rem; height: 1.1rem; transition: transform .22s var(--tf-ease); }
.tf-btn:hover svg { transform: translateX(3px); }
.tf-btn--primary { background: var(--tf-blue); color: #fff; box-shadow: 0 8px 20px -10px rgba(51, 87, 163, .7); }
.tf-btn--primary:hover { background: #2a4a8f; transform: translateY(-1px); box-shadow: 0 12px 24px -12px rgba(51, 87, 163, .8); }
.tf-btn--ghost { background: #fff; color: var(--tf-navy); border-color: rgba(48, 58, 86, .16); }
.tf-btn--ghost:hover { border-color: var(--tf-blue); color: var(--tf-blue); }
.tf-btn--on-dark { background: #fff; color: var(--tf-navy); }
.tf-btn--on-dark:hover { background: var(--tf-light); }
.tf-btn--outline-light { color: #fff; border-color: rgba(255, 255, 255, .45); }
.tf-btn--outline-light:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }

/* Donate — keeps the blue identity, calmer gradient, white/off-white accents */
.tf-hero--donate { background: var(--tf-gradient); }
.tf-hero--donate::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(60rem 30rem at 0% 0%, rgba(255, 255, 255, .10), transparent 60%);
}
.tf-hero--donate .tf-hero__inner { padding-top: clamp(2.5rem, 5vw, 4.5rem); padding-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.tf-trust-card { background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .2); border-radius: 1.1rem; padding: 1.25rem; transition: background-color .25s var(--tf-ease), border-color .25s var(--tf-ease); }
.tf-trust-card:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .32); }
.tf-trust-icon { width: 2.6rem; height: 2.6rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: .75rem; background: rgba(255, 255, 255, .95); color: var(--tf-blue); }
.tf-trust-icon svg { width: 1.25rem; height: 1.25rem; }

/* Volunteer — light, energetic split with photo and "open activities" card */
.tf-hero--volunteer { background: linear-gradient(180deg, #ffffff 0%, var(--tf-paper) 100%); border-bottom: 1px solid var(--tf-light); }
.tf-photo { position: relative; }
@media (max-width: 1023.98px) { .tf-photo { max-width: 36rem; } .tf-photo__frame { aspect-ratio: 16 / 10; } }
.tf-photo__frame { border-radius: 1.5rem; overflow: hidden; box-shadow: var(--tf-shadow-lift); aspect-ratio: 4 / 3; background: var(--tf-light); }
.tf-photo__frame { position: relative; }
.tf-photo__frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-photo__frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(53, 54, 136, 0) 45%, rgba(53, 54, 136, .28) 100%); }
.tf-activity-card {
    position: relative; margin: -2.5rem 1rem 0 auto; max-width: 20rem; background: #fff; border-radius: 1.1rem;
    padding: 1rem 1.15rem; box-shadow: var(--tf-shadow-soft); border: 1px solid var(--tf-light);
}
@media (min-width: 1024px) { .tf-activity-card { position: absolute; left: -2rem; bottom: -1.75rem; margin: 0; } }
.tf-activity-card__title { font-size: .85rem; color: rgba(48, 58, 86, .65); margin: 0 0 .5rem; }
.tf-activity-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.tf-activity-card li { display: flex; align-items: center; gap: .55rem; color: var(--tf-navy); font-size: .95rem; }
.tf-activity-card li::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--tf-blue); flex-shrink: 0; }
.tf-hero-stats { display: flex; flex-wrap: wrap; gap: 1.5rem 2rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--tf-light); }
.tf-hero-stats strong { display: block; font-size: 1.5rem; font-weight: 500; color: var(--tf-blue); line-height: 1.2; }
.tf-hero-stats span { font-size: .9rem; color: rgba(48, 58, 86, .65); }

/* Stories — editorial: navy field, large serif-free quote, portrait image */
.tf-hero--stories { background: #293b6b; color: #fff; }
.tf-hero--stories .tf-hero__title { color: #fff; }
.tf-hero--stories .tf-hero__lead { color: rgba(255, 255, 255, .82); }
.tf-quote { position: relative; margin: 1.75rem 0 0; padding: 0 0 0 1.25rem; border-left: 3px solid rgba(255, 255, 255, .5); }
.tf-quote p { margin: 0; font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.6; color: #fff; }
.tf-quote footer { margin-top: .5rem; font-size: .9rem; color: rgba(255, 255, 255, .65); }
.tf-story-figure { position: relative; margin: 0; }
.tf-story-figure img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 1.5rem; display: block; }
.tf-story-figure::before {
    content: "\201C"; position: absolute; z-index: 1; left: -.25rem; top: -2.6rem; font-size: 7rem; line-height: 1;
    font-family: "Prompt", sans-serif; color: rgba(255, 255, 255, .9);
}
@media (max-width: 1023.98px) { .tf-story-figure { max-width: 34rem; } .tf-story-figure::before { display: none; } }
.tf-story-figure figcaption { margin-top: .75rem; font-size: .85rem; color: rgba(255, 255, 255, .6); }

/* Contact — calm and compact, service panel instead of a big banner */
.tf-hero--contact { background: var(--tf-paper); border-bottom: 1px solid var(--tf-light); }
.tf-hero--contact .tf-hero__inner { padding-top: clamp(2.25rem, 5vw, 3.75rem); padding-bottom: clamp(2.25rem, 5vw, 3.75rem); }
.tf-service-panel { background: #fff; border: 1px solid var(--tf-light); border-radius: 1.25rem; box-shadow: var(--tf-shadow-soft); overflow: hidden; }
.tf-service-panel__head { background: var(--tf-gradient); color: #fff; padding: 1rem 1.25rem; font-size: .95rem; }
.tf-service-row { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.25rem; border-top: 1px solid #eef3f7; color: var(--tf-navy); text-decoration: none; }
.tf-service-row:first-of-type { border-top: 0; }
a.tf-service-row:hover { background: var(--tf-paper); }
.tf-service-row__icon { width: 2.4rem; height: 2.4rem; border-radius: .75rem; background: rgba(51, 87, 163, .08); color: var(--tf-blue); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tf-service-row__icon svg { width: 1.2rem; height: 1.2rem; }
.tf-service-row small { display: block; color: rgba(48, 58, 86, .6); font-size: .82rem; }
.tf-service-row span { word-break: break-word; }
.tf-reassure { display: flex; gap: .6rem; align-items: center; margin-top: 1.5rem; color: rgba(48, 58, 86, .75); font-size: .95rem; }
.tf-reassure svg { width: 1.2rem; height: 1.2rem; color: var(--tf-blue); flex-shrink: 0; }

/* ------------------------------------------------------------------
   Motion: hero entrance + reveal on scroll (classes added by thaifa-motion.js,
   so content is always visible without JS)
------------------------------------------------------------------ */
@keyframes tf-fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes tf-reveal-mask { from { clip-path: inset(0 0 100% 0 round 1.5rem); } to { clip-path: inset(0 0 0 0 round 1.5rem); } }
.tf-anim { animation: tf-fade-up .7s var(--tf-ease) both; }
.tf-anim-d1 { animation-delay: .08s; } .tf-anim-d2 { animation-delay: .16s; } .tf-anim-d3 { animation-delay: .24s; }
.tf-anim-mask { animation: tf-reveal-mask .9s var(--tf-ease) .1s both; }

.tf-js .tf-reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--tf-ease), transform .7s var(--tf-ease); transition-delay: var(--tf-delay, 0s); }
.tf-js .tf-reveal.is-visible { opacity: 1; transform: none; }

/* Card hover: soft lift + shadow (opt-in through JS on existing cards) */
.tf-card-hover { transition: transform .3s var(--tf-ease), box-shadow .3s var(--tf-ease), border-color .3s var(--tf-ease); }
@media (hover: hover) { .tf-card-hover:hover { transform: translateY(-3px); box-shadow: var(--tf-shadow-lift); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .tf-js .tf-reveal { opacity: 1; transform: none; }
    .tf-card-hover:hover, .tf-btn--primary:hover { transform: none; }
}

/* News listing — same calm tone as the contact hero */
.tf-hero--news { background: var(--tf-paper); border-bottom: 1px solid var(--tf-light); }
.tf-hero--news .tf-hero__inner { padding-top: clamp(1.75rem, 4vw, 3rem); padding-bottom: clamp(1.75rem, 4vw, 3rem); }
