/* ==========================================================================
   Aramgah Memorial Garden Foundation — Design Tokens & Base Styles
   Single source of truth for the site's look. See /style-guide.html.
   Type scale is deliberately large: most visitors are elderly, and the
   header offers A− / A+ controls that scale everything further.

   CONTENTS
   1. :root design tokens (colors, type scale, spacing)
   2. Reset & base element styles (body, headings, links, lists)
   3. Layout helpers (.wrap, .section, .grid)
   4. Signature garden-path divider
   5. Buttons (.btn-primary / -brass / -outline)
   6. Cards, tables, forms, notices
   7. Header (two rows: brand+utilities, then nav) & mobile menu
   8. Footer
   9. RTL / Persian-mode overrides (html[dir="rtl"])
   10. Utilities, focus states, reduced-motion
   ========================================================================== */

:root {
  /* ---- Color ---- */
  --color-cypress:        #2F4A3E;
  --color-cypress-dark:   #223529;
  --color-ink:            #23291F;
  --color-parchment:      #F1EFE6;
  --color-parchment-alt:  #E9E5D6;
  --color-sage:           #E3E7DA;
  --color-sage-line:      #C9D0BC;
  --color-brass:          #B8873B;
  --color-brass-dark:     #96692A;
  --color-clay:           #8C4A2F;
  --color-white:          #FFFFFF;

  /* ---- Type ---- */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", Tahoma, sans-serif;
  --font-fa: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;

  /* Larger-than-usual scale for an older audience */
  --step--1: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  --step-0:  clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem);
  --step-1:  clamp(1.35rem, 1.25rem + 0.5vw, 1.6rem);
  --step-2:  clamp(1.7rem, 1.5rem + 0.9vw, 2.15rem);
  --step-3:  clamp(2.1rem, 1.8rem + 1.5vw, 2.9rem);
  --step-4:  clamp(2.6rem, 2.1rem + 2.4vw, 3.7rem);

  /* ---- Layout ---- */
  --content-max: 1160px;
  --content-narrow: 800px;
  --radius: 6px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;

  --shadow-card: 0 1px 2px rgba(35, 41, 31, 0.06), 0 4px 16px rgba(35, 41, 31, 0.06);
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--color-ink);
  background: var(--color-parchment);
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-cypress-dark);
  line-height: 1.18;
  margin: 0 0 0.5em;
  font-weight: 600;
}
h1 { font-size: var(--step-4); font-weight: 500; }
h2 { font-size: var(--step-3); font-weight: 500; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 700; }

p { margin: 0 0 1em; }
p.lede { font-size: var(--step-1); color: var(--color-cypress-dark); }

a { color: var(--color-cypress); text-decoration-color: var(--color-brass); text-underline-offset: 3px; }
a:hover { color: var(--color-brass-dark); }

ul, ol { padding-left: 1.25em; }
li { margin-bottom: 0.45em; }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brass-dark);
  display: block;
  margin-bottom: 0.5em;
}

/* ---- Layout helpers ---- */
.wrap { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-3); }
.wrap-narrow { max-width: var(--content-narrow); margin: 0 auto; padding: 0 var(--space-3); }
.section { padding: var(--space-5) 0; }
.section-tight { padding: var(--space-4) 0; }
.section-sage { background: var(--color-sage); }
.section-cypress { background: var(--color-cypress); color: var(--color-parchment); }
.section-cypress h2, .section-cypress h3 { color: var(--color-white); }

.grid { display: grid; gap: var(--space-3); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---- Signature: garden-path divider ---- */
.path-divider { display: block; width: 100%; height: 28px; margin: 0 auto; color: var(--color-brass); opacity: 0.9; }
.path-divider.on-dark { color: var(--color-parchment); opacity: 0.55; }

/* ---- Buttons (large touch targets) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: inherit;
  font-weight: 700;
  font-size: var(--step-0);
  letter-spacing: 0.01em;
  padding: 0.8em 1.5em;
  min-height: 48px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--color-cypress); color: var(--color-white); }
.btn-primary:hover { background: var(--color-cypress-dark); color: var(--color-white); }
.btn-brass { background: var(--color-brass); color: var(--color-ink); }
.btn-brass:hover { background: var(--color-brass-dark); color: var(--color-white); }
.btn-outline { background: transparent; color: var(--color-cypress); border-color: var(--color-cypress); }
.btn-outline:hover { background: var(--color-cypress); color: var(--color-white); }
.btn-outline.on-dark { color: var(--color-parchment); border-color: var(--color-parchment); }
.btn-outline.on-dark:hover { background: var(--color-parchment); color: var(--color-cypress-dark); }

/* ---- Cards / tables / forms / notices ---- */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-sage-line);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
}
.card h3, .card h4 { margin-top: 0; }
.card-sage { background: var(--color-sage); }

table { width: 100%; border-collapse: collapse; background: var(--color-white); font-size: var(--step-0); }
caption { text-align: inherit; font-family: var(--font-display); font-size: var(--step-1); margin-bottom: 0.5em; color: var(--color-cypress-dark); }
th, td { text-align: inherit; padding: 0.75em 1em; border-bottom: 1px solid var(--color-sage-line); }
thead th { background: var(--color-sage); color: var(--color-cypress-dark); font-family: var(--font-body); }

