/* =========================================================
   IPGS — International Plant Grafting Society
   Main stylesheet · v1.0 · 2026
   Palette, typography, layout, components, utilities.
   ========================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  --ipgs-green:      #14532D;
  --ipgs-green-700:  #1B6B3A;
  --ipgs-green-400:  #4A7C59;
  --ipgs-green-100:  #E7EFE9;
  --ipgs-gold:       #B8860B;
  --ipgs-gold-400:   #D4A737;
  --ipgs-gold-100:   #F6EFD9;
  --ipgs-earth:      #8B5A2B;
  --ipgs-stone:      #3F3F46;
  --ipgs-stone-500:  #6B6B73;
  --ipgs-stone-200:  #D4D4D8;
  --ipgs-stone-100:  #E7E7EA;
  --ipgs-paper:      #FAFAF5;
  --ipgs-white:      #FFFFFF;
  --ipgs-danger:     #B54040;

  --font-sans: 'Inter', 'Noto Sans', 'Segoe UI', 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  --font-serif: 'Noto Serif', Georgia, 'Times New Roman', serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(20,83,45,.06), 0 1px 3px rgba(20,83,45,.05);
  --shadow-md: 0 2px 6px rgba(20,83,45,.08), 0 4px 12px rgba(20,83,45,.06);
  --shadow-lg: 0 8px 24px rgba(20,83,45,.12);

  --transition: 200ms ease;

  --max-w:     1200px;
  --max-w-prose: 72ch;
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ipgs-stone);
  background: var(--ipgs-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--ipgs-green); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus-visible { color: var(--ipgs-gold); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--ipgs-gold); outline-offset: 2px; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--ipgs-green);
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(1.9rem, 2.5vw + 1rem, 2.8rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.5vw + 1rem, 2.1rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1.1em; }
p, li { max-width: var(--max-w-prose); }
.lead { font-size: 1.15rem; color: var(--ipgs-stone-500); }
small { font-size: 0.85rem; }
hr { border: 0; height: 1px; background: var(--ipgs-stone-200); margin: 2rem 0; }
ul, ol { padding-left: 1.2rem; }
li + li { margin-top: .35em; }
blockquote {
  border-left: 4px solid var(--ipgs-gold);
  margin: 1.5em 0; padding: .5em 1.2em;
  font-style: italic; color: var(--ipgs-stone-500);
}
code, pre {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.92em;
  background: var(--ipgs-stone-100);
  border-radius: var(--radius-sm);
}
code { padding: 0.1em 0.4em; }
pre { padding: 1rem; overflow-x: auto; }

/* ---------- 3. Layout utilities ---------- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 4rem 0; }
.section-tight { padding: 2.5rem 0; }
.section-green { background: var(--ipgs-green); color: var(--ipgs-white); }
.section-green h1, .section-green h2, .section-green h3 { color: var(--ipgs-white); }
.section-green a { color: var(--ipgs-gold-400); }
.section-paper { background: var(--ipgs-paper); }
.section-cream { background: var(--ipgs-gold-100); }
.section-light { background: var(--ipgs-green-100); }
.bg-stripe {
  background:
    linear-gradient(var(--ipgs-paper), var(--ipgs-paper)) padding-box,
    linear-gradient(90deg, var(--ipgs-green) 0 50%, var(--ipgs-gold) 50% 100%) border-box;
  border-top: 4px solid transparent;
}
.text-center { text-align: center; }
.muted { color: var(--ipgs-stone-500); }
.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ipgs-gold);
  font-weight: 600;
  margin-bottom: .75rem;
}
.divider-gold {
  width: 60px; height: 4px; background: var(--ipgs-gold);
  border-radius: 2px; margin: 1rem 0 1.5rem;
}
.section-green .eyebrow { color: var(--ipgs-gold-400); }

/* ---------- 4. Header / nav ---------- */
.utility-bar {
  background: var(--ipgs-green);
  color: var(--ipgs-white);
  font-size: 0.85rem;
}
.utility-bar .container {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 1.5rem; padding-top: .4rem; padding-bottom: .4rem;
}
.utility-bar a { color: rgba(255,255,255,0.85); }
.utility-bar a:hover { color: var(--ipgs-gold-400); }

