/*
Play With Purpose Hub — Theme-matching CSS
Goal: inherit your site’s colour system (WP theme) instead of forcing a Netflix-red look.

It will try, in order:
- WordPress block theme variables (wp--preset)
- Elementor global colours (e-global)
- Astra globals (ast-global)
- Generic CSS variables if your theme sets them
- Fallback defaults
*/

:root{
  /* Inherit primary / accent from the site if available */
  --pwp-accent:
    var(--wp--preset--color--primary,
    var(--e-global-color-primary,
    var(--ast-global-color-0,
    var(--primary,
    #1f5eff)))); /* fallback */

  --pwp-accent-2:
    var(--wp--preset--color--secondary,
    var(--e-global-color-secondary,
    var(--ast-global-color-1,
    var(--secondary,
    #0a7a5c)))); /* fallback */

  /* Prefer site background/text variables if set */
  --pwp-bg:
    var(--wp--preset--color--base,
    var(--e-global-color-text,
    #ffffff));

  --pwp-surface: #ffffff;
  --pwp-surface-2: #f6f7f9;

  --pwp-text:
    var(--wp--preset--color--contrast,
    var(--e-global-color-text,
    #121212));

  --pwp-muted:
    rgba(18, 18, 18, .68);

  --pwp-border:
    rgba(18, 18, 18, .12);

  --pwp-shadow:
    0 18px 60px rgba(0,0,0,.14);

  --pwp-radius: 16px;
}

.pwp-root *{box-sizing:border-box}
.pwp-root{
  color:var(--pwp-text);
  background:transparent; /* let WordPress body background show through */
  font-family:inherit;    /* inherit your site typography */
}

/* =========================
   Shared layout / bars
========================= */

.pwp-topbar, .pwp-nav{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px;
  background:rgba(255,255,255,.86);
  border-bottom:1px solid var(--pwp-border);
  backdrop-filter: blur(8px);
}

.pwp-brand{
  font-weight:900;
  letter-spacing:.3px;
  color:var(--pwp-accent);
  text-transform:uppercase;
}

.pwp-topmeta{color:var(--pwp-muted); font-size:13px}

.pwp-links a{
  color:var(--pwp-muted);
  text-decoration:none;
  margin-right:14px;
  font-size:14px;
}
.pwp-links a:hover{color:var(--pwp-text)}
.pwp-admin-link{opacity:.9}

/* =========================
   Login
========================= */

.pwp-wrap{
  display:grid;
  place-items:center;
  padding:26px 16px;
  min-height:68vh;
}

.pwp-card{
  width:min(520px,100%);
  background:var(--pwp-surface);
  border:1px solid var(--pwp-border);
  border-radius:var(--pwp-radius);
  padding:26px;
  box-shadow:var(--pwp-shadow);
}

.pwp-h1{margin:0 0 10px; font-size:26px}
.pwp-h2{font-size:18px}
.pwp-sub{margin:0 0 18px; color:var(--pwp-muted); font-size:13px; line-height:1.55}

.pwp-label{display:block; margin:14px 0 8px; color:var(--pwp-muted); font-size:13px}

.pwp-input{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--pwp-border);
  background:#fff;
  color:var(--pwp-text);
  outline:none;
}

.pwp-input:focus{
  border-color: color-mix(in oklab, var(--pwp-accent) 55%, #000 0%);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--pwp-accent) 18%, transparent 82%);
}

.pwp-textarea{min-height:120px; resize:vertical}

.pwp-row{display:flex; gap:10px; margin-top:12px; flex-wrap:wrap}

.pwp-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:999px;
  font-weight:800;
  cursor:pointer;
  border:1px solid var(--pwp-border);
  background:#fff;
  color:var(--pwp-text);
  text-decoration:none;
  user-select:none;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.pwp-btn:hover{
  border-color: color-mix(in oklab, var(--pwp-accent) 25%, var(--pwp-border) 75%);
  box-shadow: 0 10px 26px rgba(0,0,0,.10);
  transform: translateY(-1px);
}

.pwp-btn:disabled{opacity:.55; cursor:not-allowed; transform:none; box-shadow:none}

.pwp-btn-primary{
  border:1px solid color-mix(in oklab, var(--pwp-accent) 35%, #000 0%);
  background: var(--pwp-accent);
  color:#fff;
}

.pwp-btn-secondary{
  background: var(--pwp-surface-2);
  border:1px solid var(--pwp-border);
  font-weight:800;
}

.pwp-btn-ghost{
  background: transparent;
  border:1px solid var(--pwp-border);
}

.pwp-btn-wide{width:100%}
.pwp-btn-link{width:auto}

.pwp-notice{
  display:none;
  margin-top:12px;
  padding:10px 12px;
  border-radius:12px;
  font-size:13px;
  line-height:1.45;
  border:1px solid var(--pwp-border);
  background: var(--pwp-surface-2);
  color: var(--pwp-text);
}

.pwp-notice.pwp-error{
  border-color: rgba(170, 20, 20, .25);
  background: rgba(170, 20, 20, .08);
  color: rgba(110, 0, 0, .95);
}

.pwp-footnote{
  margin-top:14px;
  color:var(--pwp-muted);
  font-size:12px;
  line-height:1.5;
}

/* =========================
   Browse (Netflix-style rows)
========================= */

.pwp-nav-left{display:flex; align-items:center; gap:18px}
.pwp-nav-right{display:flex; align-items:center; gap:10px}

.pwp-search{
  width:260px;
  max-width:46vw;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--pwp-border);
  background:#fff;
  color:var(--pwp-text);
  outline:none;
}

.pwp-search:focus{
  border-color: color-mix(in oklab, var(--pwp-accent) 35%, var(--pwp-border) 65%);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--pwp-accent) 14%, transparent 86%);
}

.pwp-hero{
  padding:28px 18px 14px;
  background:
    radial-gradient(900px 500px at 18% 20%, color-mix(in oklab, var(--pwp-accent) 22%, transparent 78%), transparent 60%),
    radial-gradient(700px 450px at 80% 30%, rgba(0,0,0,.04), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.0), rgba(255,255,255,1));
  border-bottom:1px solid var(--pwp-border);
}

.pwp-hero-inner{max-width:980px; padding:10px 0}
.pwp-hero-tag{display:inline-block; color:var(--pwp-muted); font-size:13px; letter-spacing:.2px}
.pwp-hero-title{margin:10px 0 10px; font-size:40px; line-height:1.05}
.pwp-hero-desc{color:var(--pwp-muted); font-size:15px; line-height:1.6; max-width:760px}
.pwp-hero-actions{display:flex; gap:10px; margin-top:14px; flex-wrap:wrap}

.pwp-content{padding:10px 0 24px}

.pwp-section{padding:18px 18px 26px}
.pwp-section h2{font-size:18px; margin:0 0 12px}

.pwp-row-scroll{
  display:flex;
  gap:12px;
  overflow:auto;
  padding-bottom:10px;
  scroll-snap-type:x mandatory;
}

.pwp-tile{
  flex:0 0 auto;
  width:220px;
  height:124px;
  border-radius:14px;
  overflow:hidden;
  position:relative;
  cursor:pointer;
  border:1px solid var(--pwp-border);
  background:#fff;
  scroll-snap-align:start;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.pwp-tile:hover{
  transform: scale(1.06);
  z-index:2;
  border-color: color-mix(in oklab, var(--pwp-accent) 30%, var(--pwp-border) 70%);
  box-shadow: 0 18px 46px rgba(0,0,0,.18);
}

.pwp-thumb{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.pwp-tile::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.55));
}

.pwp-tile-label{
  position:absolute;
  left:10px;
  right:10px;
  bottom:10px;
  font-size:13px;
  color:#fff;
  text-shadow:0 10px 24px rgba(0,0,0,.65);
  line-height:1.2;
}

/* =========================
   Modal
========================= */

.pwp-modal{
  position:fixed;
  inset:0;
  display:none;
  place-items:center;
  padding:18px;
  background:rgba(0,0,0,.55);
}

.pwp-modal.is-open{display:grid}

.pwp-modal-card{
  width:min(920px, 100%);
  border-radius:var(--pwp-radius);
  background:#fff;
  border:1px solid var(--pwp-border);
  overflow:hidden;
  box-shadow:0 28px 120px rgba(0,0,0,.35);
}

.pwp-modal-top{
  padding:16px 16px 10px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.pwp-modal-kicker{color:var(--pwp-muted); font-size:12px; letter-spacing:.2px}
.pwp-modal-title{font-size:22px; margin:6px 0 0}

.pwp-modal-close{
  border:0;
  background:transparent;
  color:var(--pwp-muted);
  font-size:26px;
  cursor:pointer;
}
.pwp-modal-close:hover{color:var(--pwp-text)}

.pwp-modal-media{
  height:340px;
  background: var(--pwp-surface-2);
  position:relative;
}

.pwp-modal-media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.pwp-modal-media::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.35));
}

.pwp-modal-body{padding:14px 16px 18px}

.pwp-modal-blurb{
  margin:0 0 14px;
  color:var(--pwp-muted);
  line-height:1.6;
}

.pwp-modal-actions{display:flex; gap:10px; flex-wrap:wrap}

/* =========================
   Admin console layout
========================= */

.pwp-admin{padding:22px 18px}

.pwp-admin-card{
  max-width:1200px;
  margin:0 auto;
  background:#fff;
  border:1px solid var(--pwp-border);
  border-radius:var(--pwp-radius);
  padding:18px;
  box-shadow: var(--pwp-shadow);
}

.pwp-grid{
  display:grid;
  grid-template-columns: 1fr 1.2fr;
  gap:18px;
}
@media (max-width: 980px){
  .pwp-grid{grid-template-columns:1fr}
}

.pwp-admin-list{margin-top:12px; display:flex; flex-direction:column; gap:10px}

.pwp-admin-item{
  padding:12px;
  border-radius:12px;
  background: var(--pwp-surface-2);
  border:1px solid var(--pwp-border);
}

.pwp-admin-item .meta{color:var(--pwp-muted); font-size:12px; margin-top:6px}
.pwp-admin-item .actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:10px}
