/**
 * GBWebcams — site page widgets (Step 86, v2.56.0).
 *
 * Ported from the settled round 2c mock (previews/fixtures/site-pages-r2.html, r2-* → gb-sp-*).
 * Markup: inc/site-pages.php (one renderer per widget). Drawing: assets/js/gbwebcams-site-pages.js
 * (the shopfronts) + the Town Hero's own scene for the little town views in the sketch and postcards.
 *
 *   .gb-sp-head          section heading + sub line (every widget's optional heading)
 *   .gb-sp-place …       "Where your name appears" — the webcam page sketch, computer + phone, pins 1–4
 *   .gb-sp-street …      "Pick your patch" — the four shopfronts (hover / in-view on phones)
 *   .gb-sp-line …        postcards pegged on a washing line (Host steps)
 *   .gb-sp-board         the chalkboard list
 *   .gb-sp-keys          the feature list (red pins / stars)
 *   .gb-sp-cork …        the FAQ noticeboard
 *   .gb-sp-legal …       the legal document (postmark, numbered sections, contents pills, paper card)
 *   .gb-sp-cta           the call-to-action band
 *   .gb-sp-bunting       the hero's pennants as a divider
 *
 * Phones: no sideways swipes anywhere; hover effects play as things scroll into view (.is-view).
 */

.gb-sp {
    --sp-paper: #f6f1e7;
    --sp-ink: #24324a;
    --sp-ink-2: #5a6b85;
    --sp-red: #e01e26;
    --sp-gold: #f6c272;
    --sp-iron: #23262e;
    --sp-brass: #d9b86b;
    margin: 0 0 30px;
}