.site-header {
  background: var(--ipgs-white);
  border-bottom: 1px solid var(--ipgs-stone-100);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 0.9rem; padding-bottom: 0.9rem;
  gap: 2rem;
}
.brand {
  display: flex; align-items: center; gap: .8rem;
  color: var(--ipgs-green); font-weight: 700; text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; color: var(--ipgs-green); }
.brand-mark { width: 44px; height: 44px; flex-shrink: 0; }
.brand-text { line-height: 1.1; }
.brand-text .short { font-size: 1.3rem; letter-spacing: 0.02em; }
.brand-text .long { display: block; font-size: .72rem; font-weight: 500; color: var(--ipgs-stone-500); letter-spacing: 0.05em; text-transform: uppercase; }

.main-nav ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; gap: 1.7rem; align-items: center;
}
.main-nav a {
  color: var(--ipgs-stone);
  font-weight: 500;
  font-size: 0.97rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--ipgs-green);
  border-bottom-color: var(--ipgs-gold);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none; border: 0; padding: 0.4rem;
  color: var(--ipgs-green);
}
.nav-toggle svg { width: 28px; height: 28px; }

@media (max-width: 960px) {
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--ipgs-white); box-shadow: var(--shadow-md); border-top: 1px solid var(--ipgs-stone-100); }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 0.5rem 0; }
  .main-nav li { width: 100%; }
  .main-nav a { display: block; padding: 0.9rem 1.5rem; border-bottom: 1px solid var(--ipgs-stone-100); border-left: 4px solid transparent; }
  .main-nav a:hover, .main-nav a[aria-current="page"] { border-left-color: var(--ipgs-gold); border-bottom-color: var(--ipgs-stone-100); background: var(--ipgs-paper); }
  .nav-toggle { display: inline-flex; }
}

/* ---------- 5. Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--ipgs-green) 0%, #0F3E22 100%);
  color: var(--ipgs-white);
  padding: 5rem 0 5.5rem;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; top: 0; right: 0; bottom: 0; width: 35%;
  background: radial-gradient(circle at 80% 40%, rgba(184,134,11,0.25), transparent 60%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: var(--ipgs-white); margin-bottom: 1rem; max-width: 20ch; }
.hero .lead { color: rgba(255,255,255,0.88); font-size: 1.25rem; max-width: 58ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

.announcement-banner {
  background: var(--ipgs-gold);
  color: #2B1D03;
  padding: 0.9rem 0;
  font-size: 0.95rem;
}
.announcement-banner .container {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: center;
  text-align: center;
}
.announcement-banner strong { color: #1a1100; }
.announcement-banner a { color: #1a1100; text-decoration: underline; font-weight: 600; }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.97rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
}
.btn-primary { background: var(--ipgs-gold); color: #1a1100; border-color: var(--ipgs-gold); }
.btn-primary:hover { background: var(--ipgs-gold-400); color: #1a1100; text-decoration: none; }
.btn-secondary { background: var(--ipgs-white); color: var(--ipgs-green); border-color: var(--ipgs-white); }
.btn-secondary:hover { background: var(--ipgs-green-100); color: var(--ipgs-green); text-decoration: none; }
.btn-outline { background: transparent; color: var(--ipgs-white); border-color: var(--ipgs-white); }
.btn-outline:hover { background: var(--ipgs-white); color: var(--ipgs-green); text-decoration: none; }
.btn-outline-green { background: transparent; color: var(--ipgs-green); border-color: var(--ipgs-green); }
.btn-outline-green:hover { background: var(--ipgs-green); color: var(--ipgs-white); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ipgs-green); }
.btn-ghost:hover { background: var(--ipgs-green-100); text-decoration: none; }
.btn-sm { padding: 0.55rem 1rem; font-size: 0.88rem; }

/* ---------- 7. Grids & cards ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--ipgs-white);
  border: 1px solid var(--ipgs-stone-100);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--ipgs-green-100); }
.card h3 { margin-top: 0; margin-bottom: .6rem; }
.card p { margin-bottom: .8rem; }
.card .card-footer { margin-top: auto; padding-top: .6rem; }

.card-accent-top { border-top: 4px solid var(--ipgs-gold); }
.card-accent-left { border-left: 4px solid var(--ipgs-gold); }

.card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--ipgs-green-100);
  color: var(--ipgs-green);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.card-icon svg { width: 26px; height: 26px; }

/* Metric block */
.metric {
  background: var(--ipgs-white);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
  border-top: 4px solid var(--ipgs-gold);
  box-shadow: var(--shadow-sm);
}
.metric .value {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--ipgs-green);
  line-height: 1;
  letter-spacing: -0.02em;
}
.metric .label {
  display: block;
  font-size: 0.9rem;
  color: var(--ipgs-stone-500);
  margin-top: 0.5rem;
}
.section-green .metric { background: rgba(255,255,255,0.05); border-top-color: var(--ipgs-gold-400); }
.section-green .metric .value { color: var(--ipgs-gold-400); }
.section-green .metric .label { color: rgba(255,255,255,0.82); }

