/**
 * Ganjier Guild Design Tokens
 * CSS custom properties for the GuildCommerce theme layer.
 * Reference these tokens in all theme templates.
 *
 * Usage: var(--honey), var(--mint), etc.
 */

:root {
    /* ── Brand palette ────────────────────────────────────────── */
    --honey:          #FCB240;
    --mint:           #86CCAA;
    --lavender:       #9C66AA;
    --mocha:          #524235;

    /* ── Status / alert ───────────────────────────────────────── */
    --warning-yellow: #FFF200;
    --warning-red:    #DA3831;
    --success-green:  #2E7D52;
    --neutral-grey:   #6B7280;

    /* ── Surface / background ─────────────────────────────────── */
    --surface-base:   #FFFFFF;
    --surface-muted:  #F9F6F2;
    --surface-dark:   var(--mocha);
    --border-subtle:  #E5DDD5;
    --border-mid:     #C4B49C;

    /* ── ACL tier accent colours ─────────────────────────────── */
    --tier-public-bg:      #EAF6EE;
    --tier-public-border:  var(--mint);
    --tier-member-bg:      #FEF7E8;
    --tier-member-border:  var(--honey);
    --tier-board-bg:       #F0EAF7;
    --tier-board-border:   var(--lavender);
    --tier-priv-bg:        #FFF2F2;
    --tier-priv-border:    var(--warning-red);

    /* ── Entity accent colours ───────────────────────────────── */
    --entity-c6-bg:        #FEF7E8;
    --entity-c6-border:    var(--honey);
    --entity-llc-bg:       #EAF6EE;
    --entity-llc-border:   var(--mint);
    --entity-coop-bg:      #F0EAF7;
    --entity-coop-border:  var(--lavender);

    /* ── Typography ──────────────────────────────────────────── */
    --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
    --font-body:    "DM Sans", system-ui, sans-serif;
    --font-mono:    "JetBrains Mono", "Fira Mono", monospace;

    /* ── Spacing scale ───────────────────────────────────────── */
    --space-xs:  0.25rem;
    --space-sm:  0.5rem;
    --space-md:  1rem;
    --space-lg:  1.5rem;
    --space-xl:  2rem;
    --space-2xl: 3rem;

    /* ── Border radius ───────────────────────────────────────── */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 999px;

    /* ── Shadows ──────────────────────────────────────────────── */
    --shadow-card: 0 1px 3px rgba(82,66,53,0.10), 0 1px 2px rgba(82,66,53,0.06);
    --shadow-elevated: 0 4px 12px rgba(82,66,53,0.12);
}

/* ── Base resets scoped to GuildCommerce elements ────────────── */
.gc-page,
.gc-portal,
.gc-dashboard {
    font-family: var(--font-body);
    color: var(--mocha);
    line-height: 1.6;
}

.gc-page h1,
.gc-page h2,
.gc-page h3,
.gc-portal h1,
.gc-portal h2,
.gc-portal h3,
.gc-dashboard h1,
.gc-dashboard h2,
.gc-dashboard h3 {
    font-family: var(--font-display);
    color: var(--mocha);
    line-height: 1.25;
}

/* ── Utility: visually hidden (screen-reader text) ───────────── */
.gc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* ── Form letter badge ───────────────────────────────────────── */
.gc-form-letter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: var(--honey);
    color: var(--mocha);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ── Tier badge ──────────────────────────────────────────────── */
