/* ===========================================================================
   GEM AWARDS — DESIGN SYSTEM
   ---------------------------------------------------------------------------
   The redesign layer, ported from mockups/mockup-h-palette.html (the approved
   candidate). This file carries ONLY tokens and surface primitives; page and
   template styling builds on top of it.

   It is deliberately separate from style.css. style.css is the Divi CLONE —
   it reproduces the live site so the Blocksy rebuild could be compared to it
   like-for-like. That clone is being retired: as each template moves to the
   design system, the matching clone rules come out of style.css. Keeping the
   two apart means the retirement is a delete, not an untangle.

   SETTLED RULES — these were decided with Treyson and are not open questions.
   Do not "improve" them without asking:

   1. TYPE BY GROUND. Light ground -> Quasimoda (sans). Maroon ground -> Alga
      (display serif). The hero is the one documented exception.
   2. PLAQUE RULE. Maroon surfaces are ARTIFACTS: 45 degree chamfered corners
      with a gold keyline that traces the chamfer. Light surfaces are
      INTERFACE: rounded corners. A maroon panel never travels without gold.
   3. GOLD. Buttons are white text on the original brand gradient
      (#EAC66E -> #D39700). That fails AA and was reverted to on purpose.
      Gold TEXT on white is a different problem and must use --gold-text
      (#8A6200, 5.49:1) — both brand golds fail as small text.
   4. GREENS are for photography, never interface. Blue is used sparingly.
   5. SPACING is the site's own convention, not a new scale: sections are
      96px, a section lead is 640px wide with 44px beneath it.
   =========================================================================== */

