/*
Theme Name: PS Rewards
Theme URI: https://psrewards.com.au
Author: Syfre
Description: Block theme for the PS Rewards marketing site. Design tokens live in theme.json.
Version: 0.1.0
Requires at least: 6.7
Tested up to: 6.7
Requires PHP: 8.2
License: Proprietary
Text Domain: psrewards
*/

/* Block themes style via theme.json. Keep this file for the header and for the
   few rules that genuinely cannot be expressed as tokens. */

/* ---------------------------------------------------------------------------
   Header — measured on psrewards.com.au (ConsumerHeader.tsx): white bar with a
   1px 45%-divider rule; toolbar 84px min-height, padding 8/16 (xs) 10/24 (sm)
   16/32 (lg); logo 30px tall to sm, 36 from sm; Inter 500 nav links from the lg
   breakpoint (1200px), a 40px hamburger and a 280px right-hand drawer below it.
   --------------------------------------------------------------------------- */

.psr-header {
    border-bottom: 1px solid rgba(226, 232, 240, .45);
}

/* The toolbar's inset is the whole inset — no root padding on top of it. */
.psr-header.has-global-padding { padding-inline: 0; }
.psr-header { padding-top: 8px !important; padding-bottom: 8px !important; }
@media (min-width: 600px)  { .psr-header { padding-top: 10px !important; padding-bottom: 10px !important; } }
@media (min-width: 1200px) { .psr-header { padding-top: 16px !important; padding-bottom: 16px !important; } }

.psr-header__bar {
    box-sizing: border-box;
    gap: 1rem;
    min-height: 68px;
    padding-inline: 16px;
    flex-wrap: nowrap !important;
}
@media (min-width: 600px)  { .psr-header__bar { min-height: 64px; padding-inline: 24px; } }
@media (min-width: 1200px) { .psr-header__bar { min-height: 80px; padding-inline: 32px; } }   /* logo link minHeight lg 80 */

.psr-header .custom-logo { height: 30px; width: auto; display: block; }
@media (min-width: 600px) { .psr-header .custom-logo { height: 36px; } }

.psr-header__nav {
    display: none !important;
    gap: 24px;
    align-items: center;
}
@media (min-width: 1200px) { .psr-header__nav { display: flex !important; } }

.psr-header__nav p { margin: 0; }