.gc-tier-badge {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.gc-tier-badge--friend        { background: #F3F4F6; color: var(--neutral-grey); }
.gc-tier-badge--community-ed  { background: var(--tier-member-bg); color: #7C5E1E; border: 1px solid var(--honey); }
.gc-tier-badge--certified     { background: var(--lavender); color: #fff; }
.gc-tier-badge--founding      { background: var(--mocha); color: var(--honey); }

/* ── Role badge ──────────────────────────────────────────────── */
.gc-role-badge {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    background: var(--surface-muted);
    border: 1px solid var(--border-mid);
    color: var(--mocha);
}
.gc-role-badge--patron    { background: var(--honey); color: var(--mocha); }
.gc-role-badge--navigator { background: var(--mocha); color: #fff; }
.gc-role-badge--emeritus  { background: #E5E7EB; color: #6B7280; }
.gc-role-badge--operator  { background: var(--mint); color: #1A4034; }
.gc-role-badge--voyage    { background: var(--tier-board-bg); color: #5A3D80; border-color: var(--lavender); }

/* ── Entity tag ──────────────────────────────────────────────── */
.gc-entity-tag {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    border-width: 1px;
    border-style: solid;
    white-space: nowrap;
}
.gc-entity-tag--c6   { background: var(--entity-c6-bg);   border-color: var(--entity-c6-border);   color: #7C5E1E; }
.gc-entity-tag--llc  { background: var(--entity-llc-bg);  border-color: var(--entity-llc-border);  color: #1A4034; }
.gc-entity-tag--coop { background: var(--entity-coop-bg); border-color: var(--entity-coop-border); color: #5A3D80; }

/* ── ACL gate / tier indicators ──────────────────────────────── */
.gc-acl-tier-badge {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-width: 1px;
    border-style: solid;
}
.gc-acl-tier-public     { background: var(--tier-public-bg);  border-color: var(--tier-public-border);  color: #1A4034; }
.gc-acl-tier-member     { background: var(--tier-member-bg);  border-color: var(--tier-member-border);  color: #7C5E1E; }
.gc-acl-tier-board      { background: var(--tier-board-bg);   border-color: var(--tier-board-border);   color: #5A3D80; }
.gc-acl-tier-privileged { background: var(--tier-priv-bg);    border-color: var(--tier-priv-border);    color: var(--warning-red); }

/* ── Card ────────────────────────────────────────────────────── */
.gc-card {
    background: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
}
.gc-card + .gc-card { margin-top: var(--space-md); }

/* ── Form card ───────────────────────────────────────────────── */
.gc-form-card {
    display: grid;
    grid-template-columns: 2.5rem 1fr auto;
    gap: var(--space-md);
    align-items: start;
    background: var(--surface-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-card);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.gc-form-card:hover {
    border-color: var(--honey);
    box-shadow: var(--shadow-elevated);
}

/* ── Status pill ──────────────────────────────────────────────── */
.gc-status-pill {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-display);
}
.gc-status--draft      { background: #F3F4F6; color: var(--neutral-grey); }
.gc-status--submitted  { background: #FEF7E8; color: #7C5E1E; }
.gc-status--review     { background: #EFF6FF; color: #1D4ED8; }
.gc-status--approved   { background: #D1FAE5; color: #065F46; }
.gc-status--denied     { background: #FEE2E2; color: #991B1B; }
.gc-status--withdrawn  { background: #F3F4F6; color: var(--neutral-grey); }
.gc-status--qb_handed  { background: #D1FAE5; color: #065F46; }
.gc-status--rejected   { background: #FEE2E2; color: #991B1B; }

/* ── Access denied / gate notice ─────────────────────────────── */
.gc-access-denied {
    background: #FFF8E1;
    border: 1px solid var(--honey);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
}
.gc-access-denied__icon   { font-size: 2rem; margin-bottom: var(--space-sm); }
.gc-access-denied__title  { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--mocha); }
.gc-access-denied__body   { color: var(--neutral-grey); margin-top: var(--space-sm); font-size: 0.9rem; }

/* ── Table ────────────────────────────────────────────────────── */
.gc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.gc-table thead th {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 2px solid var(--border-mid);
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--mocha);
    background: var(--surface-muted);
}
.gc-table tbody td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
}
.gc-table tbody tr:last-child td { border-bottom: none; }
.gc-table tbody tr:hover td { background: var(--surface-muted); }

/* ── Checklist ────────────────────────────────────────────────── */
.gc-checklist { list-style: none; padding: 0; margin: 0; }
.gc-checklist__item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
}
.gc-checklist__item:last-child { border-bottom: none; }
.gc-checklist__check {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.1em;
}
.gc-checklist__check--pass { background: var(--success-green); color: #fff; text-align: center; line-height: 1.25rem; }
.gc-checklist__check--fail { background: var(--warning-red); color: #fff; text-align: center; line-height: 1.25rem; }
.gc-checklist__check--pending { background: var(--neutral-grey); color: #fff; text-align: center; line-height: 1.25rem; }

/* ── Footer disclaimer ────────────────────────────────────────── */
.gc-footer-disclaimer {
    margin-top: var(--space-2xl);
    padding: var(--space-md) var(--space-lg);
    background: var(--surface-muted);
    border-top: 2px solid var(--border-mid);
    font-size: 0.8rem;
    color: var(--neutral-grey);
    text-align: center;
    line-height: 1.5;
}

/* ── Section heading ─────────────────────────────────────────── */
.gc-section-heading {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mocha);
    margin: 0 0 var(--space-md);
    padding-bottom: var(--space-xs);
    border-bottom: 2px solid var(--honey);
    display: inline-block;
}

/* ── Dashboard layout ────────────────────────────────────────── */
.gc-dashboard__header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}
.gc-dashboard__title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--mocha);
    margin: 0;
}
.gc-dashboard__subtitle {
    margin: var(--space-xs) 0 0;
    color: var(--neutral-grey);
    font-size: 0.9rem;
}
.gc-dashboard__grid {
    display: grid;
    gap: var(--space-lg);
}
@media (min-width: 768px) {
    .gc-dashboard__grid--2col { grid-template-columns: 1fr 1fr; }
    .gc-dashboard__grid--3col { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── Audit log row ───────────────────────────────────────────── */
.gc-audit-row {
    display: grid;
    grid-template-columns: 10rem 8rem 1fr;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}
.gc-audit-row:hover { background: var(--surface-muted); }
.gc-audit-row__timestamp { color: var(--neutral-grey); }
.gc-audit-row__event     { font-weight: 600; color: var(--mocha); }
.gc-audit-row__context   { color: var(--mocha); word-break: break-all; }
