/* ============================================================
   Athi Maram Ministries  |  அத்தி மரம் ஊழியங்கள்
   Theme
   ============================================================ */
:root {
  --nav: #2a0b62;
  --bg: #eee8d7;
  --text: #16021c;
  --accent: #563186;
  --accent2: #595672;
  --accent3: #3c2055;
  --purple-soft: #9876c4;
  --purple-mid: #75509a;
  --grey-soft: #aea1b3;
  --white: #ffffff;

  --maxw: 1180px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(22, 2, 28, 0.12);
  --shadow-sm: 0 4px 14px rgba(22, 2, 28, 0.10);
  --font: "Segoe UI", "Noto Sans Tamil", "Latha", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 40px;
  font-weight: 600;
  letter-spacing: .3px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--nav);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent3); transform: translateY(-2px); text-decoration: none; }
.btn-gold {
  background: var(--purple-soft);
  color: var(--text);
}
.btn-gold:hover { background: var(--purple-mid); transform: translateY(-2px); text-decoration: none; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--nav);
  color: var(--nav);
}
.btn-outline:hover { background: var(--nav); color: #fff; text-decoration: none; }

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  background: var(--nav);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.brand img {
  height: 52px;
  width: auto;
  border-radius: 8px;
  background: #2c055b;
  padding: 3px;
}
.brand-text { line-height: 1.1; }
.brand-text .brand-name { font-weight: 700; font-size: 1.05rem; color: #fff; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu li {
  width: auto;
  flex: 0 0 auto;
}
.nav-menu li a {
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 500;
  font-size: .95rem;
  display: block;
  width: 100%;
  white-space: nowrap;
  transition: background .2s ease;
}
.nav-menu li a:hover,
.nav-menu li a.active {
  background: rgba(255,255,255,.15);
  text-decoration: none;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

/* Language switch */
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { position: relative; }
.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 9px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background .2s ease;
}
.lang-btn:hover { background: rgba(255,255,255,.28); }
.lang-globe { font-size: 1rem; }
.lang-caret { font-size: .65rem; opacity: .85; }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  min-width: 185px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  list-style: none;
  margin: 0;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 1100;
}
.lang-switch.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--nav);
  font: inherit;
  font-size: .92rem;
}
.lang-menu button:hover { background: var(--bg); }
.lang-menu button.active { background: var(--bg); color: var(--accent); font-weight: 700; }

/* Language: hide the inline Tamil (secondary) text; only one language is shown per selection */
.ta { display: none !important; }

/* ============================================================
   Hero / Carousel
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
}
.hero-desktop { height: 460px; }
.hero-mobile { display: none; height: 167px; }
.slides { height: 100%; position: relative; }
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s ease;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dummy-slide span {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0,0,0,.6);
  letter-spacing: 1px;
}
.slide.active { opacity: 1; }
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.7));
}
.slide-caption {
  position: absolute;
  z-index: 3;
  bottom: 14%;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  padding: 0 20px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
}
.slide.active .slide-caption {
  opacity: 1;
  transform: translateY(0);
}
.slide-caption h2 {
  font-size: clamp(1.4rem, 3.5vw, 2.4rem);
  margin: 0 0 6px;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.slide-caption p {
  font-size: clamp(.9rem, 2vw, 1.2rem);
  color: var(--bg);
  margin: 0;
}
.carousel-dots {
  position: absolute;
  z-index: 4;
  bottom: 18px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.carousel-dots button {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: none;
  background: #fff;
  opacity: .55;
  cursor: pointer;
  padding: 0;
  transition: opacity .2s, background .2s;
}
.carousel-dots button.active { background: var(--accent); opacity: 1; }
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s;
}
.carousel-arrow:hover { background: rgba(255,255,255,.45); }
.carousel-arrow.prev { left: 18px; }
.carousel-arrow.next { right: 18px; }

/* ============================================================
   Accessibility / SEO utilities
   ============================================================ */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Sections
   ============================================================ */
section { padding: 64px 0; }
.section-title {
  text-align: center;
  margin-bottom: 40px;
}
.section-title h2 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  color: var(--nav);
  margin: 0 0 6px;
}
.section-title .ta { color: var(--accent); font-size: 1.1rem; }
.section-title .line {
  width: 70px; height: 4px;
  background: var(--purple-soft);
  margin: 14px auto 0;
  border-radius: 4px;
}

.home-about {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 40px;
  align-items: center;
}
.home-about img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
}
.home-about h3 { color: var(--accent3); margin-top: 0; }
.home-about .ta { color: var(--accent2); font-style: italic; }

.verse {
  background: var(--nav);
  color: #fff;
  text-align: center;
}
.verse blockquote {
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  max-width: 760px;
  margin: 0 auto;
  font-style: italic;
}
.verse .ref { color: var(--purple-soft); margin-top: 12px; display: block; }

