/*
Theme Name: gamblingproblem.net
Theme URI: https://gamblingproblem.net
Author: gamblingproblem.net editorial
Description: Custom warm, compassionate, accessible theme for a problem-gambling help and information resource. System-font delivery, no external requests.
Version: 1.0.0
Requires at least: 6.8
Tested up to: 6.9
Requires PHP: 8.1
License: Proprietary
Text Domain: gpn
*/

/* =========================================================================
   Design tokens
   Palette family: clay / terracotta (warm sand). Font delivery: system.
   ========================================================================= */
:root {
  --gp-sand:        #e2c7a8;   /* primary warm background */
  --gp-sand-deep:   #d4b593;   /* alt warm block */
  --gp-sand-soft:   #ecddc8;   /* faint tint */
  --gp-paper:       #fcf9f5;   /* light section background */
  --gp-ink:         #33282320;/* (unused placeholder) */
  --gp-ink-1:       #3a2e2a;   /* primary text */
  --gp-ink-2:       #5d4f47;   /* secondary text (AA on sand/paper) */
  --gp-clay:        #b56e4c;   /* accent / borders / icon */
  --gp-clay-strong: #8f4a2a;   /* CTA background — white text AA */
  --gp-clay-deep:   #7a3d22;   /* CTA hover */
  --gp-crisis:      #8c3d3d;   /* crisis bar / urgent */
  --gp-crisis-deep: #6f2f2f;
  --gp-line:        rgba(58,46,42,0.14);
  --gp-white:       #ffffff;

  /* type — system stacks (zero web-font load) */
  --gp-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --gp-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* spacing / radius */
  --gp-r-sm: 12px;
  --gp-r-md: 20px;
  --gp-r-lg: 32px;
  --gp-r-pill: 999px;
  --gp-wrap: 1120px;
  --gp-shadow: 0 18px 40px -24px rgba(58,46,42,0.5);

  /* motion personality — "settle": gentle, slightly slow, never snappy */
  --gp-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gp-dur: 460ms;
  --gp-dur-fast: 220ms;
}

/* =========================================================================
   Base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--gp-sans);
  font-size: 1.075rem;
  line-height: 1.7;
  color: var(--gp-ink-1);
  background: var(--gp-sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--gp-serif); line-height: 1.18; letter-spacing: -0.01em; color: var(--gp-ink-1); font-weight: 600; margin: 0 0 .5em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); }
p { margin: 0 0 1.1em; }
a { color: var(--gp-clay-deep); text-underline-offset: .18em; }
img, svg { max-width: 100%; height: auto; }
strong { font-weight: 700; }

/* Layer-0 cheap wins (identity details) */
::selection { background: var(--gp-clay); color: #fff; }
:focus-visible { outline: 3px solid var(--gp-clay-strong); outline-offset: 2px; border-radius: 4px; }
:root { accent-color: var(--gp-clay-strong); scrollbar-color: var(--gp-clay) var(--gp-sand-soft); }
ul { padding-left: 1.15em; }
li::marker { color: var(--gp-clay); }
hr.gp-rule { border: 0; height: 2px; width: 64px; margin: 2rem 0; background: repeating-linear-gradient(90deg, var(--gp-clay) 0 10px, transparent 10px 18px); }

.gp-container { width: 100%; max-width: var(--gp-wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.5rem); }
.gp-section { padding-block: clamp(3.2rem, 7vw, 6rem); }
.gp-bg-paper { background: var(--gp-paper); }
.gp-bg-sand { background: var(--gp-sand); }
.gp-bg-sand-deep { background: var(--gp-sand-deep); }
.gp-narrow { max-width: 760px; }
.gp-center { text-align: center; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--gp-ink-1); color:#fff; padding:.7rem 1.1rem; z-index: 200; border-radius: 0 0 var(--gp-r-sm) 0; }
.skip-link:focus { left: 0; }
.screen-reader-text { position:absolute; width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap; }

/* =========================================================================
   Crisis bar (persistent, sitewide)
   ========================================================================= */
.gp-crisisbar {
  background: var(--gp-crisis); color: #fff;
  font-size: .95rem; line-height: 1.4;
}
.gp-crisisbar__inner {
  display: flex; flex-wrap: wrap; gap: .35rem 1.6rem; align-items: center; justify-content: center;
  padding-block: .6rem; text-align: center;
}
.gp-crisisbar a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: .16em; }
.gp-crisisbar a:hover { text-decoration-thickness: 2px; }
.gp-crisisbar__item { display: inline-flex; align-items: center; gap: .45rem; }
.gp-crisisbar svg { width: 1.05em; height: 1.05em; flex: none; }

