/* Aatma Prakash Foundation: design tokens, base, shared UI (header, footer, dialogs, chat).
   Section styles live in /css/sections.css; page-only styles in /css/pages/<slug>.css.
   Mobile first: base styles target 375px; breakpoints at 700px and 1000px. */

:root {
  /* Brand palette, taken from the logo: blue + warm orange on cream. */
  --cream: #fbf7ef;
  --paper: #fffdf9;
  --warm: #f6eedf;
  --tint: #e9f1f9; /* pale blue band (bg: "tint") */
  --brand: #0e3d73; /* dark navy: primary buttons, links, headings (10.6:1 on cream) */
  --brand-dark: #0a2e58; /* hover / pressed */
  --brand-soft: #1f5fa8; /* eyebrows, small icons, focus ring (6:1 on cream) */
  --sky: #0090d0; /* the logo's bright blue: decoration only, never text */
  --ink: #16253a;
  --muted: #536070;
  --line: #e6dfd0;
  --orange: #f0911f; /* the logo's orange: decoration only, never text */
  --orange-ink: #a94a0c; /* orange that is readable as text */
  --focus: var(--brand-soft);


  --serif: Fraunces, Georgia, "Times New Roman", serif;
  --sans: "DM Sans", "Segoe UI", Arial, sans-serif;
  --script: Caveat, "Segoe Script", cursive;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(14, 61, 115, 0.05), 0 8px 24px rgba(14, 61, 115, 0.07);
  --gutter: 20px;
  --wrap: 1180px;
  --header-h: 68px;

  /* default tone (blue) */
  --tone-bg: #e1edf9;
  --tone-fg: #1f6fb8;
  --tone-ink: #14508c;
}