/* WG tag */
.wg-tag {
  display: inline-block;
  background: var(--ipgs-gold);
  color: #1a1100;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.wg-card { position: relative; }
.wg-card .wg-tag { position: absolute; top: -10px; left: 1.25rem; }

/* People / institutions */
.profile {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--ipgs-white);
  border: 1px solid var(--ipgs-stone-100);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--ipgs-green-100);
  color: var(--ipgs-green);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.2rem;
  flex-shrink: 0;
}
.profile-name { font-weight: 700; color: var(--ipgs-green); margin-bottom: 0.15rem; }
.profile-affil { font-size: 0.9rem; color: var(--ipgs-stone-500); margin: 0; }
.profile-country { font-size: 0.8rem; color: var(--ipgs-stone-500); display: block; margin-top: .25rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse; background: var(--ipgs-white);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md); overflow: hidden;
  font-size: 0.95rem;
}
.table th, .table td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--ipgs-stone-100); vertical-align: top; }
.table th { background: var(--ipgs-green-100); color: var(--ipgs-green); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table .check { color: var(--ipgs-green); font-weight: 700; text-align: center; }
.table .dash { color: var(--ipgs-stone-200); text-align: center; }

/* Timeline (roadmap) */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 0; bottom: 0;
  width: 2px; background: var(--ipgs-gold);
}
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-item::before {
  content: ""; position: absolute; left: -1.85rem; top: 0.35em;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ipgs-green); border: 3px solid var(--ipgs-gold);
}
.timeline-phase { font-size: 0.82rem; color: var(--ipgs-gold); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.timeline-item h3 { margin: 0.15rem 0 0.4rem; }

/* Org chart */
.org-chart { max-width: 900px; margin: 2rem auto; font-size: 0.95rem; }
.org-box {
  background: var(--ipgs-white);
  border: 2px solid var(--ipgs-green);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.2rem;
  text-align: center;
  font-weight: 600;
  color: var(--ipgs-green);
}
.org-box.accent { background: var(--ipgs-green); color: var(--ipgs-white); }
.org-box.gold { border-color: var(--ipgs-gold); background: var(--ipgs-gold-100); color: #5a3f00; }
.org-line {
  width: 2px; height: 24px; background: var(--ipgs-green);
  margin: 0 auto;
}
.org-row {
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 0.75rem;
}
.org-row .org-box { padding: 0.7rem 0.5rem; font-size: 0.88rem; }

/* ---------- 8. Forms ---------- */
form { display: grid; gap: 1.1rem; }
.form-row { display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.field label {
  display: block; font-weight: 600; color: var(--ipgs-stone);
  margin-bottom: 0.4rem; font-size: 0.93rem;
}
.field label .req { color: var(--ipgs-danger); }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.7rem 0.9rem;
  border: 1px solid var(--ipgs-stone-200);
  border-radius: var(--radius-md);
  font: inherit; color: var(--ipgs-stone);
  background: var(--ipgs-white);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--ipgs-green);
  box-shadow: 0 0 0 3px rgba(20,83,45,0.12);
  outline: none;
}
.field textarea { min-height: 140px; resize: vertical; }
.help-text { font-size: 0.85rem; color: var(--ipgs-stone-500); margin-top: 0.3rem; }

/* ---------- 9. Footer ---------- */
.site-footer {
  background: #0E3D1F;
  color: rgba(255,255,255,0.82);
  padding: 3.5rem 0 1.5rem;
  margin-top: 4rem;
  font-size: 0.92rem;
}
.site-footer a { color: rgba(255,255,255,0.82); }
.site-footer a:hover { color: var(--ipgs-gold-400); }
.footer-grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1.5fr repeat(3, 1fr);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: var(--ipgs-gold-400); font-size: 0.92rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.8rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li + li { margin-top: 0.4rem; }
.footer-brand-text { color: var(--ipgs-white); font-weight: 700; font-size: 1.1rem; margin-bottom: 0.4rem; }
.footer-address { color: rgba(255,255,255,0.7); line-height: 1.55; font-size: 0.88rem; }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  font-size: 0.82rem; color: rgba(255,255,255,0.6);
}
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; list-style: none; padding: 0; margin: 0; }

