/* AGAI — Anvaya Golfers Association Inc. */
:root {
  --green-900: #12301c;
  --green-800: #1b4329;
  --green-700: #22593a;
  --green-600: #2e7a45;
  --green-100: #e7f1ea;
  --sand: #f6f3ec;
  --ink: #18201b;
  --muted: #5b665f;
  --line: #dfe5e0;
  --white: #fff;
  --gold: #c9a24a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 48, 28, .06), 0 8px 24px rgba(18, 48, 28, .08);
  --max: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 17px/1.65 var(--font);
  color: var(--ink);
  background: var(--white);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-600); }
a:hover { color: var(--green-800); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--green-900); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-family: var(--serif); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-family: var(--serif); font-weight: 600; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }
.section { padding: 64px 0; }
.section--sand { background: var(--sand); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--green-600); margin-bottom: .5em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--white); padding: 8px 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .75em 1.4em; border-radius: 999px; border: 2px solid transparent;
  font-weight: 650; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--green-600); color: var(--white); }
.btn--primary:hover { background: var(--green-800); color: var(--white); }
.btn--ghost { border-color: currentColor; color: var(--white); }
.btn--ghost:hover { background: var(--white); color: var(--green-900); }
.btn--outline { border-color: var(--green-600); color: var(--green-700); }
.btn--outline:hover { background: var(--green-600); color: var(--white); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.brand img { height: 48px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem;
  padding: .5em .8em; border-radius: 8px;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--green-700); background: var(--green-100); }
.nav .btn { margin-left: 8px; color: var(--white); }
.nav .btn:hover { background: var(--green-800); color: var(--white); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--green-900); }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: .8em; }
  .nav .btn { margin: 8px 0 0; justify-content: center; }
}

/* Hero */
.hero { position: relative; color: var(--white); min-height: min(78vh, 640px); display: flex; align-items: flex-end; }
.hero picture, .hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 30, 16, .15) 0%, rgba(10, 30, 16, .75) 100%); }
.hero .container { position: relative; z-index: 1; padding-top: 96px; padding-bottom: 64px; }
.hero h1 { color: var(--white); max-width: 15em; }
.hero p { font-size: 1.15rem; max-width: 38em; opacity: .95; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.page-hero { background: var(--green-900); color: var(--white); padding: 56px 0 48px; }
.page-hero h1 { color: var(--white); margin: 0; }
.page-hero p { color: rgba(255, 255, 255, .8); margin: .5em 0 0; }

/* Pillars */
.pillars { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 32px; }
.pillar { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.pillar .num { font-family: var(--serif); font-size: 2rem; color: var(--gold); line-height: 1; margin-bottom: 12px; }

/* Cards */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  display: flex; flex-direction: column; background: var(--white); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(18, 48, 28, .08), 0 14px 32px rgba(18, 48, 28, .12); color: inherit; }
.card .media { aspect-ratio: 4 / 3; background: var(--green-100); overflow: hidden; }
.card .media img { width: 100%; height: 100%; object-fit: cover; }
.card .media--contain img { object-fit: contain; padding: 12px; background: var(--white); }
.card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 1.1rem; }
.card .meta { font-size: .85rem; color: var(--muted); }
.card .price { font-weight: 750; color: var(--green-700); font-size: 1.15rem; margin-top: auto; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; }

/* Split */
.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* Article */
.article { max-width: 760px; margin: 0 auto; }
.article .cover { border-radius: var(--radius); margin: 0 auto 32px; max-height: 560px; width: auto; box-shadow: var(--shadow); }
.article h2 { font-size: 1.6rem; margin-top: 1.4em; }
.article h3 { margin-top: 1.4em; }
.article h4 { margin-top: 1.2em; font-size: 1.05rem; }
.article ul { padding-left: 1.2em; }
.article li { margin-bottom: .35em; }
.back { display: inline-block; margin-bottom: 24px; font-weight: 600; text-decoration: none; }

