/**
 * GPRO Dashboard — shared frontend primitives.
 *
 * Registered (not enqueued) by the Dashboard plugin. Plugins that need
 * frontend UI enqueue their own CSS with 'gpro-base-frontend' as a
 * dependency, or enqueue this handle directly.
 *
 * Variables are namespaced --gpro-fe-* and resolve to the child theme's
 * --gpro-* tokens where defined, falling back to neutral values for sites
 * that don't use the GPRO Divi 5 Child Theme. The child theme remains the
 * source of truth for visual identity; primitives here provide structure.
 *
 * Class API:
 *   .gpro-lock         Full-page centred container (lock screens, gates)
 *   .gpro-form         Flex column form layout
 *   .gpro-form__title  Heading inside a .gpro-form
 *   .gpro-form__intro  Lead paragraph below the title
 *   .gpro-input        Text/password input
 *   .gpro-button       Primary button
 *   .gpro-message      Inline message block
 *   .gpro-message--error / --success  Modifiers
 *   .gpro-image        Figure wrapper for an image with optional title + caption
 *   .gpro-image__img   The <img> inside .gpro-image (fills container width)
 *   .gpro-image__meta  Figcaption wrapper (title + caption text)
 *   .gpro-image__title    Title (h4) inside .gpro-image__meta — unstyled, tune via Divi
 *   .gpro-image__caption  Caption (p) inside .gpro-image__meta — unstyled, tune via Divi
 */

:root {
    /* Typography */
    --gpro-fe-font:        var(--gpro-font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    --gpro-fe-text:        var(--gpro-color-text, #1a1a18);
    --gpro-fe-text-muted:  var(--gpro-color-muted, #6b6b6b);

    /* Surfaces */
    --gpro-fe-bg:          var(--gpro-color-bg, #ffffff);
    --gpro-fe-bg-soft:     var(--gpro-color-bg-soft, #f6f6f6);
    --gpro-fe-border:      var(--gpro-color-border, #d9d9d9);
    --gpro-fe-border-focus:var(--gpro-color-accent, #1a1a18);

    /* Accent (used by primary button) */
    --gpro-fe-accent:      var(--gpro-color-accent, #1a1a18);
    --gpro-fe-accent-text: var(--gpro-color-accent-text, #ffffff);
    --gpro-fe-accent-hover:var(--gpro-color-accent-hover, #333333);

    /* States */
    --gpro-fe-error-bg:    #fdecea;
    --gpro-fe-error-fg:    #a72020;
    --gpro-fe-success-bg:  #e8f5ec;
    --gpro-fe-success-fg:  #1a6c34;

    /* Geometry */
    --gpro-fe-radius:      4px;
    --gpro-fe-max-form:    420px;
    --gpro-fe-gap:         1rem;
}

/* =============================================================================
   .gpro-lock — full-page centred container
   ============================================================================= */

.gpro-lock {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.25rem;
    font-family: var(--gpro-fe-font);
    color: var(--gpro-fe-text);
}

.gpro-lock__inner {
    width: 100%;
    max-width: var(--gpro-fe-max-form);
}

/* =============================================================================
   .gpro-form — vertical form layout
   ============================================================================= */

.gpro-form {
    display: flex;
    flex-direction: column;
    gap: var(--gpro-fe-gap);
    width: 100%;
}

.gpro-form__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--gpro-fe-text);
}

.gpro-form__intro {
    font-size: 0.95rem;
    color: var(--gpro-fe-text-muted);
    margin: 0 0 0.75rem;
}

.gpro-form__row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.gpro-form__label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gpro-fe-text);
}

/* =============================================================================
   .gpro-input — text / password / email
   ============================================================================= */

.gpro-input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font: inherit;
    font-size: 1rem;
    color: var(--gpro-fe-text);
    background: var(--gpro-fe-bg);
    border: 1px solid var(--gpro-fe-border);
    border-radius: var(--gpro-fe-radius);
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.gpro-input:focus {
    outline: none;
    border-color: var(--gpro-fe-border-focus);
}

/* =============================================================================
   .gpro-button — primary action button
   ============================================================================= */

.gpro-button {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--gpro-fe-accent-text);
    background: var(--gpro-fe-accent);
    border: 1px solid var(--gpro-fe-accent);
    border-radius: var(--gpro-fe-radius);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.gpro-button:hover,
.gpro-button:focus {
    background: var(--gpro-fe-accent-hover);
    border-color: var(--gpro-fe-accent-hover);
    color: var(--gpro-fe-accent-text);
}

/* =============================================================================
   .gpro-message — inline notice block
   ============================================================================= */

.gpro-message {
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    border-radius: var(--gpro-fe-radius);
    background: var(--gpro-fe-bg-soft);
    color: var(--gpro-fe-text);
    border-left: 3px solid var(--gpro-fe-border);
}

.gpro-message--error {
    background: var(--gpro-fe-error-bg);
    color: var(--gpro-fe-error-fg);
    border-left-color: var(--gpro-fe-error-fg);
}

.gpro-message--success {
    background: var(--gpro-fe-success-bg);
    color: var(--gpro-fe-success-fg);
    border-left-color: var(--gpro-fe-success-fg);
}

/* =============================================================================
   .gpro-image — figure block for an image with optional title + caption
   ============================================================================= */

.gpro-image {
    display: block;
    position: relative;
    margin: 0;
    width: 100%;
}

/* Image fills the column — scales up and down */
.gpro-image__img {
    display: block;
    width: 100%;
    height: auto;
}

/* Anchor wrapping the image — no inline whitespace gap */
.gpro-image > a {
    display: block;
    line-height: 0;
}

/* Meta block (figcaption) — holds title (h4) + caption (p).
   Defaults are embedded as var() fallbacks; override in the child theme
   by setting --gpro-fe-image-meta-* on .gpro-image. The child theme's
   declarations win unconditionally because no rule pre-sets the
   variables on .gpro-image. */
.gpro-image__meta {
    color:      var(--gpro-fe-image-meta-color, inherit);
    background: var(--gpro-fe-image-meta-bg, transparent);
    padding:    var(--gpro-fe-image-meta-padding, 0.75em 0 0);
    margin:     var(--gpro-fe-image-meta-margin, 0);
    position:   var(--gpro-fe-image-meta-position, static);
    text-align: var(--gpro-fe-image-meta-align, left);
}

/* ── Per-site overlay example (child theme) ─────────────────────────────────
 *
 *   .gpro-image {
 *       --gpro-fe-image-meta-position: absolute;
 *       --gpro-fe-image-meta-color:    #fff;
 *       --gpro-fe-image-meta-bg:       linear-gradient(transparent, rgba(0,0,0,0.7));
 *       --gpro-fe-image-meta-padding:  2em 1.25em 1em;
 *   }
 *   .gpro-image__meta { bottom: 0; left: 0; right: 0; }
 *
 * ────────────────────────────────────────────────────────────────────────── */
