/**
 * PIECE OF HUMANITY — SHARED DESIGN SYSTEM
 * File: poh-design-system.css | Version: 2.3.0
 * Load before all public, admin and feature stylesheets.
 * A. Design tokens   B. Brand identity
 * C. Shared components   D. Accessibility
 * Page-specific layouts belong in feature stylesheets.
 */

/* =========================================================
   A. DESIGN TOKENS
   ========================================================= */
:root {
    /* A.01 — Primary brand palette */
    --poh-navy: #01264b;
    --poh-navy-hover: #013766;
    --poh-gold: #b08227;
    --poh-gold-dark: #9f6b17;
    --poh-gold-light: #d9a649;
    --poh-gold-muted: #d4b883;
    --poh-ivory: #f9f4e6;
    --poh-cream: #f1e8d3;
    --poh-parchment: #e7d7b6;
    --poh-sand: #cbab6c;
    --poh-taupe: #dbc597;
    --poh-burgundy: #762e39;
    --poh-white: #ffffff;

    /* A.02 — Semantic colors */
    --poh-accent: var(--poh-gold);
    --poh-accent-hover: var(--poh-gold-dark);
    --poh-text: #243247;
    --poh-muted: #657185;
    --poh-text-on-dark: var(--poh-ivory);
    --poh-text-gold: var(--poh-gold-light);
    --poh-surface: var(--poh-white);
    --poh-surface-soft: var(--poh-ivory);
    --poh-edit-bg: #fffdf5;
    --poh-border: var(--poh-taupe);
    --poh-border-light: var(--poh-parchment);
    --poh-border-strong: var(--poh-gold);

    /* A.03 — Status colors */
    --poh-success: #237447;
    --poh-warning: #946200;
    --poh-danger: #b42318;
    --poh-danger-hover: #8f1c14;
    --poh-info: #3575bd;
    --poh-neutral: #9ca3af;
    --poh-success-bg: #e6f4eb;
    --poh-warning-bg: #fff3d6;
    --poh-danger-bg: #fce8e6;

    /* A.04 — Typography */
    --poh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --poh-font-display: Georgia, "Times New Roman", serif;
    --poh-font-record: "Abhaya Libre", var(--poh-font-reading);
    --poh-font-admin: var(--poh-font);
    --poh-font-heading: var(--poh-font-display);
    --poh-font-navigation: var(--poh-font-display);
    --poh-font-reading: var(--poh-font-display);
    --poh-font-code: Consolas, Monaco, monospace;
    --poh-font-size-xs: 11px;
    --poh-font-size-sm: 12px;
    --poh-font-size-control: 13px;
    --poh-font-size-md: 14px;
    --poh-font-size-base: 16px;
    --poh-font-size-lg: 20px;

    /* A.05 — Spacing and shape */
    --poh-radius: 6px;
    --poh-radius-sm: 4px;
    --poh-radius-lg: 10px;
    --poh-radius-pill: 999px;
    --poh-space-1: 4px;
    --poh-space-2: 8px;
    --poh-space-3: 12px;
    --poh-space-4: 16px;
    --poh-space-5: 24px;
    --poh-space-6: 32px;

    /* A.06 — Layout and controls */
    --poh-content-width: 1100px;
    --poh-reading-width: 780px;
    --poh-admin-width: 1440px;
    --poh-admin-width-medium: 1200px;
    --poh-admin-width-narrow: 1100px;
    --poh-control-height: 34px;
    --poh-control-height-mobile: 44px;
    --poh-shadow-soft: 0 3px 12px rgba(1, 38, 75, .08);
    --poh-shadow-panel: 0 6px 20px rgba(1, 38, 75, .10);
    --poh-focus-color: var(--poh-gold);
    --poh-focus-soft: rgba(176, 130, 39, .25);

    /* A.07 — Shared component dimensions (existing values) */
    --poh-button-gap: 6px;
    --poh-field-gap: 14px;
    --poh-label-gap: 5px;
    --poh-textarea-min-height: 90px;
}