/* ---------- shared heading ---------- */
.gb-sp-h2 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); letter-spacing: .03em; margin: 38px 0 6px; text-transform: uppercase; }
.gb-sp-sub { color: var(--gb-text-muted); margin: 0 0 18px; max-width: 64ch; }
.gb-sp > .gb-sp-h2:first-child { margin-top: 10px; }
.gb-sp-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 800; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; border: 0; cursor: pointer; background: var(--gb-accent-green, #1e9e5a); color: #fff; }
.gb-sp-btn:hover, .gb-sp-btn:focus-visible { color: #fff; filter: brightness(1.08); }

/* ---------- bunting divider (the hero's pennants) ---------- */
.gb-sp-bunting { height: 34px; margin: 26px 0 8px; opacity: .95; background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='34' viewBox='0 0 200 34'%3E%3Cpath d='M0 3 Q100 16 200 3' stroke='%23e8e2d0' stroke-width='1.2' fill='none'/%3E%3Cpolygon points='12,5 26,6.5 18,24' fill='%23e01e26'/%3E%3Cpolygon points='44,8 58,9 50,27' fill='%23f3efe6'/%3E%3Cpolygon points='78,9.5 92,9.8 85,29' fill='%231fb6d1'/%3E%3Cpolygon points='108,9.8 122,9.4 115,29' fill='%23f6c272'/%3E%3Cpolygon points='142,8.6 156,7.6 150,26' fill='%231e9e5a'/%3E%3Cpolygon points='174,6.2 188,4.6 182,23' fill='%23e01e26'/%3E%3C/svg%3E") repeat-x 0 0 / 200px 34px; }

/* ---------- where your name appears: the webcam page sketch ---------- */
.gb-sp-place { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 24px; align-items: start; }
.gb-sp-sk-label { font-size: .7rem; letter-spacing: .12em; font-weight: 800; color: var(--gb-accent-blue); margin: 0 0 8px; }
.gb-sp-sk { background: var(--gb-bg-card); border: 1px solid var(--gb-border); border-radius: var(--gb-radius); padding: 10px; font-size: .56rem; font-weight: 800; letter-spacing: .07em; color: var(--gb-text-muted); text-transform: uppercase; }
.gb-sp-sk .k { border-radius: 6px; background: rgba(255,255,255,.045); border: 1px dashed rgba(255,255,255,.16); min-height: 30px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 5px; position: relative; }
.gb-sp-sk .k.ad { background: rgba(246,194,114,.13); border: 2px solid var(--sp-gold); color: #f8e3bb; }
.gb-sp-pin { position: absolute; top: -9px; left: -9px; width: 20px; height: 20px; border-radius: 50%; background: var(--sp-red); color: #fff; font-size: .7rem; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.45); letter-spacing: 0; }
.gb-sp-sk .k.title { min-height: 96px; padding: 0; overflow: hidden; align-items: flex-start; justify-content: flex-start; border-style: solid; }
.gb-sp-sk .k.title span { position: relative; z-index: 2; padding: 7px 8px; color: #fff; text-shadow: 0 1px 3px #000; text-align: left; }
.gb-sp-sk .k.title .gb-town-banner-scene { z-index: 0; }
.gb-sp-sk .k.player { min-height: 120px; background: #000; color: #8a93a6; border-style: solid; }
.gb-sp-sk .tabs { display: flex; gap: 4px; }
.gb-sp-sk .tabs i { font-style: normal; border: 1px solid var(--gb-border); border-radius: 4px; padding: 3px 6px; font-size: .5rem; line-height: 1; height: 16px; box-sizing: border-box; display: flex; align-items: center; }
.gb-sp-sk .tabs i:first-child { background: var(--gb-accent-blue); color: #04121f; border-color: transparent; }
.gb-sp-sk .k i.ph { display: block; width: 88%; height: 58%; border-radius: 4px; background: rgba(246,194,114,.25); }
.gb-sp-sk .chips { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.gb-sp-sk .chips i { width: 26px; height: 16px; border-radius: 3px; background: rgba(255,255,255,.75); }
/* the computer sketch follows the live Petersfield page: columns 310/730/310, block heights × .42 */
.gb-sp-sk-desk { display: grid; grid-template-columns: 310fr 730fr 310fr; gap: 7px; align-items: start; }
.gb-sp-sk-desk > div { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.gb-sp-sk-desk .k { min-height: 0; }
.gb-sp-sk-phone { width: 210px; box-sizing: border-box; padding: 8px; border: 7px solid #111; border-radius: 22px; display: flex; flex-direction: column; gap: 7px; }
.gb-sp-sk-phone .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.gb-sp-sk-phone .k.title { min-height: 80px; }
.gb-sp-sk-phone .k.title em { position: absolute; z-index: 2; right: 6px; top: 6px; font-style: normal; background: rgba(10,20,35,.75); color: #fff; border-radius: 5px; padding: 3px 5px; }
.gb-sp-sk-phone .k.player { min-height: 74px; }
.gb-sp-keys4 { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.gb-sp-keys4 li, .gb-sp-keys li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.gb-sp-keys4 li > span, .gb-sp-keys li > span { width: 24px; height: 24px; border-radius: 50%; background: var(--sp-red); color: #fff; font-weight: 900; font-size: .78rem; display: grid; place-items: center; }
.gb-sp-keys4 b, .gb-sp-keys b { display: block; }
.gb-sp-keys4 p { margin: 2px 0 0; color: var(--gb-text-muted); font-size: .86rem; }

/* ---------- feature list ---------- */
.gb-sp-keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gb-sp-keys p { margin: 2px 0 0; color: var(--gb-text-muted); font-size: .88rem; }

/* ---------- packages: shopfronts drawn like the hero (SVG by drawShop() in the JS) ---------- */
.gb-sp-street { display: grid; grid-template-columns: var(--gb-sp-cols, 200fr 240fr 240fr 290fr); gap: 6px; align-items: end; position: relative; padding: 130px 0 0; max-width: 820px; margin: 0 auto; }
.gb-sp-street::after { content: ""; position: absolute; left: -8px; right: -8px; bottom: -16px; height: 16px; border-radius: 0 0 8px 8px; background: linear-gradient(180deg, #60656f 0 2px, #4a4e58 2px 8px, #2a2d36 8px 10px, #3a3e48 10px); }
.gb-sp-shopfront { position: relative; display: block; text-decoration: none; color: inherit; outline-offset: 6px; }
.gb-sp-shopfront svg { display: block; width: 100%; height: auto; transition: transform .35s, filter .35s; filter: drop-shadow(0 10px 14px rgba(0,0,0,.35)); }
.gb-sp-shopfront .gb-sp-glass { transition: fill .35s; }
.gb-sp-shopfront .gb-sp-shopglow { opacity: 0; transition: opacity .35s; }
.gb-sp-shopfront:hover svg, .gb-sp-shopfront:focus-visible svg { transform: translateY(-6px); filter: drop-shadow(0 18px 22px rgba(0,0,0,.5)); }
.gb-sp-shopfront:hover .gb-sp-glass, .gb-sp-shopfront:focus-visible .gb-sp-glass { fill: #ffe39a; }
.gb-sp-shopfront:hover .gb-sp-shopglow, .gb-sp-shopfront:focus-visible .gb-sp-shopglow { opacity: .6; }
.gb-sp-shopcard { position: absolute; left: 50%; bottom: calc(100% - 60px); width: min(250px, 96%); transform: translate(-50%, 14px) rotate(-1.5deg) scale(.96); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 5;
    background: var(--sp-paper); color: var(--sp-ink); border-radius: 8px; padding: 12px 14px; box-shadow: 0 18px 40px rgba(0,0,0,.55); font-size: .84rem; line-height: 1.45; }
.gb-sp-shopcard::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px; margin-left: -8px; background: var(--sp-paper); transform: rotate(45deg); }
.gb-sp-shopcard b { display: block; font-family: var(--gb-font-script); font-size: 1.45rem; line-height: 1; margin-bottom: 4px; }
.gb-sp-shopcard ul { margin: 6px 0 8px; padding-left: 17px; }
.gb-sp-ask { display: inline-block; font-weight: 800; font-size: .72rem; letter-spacing: .08em; color: #fff; background: var(--gb-accent-green, #1e9e5a); padding: 6px 11px; border-radius: 999px; }
.gb-sp-shopfront:hover .gb-sp-shopcard, .gb-sp-shopfront:focus-visible .gb-sp-shopcard { opacity: 1; transform: translate(-50%, 0) rotate(-1.5deg); }
.gb-sp-street-lines { display: grid; grid-template-columns: var(--gb-sp-cols, 200fr 240fr 240fr 290fr); gap: 6px; max-width: 820px; margin: 0 auto; }
.gb-sp-shopline { margin: 26px 4px 0; text-align: center; font-size: .86rem; color: var(--gb-text-muted); }
.gb-sp-shopline em, .gb-sp-mline em { display: block; font-style: normal; font-weight: 800; color: var(--gb-text-main); font-size: .78rem; letter-spacing: .1em; }
.gb-sp-shopfront .gb-sp-mline { display: none; margin: 8px 0 0; text-align: center; font-size: .82rem; color: var(--gb-text-muted); }
.gb-sp-hint { text-align: center; color: var(--gb-text-muted); font-size: .82rem; margin: 18px 0 0; }

/* ---------- postcards on a washing line ---------- */
.gb-sp-line { position: relative; padding-top: 22px; }
.gb-sp-line::before { content: ""; position: absolute; left: -10px; right: -10px; top: 0; height: 26px; border-bottom: 2px solid #e8e2d0; border-radius: 0 0 50% 50% / 0 0 26px 26px; opacity: .8; }
.gb-sp-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.gb-sp-postcard { position: relative; background: var(--sp-paper); color: var(--sp-ink); border-radius: 6px; padding: 12px 12px 14px; box-shadow: 0 14px 30px rgba(0,0,0,.45); transform: rotate(var(--rot, -2deg)); transition: transform .3s; }
.gb-sp-postcard:hover, .gb-sp-postcard.is-view { transform: rotate(0) translateY(-4px) scale(1.03); }
.gb-sp-postcard:nth-child(4n+2) { --rot: 1.8deg; margin-top: 14px; }
.gb-sp-postcard:nth-child(4n+3) { --rot: -1.2deg; margin-top: 22px; }
.gb-sp-postcard:nth-child(4n+4) { --rot: 2.4deg; margin-top: 10px; }
.gb-sp-peg { position: absolute; top: -18px; left: 50%; width: 10px; height: 30px; margin-left: -5px; background: #c9a36a; border-radius: 3px; box-shadow: inset -3px 0 0 rgba(0,0,0,.18); }
.gb-sp-pic { height: 108px; border-radius: 4px; background: linear-gradient(180deg, #7fb3d9, #cfe3ef 60%, #8fbf7a 60%); position: relative; overflow: hidden; display: grid; place-items: center; }
.gb-sp-pic svg.gb-sp-ico { position: relative; z-index: 2; width: 52px; height: 52px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); background: rgba(246,241,231,.9); border-radius: 50%; padding: 8px; box-sizing: border-box; }
.gb-sp-pic .gb-town-banner-scene { z-index: 0; }
.gb-sp-stamp { position: absolute; z-index: 3; top: 8px; right: 8px; width: 34px; height: 40px; background: var(--sp-paper); border: 2px dashed #c9bda6; color: #9a2a2a; font: 900 .9rem/1 var(--gb-font-family); display: grid; place-items: center; transform: rotate(6deg); }
.gb-sp-postcard h3 { font-family: var(--gb-font-script); font-size: 1.55rem; line-height: 1.05; margin: 10px 0 4px; color: var(--sp-ink); text-transform: none; letter-spacing: 0; }
.gb-sp-postcard p { margin: 0; font-size: .86rem; color: #3b4a62; line-height: 1.45; }

/* ---------- chalkboard ---------- */
.gb-sp-board { background: #1f2a24; border: 10px solid #6b4f3a; border-radius: 6px; padding: 18px 20px; color: #e9efe6; box-shadow: inset 0 0 40px rgba(0,0,0,.45), 0 12px 26px rgba(0,0,0,.4); }
.gb-sp-board h3 { font-family: var(--gb-font-script); font-size: 1.8rem; margin: 0 0 8px; text-transform: none; letter-spacing: 0; color: #f6f1e7; }
.gb-sp-board ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .98rem; }
.gb-sp-board li { display: flex; gap: 10px; }
.gb-sp-board li::before { content: "\2713"; color: var(--sp-gold); font-weight: 900; flex-shrink: 0; }

/* ---------- FAQ noticeboard ---------- */
.gb-sp-cork { background: #a57a52; background-image: radial-gradient(rgba(0,0,0,.14) 1px, transparent 1.5px), radial-gradient(rgba(255,255,255,.12) 1px, transparent 1.5px); background-size: 9px 9px, 13px 13px; background-position: 0 0, 4px 6px; border: 12px solid #5b3f2a; border-radius: 8px; padding: 22px 22px 26px; box-shadow: inset 0 0 30px rgba(0,0,0,.35), 0 14px 30px rgba(0,0,0,.4); }
.gb-sp-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.gb-sp-cork .gb-webcam-tab { background: rgba(10,20,35,.88); color: #dfe7f0; border-color: rgba(0,0,0,.4); cursor: pointer; font: inherit; font-weight: 700; }
.gb-sp-cork .gb-webcam-tab.gb-webcam-tab-active { background: var(--gb-accent-blue); color: #04121f; }
.gb-sp-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; align-items: start; }
.gb-sp-noteq { position: relative; background: #fffbe8; color: #2b2a24; padding: 16px 16px 12px; box-shadow: 0 8px 14px rgba(0,0,0,.3); transform: rotate(var(--r, -.7deg)); border-radius: 2px; }
.gb-sp-noteq:nth-child(2n) { --r: .8deg; background: #e9f6fb; }
.gb-sp-noteq:nth-child(3n) { --r: -.6deg; background: #fdeef0; }
.gb-sp-noteq[hidden] { display: none; }
.gb-sp-noteq::before { content: ""; position: absolute; top: -7px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff6b6b, var(--sp-red) 60%, #7a0d12); box-shadow: 0 3px 4px rgba(0,0,0,.4); }
.gb-sp-noteq summary { cursor: pointer; font-weight: 800; font-size: .98rem; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.gb-sp-noteq summary::-webkit-details-marker { display: none; }
.gb-sp-noteq summary::after { content: "+"; font-weight: 900; color: var(--sp-red); }
.gb-sp-noteq[open] summary::after { content: "\2013"; }
.gb-sp-noteq .gb-sp-ans { margin: 8px 0 0; font-size: .9rem; line-height: 1.5; color: #45443c; }
.gb-sp-noteq .gb-sp-ans p { margin: 0 0 6px; }
.gb-sp-noteq .gb-sp-ans p:last-child { margin-bottom: 0; }
.gb-sp-noteq .gb-sp-ans a { color: #0b5aa6; }

/* ---------- legal document ---------- */
.gb-sp-legal { max-width: 760px; margin: 0 auto 30px; }
.gb-sp-postmark { float: right; margin: -6px 0 10px 16px; width: 116px; height: 116px; border-radius: 50%; border: 3px double rgba(31,182,209,.75); color: var(--gb-accent-blue); display: grid; place-items: center; text-align: center; font: 800 .64rem/1.3 var(--gb-font-family); letter-spacing: .1em; transform: rotate(-10deg); text-transform: uppercase; }
.gb-sp-postmark b { display: block; font-size: .9rem; letter-spacing: .04em; }
.gb-sp-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.gb-sp-legal h2 { display: flex; align-items: center; gap: 12px; font-size: 1.15rem; margin: 30px 0 8px; text-transform: none; letter-spacing: .01em; scroll-margin-top: 90px; clear: none; }
.gb-sp-legal h2 > span { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--sp-red); color: #fff; font-size: .82rem; display: grid; place-items: center; }
.gb-sp-legal p, .gb-sp-legal li { color: var(--gb-text-main); opacity: .9; line-height: 1.65; font-size: .98rem; }
.gb-sp-legal p, .gb-sp-legal ul { margin: 0 0 12px; }
.gb-sp-legal ul { padding-left: 22px; }
.gb-sp-legal a { color: var(--gb-accent-blue); }
.gb-sp-callout { background: var(--sp-paper); color: var(--sp-ink); border-radius: 8px; padding: 14px 16px; margin: 16px 0; box-shadow: 0 8px 18px rgba(0,0,0,.35); }
.gb-sp-legal .gb-sp-callout p, .gb-sp-legal .gb-sp-callout li { color: var(--sp-ink); opacity: 1; margin: 0; font-size: .92rem; }
.gb-sp-legal .gb-sp-callout a { color: #0b5aa6; }
.gb-sp-draft { clear: both; margin: 0 0 18px; padding: 12px 14px; border: 1px dashed var(--gb-accent-red, #e01e26); border-radius: var(--gb-radius); color: var(--gb-text-main); font-size: .86rem; line-height: 1.5; }

/* ---------- call-to-action band ---------- */
.gb-sp-cta { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-radius: var(--gb-radius); background: linear-gradient(90deg, rgba(31,182,209,.18), rgba(30,158,90,.16)); border: 1px solid var(--gb-border); }
.gb-sp-cta h3 { margin: 0; font-size: 1.1rem; }
.gb-sp-cta p { margin: 3px 0 0; color: var(--gb-text-muted); font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
    .gb-sp-shopfront svg, .gb-sp-shopcard, .gb-sp-postcard { transition: none; }
}

/* ---------- phones and small tablets: wrap, never swipe; in-view instead of hover ---------- */
@media (max-width: 900px) {
    .gb-sp-street { grid-template-columns: 1fr 1fr; padding: 10px 0 0; gap: 26px 12px; align-items: start; }
    .gb-sp-street::after { display: none; }
    .gb-sp-shopfront { display: flex; flex-direction: column; justify-content: flex-end; }
    .gb-sp-shopfront svg { height: 210px; border-bottom: 7px solid #4a4e58; box-shadow: 0 3px 0 #2a2d36; }
    .gb-sp-shopfront .gb-sp-shopcard { position: relative; left: auto; bottom: auto; width: auto; margin-top: 12px; font-size: .78rem; padding: 10px 11px; opacity: 0; transform: translateY(10px) rotate(-1deg) scale(.96); }
    .gb-sp-shopfront .gb-sp-shopcard::after { top: -7px; bottom: auto; }
    .gb-sp-shopfront .gb-sp-shopcard b { font-size: 1.2rem; }
    .gb-sp-shopfront .gb-sp-shopcard ul { padding-left: 15px; }
    .gb-sp-shopfront.is-view .gb-sp-shopcard { opacity: 1; transform: rotate(-1deg); }
    .gb-sp-shopfront.is-view svg { transform: translateY(-4px); }
    .gb-sp-shopfront.is-view .gb-sp-glass { fill: #ffe39a; }
    .gb-sp-shopfront.is-view .gb-sp-shopglow { opacity: .6; }
    .gb-sp-street-lines, .gb-sp-hint { display: none; }
    .gb-sp-keys4 { grid-template-columns: 1fr; }
    .gb-sp-place { grid-template-columns: 1fr; }
    .gb-sp-place > div:first-child { display: none; }
    .gb-sp-sk-phone { margin: 0 auto; width: 100%; max-width: 320px; border: 1px solid var(--gb-border); border-radius: var(--gb-radius); }
    .gb-sp-cards { grid-template-columns: 1fr 1fr; }
    .gb-sp-notes { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .gb-sp-cork { padding: 16px 12px 18px; border-width: 9px; }
    .gb-sp-postmark { width: 92px; height: 92px; font-size: .56rem; }
}