:root {
    /* -- THE OFFICIAL DIGITAL (RGB) PALETTE ---------------------------------
       Read out of Brand Assets/01 Color Palette/Digital (RGB) Palette.ase and
       named as that file names them, so nothing here is invented and anything
       unused is unused on purpose. --gold-1 (#E1A91B) is the true Primary
       Gold; #D39700 is Secondary Gold 2. */
    --gem-red-2: #450910;
    --gem-red-1: #5B0209;
    --gem-red-t1: #760000;
    --gem-red-t2: #870000;
    --gem-red-t3: #AC0A08;

    --gem-gold-s1: #C18705;
    --gem-gold-s2: #D39700;
    --gem-gold-1: #E1A91B;
    --gem-gold-s3: #EABC49;
    --gem-gold-s4: #EAC66E;

    --gem-blue-1: #090960;
    --gem-blue-s1: #0E277F;
    --gem-blue-s2: #0843A0;
    --gem-blue-s3: #3762B7;
    --gem-blue-s4: #5C85C6;

    --gem-gray-k: #01010C;
    --gem-gray-s1: #61616B;
    --gem-gray-s2: #AAAAB2;
    --gem-gray-1: #EBEBED;
    --gem-gray-w: #FBFBFB;

    /* Declared for completeness. NOT for interface — these belong to
       photography. See rule 4. */
    --gem-green-1: #055105;
    --gem-green-2: #146618;
    --gem-green-3: #258727;
    --gem-green-4: #469E46;
    --gem-green-5: #62B762;

    /* -- SEMANTIC ALIASES ---------------------------------------------------
       Templates should reach for these, not the raw swatches above, so a
       palette correction happens in one place. */
    --gem-maroon: var(--gem-red-1);
    --gem-maroon-deep: var(--gem-red-2);
    --gem-maroon-mid: var(--gem-red-t1);
    --gem-navy: var(--gem-blue-1);
    --gem-navy-lt: var(--gem-blue-s1);

    --gem-ink: var(--gem-gray-k);
    --gem-slate: var(--gem-gray-s1);
    --gem-mist: var(--gem-gray-s2);
    --gem-line: var(--gem-gray-1);
    --gem-paper: var(--gem-gray-w);

    --gem-gold: var(--gem-gold-1);
    --gem-gold-lt: var(--gem-gold-s4);
    /* The BUTTON gradient: Secondary Gold 4 into Secondary Gold 2. White on
       it measures 1.64:1 at the top stop; navy on the same gradient measures
       10.5:1 if that ever needs solving without touching the gold. Recorded
       once, settled, not re-litigated. */
    --gem-gold-grad: linear-gradient(180deg, var(--gem-gold-s4), var(--gem-gold-s2));
    /* Gold as SMALL TEXT on white. Never use --gem-gold for body-size type. */
    --gem-gold-text: #8A6200;

    --gem-tile: linear-gradient(160deg, #F5F5F8, #EDEDF3);

    /* -- TYPE ---------------------------------------------------------------
       Alga arrives from the Adobe kit lowercase ("alga"); existing "Alga"
       references match case-insensitively. */
    --gem-font-sans: "Quasimoda", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --gem-font-display: "alga", "Playfair Display", Georgia, serif;
    --gem-font-script: "above-the-beyond", "AboveTheBeyond", cursive;

    /* -- ROUNDED-BOX LANGUAGE (light/interface surfaces only) --------------- */
    --gem-r-xl: 26px;
    --gem-r-lg: 20px;
    --gem-r-md: 15px;
    --gem-r-sm: 11px;

    --gem-shadow-s: 0 2px 10px rgba(9, 9, 96, .05);
    --gem-shadow-m: 0 12px 32px rgba(9, 9, 96, .09);
    --gem-shadow-l: 0 26px 60px rgba(9, 9, 96, .13);

    /* -- SPACING (rule 5) --------------------------------------------------- */
    --gem-sp-2: 8px;
    --gem-sp-3: 12px;
    --gem-sp-4: 16px;
    --gem-sp-6: 24px;
    --gem-sp-8: 32px;
    --gem-sp-12: 48px;
    --gem-sp-16: 64px;
    --gem-sp-24: 96px;

    /* -- CONTAINER ----------------------------------------------------------
       Content sits --pad off the viewport edge until the page exceeds --shell,
       then it centres. --gem-gut is the matching gutter for full-bleed
       elements whose contents must still land on the content bound; it is
       valid ONLY on elements that span the full width, since the 50% resolves
       against the element's own box. max() guards the narrow case: a bare
       calc() goes negative below --shell, which is invalid CSS and silently
       drops the whole padding declaration. */
    --gem-shell: 1720px;
    --gem-pad: 72px;
    --gem-gut: max(var(--gem-pad), calc(50% - var(--gem-shell) / 2 + var(--gem-pad)));

    --gem-ease: cubic-bezier(.16, 1, .3, 1);
}

@media (max-width: 1040px) {
    :root { --gem-pad: 40px; }
}

@media (max-width: 760px) {
    :root { --gem-pad: 22px; }
}

/* ---------------------------------------------------------------------------
   RULE 1 — TYPE BY GROUND
   Light ground gets Quasimoda, maroon ground gets Alga. Expressed as surface
   classes so a template opts in by naming the ground, not by picking a font.
   --------------------------------------------------------------------------- */
.gem-ds {
    font-family: var(--gem-font-sans);
    color: var(--gem-ink);
}

.gem-ds .gem-display,
.gem-ds h1,
.gem-ds h2 {
    font-family: var(--gem-font-sans);
    letter-spacing: -.02em;
}

/* On a maroon ground the display face takes over, per rule 1. */
.gem-on-maroon,
.gem-on-maroon h1,
.gem-on-maroon h2,
.gem-on-maroon h3,
.gem-on-maroon .gem-display {
    font-family: var(--gem-font-display);
    color: #fff;
}

.gem-script {
    font-family: var(--gem-font-script);
    color: var(--gem-gold-lt);
}

/* Gold text on a light ground must be the deepened value. Rule 3. */
.gem-ds .gem-gold-text {
    color: var(--gem-gold-text);
}

/* ---------------------------------------------------------------------------
   RULE 5 — SECTION RHYTHM
   The site's own convention. Do not invent a competing scale.
   --------------------------------------------------------------------------- */
.gem-sec {
    padding: var(--gem-sp-24) 0;
}

.gem-sec-lead {
    max-width: 640px;
    margin-bottom: 44px;
}

.gem-sec-lead h2 {
    margin: 0 0 var(--gem-sp-3);
}

.gem-sec-lead p {
    margin: 0;
    color: var(--gem-slate);
}

/* Sub-module headings step down from the movement openers (FAQ, best
   sellers, reviews), which keep the full display size. */
.gem-sec-lead--sub h2 {
    font-size: 2rem;
}

.gem-shell {
    max-width: var(--gem-shell);
    margin-inline: auto;
    padding-inline: var(--gem-pad);
}

/* ---------------------------------------------------------------------------
   RULE 2 — THE PLAQUE RULE
   Maroon surfaces are ARTIFACTS: 45 degree chamfered corners with a gold
   keyline tracing the chamfer. Light surfaces are INTERFACE: rounded.

   The keyline cannot be a border — a border cannot bend around a chamfer — so
   it is eight background layers on a pseudo-element: four straight runs that
   stop short of each corner, plus four 45 degree diagonal segments that cross
   the cut. The runs start at 19.6px so they meet the diagonals cleanly.

   The clip-path removes the drop shadow as a side effect. That is embraced,
   not a bug: plaques sit printed-flat while interface floats.
   --------------------------------------------------------------------------- */
.gem-plaque {
    position: relative;
    background: linear-gradient(150deg, var(--gem-maroon-mid), var(--gem-maroon));
    color: #fff;
    border-radius: 0;
    clip-path: polygon(
        26px 0, calc(100% - 26px) 0,
        100% 26px, 100% calc(100% - 26px),
        calc(100% - 26px) 100%, 26px 100%,
        0 calc(100% - 26px), 0 26px
    );
}

.gem-plaque::after {
    content: "";
    position: absolute;
    inset: 11px;
    pointer-events: none;
    background:
        linear-gradient(rgba(234, 198, 110, .6), rgba(234, 198, 110, .6)) 19.6px 0/calc(100% - 39.2px) 2px no-repeat,
        linear-gradient(rgba(234, 198, 110, .6), rgba(234, 198, 110, .6)) 19.6px 100%/calc(100% - 39.2px) 2px no-repeat,
        linear-gradient(rgba(234, 198, 110, .6), rgba(234, 198, 110, .6)) 0 19.6px/2px calc(100% - 39.2px) no-repeat,
        linear-gradient(rgba(234, 198, 110, .6), rgba(234, 198, 110, .6)) 100% 19.6px/2px calc(100% - 39.2px) no-repeat,
        linear-gradient(135deg, transparent calc(50% - 1.4px), rgba(234, 198, 110, .6) calc(50% - 1.4px) calc(50% + 1.4px), transparent calc(50% + 1.4px)) 0 0/20.6px 20.6px no-repeat,
        linear-gradient(225deg, transparent calc(50% - 1.4px), rgba(234, 198, 110, .6) calc(50% - 1.4px) calc(50% + 1.4px), transparent calc(50% + 1.4px)) 100% 0/20.6px 20.6px no-repeat,
        linear-gradient(45deg, transparent calc(50% - 1.4px), rgba(234, 198, 110, .6) calc(50% - 1.4px) calc(50% + 1.4px), transparent calc(50% + 1.4px)) 0 100%/20.6px 20.6px no-repeat,
        linear-gradient(315deg, transparent calc(50% - 1.4px), rgba(234, 198, 110, .6) calc(50% - 1.4px) calc(50% + 1.4px), transparent calc(50% + 1.4px)) 100% 100%/20.6px 20.6px no-repeat;
}

@media (max-width: 760px) {
    .gem-plaque {
        clip-path: polygon(
            16px 0, calc(100% - 16px) 0,
            100% 16px, 100% calc(100% - 16px),
            calc(100% - 16px) 100%, 16px 100%,
            0 calc(100% - 16px), 0 16px
        );
    }
}

/* Light surfaces are interface: rounded, and they float. */
.gem-card {
    background: #fff;
    border: 1px solid var(--gem-line);
    border-radius: var(--gem-r-lg);
    box-shadow: var(--gem-shadow-s);
}

.gem-card--raised {
    box-shadow: var(--gem-shadow-m);
}

/* ---------------------------------------------------------------------------
   RULE 3 — BUTTONS
   --------------------------------------------------------------------------- */
.gem-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--gem-sp-2);
    padding: 15px 30px;
    border: 0;
    border-radius: 999px;
    font-family: var(--gem-font-sans);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform .25s var(--gem-ease), box-shadow .25s var(--gem-ease);
}