/* =========================================================
   B. BRAND IDENTITY
   ========================================================= */
:root {
    /* B.01 — Header, footer and navigation */
    --poh-brand-bg: var(--poh-navy);
    --poh-brand-title: var(--poh-ivory);
    --poh-brand-tagline: var(--poh-gold-light);
    --poh-brand-nav: var(--poh-gold-muted);
    --poh-brand-nav-hover: var(--poh-ivory);
    --poh-brand-border: var(--poh-gold);
    --poh-brand-border-width: 3px;

    /* B.02 — Signature ornament (SVG colors are embedded) */
    --poh-ornament-gold: #d9ac50;
    --poh-ornament-highlight: #f5d78e;
    --poh-ornament-image: url("https://pieceofhumanity.com/wp-content/uploads/2026/11/Serene-Riverside-Landscape.png");
    --poh-ornament-height: 16px;
    --poh-ornament-height-mobile: 10px;
    --poh-ornament-max-width: 320px;

    /* B.03 — Parchment transitions */
    --poh-parchment-transition-start: #e6d8b7;
    --poh-parchment-transition-end: #f4edda;
    --poh-parchment-gradient: linear-gradient(to bottom, var(--poh-parchment-transition-start), var(--poh-parchment-transition-end));

    /* B.04 — Legacy public record palette; retain until redesign */
    --poh-record-text: #151515;
    --poh-record-accent: #9e6636;
    --poh-record-border: #e3ddd6;
    --poh-record-border-active: #ded6cc;
    --poh-record-tab-bg: #f4f2ef;
    --poh-record-tab-hover: #eae5df;
    --poh-record-button-bg: #f1efeb;
    --poh-record-button-hover: #e8dfd5;
    --poh-record-button-border: #d6cec5;
}

/* =========================================================
   C. SHARED COMPONENTS
   ========================================================= */
/* C.01 — Base */
.poh,
[class^="poh-"],
[class*=" poh-"] { box-sizing: border-box; }

.poh,
.poh-panel,
.poh-card { color: var(--poh-text); font-family: var(--poh-font); }

.poh h1,
.poh h2,
.poh h3,
.poh h4 { color: var(--poh-navy); line-height: 1.3; }
.poh a { color: var(--poh-navy); }
.poh a:hover { color: var(--poh-accent-hover); }

/* C.02 — Buttons: match container specificity for variants and states */
.poh .poh-button,
.poh-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--poh-button-gap);
    min-height: var(--poh-control-height);
    padding: 7px 13px;
    border: 1px solid var(--poh-navy);
    border-radius: var(--poh-radius);
    background: var(--poh-navy);
    color: var(--poh-white);
    font: 500 var(--poh-font-size-control)/1.35 var(--poh-font);
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
    transition: background-color .15s ease, border-color .15s ease;
}
.poh .poh-button:hover,
.poh .poh-button:focus,
.poh-button:hover,
.poh-button:focus { background: var(--poh-navy-hover); border-color: var(--poh-navy-hover); color: var(--poh-white); }

.poh .poh-button--accent,
.poh-button--accent { background: var(--poh-accent); border-color: var(--poh-accent); color: var(--poh-navy); }
.poh .poh-button--accent:hover,
.poh .poh-button--accent:focus,
.poh-button--accent:hover,
.poh-button--accent:focus { background: var(--poh-accent-hover); border-color: var(--poh-accent-hover); color: var(--poh-white); }

.poh .poh-button--secondary,
.poh-button--secondary { background: var(--poh-white); border-color: var(--poh-border); color: var(--poh-navy); }
.poh .poh-button--secondary:hover,
.poh .poh-button--secondary:focus,
.poh-button--secondary:hover,
.poh-button--secondary:focus { background: var(--poh-ivory); border-color: var(--poh-accent); color: var(--poh-navy); }

