/* Marina Kairali Samajam - main stylesheet (Kerala green & gold theme) */
:root {
  --primary: #2e7d32;
  --primary-dark: #143d1f;
  --primary-light: #eaf3ea;
  --gold: #d4a017;
  --cream: #ffffff;
  --text: #1f2b20;
  --muted: #5b6b5c;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --side-pad: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.65;
}

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

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--gold); }

/* Full-width layout: no centered max-width box, just consistent side padding */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--side-pad);
}
.container.narrow { width: 100%; }

/* Header */
.site-header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}
.header-inner {
  width: 100%;
  margin: 0 auto;
  padding: 0.6rem var(--side-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--primary);
  font-size: 1.15rem;
}
.brand img { height: 72px; width: 72px; border-radius: 0; object-fit: contain; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--primary);
}

.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.main-nav > ul > li {
  position: relative;
}
.main-nav a {
  display: block;
  padding: 0.85rem 0.8rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav li.active > a {
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 6px;
}
.has-dropdown .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: 8px;
  min-width: 220px;
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  z-index: 10;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  display: block;
}
.has-dropdown .dropdown a { padding: 0.6rem 1rem; font-weight: 500; }

/* Hero */
.page-hero {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 65%, var(--gold));
  color: var(--white);
  padding: 3.2rem var(--side-pad);
  text-align: center;
}
.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2.3rem;
}
.page-hero p { margin: 0 auto; font-size: 1.05rem; opacity: 0.95; max-width: 700px; }
.page-hero-inner { width: 100%; margin: 0 auto; }

.home-hero {
  background-size: cover;
  background-position: center;
  padding: 5.5rem var(--side-pad);
}
.home-hero h1 { font-size: 2.8rem; text-shadow: 0 2px 10px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.6); }
.home-hero p { font-size: 1.2rem; text-shadow: 0 2px 8px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.6); }

/* News scroller */
.news-ticker {
  background: var(--primary-dark);
  color: var(--white);
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}
.news-ticker-label {
  flex: 0 0 auto;
  background: var(--gold);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.55rem 1rem;
  white-space: nowrap;
}
.news-ticker-viewport {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
}
.news-ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding-left: 100%;
  animation: news-scroll 38s linear infinite;
}
.news-ticker:hover .news-ticker-track { animation-play-state: paused; }
.news-ticker-track span {
  margin-right: 3rem;
  font-size: 0.92rem;
}
@keyframes news-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Sections */
.section { padding: 3rem 0; width: 100%; }
.section.alt { background: #fff; }
.section h2 { color: var(--primary); margin-top: 0; }
.section h2.center, h2.center { text-align: center; }
.section h3 { color: var(--primary); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.center { text-align: center; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--gold);
}
.card h3 { margin-top: 0; }

.btn {
  display: inline-block;
  background: var(--primary);
  color: var(--white) !important;
  padding: 0.7rem 1.5rem;
  border-radius: 30px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { background: var(--gold); color: var(--text) !important; }
.btn-outline {
  background: transparent;
  color: var(--primary) !important;
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white) !important; }

.img-stack img { border-radius: var(--radius); box-shadow: var(--shadow); }
.img-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.img-row img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.gallery-grid.small { grid-template-columns: repeat(4, 1fr); }
.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.gallery-item:hover img { transform: scale(1.03); }
.gallery-item { cursor: pointer; }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 12, 0.94);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-img {
  max-width: 88vw;
  max-height: 76vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border: none;
  cursor: pointer;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: var(--gold); color: var(--text); }
.lightbox-close { top: 18px; right: 18px; }
.lightbox-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-counter {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(255,255,255,0.12);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
}
.lightbox-actions {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.6rem;
}
.lightbox-actions a,
.lightbox-actions button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
}
.lightbox-actions a:hover,
.lightbox-actions button:hover { background: var(--gold); color: var(--text); }
.lightbox-actions svg { width: 16px; height: 16px; fill: currentColor; }
@media (max-width: 600px) {
  .lightbox-prev, .lightbox-next, .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
  .lightbox-close { top: 8px; right: 8px; }
  .lightbox-actions { flex-wrap: wrap; justify-content: center; bottom: 10px; }
  .lightbox-counter { bottom: 64px; }
}

/* Social icons */
.social-icons {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #e7efe8;
  transition: background 0.2s ease, color 0.2s ease;
}
.social-icons a:hover { background: var(--gold); color: var(--text); }
.social-icons svg { width: 18px; height: 18px; fill: currentColor; }

/* Lists */
.check-list { list-style: none; padding: 0; }
.check-list li {
  padding-left: 1.6rem;
  position: relative;
  margin-bottom: 0.6rem;
}
.check-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

.contact-list { list-style: none; padding: 0; }
.contact-list li { margin-bottom: 0.6rem; }

/* Committee */
.committee-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Members directory */
.member-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.member-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
}
.member-card h4 { margin: 0 0 0.5rem; color: var(--primary); }
.member-card ul { margin: 0; padding-left: 1.1rem; }
.member-card li { font-size: 0.92rem; }