/* ---------- 10. Page header (interior) ---------- */
.page-header {
  background: linear-gradient(135deg, var(--ipgs-green) 0%, #0F3E22 100%);
  color: var(--ipgs-white);
  padding: 3.5rem 0 3rem;
}
.page-header h1 { color: var(--ipgs-white); margin-bottom: 0.4rem; }
.page-header .lead { color: rgba(255,255,255,0.85); max-width: 70ch; }
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 0.8rem; }
.breadcrumb a { color: var(--ipgs-gold-400); }

/* ---------- 11. Details / accordion ---------- */
details {
  background: var(--ipgs-white);
  border: 1px solid var(--ipgs-stone-100);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.8rem;
  box-shadow: var(--shadow-sm);
}
details[open] { border-color: var(--ipgs-green-100); }
details > summary {
  cursor: pointer; font-weight: 600; color: var(--ipgs-green);
  list-style: none; padding-right: 2rem; position: relative;
}
details > summary::after {
  content: "+"; position: absolute; right: 0; top: 0;
  color: var(--ipgs-gold); font-weight: 700; font-size: 1.3rem; line-height: 1;
}
details[open] > summary::after { content: "−"; }
details > *:not(summary) { margin-top: 0.9rem; }

/* ---------- 12. Misc helpers ---------- */
.chip {
  display: inline-block; padding: 0.2rem 0.7rem;
  background: var(--ipgs-green-100); color: var(--ipgs-green);
  border-radius: 999px; font-size: 0.8rem; font-weight: 600;
}
.chip-gold { background: var(--ipgs-gold-100); color: #5a3f00; }
.chip-stone { background: var(--ipgs-stone-100); color: var(--ipgs-stone); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.8rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--ipgs-gold); color: #1a1100;
  padding: 0.6rem 1rem; font-weight: 700;
  z-index: 999;
}
.skip-link:focus { top: 0; }

/* Print */
@media print {
  .site-header, .site-footer, .utility-bar, .announcement-banner, .nav-toggle, .hero-ctas { display: none; }
  body { background: white; color: black; }
  a { color: black; text-decoration: underline; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