.psr-header__nav a {
    display: inline-block;
    padding: 4px 10px;
    font-family: var(--wp--preset--font-family--nav, Inter, system-ui, sans-serif);
    font-size: 1rem;
    font-weight: 500;
    line-height: 28px;
    color: var(--wp--preset--color--text, #0F172A);
    text-decoration: none;
    border-radius: 8px;
}

.psr-header__nav a:hover { background: rgba(15, 23, 42, .04); text-decoration: none; }

/* Hamburger: MUI IconButton, 40px, 8px padding, 24px glyph. */
.psr-nav-toggle {
    appearance: none; border: 0; background: transparent; cursor: pointer;
    width: 40px; height: 40px; padding: 8px; border-radius: 50%;
    color: var(--wp--preset--color--text, #0F172A);
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: auto;
}
.psr-nav-toggle:hover { background: rgba(15, 23, 42, .04); }
@media (min-width: 1200px) { .psr-nav-toggle { display: none; } }

/* Drawer: 280px, right, rgb(248,250,249), 16px above the list and 24 below; items
   48px tall with 8/16 padding, Inter 500 16px; 20% backdrop. */
.psr-drawer { position: fixed; inset: 0; z-index: 1200; }
.psr-drawer[hidden] { display: none; }
.psr-drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .2); opacity: 0; transition: opacity .2s ease; }
.psr-drawer__panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: 280px; max-width: calc(100vw - 56px);
    background: rgb(248, 250, 249);
    box-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12);
    padding: 16px 0 24px;
    transform: translateX(100%); transition: transform .225s cubic-bezier(0, 0, .2, 1);
    overflow-y: auto;
}
.psr-drawer.is-open .psr-drawer__backdrop { opacity: 1; }
.psr-drawer.is-open .psr-drawer__panel { transform: none; }
.psr-drawer__list { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.psr-drawer__link {
    box-sizing: border-box;
    display: flex; align-items: center; min-height: 48px; padding: 8px 16px;
    font-family: var(--wp--preset--font-family--nav, Inter, system-ui, sans-serif);
    font-size: 1rem; font-weight: 500; line-height: 1.5;
    color: var(--wp--preset--color--text, #0F172A); text-decoration: none; border-radius: 8px;
}
.psr-drawer__link:hover { background: rgba(15, 23, 42, .04); text-decoration: none; }
html.psr-drawer-open { overflow: hidden; }

/* ---------------------------------------------------------------------------
   Footer — measured on psrewards.com.au (ConsumerFooter.tsx): 2 columns to md,
   4 from md; gap 32 / 40 / 24; inset 24 (xs) 32 (sm); 40/56 above, 32/40 below;
   600 headings in brand-dark, underlined brand links, 40/52px logo 48/64 below.
   --------------------------------------------------------------------------- */

.psr-footer.has-global-padding { padding-inline: 0; }
.psr-footer { padding-top: 40px !important; padding-bottom: 32px !important; }
@media (min-width: 600px) { .psr-footer { padding-top: 56px !important; padding-bottom: 40px !important; } }

.psr-footer__cols {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    padding-inline: 24px;
    text-align: center;
}
@media (min-width: 600px) { .psr-footer__cols { gap: 40px; padding-inline: 32px; } }
@media (min-width: 900px) { .psr-footer__cols { grid-template-columns: repeat(4, 1fr); gap: 24px; } }
.psr-footer__cols > .wp-block-column { flex: none !important; flex-basis: auto !important; margin: 0 !important; }

.psr-footer__heading,
.psr-footer__heading a {
    display: block;
    color: var(--wp--preset--color--brand-dark, #00A85F);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    margin: 0 0 12px;
}

.psr-footer__heading a:hover { text-decoration: underline; }

.psr-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.psr-footer__links a {
    color: var(--wp--preset--color--brand, #01BF70);
    font-size: 1rem;
    text-decoration: underline;
}

.psr-footer__base { margin-top: 48px; text-align: center; }
@media (min-width: 600px) { .psr-footer__base { margin-top: 64px; } }
.psr-footer__base .custom-logo { height: 40px; width: auto; margin-inline: auto; display: block; }
@media (min-width: 600px) { .psr-footer__base .custom-logo { height: 52px; } }
.psr-footer__legal {
    color: var(--wp--preset--color--brand-dark, #00A85F);
    font-size: 0.75rem;
    line-height: 1.6;
    max-width: 320px;
    margin: 12px auto 0;
}

/* Social row. One size for every icon — set here, not per icon, which is how the
   old build ended up with mismatched sizes (Chris #5). */
/* Four icons (live has three; Facebook came from Chris's signature) fit the 155px
   phone column at an 8px gap; 12px from sm as on the live site. */
.psr-social {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}
@media (min-width: 600px) { .psr-social { gap: 12px; } }

.psr-social img {
    width: 32px;
    height: 32px;
    display: block;
}

.psr-social a:hover img { opacity: .75; }

/* Store badges — the live outlined AppStoreBadges: white, 1px #111 border, radius 12,
   6px 12px padding, 6px gap, 0.875rem/600, stacked 8px apart. Both marks are one size
   (22px) rather than the live 24 / 20×22 mismatch (Chris #5). */
.psr-store-badges {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.psr-store-badges a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #111;
    border-radius: 12px;
    background: #fff;
    color: #111;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: nowrap;
}

.psr-store-badges a:hover { background: #fff; text-decoration: none; }

.psr-store-badges img,
.psr-store-badges svg { width: 22px; height: 22px; display: block; flex: none; }

/* ---------------------------------------------------------------------------
   Block styles
   --------------------------------------------------------------------------- */

/* Chris's item #6: "Remove the scribble underneath the text on the Business page."
   It is a style variation rather than baked into the markup, so he can toggle it
   off himself in the editor instead of raising a ticket. */
.is-style-underline-stroke {
    position: relative;
    display: inline-block;
}

.is-style-underline-stroke::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.12em;
    height: 0.14em;
    background: var(--wp--preset--color--brand, #01BF70);
    border-radius: 999px;
    transform: rotate(-0.6deg);
}

.is-style-sketch-arrow { position: relative; }

.wp-block-button.is-style-outline-pill .wp-block-button__link {
    background: transparent;
    color: var(--wp--preset--color--text, #0F172A);
    border: 2px solid rgba(15, 23, 42, .35);
}

.wp-block-button.is-style-outline-pill .wp-block-button__link:hover {
    border-color: rgba(15, 23, 42, .5);
    background: rgba(15, 23, 42, .04);
}

/* ---------------------------------------------------------------------------
   Campaign terms — /promotions/{campaignId}/terms
   Mirrors the frame the retired Next.js CampaignTermsRenderer used: dark green
   hero band, cream page, white body card. Colours reference theme.json tokens
   where they exist; the cream is specific to the legal/terms pages.
   --------------------------------------------------------------------------- */

.psr-campaign-terms {
    --psr-cream: #FFF8F0;
    background: var(--psr-cream);
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) clamp(3rem, 7vw, 5rem);
}

.psr-campaign-terms__band {
    max-width: 860px;
    margin: 0 auto clamp(2rem, 4vw, 3rem);
    padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1.5rem, 4vw, 3rem);
    background: var(--wp--preset--color--hero-dark, #024638);
    border-radius: 24px;
    color: #fff;
}

.psr-campaign-terms__eyebrow {
    margin: 0 0 .5rem;
    font-size: var(--wp--preset--font-size--sm, .875rem);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--wp--preset--color--brand-light, #00BF6F);
}

.psr-campaign-terms__band h1 {
    margin: 0;
    color: #fff;
    font-size: var(--wp--preset--font-size--heading-2, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.psr-campaign-terms__body {
    max-width: 860px;
    margin: 0 auto;
    padding: clamp(1.75rem, 4vw, 3rem);
    background: #fff;
    border-radius: 24px;
    color: rgba(2, 70, 56, 0.85);
    line-height: 1.7;
}

.psr-campaign-terms__body > :first-child { margin-top: 0; }
.psr-campaign-terms__body > :last-child  { margin-bottom: 0; }

.psr-campaign-terms__body h2,
.psr-campaign-terms__body h3 {
    color: var(--wp--preset--color--hero-dark, #024638);
    margin-top: 2em;
}

.psr-campaign-terms__body a {
    color: var(--wp--preset--color--brand-dark, #00A85F);
}

.psr-campaign-terms__body ol,
.psr-campaign-terms__body ul { padding-left: 1.25em; }

.psr-campaign-terms__body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.psr-campaign-terms__body th,
.psr-campaign-terms__body td {
    border: 1px solid var(--wp--preset--color--divider, #E2E8F0);
    padding: .6em .8em;
    text-align: left;
}

/* ---------------------------------------------------------------------------
   Forms — measured on psrewards.com.au/contact (ContactFormSection.tsx): filled
   #f1f1f1 inputs, radius 16, 0.8rem text, placeholders instead of labels, 10px
   between fields, 0.75rem pill submit.
   --------------------------------------------------------------------------- */

.psr-form { max-width: 760px; }

.psr-form__field { display: block; margin: 0 0 10px; }

.psr-form__field input,
.psr-form__field textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 9.5px 24px;
    border: 0;
    border-radius: 16px;
    background: #f1f1f1;
    font: inherit;
    font-size: 0.8rem;
    line-height: 23px;
    height: 42px;
    color: var(--wp--preset--color--text, #0F172A);
    transition: background .2s ease;
}

.psr-form__field textarea { padding: 8px 24px; height: 108px; min-height: 0; resize: vertical; }

.psr-form__field input::placeholder,
.psr-form__field textarea::placeholder { color: rgba(15, 23, 42, .55); opacity: 1; }

.psr-form__field input:hover,
.psr-form__field textarea:hover,
.psr-form__field input:focus-visible,
.psr-form__field textarea:focus-visible { background: #ededed; outline: none; }

.psr-form__fieldset { border: 0; padding: 0; margin: 4px 0 0; }

.psr-form__fieldset legend {
    font-size: 0.8rem;
    color: var(--wp--preset--color--text-secondary, #64748B);
    margin-bottom: 4px;
    padding: 0;
}

.psr-form__fieldset label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;                 /* MUI's small Radio touch target */
    margin-right: 16px;
    font-size: 0.8rem;
    color: var(--wp--preset--color--text-secondary, #64748B);
}

.psr-form__fieldset input[type="radio"] { accent-color: var(--wp--preset--color--brand, #01BF70); width: 18px; height: 18px; margin: 0; }

/* Honeypot. Hidden from people, still in the DOM for bots to fill.
   Not display:none and not type=hidden — bots skip both. */
.psr-form__trap {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.psr-form__actions { margin: 16px 0 0; }   /* form gap 10 + the button's own 6 */

.psr-form__submit {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 8px 20px;
    background: var(--wp--preset--color--brand, #01BF70);
    color: #fff;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.75;
    cursor: pointer;
    transition: background .2s ease;
}

.psr-form__submit:hover:not(:disabled) { background: var(--wp--preset--color--brand-dark, #00A85F); }

.psr-form__submit:disabled { background: rgba(0, 0, 0, .12); color: rgba(0, 0, 0, .26); cursor: not-allowed; }

.psr-form__status:empty { display: none; }

.psr-form__status {
    margin: 0 0 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.psr-form__status.is-error {
    background: #FEF0F0;
    color: #632D2D;
    border: 1px solid #F8B7B7;
}

.psr-form__done {
    padding: 20px;
    border-radius: 12px;
    background: #EAFAF4;
    border: 1px solid #A4E4CF;
    color: #14543D;
}

/* ---------------------------------------------------------------------------
   FAQ — core/details, so no JS and the client owns the content
   --------------------------------------------------------------------------- */

.psr-faq__item {
    border-bottom: 1px solid var(--wp--preset--color--divider, #E2E8F0);
    padding: 1.25rem 0;
}

.psr-faq__item summary {
    cursor: pointer;
    font-weight: 600;
    font-size: var(--wp--preset--font-size--lg);
    color: var(--wp--preset--color--brand, #01BF70);
    list-style: none;
}

.psr-faq__item summary::-webkit-details-marker { display: none; }

.psr-faq__item summary::after {
    content: "＋";
    float: right;
    font-weight: 400;
    transition: transform .2s ease;
}

.psr-faq__item[open] summary::after { content: "－"; }

.psr-faq__item p { margin-top: 1rem; line-height: 1.7; }

/* ---------------------------------------------------------------------------
   Logo strip
   --------------------------------------------------------------------------- */

.psr-logo-strip__logos { align-items: center; margin-top: 2rem; }
.psr-logo-strip__logos img { filter: grayscale(1); opacity: .7; transition: all .2s ease; }
.psr-logo-strip__logos img:hover { filter: none; opacity: 1; }

@media (max-width: 781px) {
    .psr-logo-strip__logos {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 1.5rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .psr-logo-strip__logos figure { flex: 0 0 auto; scroll-snap-align: center; }
}

/* Visually hidden, available to assistive tech (form labels behind placeholders). */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