/* ministry cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card img { height: 200px; width: 100%; object-fit: cover; }
.card .body { padding: 20px; }
.card .body h3 { margin: 0 0 8px; color: var(--nav); }
.card .body .ta { color: var(--accent); font-size: .9rem; }

/* stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  text-align: center;
}
.stat {
  background: #fff;
  padding: 28px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat .num { font-size: 2.4rem; font-weight: 800; color: var(--nav); }
.stat .lbl { color: var(--accent2); }

/* ============================================================
   Gallery
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.gallery-grid a {
  overflow: hidden;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.gallery-grid img {
  height: 220px;
  width: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.gallery-grid a:hover img { transform: scale(1.08); }
.gallery-grid .gallery-video video {
  height: 220px;
  width: 100%;
  object-fit: cover;
  display: block;
  background: #000;
  transition: transform .4s ease;
}
.gallery-grid a.gallery-video:hover video { transform: scale(1.08); }
.gallery-grid .gallery-video {
  display: block;
  position: relative;
}
.gallery-grid .video-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(22,2,28,.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  flex-direction: column;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90%; max-height: 80vh; border-radius: 8px; }
.lightbox video { max-width: 90%; max-height: 80vh; border-radius: 8px; background: #000; }
.lightbox .close {
  position: absolute; top: 24px; right: 30px;
  color: #fff; font-size: 2.4rem; cursor: pointer; background: none; border: none;
}
.lightbox .nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: #fff; font-size: 2.4rem; background: none; border: none; cursor: pointer;
}
.lightbox .nav.prev { left: 24px; }
.lightbox .nav.next { right: 24px; }

/* ============================================================
   Donation
   ============================================================ */
.donate-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.donate-card {
  background: #fff;
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.donate-card h3 { color: var(--nav); margin-top: 0; }
.bank-details { list-style: none; padding: 0; margin: 18px 0 0; }
.bank-details li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--grey-soft);
  display: flex;
  justify-content: space-between;
}
.bank-details li span:first-child { color: var(--accent2); font-weight: 600; }
.qr-box { text-align: center; }
.qr-box img { max-width: 220px; margin: 3px auto 3px; border-radius: 10px; }
.pay-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 16px 0 2px;
}
.pay-icons .pay-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-width: 58px;
  padding: 7px 12px;
  background: #fff;
  border: 1px solid var(--grey-soft);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.pay-icons .pay-icon img { height: 25px; width: auto; max-width: 100%; display: block; }

/* ============================================================
   Events
   ============================================================ */
.event-list { display: grid; gap: 22px; }
.event-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 22px;
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  align-items: center;
}
.event-date {
  background: var(--nav);
  color: #fff;
  border-radius: 12px;
  text-align: center;
  padding: 14px 8px;
}
.event-date .d { font-size: 2rem; font-weight: 800; line-height: 1; }
.event-date .m { text-transform: uppercase; font-size: .85rem; letter-spacing: 1px; }
.event-item h3 { margin: 0 0 6px; color: var(--nav); }
.event-item .meta { color: var(--accent2); font-size: .9rem; }
.badge {
  display: inline-block;
  background: var(--purple-soft);
  color: var(--text);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .75rem;
  margin-left: 8px;
}

/* ============================================================
   Contact
   ============================================================ */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.contact-info h3 { color: var(--nav); }
.contact-info .row { margin-bottom: 16px; }
.contact-info .row span { display:block; color: var(--accent2); font-weight:600; font-size:.85rem; }
form .field { margin-bottom: 16px; }
form label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--accent3); }
form input, form textarea, form select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--grey-soft);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 1rem;
  background: #fff;
}
form input:focus, form textarea:focus { outline: 2px solid var(--purple-soft); border-color: var(--purple-soft); }
.yt-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--nav);
  color: #fff;
  padding: 10px 20px;
  border-radius: 40px;
  font-weight: 600;
}
.yt-link:hover { background: var(--accent3); text-decoration: none; }

.map { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--accent3);
  color: #fff;
  padding: 50px 0 22px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
}
.footer-grid h4 { color: var(--purple-soft); margin-top: 0; }
.footer-grid a { color: var(--bg); }
.footer-grid a:hover { color: #fff; }
.footer-social a {
  display: inline-block;
  margin-right: 12px;
  background: var(--nav);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: .9rem;
}
.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255,255,255,.15);
  margin-top: 30px;
  padding-top: 18px;
  font-size: .85rem;
  color: var(--grey-soft);
}

/* ============================================================
   Admin
   ============================================================ */
.admin-login {
  max-width: 380px;
  margin: 60px auto;
  background: #fff;
  padding: 34px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.admin-login h2 { color: var(--nav); text-align: center; margin-top: 0; }
.admin-dash { display: none; }
.admin-dash.show { display: block; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 20px; }
.admin-box { background:#fff; padding: 22px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.admin-box h3 { margin-top:0; color: var(--nav); }
.admin-topbar {
  background: var(--nav);
  color: #fff;
  padding: 14px 20px;
  display:flex;
  justify-content: space-between;
  align-items:center;
}
.note {
  background: #fff;
  border-left: 4px solid var(--purple-soft);
  padding: 14px 18px;
  border-radius: 6px;
  font-size: .9rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .nav-menu {
    position: fixed;
    top: 68px;
    right: -100%;
    width: 250px;
    height: calc(100vh - 68px);
    background: var(--nav);
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    gap: 6px;
    transition: right .3s ease;
    box-shadow: -6px 0 20px rgba(0,0,0,.3);
  }
  .nav-menu.open { right: 0; }
  .nav-toggle { display: block; }
  .home-about, .donate-wrap, .contact-wrap { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .event-item { grid-template-columns: 1fr; text-align: center; }
  .nav-actions { gap: 6px; }
  .lang-btn { padding: 8px 10px; font-size: .82rem; }
  .lang-current {
    display: inline-block;
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }
}

/* Hero / Carousel responsive visibility */
@media (max-width: 768px) {
  .hero-desktop { display: none; }
  .hero-mobile { display: block; }
  .slide-caption { bottom: 10%; }
  .carousel-arrow { width: 30px; height: 40px; font-size: 1.5rem; }
}
@media (max-width: 576px) {
  .slide-caption h2 { font-size: 14px; }
  .slide-caption p { font-size: 11px; }
}
