/* Hahn Consent Gate — banner, preference center, floating button.

   Colours and radius come from CSS custom properties that the plugin prints
   inline from the Appearance settings (see HCG_Frontend::enqueue_styles). The
   var() fallbacks below are the packaged defaults, so this stylesheet still
   renders correctly on its own and a site needs no theme CSS to rebrand.

   Note the Reject button deliberately has no colour of its own: it is outlined
   with currentColor and inherits the surrounding text colour, so it stays as
   legible as Accept under any palette. Equal visual weight is a compliance
   decision (no dark patterns) — don't "fix" it by muting Reject. */

.hcg-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99998;
    background: var(--hcg-banner-bg, #1a1a1a);
    color: var(--hcg-banner-text, #fff);
    padding: 20px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
    font-size: 15px;
    line-height: 1.5;
}

/* ---- Banner position variants -------------------------------------------
   Default (no modifier needed) is the full-width bottom bar above. */

.hcg-banner--top {
    top: 0;
    bottom: auto;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.hcg-banner--bottom-left,
.hcg-banner--bottom-right,
.hcg-banner--center {
    left: auto;
    right: auto;
    width: min(380px, calc(100vw - 32px));
    border-radius: var(--hcg-radius, 4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hcg-banner--bottom-left  { left: 16px;  bottom: 16px; }
.hcg-banner--bottom-right { right: 16px; bottom: 16px; }

.hcg-banner--center {
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 32px));
}

/* Card layouts stack the text above the buttons instead of running in a row. */
.hcg-banner--bottom-left .hcg-banner__inner,
.hcg-banner--bottom-right .hcg-banner__inner,
.hcg-banner--center .hcg-banner__inner {
    flex-direction: column;
    align-items: stretch;
}

.hcg-banner--bottom-left .hcg-banner__text,
.hcg-banner--bottom-right .hcg-banner__text,
.hcg-banner--center .hcg-banner__text {
    flex: 1 1 auto;
}

.hcg-banner__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.hcg-banner__text { flex: 1 1 480px; }

.hcg-banner__heading {
    margin: 0 0 4px;
    font-weight: 700;
    font-size: 16px;
}

.hcg-banner__body { margin: 0; }

.hcg-banner__link {
    color: inherit;
    text-decoration: underline;
    margin-left: 6px;
}

.hcg-banner__actions {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

.hcg-btn {
    appearance: none;
    border: 1px solid currentColor;
    border-radius: var(--hcg-radius, 4px);
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: inherit;
}

/* Accept and Reject get equal visual weight on purpose (no dark patterns). */
.hcg-btn--accept {
    background: var(--hcg-banner-accept-bg, #fff);
    color: var(--hcg-banner-accept-text, #1a1a1a);
    border-color: var(--hcg-banner-accept-bg, #fff);
}

.hcg-btn:focus-visible {
    outline: 2px solid #7ab8ff;
    outline-offset: 2px;
}

.hcg-prefs {
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.hcg-prefs__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.hcg-prefs__panel {
    position: relative;
    max-width: 520px;
    margin: 8vh auto 0;
    background: var(--hcg-panel-bg, #fff);
    color: var(--hcg-panel-text, #1a1a1a);
    border-radius: calc(var(--hcg-radius, 4px) * 2);
    padding: 28px;
    font-size: 15px;
    line-height: 1.55;
    max-height: 80vh;
    overflow-y: auto;
}

/* Reject inherits the panel's text colour via currentColor — no override
   needed. Accept is re-coloured for the panel's own background. */
.hcg-prefs__panel .hcg-btn--accept {
    background: var(--hcg-panel-accept-bg, #1a1a1a);
    color: var(--hcg-panel-accept-text, #fff);
    border-color: var(--hcg-panel-accept-bg, #1a1a1a);
}

.hcg-prefs__close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: 0;
    background: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}

.hcg-prefs__heading { margin: 0 0 12px; font-size: 20px; }

/* Text inherits the panel colour rather than being pinned dark, so a site that
   sets a dark preference center only has to darken the two GPC swatches. */
.hcg-prefs__gpc {
    background: var(--hcg-gpc-bg, #eef6ee);
    border: 1px solid var(--hcg-gpc-border, #bcd9bc);
    border-radius: var(--hcg-radius, 4px);
    padding: 10px 12px;
    color: inherit;
}

.hcg-prefs__actions {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}

.hcg-prefs__links a {
    color: inherit;
    text-decoration: underline;
    margin-right: 14px;
}

.hcg-float {
    position: fixed;
    z-index: 99997;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 999px;
    background: var(--hcg-panel-bg, #fff);
    color: var(--hcg-panel-text, #1a1a1a);
    font-size: 13px;
    padding: 8px 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* GPC confirmation. Centred rather than cornered on purpose: the floating
   button can sit in any of the four corners, and a GPC visitor never sees the
   banner, so the middle is the one spot guaranteed to be free. */
.hcg-gpc-confirm {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 99996;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: min(420px, calc(100vw - 32px));
    background: var(--hcg-panel-bg, #fff);
    color: var(--hcg-panel-text, #1a1a1a);
    border: 1px solid var(--hcg-gpc-border, #bcd9bc);
    border-left: 3px solid var(--hcg-gpc-border, #bcd9bc);
    border-radius: var(--hcg-radius, 4px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
}

.hcg-gpc-confirm__close {
    border: 0;
    background: none;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    flex: 0 0 auto;
}

.hcg-float--bottom-left  { left: 16px;  bottom: 16px; }
.hcg-float--bottom-right { right: 16px; bottom: 16px; }
.hcg-float--top-left     { left: 16px;  top: 16px; }
.hcg-float--top-right    { right: 16px; top: 16px; }

@media (max-width: 640px) {
    .hcg-banner__actions { width: 100%; }
    .hcg-btn { flex: 1; }

    /* Cards go full-width on small screens rather than floating in a corner. */
    .hcg-banner--bottom-left,
    .hcg-banner--bottom-right,
    .hcg-banner--center {
        left: 8px;
        right: 8px;
        bottom: 8px;
        top: auto;
        width: auto;
        transform: none;
    }
}