.tone-blue { --tone-bg: #e1edf9; --tone-fg: #1f6fb8; --tone-ink: #14508c; }
.tone-green { --tone-bg: #e6efdf; --tone-fg: #3f7a4f; --tone-ink: #2c6340; }
.tone-orange { --tone-bg: #fde8d6; --tone-fg: #e0762b; --tone-ink: #a94a0c; }
.tone-purple { --tone-bg: #ece4f6; --tone-fg: #7a57b5; --tone-ink: #63429c; }
.tone-yellow { --tone-bg: #fcf0c9; --tone-fg: #c48f10; --tone-ink: #7d5800; }
.tone-pink { --tone-bg: #fbe1e4; --tone-fg: #d8566b; --tone-ink: #ac3049; }
.tone-teal { --tone-bg: #dbeeee; --tone-fg: #2c8a8a; --tone-ink: #1c6a6a; }

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  overflow-x: clip;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
blockquote,
address {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

address {
  font-style: normal;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video,
svg {
  max-width: 100%;
}

img,
video {
  display: block;
  height: auto;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

/* ---- shared atoms ---- */

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.icon-circle {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  flex: none;
  border-radius: 50%;
  background: var(--tone-bg);
  color: var(--tone-fg);
}

.icon-circle .icon {
  width: 28px;
  height: 28px;
}

.icon-circle.is-small {
  width: 32px;
  height: 32px;
}

.icon-circle.is-small .icon {
  width: 17px;
  height: 17px;
}

.icon-circle.is-solid {
  background: var(--tone-fg);
  color: #fff;
}

.icon-circle.is-ring {
  background: var(--paper);
  border: 1.5px solid var(--tone-fg);
  box-shadow: 0 0 0 6px var(--tone-bg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 22px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn .icon {
  width: 1.15em;
  height: 1.15em;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-outline {
  background: var(--paper);
  border-color: var(--brand);
  color: var(--brand);
}

.btn-outline:hover {
  background: var(--tint);
}

.btn-soft {
  background: var(--tone-bg);
  border-color: transparent;
  border-radius: 12px;
  color: var(--ink);
}

.btn-soft .icon {
  color: var(--tone-ink);
}

.btn-soft:hover {
  border-color: var(--tone-fg);
}

.btn-large {
  min-height: 56px;
  padding: 14px 30px;
  font-size: 1.02rem;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.text-link .icon {
  width: 1.1em;
  height: 1.1em;
  transition: transform 0.15s;
}

.text-link:hover .icon {
  transform: translateX(3px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.checks {
  display: grid;
  gap: 8px;
}

.checks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
}

.checks .icon {
  margin-top: 0.15em;
  color: var(--brand-soft);
}

.field {
  display: block;
  margin-bottom: 14px;
  font-size: 0.85rem;
  font-weight: 600;
}

.field > span {
  display: block;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cfc8b8;
  border-radius: var(--radius-sm);
  background: #fff;
  font-weight: 400;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-status {
  min-height: 1.4em;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--brand);
}

/* A missing image keeps its box: the tinted parent shows through. */
img.is-missing {
  visibility: hidden;
}

/* ---- header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 247, 239, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand-mark {
  width: auto;
  height: 46px;
  flex: none;
}

.brand-text {
  display: grid;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.15;
  text-transform: uppercase;
}

.brand-text small {
  margin-top: 2px;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--muted);
}

#site-nav {
  display: none;
}

#site-nav a {
  position: relative;
  padding: 8px 2px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
}

#site-nav a:hover,
#site-nav a[aria-current="page"] {
  color: var(--brand);
}

#site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

.nav-cta {
  display: none;
}

.menu {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--brand);
}

.menu .icon {
  width: 24px;
  height: 24px;
}

.nav-open {
  border-bottom-color: var(--line);
}

.nav-open #site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  padding: 12px var(--gutter) 20px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 24px rgba(14, 61, 115, 0.08);
}

.nav-open #site-nav a {
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}

.nav-open #site-nav a[aria-current="page"]::after {
  display: none;
}

.nav-cta-mobile {
  margin-top: 12px;
}

@media (min-width: 1000px) {
  :root {
    --gutter: 32px;
    --header-h: 80px;
  }

  #site-nav,
  .nav-open #site-nav {
    position: static;
    display: flex;
    gap: 34px;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: none;
  }

  .nav-open #site-nav a {
    padding: 8px 2px;
    border: 0;
    font-size: 0.92rem;
  }

  .nav-open #site-nav a[aria-current="page"]::after {
    display: block;
  }

  .nav-cta {
    display: inline-flex;
  }

  .menu,
  .nav-cta-mobile {
    display: none;
  }
}

/* ---- footer ---- */

.site-footer {
  background: var(--warm);
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 24px;
  padding-block: 48px 40px;
}

.footer-brand,
.footer-col.newsletter {
  grid-column: 1 / -1;
}

/* Connect (email, phone, address) takes the full row on phones so the email address is not broken mid-word. */
@media (max-width: 699px) {
  .footer-col:nth-child(4) {
    grid-column: 1 / -1;
  }
}

.footer-brand p {
  max-width: 260px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-col h2 {
  margin-bottom: 12px;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-col ul {
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
}

.footer-col a,
.footer-link {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.footer-col a:hover,
.footer-link:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-link {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}

.footer-col address {
  color: var(--muted);
  max-width: 230px;
}

.socials {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.social {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #d9d0bd;
  background: var(--paper);
  color: var(--brand);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.footer-col a.social:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.newsletter p {
  font-size: 0.88rem;
  color: var(--muted);
}

#newsletter {
  display: flex;
  max-width: 340px;
  margin-top: 12px;
  padding: 4px;
  border: 1px solid #d9d0bd;
  border-radius: 999px;
  background: var(--paper);
}

#newsletter:focus-within {
  border-color: var(--brand);
}

#newsletter input {
  flex: 1;
  min-width: 0;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  font-size: 0.9rem;
}

#newsletter input:focus-visible {
  outline: none;
}

/* The field has no outline of its own, so the pill around it carries the focus ring. */
#newsletter:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

#newsletter button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
}

.footer-bar {
  background: var(--brand);
  color: #dde8f4;
  font-size: 0.8rem;
}

.footer-bar .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  /* extra bottom room on small screens so the chat button never covers the legal links */
  padding-block: 16px 76px;
}

.footer-bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.footer-bar a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-bar :focus-visible {
  outline-color: #fff;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-col.newsletter {
    grid-column: span 2;
  }

  .footer-bar .wrap {
    padding-block: 16px;
    padding-right: 220px;
  }
}

@media (min-width: 1000px) {
  .footer-grid {
    grid-template-columns: 1.3fr 0.8fr 0.9fr 1.3fr 1.3fr;
    gap: 40px;
    padding-block: 64px 48px;
  }

  .footer-brand,
  .footer-col.newsletter {
    grid-column: auto;
  }
}

/* ---- dialogs (contact modal + campaign popup) ---- */

dialog {
  width: calc(100% - 32px);
  max-width: 520px;
  max-height: calc(100dvh - 32px);
  padding: 36px 24px 28px;
  border: 0;
  border-radius: 20px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(10, 30, 58, 0.3);
  overflow: auto;
}

dialog::backdrop {
  background: rgba(10, 30, 58, 0.6);
}

dialog h2 {
  margin-bottom: 18px;
  font: 600 clamp(1.6rem, 5vw, 2.1rem) / 1.12 var(--serif);
  letter-spacing: -0.01em;
  color: var(--brand);
}

.dialog-note {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.dialog-note a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
}

.dialog-close:hover {
  background: var(--tint);
}

#campaign-popup {
  max-width: 460px;
  background: var(--cream) radial-gradient(circle at 100% 0, #fde8d6 0, transparent 55%);
}

#campaign-popup h2 {
  margin-bottom: 12px;
}

#campaign-popup p:not(.eyebrow) {
  margin-bottom: 22px;
  color: var(--muted);
}

#campaign-popup .eyebrow {
  padding-right: 36px;
  color: var(--orange-ink);
}

.popup-image {
  width: 100%;
  margin-bottom: 18px;
  border-radius: 12px;
}

@media (min-width: 700px) {
  dialog {
    padding: 44px 40px 36px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  #campaign-popup[open] {
    animation: popup-in 0.25s ease-out;
  }
}

@keyframes popup-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ---- WhatsApp chat button ---- */

.chat-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #1f7a4c;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(10, 30, 58, 0.28);
}

.chat-fab:hover {
  background: #186440;
}

.chat-fab .icon {
  width: 24px;
  height: 24px;
}

@media (max-width: 699px) {
  /* icon-only on phones; the accessible name stays on the link */
  .chat-fab {
    width: 52px;
    padding: 0;
    justify-content: center;
  }

  .chat-fab span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