.gem-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--gem-shadow-m);
}

/* Gold gradient, white text. Settled — see rule 3. */
.gem-btn--gold {
    background: var(--gem-gold-grad);
    color: #fff;
}

.gem-btn--navy {
    background: var(--gem-navy);
    color: #fff;
}

.gem-btn--ghost {
    background: transparent;
    color: var(--gem-navy);
    box-shadow: inset 0 0 0 2px var(--gem-line);
}

.gem-btn--ghost:hover {
    box-shadow: inset 0 0 0 2px var(--gem-navy);
}

/* Author display rules and the image reset both defeat the [hidden]
   attribute inside designer markup. Restore it explicitly — this has bitten
   more than once. */
.gem-ds [hidden] {
    display: none !important;
}

/* ---------------------------------------------------------------------------
   MEMBER PRICING (buy box)
   Values lifted from the approved mockup's .mem-price / .mem-join / .mem-note.
   The join link uses --gem-gold-text, not --gem-gold: this is small text on
   white, where both brand golds fail contrast. See rule 3.

   Only the guest state is styled. A logged-in member should instead see one
   price plus a "Member price applied" pill with no savings language — wire
   that through the gem_awards_member_price_html filter once the membership
   plugin exposes a dependable "is this user an active member" check.
   --------------------------------------------------------------------------- */
.gem-memberprice {
    display: block;
    margin-top: var(--gem-sp-3);
    font-family: var(--gem-font-sans);
    line-height: 1.35;
}

.gem-memberprice__amount {
    display: block;
    font-weight: 700;
    font-size: 1.04rem;
    letter-spacing: -.01em;
    color: var(--gem-navy);
}

.gem-memberprice__join {
    display: inline-block;
    margin-top: 3px;
    font-weight: 600;
    font-size: .93rem;
    color: var(--gem-gold-text);
    text-decoration: none;
}

.gem-memberprice__join:hover {
    text-decoration: underline;
}

.gem-memberprice__note {
    display: block;
    margin-top: 5px;
    font-size: .78rem;
    color: var(--gem-mist);
}
