/* ==========================================================
   KALKI ACADEMY — Stylesheet
   Design direction: White-first, minimal, professional, modern,
   mobile-first. No excessive gradients/shadows/animations.
   ========================================================== */

:root {
  --color-orange: #FF9A00;
  --color-blue:   #007FFF;
  --color-green:  #00A550;
  --color-red:    #FF0000;
  --color-black:  #000000;

  --color-white:      #FFFFFF;
  --color-bg-light:   #F7F7F7;
  --color-border:     #E5E5E5;
  --color-text-muted: #666666;

  --radius: 6px;
  --container-width: 1140px;
  --transition: 0.15s ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Noto Sans Tamil", "Helvetica Neue", Arial, sans-serif;
  color: var(--color-black);
  background: var(--color-white);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1em; }
.muted { color: var(--color-text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--color-black);
  color: var(--color-white);
}
.btn-primary:hover { background: #222; text-decoration: none; }

.btn-secondary {
  background: var(--color-white);
  color: var(--color-black);
  border-color: var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-black); text-decoration: none; }

.btn-login {
  background: var(--color-orange);
  color: var(--color-white);
  padding: 10px 18px;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-login:hover { background: #e88a00; text-decoration: none; }

/* ---------- Header / Nav ---------- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-white);
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-black);
}
.brand:hover { text-decoration: none; }
.brand-logo { width: 36px; height: 36px; flex-shrink: 0; }
.brand-text { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.02em; white-space: nowrap; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-black);
  border-radius: 2px;
}

.site-nav {
  position: fixed;
  top: 65px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-white);
  padding: 20px;
  transform: translateY(-110%);
  transition: transform var(--transition);
  overflow-y: auto;
}
.site-nav.open { transform: translateY(0); }
.site-nav ul {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.site-nav li { border-bottom: 1px solid var(--color-border); }
.site-nav a {
  display: block;
  padding: 14px 4px;
  color: var(--color-black);
  font-weight: 500;
}
.site-nav a:hover, .site-nav a.active { color: var(--color-blue); text-decoration: none; }
.site-nav a.active { font-weight: 700; }

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 40px;
  text-align: center;
}
.hero-logo { width: 150px; height: 150px; margin: 0 auto 20px; }
.hero h1 { font-size: 2.1rem; margin-bottom: 0.3em; }
.hero .slogan {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 1.6em;
}
.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* ---------- Sections ---------- */
.section { padding: 44px 0; }
.section-alt { background: var(--color-bg-light); }
.section-head { text-align: center; margin-bottom: 32px; }
.section-head p { max-width: 640px; margin-left: auto; margin-right: auto; }

/* ---------- Cards / Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--color-white);
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--color-black); }
.card-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-weight: 700;
  color: var(--color-white);
}
.card-icon.orange { background: var(--color-orange); }
.card-icon.blue   { background: var(--color-blue); }
.card-icon.green  { background: var(--color-green); }

/* Profile cards (Founder / Council) */
.profile-card { text-align: center; }
.profile-photo {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  overflow: hidden;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Image protection (best-effort, not foolproof) ---------- */
.protected-photo {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.brand-logo,
.hero-logo {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Protected profile photos (founder/council) — wrapper + overlay technique.
   The <img> itself sits underneath; a transparent overlay on top intercepts
   long-press/right-click so the browser's native "save image" / "copy image"
   context menu never targets the actual <img> element. Not foolproof
   (screenshots always work) but stops casual long-press saving on mobile. */
.photo-protect-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}
.photo-protect-wrap img.protected-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none; /* image itself never receives touch/click events */
}
.photo-protect-wrap .photo-protect-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none; /* blocks the long-press gesture from reaching the browser's save menu */
}
.profile-name { font-weight: 700; margin-bottom: 2px; }
.profile-role { color: var(--color-blue); font-size: 0.9rem; margin-bottom: 8px; }
.profile-meta { color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 10px; }

/* ---------- Service cards (services.php) ---------- */
.service-card {
  display: flex;
  flex-direction: column;
}
.service-card-link {
  color: inherit;
  display: block;
}
.service-card-link:hover { text-decoration: none; }
.service-card-desc {
  flex-grow: 1;
  margin-bottom: 16px;
  min-height: 1em;
}
.service-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.service-card-actions .btn {
  padding: 10px 16px;
  font-size: 0.88rem;
}
.btn-watch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Video explanation modal ---------- */
.video-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.video-modal.open { display: flex; }
.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}
.video-modal-dialog {
  position: relative;
  background: var(--color-white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.video-modal-header h3 { margin: 0; font-size: 1.05rem; }
.video-modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--color-text-muted);
}
.video-modal-close:hover { color: var(--color-black); }
.video-modal-body {
  padding: 0;
  overflow-y: auto;
}

/* Responsive 16:9 embed — works at any modal width, including full-width
   mobile, without the video ever overflowing or being cropped. */
.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
}
.video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