/* =========================================================================
   Header + nav
   ========================================================================= */
.gp-header { background: var(--gp-paper); border-bottom: 1px solid var(--gp-line); position: sticky; top: 0; z-index: 100; }
.gp-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 78px; }
.gp-logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--gp-ink-1); }
.gp-logo svg { width: 40px; height: 40px; flex: none; }
.gp-logo__word { font-family: var(--gp-serif); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.gp-nav { display: flex; align-items: center; gap: 1.6rem; }
.gp-nav__link { color: var(--gp-ink-1); text-decoration: none; font-weight: 600; font-size: .98rem; }
.gp-nav__lang { display: inline-flex; align-items:center; gap: .35rem; padding: .5rem .9rem; border-radius: var(--gp-r-pill); background: var(--gp-sand); color: var(--gp-ink-1); text-decoration: none; font-weight: 700; font-size: .92rem; }
.gp-nav__lang svg { width: 1.05em; height: 1.05em; }
.gp-menu-toggle { display: none; background: none; border: 0; padding: .4rem; color: var(--gp-ink-1); cursor: pointer; }
.gp-menu-toggle svg { width: 30px; height: 30px; }

/* animated-underline link treatment (signature) */
.gp-nav__link { background-image: linear-gradient(var(--gp-clay), var(--gp-clay)); background-position: 0 100%; background-repeat: no-repeat; background-size: 0% 2px; padding-bottom: 3px; transition: background-size var(--gp-dur-fast) var(--gp-ease), color var(--gp-dur-fast) var(--gp-ease); }
.gp-nav__link:hover, .gp-nav__link:focus-visible, .gp-nav__link[aria-current] { color: var(--gp-clay-deep); background-size: 100% 2px; }

/* =========================================================================
   Buttons
   ========================================================================= */
.gp-btn { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--gp-sans); font-weight: 700; font-size: 1.05rem; line-height: 1; text-decoration: none; padding: 1rem 1.7rem; border-radius: var(--gp-r-pill); border: 2px solid transparent; cursor: pointer; transition: transform var(--gp-dur-fast) var(--gp-ease), box-shadow var(--gp-dur-fast) var(--gp-ease), background-color var(--gp-dur-fast) var(--gp-ease); }
.gp-btn svg { width: 1.15em; height: 1.15em; }
.gp-btn--primary { background: var(--gp-clay-strong); color: #fff; }
.gp-btn--primary:hover, .gp-btn--primary:focus-visible { background: var(--gp-clay-deep); transform: translateY(-2px); box-shadow: var(--gp-shadow); }
.gp-btn--ghost { background: var(--gp-paper); color: var(--gp-ink-1); border-color: var(--gp-line); }
.gp-btn--ghost:hover, .gp-btn--ghost:focus-visible { border-color: var(--gp-clay); transform: translateY(-2px); }
.gp-btn:active { transform: translateY(0) scale(.99); }
.gp-btn--onclay { background: #fff; color: var(--gp-clay-deep); }

/* =========================================================================
   Hero
   ========================================================================= */
.gp-hero { position: relative; overflow: hidden; background: var(--gp-sand); padding-block: clamp(3.5rem, 8vw, 7rem); }
.gp-hero__deco { position: absolute; top: -60px; right: -80px; width: 420px; max-width: 60%; opacity: .16; pointer-events: none; color: var(--gp-ink-1); }
.gp-hero__inner { position: relative; z-index: 1; max-width: 880px; margin-inline: auto; text-align: center; }
.gp-eyebrow { display: inline-flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.5); padding: .5rem 1rem; border-radius: var(--gp-r-pill); font-weight: 700; font-size: .92rem; margin-bottom: 1.6rem; }
.gp-eyebrow svg { width: 1.1em; height: 1.1em; color: var(--gp-clay-strong); }
.gp-hero__lead { font-family: var(--gp-serif); font-size: clamp(1.15rem, 2.3vw, 1.5rem); color: var(--gp-ink-2); max-width: 620px; margin: 0 auto 2rem; }
.gp-hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* =========================================================================
   Reassurance cards
   ========================================================================= */
.gp-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.gp-card { background: var(--gp-sand); border: 1px solid var(--gp-line); border-radius: var(--gp-r-lg); padding: 2.2rem; }
.gp-card--paper { background: var(--gp-paper); }
.gp-card--deep { background: var(--gp-sand-deep); }
.gp-card__ic { width: 56px; height: 56px; border-radius: var(--gp-r-md); background: rgba(255,255,255,.55); display: grid; place-items: center; margin-bottom: 1.1rem; color: var(--gp-clay-strong); }
.gp-card__ic svg { width: 28px; height: 28px; }
.gp-card p:last-child { margin-bottom: 0; color: var(--gp-ink-2); }

/* =========================================================================
   Self-check teaser + assessment
   ========================================================================= */
.gp-check__card { background: var(--gp-paper); border-radius: var(--gp-r-lg); padding: clamp(1.8rem, 4vw, 3.2rem); box-shadow: var(--gp-shadow); max-width: 780px; margin-inline: auto; }
.gp-q { background: var(--gp-sand-soft); border-radius: var(--gp-r-md); padding: 1.5rem 1.6rem; margin-bottom: 1.2rem; }
.gp-q__text { font-family: var(--gp-serif); font-size: 1.2rem; margin-bottom: 1rem; }
.gp-choices { display: flex; flex-wrap: wrap; gap: .7rem; }
.gp-choice { font: inherit; font-weight: 700; padding: .7rem 1.5rem; border-radius: var(--gp-r-pill); background: #fff; border: 2px solid var(--gp-line); cursor: pointer; transition: border-color var(--gp-dur-fast) var(--gp-ease), background var(--gp-dur-fast) var(--gp-ease); }
.gp-choice:hover { border-color: var(--gp-clay); }
.gp-choice[aria-pressed="true"] { background: var(--gp-clay-strong); color: #fff; border-color: var(--gp-clay-strong); }
.gp-check__result { margin-top: 1.4rem; padding: 1.3rem 1.5rem; border-radius: var(--gp-r-md); background: var(--gp-sand); border: 1px solid var(--gp-line); }
.gp-note { font-size: .9rem; color: var(--gp-ink-2); }

/* =========================================================================
   Help paths
   ========================================================================= */
.gp-paths__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.gp-path { background: var(--gp-sand); border: 1px solid var(--gp-line); border-radius: var(--gp-r-lg); padding: 2rem; display: flex; flex-direction: column; transition: transform var(--gp-dur) var(--gp-ease), box-shadow var(--gp-dur) var(--gp-ease), border-color var(--gp-dur) var(--gp-ease); }
.gp-path:hover { transform: translateY(-4px); box-shadow: var(--gp-shadow); border-color: var(--gp-clay); }
.gp-path__ic { color: var(--gp-clay-strong); margin-bottom: 1rem; }
.gp-path__ic svg { width: 34px; height: 34px; }
.gp-path p { color: var(--gp-ink-2); }
.gp-path__more { margin-top: auto; font-weight: 700; color: var(--gp-clay-deep); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.gp-path__more svg { width: 1.1em; height: 1.1em; transition: transform var(--gp-dur-fast) var(--gp-ease); }
.gp-path:hover .gp-path__more svg { transform: translateX(4px); }

/* =========================================================================
   Hope block — SIGNATURE MOMENT: "steadying breath" ring (grounding motif)
   ========================================================================= */
.gp-hope { position: relative; text-align: center; }
.gp-hope__ring { position: relative; width: 120px; height: 120px; margin: 0 auto 1.6rem; display: grid; place-items: center; }
.gp-hope__ring::before, .gp-hope__ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--gp-clay); opacity: .5; }
.gp-hope__ring svg { width: 46px; height: 46px; color: var(--gp-clay-strong); position: relative; }
.gp-hope__quote { font-family: var(--gp-serif); font-size: clamp(1.4rem, 3vw, 2.1rem); max-width: 720px; margin-inline: auto; }
.gp-hope__stat { font-weight: 700; color: var(--gp-clay-deep); }

/* =========================================================================
   Sources / trust
   ========================================================================= */
.gp-sources { border: 1px solid var(--gp-line); border-radius: var(--gp-r-lg); padding: clamp(1.6rem, 4vw, 2.6rem); background: var(--gp-paper); }
.gp-sources__list { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.gp-sources__list li { font-weight: 700; color: var(--gp-ink-2); font-size: .95rem; }

/* =========================================================================
   Language CTA
   ========================================================================= */
.gp-langcta { background: var(--gp-clay-strong); color: #fff; text-align: center; }
.gp-langcta h2 { color: #fff; font-style: italic; }
.gp-langcta p { color: rgba(255,255,255,.92); max-width: 620px; margin-inline: auto; }

/* =========================================================================
   Article / page content (prose)
   ========================================================================= */
.gp-prose { max-width: 760px; }
.gp-prose h2 { margin-top: 2.2rem; }
.gp-prose h3 { margin-top: 1.6rem; }
.gp-prose ul, .gp-prose ol { margin: 0 0 1.1em; }
.gp-prose li { margin-bottom: .4rem; }
.gp-prose a { color: var(--gp-clay-deep); text-decoration: underline; }
.gp-prose blockquote { margin: 1.6rem 0; padding: 1rem 1.4rem; background: var(--gp-sand-soft); border-radius: var(--gp-r-md); font-family: var(--gp-serif); font-size: 1.15rem; }
.gp-pagehead { background: var(--gp-sand); padding-block: clamp(2.4rem, 5vw, 4rem); }
.gp-pagehead__inner { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.gp-pagehead__text { flex: 1 1 340px; }
.gp-pagehead__art { flex: 0 0 200px; width: 200px; border-radius: var(--gp-r-md); }
.gp-pagehead__hero { flex: 0 0 min(440px, 42%); width: min(440px, 42%); aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--gp-r-lg); box-shadow: var(--gp-shadow); }
.gp-hero__art { display: block; width: min(360px, 80%); margin: 2.2rem auto 0; border-radius: var(--gp-r-lg); }
.gp-hero__photo { display: block; width: min(720px, 100%); aspect-ratio: 3 / 2; object-fit: cover; margin: 2.4rem auto 0; border-radius: var(--gp-r-lg); box-shadow: var(--gp-shadow); }
@media (max-width: 700px) { .gp-pagehead__hero { flex-basis: 100%; width: 100%; } }
.gp-breadcrumb { font-size: .9rem; color: var(--gp-ink-2); margin-bottom: .8rem; }
.gp-breadcrumb a { color: var(--gp-ink-2); }

/* FAQ accordion */
.gp-faq { max-width: 760px; }
.gp-faq details { border: 1px solid var(--gp-line); border-radius: var(--gp-r-md); margin-bottom: .8rem; background: var(--gp-paper); overflow: hidden; }
.gp-faq summary { cursor: pointer; padding: 1.1rem 1.3rem; font-family: var(--gp-serif); font-size: 1.15rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.gp-faq summary h3 { margin: 0; font: inherit; color: inherit; display: inline; }
.gp-faq summary::-webkit-details-marker { display: none; }
.gp-faq summary::after { content: ""; width: 12px; height: 12px; border-right: 2px solid var(--gp-clay); border-bottom: 2px solid var(--gp-clay); transform: rotate(45deg); transition: transform var(--gp-dur-fast) var(--gp-ease); flex: none; }
.gp-faq details[open] summary::after { transform: rotate(-135deg); }
.gp-faq details > div { padding: 0 1.3rem 1.2rem; }

/* Resource directory cards */
.gp-res { border: 1px solid var(--gp-line); border-radius: var(--gp-r-md); padding: 1.5rem; background: var(--gp-paper); margin-bottom: 1rem; }
.gp-res__meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
.gp-tag { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .25rem .6rem; border-radius: var(--gp-r-sm); background: var(--gp-sand); color: var(--gp-ink-2); }
.gp-res__phone { font-family: var(--gp-serif); font-size: 1.3rem; font-weight: 700; color: var(--gp-clay-deep); text-decoration: none; }

/* =========================================================================
   Footer
   ========================================================================= */
.gp-footer { background: var(--gp-ink-1); color: rgba(255,255,255,.85); padding-block: clamp(3rem, 6vw, 5rem) 2.4rem; }
.gp-footer a { color: rgba(255,255,255,.75); text-decoration: none; }
.gp-footer a:hover { color: #fff; text-decoration: underline; }
.gp-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2.4rem; margin-bottom: 3rem; }
.gp-footer__brand svg { width: 34px; height: 34px; }
.gp-footer h4 { color: #fff; font-size: 1.05rem; margin-bottom: 1rem; }
.gp-footer ul { list-style: none; padding: 0; margin: 0; }
.gp-footer li { margin-bottom: .6rem; }
.gp-footer__helpline { text-align: center; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: var(--gp-r-md); padding: 1.1rem 1.4rem; display: inline-block; }
.gp-footer__helpline a { color: #fff; font-weight: 700; text-decoration: underline; }
.gp-footer__bottom { text-align: center; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.1); }
.gp-disclaimer { font-size: .82rem; color: rgba(255,255,255,.55); max-width: 720px; margin: 1.4rem auto 0; }
.gp-footer__legal { margin-top: 1rem; font-size: .82rem; color: rgba(255,255,255,.5); }
.gp-footer__legal a { color: rgba(255,255,255,.72); text-decoration: none; }
.gp-footer__legal a:hover { color: #fff; text-decoration: underline; }
.gp-footer__legal span { margin: 0 .2rem; color: rgba(255,255,255,.3); }

/* =========================================================================
   Reveal (signature) — below-the-fold only, transform+opacity, CLS-safe
   ========================================================================= */
@media (prefers-reduced-motion: no-preference) {
  /* Gated on html.js so no-JS users (and crawlers) always see full content. */
  html.js .gp-rise { opacity: 0; transform: translateY(18px); transition: opacity var(--gp-dur) var(--gp-ease), transform var(--gp-dur) var(--gp-ease); }
  html.js .gp-rise.is-in { opacity: 1; transform: none; }
  .gp-hope__ring::before { animation: gp-breathe 8s var(--gp-ease) infinite; }
  .gp-hope__ring::after  { animation: gp-breathe 8s var(--gp-ease) infinite; animation-delay: .8s; }
}
@keyframes gp-breathe { 0%,100% { transform: scale(.82); opacity: .28; } 50% { transform: scale(1.06); opacity: .6; } }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .gp-grid-3, .gp-paths__grid { grid-template-columns: 1fr 1fr; }
  .gp-footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .gp-nav { position: fixed; inset: 0 0 0 auto; width: min(82vw, 340px); flex-direction: column; align-items: flex-start; gap: 1.2rem; background: var(--gp-paper); padding: 5rem 1.6rem 2rem; transform: translateX(100%); transition: transform var(--gp-dur) var(--gp-ease); box-shadow: var(--gp-shadow); z-index: 110; }
  .gp-nav.is-open { transform: none; }
  .gp-menu-toggle { display: inline-flex; z-index: 120; }
  .gp-grid-3, .gp-paths__grid, .gp-footer__grid { grid-template-columns: 1fr; }
  body.gp-nav-open { overflow: hidden; }
}