/* Member-only gate */
.member-gate { padding: 3.5rem 0; }
.gate-card {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}
.gate-icon { font-size: 2.6rem; margin-bottom: 0.5rem; }

/* Birthdays / Anniversaries */
.month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}
.month-block h3 { margin-bottom: 0.5rem; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th, .data-table td {
  padding: 0.5rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}
.data-table th { background: var(--primary); color: var(--white); }

/* Forms */
.site-form {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 640px;
}
.form-row { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.form-row label { font-weight: 600; font-size: 0.9rem; }
.form-row input, .form-row textarea {
  padding: 0.6rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.checkbox-row { flex-direction: row; align-items: center; }
.checkbox-row label { display: flex; align-items: center; gap: 0.4rem; font-weight: 500; }
.center-box { text-align: center; }
.muted { color: var(--muted); font-size: 0.85rem; }

/* Password field with show/hide toggle */
.password-field { position: relative; }
.password-field input { padding-right: 2.6rem; }
.password-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: inherit;
}
.password-toggle:hover { color: var(--primary); }

/* Login page - split panel */
.login-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--white);
}
.login-visual {
  background: linear-gradient(160deg, var(--primary-dark), var(--primary) 70%, var(--gold));
  color: var(--white);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.login-visual h2 { font-size: 1.8rem; margin-top: 0; }
.login-visual p { opacity: 0.95; }
.login-visual .login-quote {
  margin-top: 2rem;
  font-style: italic;
  border-left: 3px solid var(--gold);
  padding-left: 1rem;
  opacity: 0.9;
}
.login-form-side {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-form-side h2 { margin-top: 0; color: var(--primary); }
.login-form-side .site-form { box-shadow: none; padding: 0; max-width: none; }
.login-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  margin: -0.4rem 0 1rem;
}
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; min-height: auto; }
  .login-visual { padding: 2rem; }
  .login-form-side { padding: 2rem; }
}

/* Modal (forgot password) */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 12, 0.6);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.open { display: flex; }
.modal-content {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.modal-content h3 { margin-top: 0; color: var(--primary); }
.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted);
}
.modal-close:hover { color: var(--primary); }
.modal-success-msg {
  display: none;
  margin-top: 1rem;
  padding: 0.8rem;
  background: var(--primary-light);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--primary-dark);
}

/* Footer */
.site-footer {
  background: var(--primary-dark);
  color: #e7efe8;
  margin-top: 2rem;
  width: 100%;
}
.footer-inner {
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem var(--side-pad) 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}
.footer-col h3 { color: var(--gold); margin-top: 0; font-size: 1.05rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: #e7efe8; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  text-align: center;
  padding: 1rem var(--side-pad);
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.85rem;
  color: #b9c9ba;
}

/* ============ Responsive breakpoints ============ */
/* Large desktop: default styles above (multi-column grids) */

/* iPad / tablet landscape and small laptops */
@media (max-width: 1100px) {
  .three-col { grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
  .gallery-grid, .gallery-grid.small { grid-template-columns: repeat(3, 1fr); }
  .member-grid { grid-template-columns: repeat(2, 1fr); }
}

/* iPad / tablet portrait */
@media (max-width: 1024px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .has-dropdown .dropdown {
    position: static;
    box-shadow: none;
    padding-left: 1rem;
  }

  .two-col { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .three-col, .committee-grid, .month-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid, .gallery-grid.small, .img-row { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .home-hero { padding: 4rem var(--side-pad); }
  .home-hero h1 { font-size: 2.2rem; }
}

/* Tablets in portrait / phablets */
@media (max-width: 768px) {
  .two-col, .three-col, .committee-grid, .member-grid, .month-grid {
    grid-template-columns: 1fr;
  }
  .gallery-grid, .gallery-grid.small, .img-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-col .social-icons { justify-content: center; }
  .page-hero { padding: 2.4rem var(--side-pad); }
  .page-hero h1 { font-size: 1.9rem; }
  .home-hero { padding: 3.2rem var(--side-pad); }
  .home-hero h1 { font-size: 1.9rem; }
  .home-hero p { font-size: 1.05rem; }
  .news-ticker-label { font-size: 0.72rem; padding: 0.45rem 0.7rem; }
}

/* Mobile phones */
@media (max-width: 480px) {
  .gallery-grid, .gallery-grid.small, .img-row {
    grid-template-columns: 1fr;
  }
  .brand span { font-size: 0.95rem; }
  .brand img { height: 54px; width: 54px; }
  .page-hero h1 { font-size: 1.5rem; }
  .home-hero h1 { font-size: 1.5rem; }
  .home-hero { padding: 2.4rem var(--side-pad); }
  .section { padding: 2rem 0; }
  .card, .site-form { padding: 1.1rem; }
  .lightbox-prev, .lightbox-next, .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
  .lightbox-close { top: 8px; right: 8px; }
}