/* Listing detail */
.listing { display: grid; gap: 40px; }
@media (min-width: 860px) { .listing { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.listing .photo { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.listing .price { font-size: 1.8rem; font-weight: 800; color: var(--green-700); margin: 8px 0 20px; }
.listing .panel { background: var(--sand); border-radius: var(--radius); padding: 20px; margin-top: 24px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.filters input, .filters select {
  font: inherit; font-size: .95rem; padding: .65em 1em; border: 1px solid var(--line);
  border-radius: 10px; background: var(--white); min-width: 0;
}
.filters input { flex: 1 1 240px; }
.empty { color: var(--muted); padding: 24px 0; }

/* Contact */
.contact-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.contact-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.contact-card h3 { margin-bottom: .3em; }
form.stack { display: grid; gap: 14px; max-width: 640px; }
form.stack label { font-weight: 600; font-size: .9rem; display: grid; gap: 6px; }
form.stack input, form.stack textarea {
  font: inherit; padding: .7em .9em; border: 1px solid var(--line); border-radius: 10px; width: 100%;
}
form.stack textarea { min-height: 140px; resize: vertical; }

/* CTA band */
.cta-band { background: var(--green-800); color: var(--white); border-radius: var(--radius); padding: 40px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.cta-band h2 { color: var(--white); margin: 0 0 .2em; }
.cta-band p { margin: 0; opacity: .85; }

/* Footer */
.site-footer { background: var(--green-900); color: rgba(255, 255, 255, .8); padding: 48px 0 24px; margin-top: 0; font-size: .95rem; }
.site-footer a { color: rgba(255, 255, 255, .9); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-grid h4 { color: var(--white); font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer .logo { height: 54px; width: auto; margin-bottom: 12px; }
.copyright { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 32px; padding-top: 20px; font-size: .85rem; }

/* ---------- Members area & dashboard ---------- */
.notice { background: #fff8e1; border: 1px solid #f0d890; border-radius: var(--radius); padding: 16px 20px; margin: 0 0 24px; }
.notice p { margin: .4em 0 0; }
.notice code { background: rgba(0,0,0,.06); padding: .1em .4em; border-radius: 4px; font-size: .9em; }
.notice--info { background: var(--green-100); border-color: #bcd9c5; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--green-900); color: #fff; padding: 12px 20px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 200; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast--error { background: #9b2c2c; }

.auth { max-width: 460px; margin: 0 auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button { background: none; border: 0; font: inherit; font-weight: 650; padding: .7em 1em; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--green-700); border-color: var(--green-600); }
.tab-panel[hidden] { display: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--sm { padding: .45em 1em; font-size: .85rem; }
.btn--danger { border-color: #c53030; color: #c53030; }
.btn--danger:hover { background: #c53030; color: #fff; }

.dash { display: grid; gap: 24px; padding: 32px 0 64px; }
@media (min-width: 900px) { .dash { grid-template-columns: 240px 1fr; align-items: start; } }
.dash-nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
@media (min-width: 900px) { .dash-nav { flex-direction: column; position: sticky; top: 88px; } }
.dash-nav button, .dash-nav a {
  display: flex; align-items: center; gap: 10px; white-space: nowrap; text-align: left; background: none; border: 0; font: inherit; font-weight: 600;
  padding: .65em .9em; border-radius: 10px; cursor: pointer; color: var(--ink); text-decoration: none;
}
.dash-nav button[aria-selected="true"], .dash-nav a:hover, .dash-nav button:hover { background: var(--green-100); color: var(--green-800); }
.dash-nav .badge { margin-left: auto; background: var(--green-600); color: #fff; font-size: .75rem; padding: .1em .55em; border-radius: 999px; }
.dash-nav .badge:empty { display: none; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head h1 { font-size: 1.8rem; margin: 0; }
.who { color: var(--muted); font-size: .9rem; }
.panel-box { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.panel-box h2 { font-size: 1.3rem; font-family: var(--font); margin-bottom: 16px; }
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 20px; }
.stat { background: var(--sand); border-radius: var(--radius); padding: 18px 20px; }
.stat b { display: block; font-size: 1.9rem; color: var(--green-700); line-height: 1.1; }
.stat span { font-size: .85rem; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15em .6em; border-radius: 999px; background: var(--line); }
.pill--pending { background: #fff1c2; color: #7a5a00; }
.pill--approved { background: #d8f0df; color: #1f5a33; }
.pill--rejected { background: #f8d7d7; color: #8a1f1f; }
.pill--sold { background: #e2e8f0; color: #334; }
.pill--admin { background: var(--green-800); color: #fff; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--sand); }

.feed { display: grid; gap: 16px; }
.feed-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.feed-item h3 { margin: 0 0 .2em; }
.feed-item .meta { color: var(--muted); font-size: .85rem; margin-bottom: 10px; }
.feed-item img { border-radius: 10px; margin: 12px 0; max-height: 420px; width: auto; }

.inbox { display: grid; gap: 20px; }
@media (min-width: 760px) { .inbox { grid-template-columns: 260px 1fr; } }
.contacts { display: grid; gap: 4px; align-content: start; }
.contacts button { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: none; border: 1px solid transparent; font: inherit; padding: .6em .8em; border-radius: 10px; cursor: pointer; }
.contacts button:hover, .contacts button[aria-selected="true"] { background: var(--green-100); }
.contacts .unread { background: var(--green-600); color: #fff; font-size: .72rem; border-radius: 999px; padding: .1em .5em; }
.thread { display: flex; flex-direction: column; min-height: 420px; background: var(--sand); border-radius: var(--radius); }
.thread-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; max-height: 60vh; }
.bubble { max-width: 78%; padding: .6em .9em; border-radius: 14px; background: var(--white); box-shadow: 0 1px 1px rgba(0,0,0,.05); font-size: .95rem; }
.bubble.me { align-self: flex-end; background: var(--green-600); color: #fff; }
.bubble .by { display: block; font-size: .75rem; font-weight: 700; margin-bottom: .15em; color: var(--green-700); }
.bubble .time { display: block; font-size: .7rem; opacity: .65; margin-top: .2em; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.composer input, .composer textarea { flex: 1; font: inherit; padding: .65em .9em; border: 1px solid var(--line); border-radius: 10px; resize: none; }
.muted { color: var(--muted); }
.form-row { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
form.stack select { font: inherit; padding: .7em .9em; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.preview { max-height: 220px; width: auto; border-radius: 10px; margin-top: 8px; }
.preview[src=""] { display: none; }