label { display: block; font-weight: 700; margin-bottom: 0.35em; font-size: var(--step-0); }
input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: var(--step-0);
  padding: 0.75em 0.9em;
  min-height: 48px;
  border: 2px solid var(--color-sage-line);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-ink);
}
textarea { min-height: 0; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--color-brass);
  outline-offset: 1px;
  border-color: var(--color-brass);
}
.field { margin-bottom: var(--space-2); }
.required::after { content: " *"; color: var(--color-clay); }
.form-note { font-size: var(--step--1); color: var(--color-cypress-dark); }

.notice {
  border-left: 5px solid var(--color-clay);
  background: var(--color-white);
  padding: var(--space-2) var(--space-3);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ==========================================================================
   HEADER — two rows for a bigger, calmer layout:
   Row 1: brand · font-size controls · language toggle · Apply
   Row 2: primary navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-parchment);
  border-bottom: 1px solid var(--color-sage-line);
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0.9rem 0;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.7em; text-decoration: none; color: var(--color-cypress-dark); }
.brand-mark {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;          /* crops the square calligraphy file to a circle */
  object-fit: cover;
  border: 1px solid var(--color-sage-line);
  background: var(--color-white);
}
.brand-name { font-family: var(--font-display); font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.8rem); font-weight: 600; line-height: 1.1; }
.brand-name small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-brass-dark);
  margin-top: 0.2em;
}

.header-utils { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* Font size controls */
.font-controls {
  display: flex;
  align-items: center;
  border: 2px solid var(--color-sage-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-white);
}
.font-controls button {
  font-family: var(--font-body);
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  min-width: 48px;
  min-height: 46px;
  color: var(--color-cypress-dark);
  font-size: 1.05rem;
}
.font-controls button + button { border-left: 1px solid var(--color-sage-line); }
.font-controls button:hover { background: var(--color-sage); }
.font-controls .fc-plus { font-size: 1.3rem; }

.lang-toggle {
  font-family: var(--font-fa), var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--color-white);
  border: 2px solid var(--color-cypress);
  color: var(--color-cypress);
  border-radius: var(--radius);
  min-height: 48px;
  padding: 0 1.1em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.lang-toggle:hover { background: var(--color-cypress); color: var(--color-white); }

.header-nav-row { border-top: 1px solid var(--color-sage-line); }
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--color-sage-line);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0.6em 0.9em;
  font-family: inherit;
  font-size: var(--step-0);
  font-weight: 700;
  color: var(--color-cypress-dark);
  min-height: 48px;
}
.site-nav ul {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  margin: 0;
  padding: 0.35rem 0;
  align-items: center;
  flex-wrap: wrap;
}
.site-nav a {
  display: inline-block;
  font-weight: 600;
  font-size: var(--step-0);
  color: var(--color-ink);
  text-decoration: none;
  padding: 0.55em 0.8em;
  border-radius: var(--radius);
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--color-cypress); background: var(--color-sage); }
.site-nav a.active { color: var(--color-cypress); border-bottom-color: var(--color-brass); }

@media (max-width: 1020px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 0.5em; }
  .header-nav-row .wrap { padding-bottom: 0; }
  .site-nav { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
  .site-nav.open { max-height: 700px; }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: 0.5rem 0 1rem; }
  .site-nav a { display: block; padding: 0.7em 0.8em; }
  .nav-toggle-row { padding: 0.5rem 0; }
}

/* ---- Footer ---- */
.site-footer { background: var(--color-cypress-dark); color: var(--color-parchment); padding: var(--space-5) 0 var(--space-3); }
.site-footer a { color: var(--color-parchment); text-decoration-color: var(--color-brass); }
.site-footer a:hover { color: var(--color-brass); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: var(--space-4); margin-bottom: var(--space-4); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: var(--color-parchment); font-family: var(--font-body); font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-bottom {
  border-top: 1px solid rgba(241, 239, 230, 0.15);
  padding-top: var(--space-2);
  font-size: var(--step--1);
  opacity: 0.8;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5em;
}

/* ==========================================================================
   RTL / Persian mode — applied when the language toggle sets dir="rtl"
   ========================================================================== */
html[dir="rtl"] body { font-family: var(--font-fa); }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4,
html[dir="rtl"] .brand-name, html[dir="rtl"] caption { font-family: var(--font-fa); font-weight: 700; }
html[dir="rtl"] ul, html[dir="rtl"] ol { padding-right: 1.25em; padding-left: 0; }
html[dir="rtl"] .notice { border-left: none; border-right: 5px solid var(--color-clay); border-radius: var(--radius) 0 0 var(--radius); }
html[dir="rtl"] .font-controls button + button { border-left: none; border-right: 1px solid var(--color-sage-line); }
html[dir="rtl"] .eyebrow { letter-spacing: 0; text-transform: none; }
.ltr-inline { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--color-brass); outline-offset: 2px; }

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