/* ===================================================================
   Mrs Earth Sri Lanka — Public Site Stylesheet
   Mobile-first. Brand: deep forest/emerald green, champagne gold,
   ivory, charcoal text. Serif display + sans body.
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=Jost:wght@400;500;600&display=swap');

:root {
  --forest: #14322a;
  --emerald: #1f5c47;
  --emerald-light: #2d7a5f;
  --gold: #b99552;
  --gold-light: #d8bd85;
  --ivory: #faf7f0;
  --beige: #f1ead9;
  --charcoal: #23231f;
  --grey: #6b6a63;
  --border: #e6ddc9;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Jost', -apple-system, 'Segoe UI', sans-serif;
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--ivory);
  line-height: 1.65;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; color: var(--forest); margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
p { margin: 0 0 1rem; color: var(--charcoal); }
a { color: var(--emerald); }
img { max-width: 100%; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3.5rem 0; }
.alt-bg { background: var(--beige); }
.section-heading { text-align: center; margin-bottom: 2rem; }
.section-heading-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.5rem; flex-wrap: wrap; gap: .5rem; }
.section-lead { max-width: 720px; margin: 0 auto 1.5rem; text-align: center; color: var(--grey); }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--gold); font-weight: 600; margin-bottom: .5rem; }
.two-col { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
.two-col.reverse { direction: rtl; } .two-col.reverse > * { direction: ltr; }
.three-col { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 800px) {
  .two-col { grid-template-columns: 1fr 1fr; }
  .three-col { grid-template-columns: repeat(3, 1fr); }
}

/* Buttons */
.btn-primary, .btn-outline, .btn-apply {
  display: inline-block;
  padding: .8rem 1.7rem;
  border-radius: 3px;
  font-weight: 600;
  text-decoration: none;
  font-size: .92rem;
  letter-spacing: .02em;
  transition: all .2s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--gold); color: var(--forest); }