@media (max-width: 600px) {
  .video-modal { padding: 0; align-items: flex-end; }
  .video-modal-dialog {
    max-width: 100%;
    width: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .service-card-actions { flex-direction: column; }
  .service-card-actions .btn { width: 100%; text-align: center; }
}

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--color-white);
  margin-bottom: 14px;
}
.badge-orange { background: var(--color-orange); }
.badge-blue   { background: var(--color-blue); }
.badge-green  { background: var(--color-green); }

/* ---------- Coming Soon ---------- */
.coming-soon {
  text-align: center;
  padding: 56px 20px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-light);
}
.coming-soon h2 { margin-bottom: 8px; }
.coming-soon p { color: var(--color-text-muted); max-width: 480px; margin: 0 auto; }

/* ---------- Dashboard action buttons ---------- */
.dashboard-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
}
.dashboard-actions .btn {
  width: 100%;
  text-align: center;
}

@media (min-width: 640px) {
  .dashboard-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: none;
  }
  .dashboard-actions .btn {
    width: auto;
    flex: 0 1 auto;
  }
}

/* ---------- Contact form ---------- */
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-blue);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-black);
  color: #ddd;
  margin-top: 60px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding: 44px 20px;
}
.footer-title { font-weight: 700; font-size: 1.1rem; color: var(--color-white); }
.footer-brand p { color: #aaa; margin: 2px 0; font-size: 0.9rem; }
.footer-links h4, .footer-social h4 {
  color: var(--color-white);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #ccc; font-size: 0.92rem; }
.footer-links a:hover { color: var(--color-white); }

.footer-social-icons {
  display: flex;
  gap: 14px;
}
.footer-social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1c1c1c;
  color: #ccc;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.footer-social-icons a:hover {
  background: var(--color-orange);
  color: var(--color-white);
  text-decoration: none;
}
.footer-bottom {
  border-top: 1px solid #222;
  padding: 16px 20px;
  font-size: 0.82rem;
  color: #888;
  text-align: center;
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }

/* ---------- Community page copy/selection protection ----------
   Best-effort only (like the photo protection above) — determined
   users can still screenshot. This blocks casual copy/paste and
   right-click, which covers the vast majority of casual scraping. */
.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ==========================================================
   Desktop enhancement (mobile is the baseline experience)
   ========================================================== */
/* ---------- Desktop grouped navigation (hidden on mobile) ---------- */
.desktop-nav { display: none; }
.desktop-nav ul {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.desktop-nav > ul > li { position: relative; }
.desktop-nav > ul > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 2px;
  color: var(--color-black);
  font-weight: 500;
  white-space: nowrap;
}
.desktop-nav > ul > li > a:hover,
.desktop-nav > ul > li > a.active {
  color: var(--color-blue);
  text-decoration: none;
}
.desktop-nav .caret {
  font-size: 0.7em;
  transition: transform var(--transition);
}
.desktop-nav .has-dropdown:hover .caret,
.desktop-nav .has-dropdown:focus-within .caret {
  transform: rotate(180deg);
}

.desktop-nav .dropdown {
  display: block; /* override .desktop-nav ul's flex — submenu items stack vertically */
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 8px;
  margin: 6px 0 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 150;
}
.desktop-nav .has-dropdown:hover .dropdown,
.desktop-nav .has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.desktop-nav .dropdown li { border-bottom: none; }
.desktop-nav .dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 0.92rem;
  color: var(--color-black);
  white-space: nowrap;
}
.desktop-nav .dropdown a:hover {
  background: var(--color-bg-light);
  color: var(--color-blue);
  text-decoration: none;
}

@media (min-width: 860px) {
  .nav-toggle { display: none; }

  /* Flat mobile nav is fully replaced by the grouped desktop nav above —
     hide it so both don't render side by side. */
  .site-nav { display: none; }
  .desktop-nav { display: flex; align-items: center; gap: 24px; }

  .hero { padding: 90px 0 64px; }
  .hero h1 { font-size: 2.7rem; }
  .hero-ctas { flex-direction: row; }

  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }

  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
}