.poh .poh-button--danger,
.poh-button--danger { background: var(--poh-danger); border-color: var(--poh-danger); color: var(--poh-white); }
.poh .poh-button--danger:hover,
.poh .poh-button--danger:focus,
.poh-button--danger:hover,
.poh-button--danger:focus { background: var(--poh-danger-hover); border-color: var(--poh-danger-hover); color: var(--poh-white); }

.poh .poh-button:disabled,
.poh .poh-button[disabled],
.poh-button:disabled,
.poh-button[disabled] { opacity: .5; cursor: not-allowed; }

/* C.03 — Cards and panels */
.poh-card,
.poh-panel {
    padding: var(--poh-space-4);
    background: var(--poh-surface);
    border: 1px solid var(--poh-border);
    border-radius: var(--poh-radius);
    box-shadow: none;
}
.poh-card--ivory,
.poh-panel--ivory { background: var(--poh-ivory); }
.poh-card__title,
.poh-panel__title {
    margin: 0 0 var(--poh-space-3);
    color: var(--poh-navy);
    font-size: var(--poh-font-size-base);
    font-weight: 600;
}

/* C.04 — Forms */
.poh-field { margin-bottom: var(--poh-field-gap); }
.poh-label {
    display: block;
    margin-bottom: var(--poh-label-gap);
    color: var(--poh-navy);
    font-size: var(--poh-font-size-control);
    font-weight: 600;
}
.poh-input,
.poh-select,
.poh-textarea {
    width: 100%;
    max-width: 100%;
    min-height: var(--poh-control-height);
    padding: 7px 10px;
    background: var(--poh-white);
    border: 1px solid var(--poh-border);
    border-radius: var(--poh-radius);
    color: var(--poh-text);
    font: var(--poh-font-size-control)/1.5 var(--poh-font);
    box-shadow: none;
}
.poh-textarea { min-height: var(--poh-textarea-min-height); resize: vertical; }
.poh-input:focus,
.poh-select:focus,
.poh-textarea:focus { outline: 2px solid var(--poh-focus-soft); outline-offset: 1px; border-color: var(--poh-accent); }
.poh-help { display: block; margin-top: var(--poh-label-gap); color: var(--poh-muted); font-size: var(--poh-font-size-sm); }

/* C.05 — Tables */
.poh-table { width: 100%; border-collapse: collapse; background: var(--poh-white); font-size: var(--poh-font-size-control); }
.poh-table th,
.poh-table td { padding: 10px var(--poh-space-3); border-bottom: 1px solid var(--poh-border); text-align: left; vertical-align: top; }
.poh-table th { background: var(--poh-ivory); color: var(--poh-navy); font-weight: 600; }
.poh-table tbody tr:hover { background: var(--poh-surface-soft); }

/* C.06 — Status labels */
.poh-status { display: inline-flex; align-items: center; padding: 3px var(--poh-space-2); border-radius: var(--poh-radius-sm); font-size: var(--poh-font-size-sm); font-weight: 600; }
.poh-status--success { background: var(--poh-success-bg); color: var(--poh-success); }
.poh-status--warning { background: var(--poh-warning-bg); color: var(--poh-warning); }
.poh-status--danger { background: var(--poh-danger-bg); color: var(--poh-danger); }

/* C.07 — Tabs */
.poh-tabs { display: flex; flex-wrap: wrap; gap: var(--poh-space-1); border-bottom: 1px solid var(--poh-border); }
.poh-tab {
    display: inline-block;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: var(--poh-radius) var(--poh-radius) 0 0;
    color: var(--poh-navy);
    text-decoration: none;
    font-size: var(--poh-font-size-control);
    font-weight: 500;
}
.poh-tab:hover { background: var(--poh-ivory); }
.poh-tab.is-active { background: var(--poh-white); border-color: var(--poh-border); color: var(--poh-navy); font-weight: 600; }

/* =========================================================
   D. ACCESSIBILITY
   ========================================================= */
.poh-button:focus-visible,
.poh-tab:focus-visible { outline: 2px solid var(--poh-focus-color); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    .poh-button { transition: none; }
}

/* END — SHARED DESIGN SYSTEM */