.btn-primary:hover { background: var(--gold-light); }
.btn-outline { border-color: var(--forest); color: var(--forest); background: transparent; }
.btn-outline:hover { background: var(--forest); color: #fff; }
.link-arrow { color: var(--emerald); font-weight: 600; text-decoration: none; font-size: .9rem; }

/* Header */
.site-header { background: var(--forest); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: #fff; }
.brand-mark { width: 38px; height: 38px; border: 1px solid var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); color: var(--gold); font-size: .85rem; }
.brand-text { font-family: var(--font-display); font-size: 1.05rem; }
.brand-text em { font-style: normal; color: var(--gold-light); }
.brand-text small { display: block; font-family: var(--font-body); font-size: .65rem; letter-spacing: .1em; color: #cfd9d2; }

.nav-toggle { display: flex; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: #fff; }

.main-nav { display: none; flex-direction: column; gap: .2rem; width: 100%; padding-top: 1rem; }
.main-nav.open { display: flex; }
.main-nav a { color: #e7ede9; text-decoration: none; padding: .6rem .3rem; font-size: .92rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.main-nav a.btn-apply { background: var(--gold); color: var(--forest); text-align: center; border-radius: 3px; margin-top: .5rem; border-bottom: none; }

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .main-nav { display: flex; flex-direction: row; align-items: center; width: auto; padding-top: 0; gap: 1.4rem; }
  .main-nav a { border-bottom: none; padding: .3rem 0; }
  .main-nav a.btn-apply { padding: .55rem 1.3rem; margin-top: 0; }
}

/* Flash */
.flash-stack { padding-top: 1rem; }
.alert { padding: .7rem 1rem; border-radius: 4px; margin-bottom: .6rem; font-size: .9rem; }
.alert-success { background: #e8f3ea; color: #2f6b45; }
.alert-error { background: #fbe9e7; color: #a3342a; }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--forest), var(--emerald));
  background-size: cover; background-position: center;
  color: #fff; padding: 5rem 0;
}
.hero-inner { max-width: 680px; }
.hero-label { color: var(--gold-light); text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; margin-bottom: .8rem; }
.hero h1 { color: #fff; }
.hero-text { color: #dfe9e4; font-size: 1.1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; }
.hero .btn-outline { border-color: #fff; color: #fff; }
.hero .btn-outline:hover { background: #fff; color: var(--forest); }

.page-hero { background: var(--beige); padding: 3rem 0; border-bottom: 1px solid var(--border); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; text-align: center; }
@media (min-width: 700px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-item strong { display: block; font-family: var(--font-display); font-size: 2rem; color: var(--gold); }
.stat-item span { font-size: .82rem; color: var(--grey); text-transform: uppercase; letter-spacing: .06em; }

/* Pillars */
.pillars-grid { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
@media (min-width: 700px) { .pillars-grid { grid-template-columns: repeat(3, 1fr); } }
.pillar-card { background: #fff; border: 1px solid var(--border); padding: 1.6rem; border-radius: 6px; }
.pillar-card h3 { font-size: 1.05rem; }

/* Cards */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }

.contestant-card, .project-card, .news-card, .titleholder-card {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.contestant-card:hover, .project-card:hover, .news-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(20,50,42,.1); }
.contestant-photo, .project-photo, .news-photo, .team-photo { aspect-ratio: 4/5; background-size: cover; background-position: center; background-color: var(--beige); }
.project-photo, .news-photo { aspect-ratio: 16/10; }
.contestant-card-body, .project-card-body, .news-card-body { padding: 1rem 1.1rem; }
.contestant-number { font-size: .75rem; color: var(--gold); font-weight: 600; letter-spacing: .05em; }
.contestant-location { font-size: .82rem; color: var(--grey); }
.news-category { display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--emerald); font-weight: 600; }
.news-date { font-size: .78rem; color: var(--grey); margin-left: .5rem; }

/* Titleholder / profile hero */
.titleholder-image, .profile-portrait { border-radius: 6px; aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.titleholder-title { color: var(--gold); font-weight: 600; }

.profile-hero { background-size: cover; background-position: center; color: #fff; position: relative; padding: 4rem 0; }
.profile-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,50,42,.75), rgba(20,50,42,.92)); }
.profile-hero .container, .profile-hero-inner { position: relative; z-index: 1; }
.profile-hero h1, .profile-hero .eyebrow { color: #fff; }
.profile-hero-inner { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: center; }
@media (min-width: 700px) { .profile-hero-inner { grid-template-columns: 200px 1fr; } }
.profile-portrait { width: 180px; }
.profile-location { color: #d9e3dd; }
.award-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.award-badge { background: var(--gold); color: var(--forest); padding: .3rem .75rem; font-size: .75rem; border-radius: 3px; font-weight: 600; }
.profile-quote { font-family: var(--font-display); font-size: 1.3rem; color: var(--forest); border-left: 3px solid var(--gold); padding-left: 1rem; margin: 0 0 1.5rem; }
.profile-facts { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; }
.profile-facts dt { color: var(--grey); font-size: .85rem; }
.profile-facts dd { margin: 0; font-weight: 600; }
.profile-sidebar { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 1.5rem; align-self: start; }
.plain-list { padding-left: 1.2rem; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
@media (min-width: 700px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
.gallery-tile { position: relative; aspect-ratio: 1/1; background-size: cover; background-position: center; border-radius: 6px; display: flex; align-items: flex-end; text-decoration: none; overflow: hidden; }
.gallery-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.6)); }
.gallery-tile span { position: relative; z-index: 1; color: #fff; padding: .75rem; font-weight: 600; font-size: .9rem; }
.lightbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 700px) { .lightbox-grid { grid-template-columns: repeat(4, 1fr); } }
.lightbox-thumb { aspect-ratio: 1/1; background-size: cover; background-position: center; border-radius: 4px; }

/* Lightbox overlay (JS-controlled) */
.lightbox-overlay { position: fixed; inset: 0; background: rgba(20,20,18,.92); display: none; align-items: center; justify-content: center; z-index: 200; padding: 2rem; }
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img { max-height: 85vh; max-width: 90vw; border-radius: 4px; }
.lightbox-close, .lightbox-prev, .lightbox-next { position: absolute; background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; }
.lightbox-close { top: 1.5rem; right: 1.5rem; }
.lightbox-prev { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1.5rem; top: 50%; transform: translateY(-50%); }

/* Forms */
.filter-bar { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 2rem; }
.filter-bar input, .filter-bar select { padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 4px; font-family: var(--font-body); }
.narrow-form { max-width: 560px; margin: 0 auto; }
.narrow-form form, aside form { display: flex; flex-direction: column; }
form label { font-size: .85rem; font-weight: 600; margin: .9rem 0 .3rem; color: var(--forest); }
form input, form select, form textarea {
  padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 4px; font-family: var(--font-body); font-size: .95rem; width: 100%;
}
form input:focus, form select:focus, form textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.checkbox-label { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; font-size: .85rem; }
.checkbox-label input { width: auto; }
.honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
form button[type="submit"] { margin-top: 1.5rem; align-self: flex-start; }

/* FAQ accordion */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
  width: 100%; text-align: left; background: none; border: none; padding: 1rem 0;
  font-family: var(--font-display); font-size: 1.05rem; color: var(--forest); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-icon { color: var(--gold); font-size: 1.3rem; }
.faq-answer { padding-bottom: 1rem; color: var(--grey); }

/* Prose (rich content) */
.prose { max-width: 780px; margin: 0 auto; }
.prose img { border-radius: 6px; margin: 1rem 0; }
.document-list { list-style: none; padding: 0; }
.document-list li { margin-bottom: .5rem; }
.document-list a { text-decoration: none; font-weight: 600; }

/* Dates */
.dates-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 700px) { .dates-grid { grid-template-columns: repeat(3, 1fr); } }
.date-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 1.2rem; text-align: center; }
.date-card strong { display: block; color: var(--gold); font-family: var(--font-display); }

/* CTA */
.cta-section { background: var(--forest); color: #fff; }
.cta-inner { text-align: center; }
.cta-section h2, .cta-section p { color: #fff; }

/* Team */
.team-photo { border-radius: 50%; aspect-ratio: 1/1; }
.team-card { text-align: center; }
.team-position { color: var(--gold); font-size: .85rem; font-weight: 600; }

/* Article */
.article-featured-image { aspect-ratio: 16/7; background-size: cover; background-position: center; }
.article-body-wrap { max-width: 780px; margin: 0 auto; }
.article-byline { color: var(--grey); font-size: .9rem; }
.social-share { margin: 2rem 0; display: flex; gap: 1rem; align-items: center; font-size: .85rem; }
.social-share a { text-decoration: none; font-weight: 600; }
.article-adjacent-nav { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 1.2rem; gap: 1rem; }
.adjacent-link { text-decoration: none; font-size: .9rem; }

/* Partners */
.partner-level-label { text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; color: var(--gold); margin: 2rem 0 1rem; }
.partner-logo-row { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }
.partner-logo-row img { max-height: 60px; width: auto; }
.partner-card { text-align: center; max-width: 200px; }

/* Newsletter */
.newsletter-form { margin-top: 1.2rem; }
.newsletter-form label { color: #fff; }
.newsletter-row { display: flex; gap: .5rem; margin-top: .4rem; }
.newsletter-row input { flex: 1; padding: .6rem .7rem; border-radius: 4px; border: none; }
.newsletter-row button { background: var(--gold); color: var(--forest); border: none; padding: .6rem 1rem; border-radius: 4px; font-weight: 600; cursor: pointer; }

/* Footer */
.site-footer { background: var(--forest); color: #cfd9d2; padding: 3.5rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand p { color: #b7c4bc; font-size: .88rem; }
.footer-col h4 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .8rem; }
.footer-col a, .footer-col span { display: block; color: #cfd9d2; text-decoration: none; font-size: .88rem; margin-bottom: .5rem; }
.footer-col a:hover { color: var(--gold-light); }
.social-icons { display: flex; gap: .6rem; margin-top: .8rem; }
.social-icons a { border: 1px solid rgba(255,255,255,.25); border-radius: 50%; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: .72rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2.5rem; padding-top: 1.2rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; font-size: .78rem; color: #9fb0a6; }

/* Pagination */
.pagination { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 2rem; justify-content: center; }
.pagination a { padding: .5rem .9rem; border: 1px solid var(--border); border-radius: 4px; text-decoration: none; color: var(--forest); font-size: .85rem; }
.pagination a.current { background: var(--forest); color: #fff; border-color: var(--forest); }

.empty-state { text-align: center; color: var(--grey); padding: 2rem 0; }
.map-embed { width: 100%; height: 220px; border: none; border-radius: 6px; margin-top: 1rem; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
