Repository navigation
Expand file tree
/
Copy pathclasses.cgi
More file actions
executable file
·1439 lines (1282 loc) · 49.6 KB
/
Copy pathclasses.cgi
File metadata and controls
executable file
·1439 lines (1282 loc) · 49.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
"""
MakeIt Labs - Standalone Classes & Workshop CGI Board
Free-standing CGI script for Apache / web servers.
Fetches live classes from Eventbrite API, caches locally, and renders
a responsive flexbox/grid layout for mobile, tablet, and desktop displays.
Includes real MakeIt Labs logo, sold-out badging, and toggle filters.
"""
import os
import sys
import re
import json
import time
import tempfile
import base64
import urllib.request
import urllib.error
import datetime
from collections import defaultdict
# ---------------------------------------------------------------------------
# Directory & Configuration
# ---------------------------------------------------------------------------
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
if SCRIPT_DIR not in sys.path:
sys.path.insert(0, SCRIPT_DIR)
ORG_ID = "27283320655"
TOKEN = None
CACHE_FILE = os.path.join(os.path.expanduser("~"), ".cache", "makeit_classboard_cache.json")
if not os.path.exists(os.path.dirname(CACHE_FILE)):
try:
os.makedirs(os.path.dirname(CACHE_FILE), exist_ok=True)
except Exception:
CACHE_FILE = "/tmp/makeit_classboard_cache.json"
CACHE_TTL_SECONDS = 14400 # 4 hours cache
EVENTBRITE_PROFILE_URL = "https://www.eventbrite.com/o/makeit-labs-1932299069"
# Attempt to load credentials from vars.py or var.py in same directory or parent
config_vars = None
try:
import vars as config_vars
except ImportError:
try:
import var as config_vars
except ImportError:
config_vars = None
if config_vars:
if hasattr(config_vars, 'ORG_ID') and config_vars.ORG_ID:
ORG_ID = config_vars.ORG_ID
if hasattr(config_vars, 'TOKEN') and config_vars.TOKEN:
TOKEN = config_vars.TOKEN
if not TOKEN:
TOKEN = os.environ.get("EVENTBRITE_TOKEN") or os.environ.get("TOKEN")
# ---------------------------------------------------------------------------
# Category Mapping
# ---------------------------------------------------------------------------
CATEGORIES = [
("all", "All Classes"),
("woodworking", "Woodworking"),
("metalworking", "Metal & Welding"),
("laser-cnc", "Laser & CNC"),
("ceramics-arts", "Ceramics & Crafts"),
("digital-cad", "CAD & Digital"),
("orientations", "Orientations & Safety")
]
def categorize_class(name):
n = name.lower()
cats = []
if any(k in n for k in ["wood", "lathe orientation", "shopbot"]):
cats.append("woodworking")
if any(k in n for k in ["weld", "metal", "machin", "mill", "trak", "bridgeport", "pewter"]):
cats.append("metalworking")
if any(k in n for k in ["laser", "kern", "epilog", "mopa", "fiber", "cnc", "router", "waterjet"]):
cats.append("laser-cnc")
if any(k in n for k in ["ceramic", "glaz", "glass", "pottery", "art", "jewelry", "wire wrap", "apparel", "mat board", "ornament"]):
cats.append("ceramics-arts")
if any(k in n for k in ["cad", "onshape", "blender", "inkscape", "design tools", "software"]):
cats.append("digital-cad")
if any(k in n for k in ["orient", "safety", "authoriz", "walkthrough", "intro", "101", "basics"]):
cats.append("orientations")
if not cats:
cats.append("all")
return cats
# ---------------------------------------------------------------------------
# MakeIt Labs Official Logo Loader (SVG with embedded fallback)
# ---------------------------------------------------------------------------
def get_logo_html():
possible_paths = [
os.path.join(SCRIPT_DIR, "..", "html", "MakeIt Labs Logo 2016.svg"),
os.path.join(SCRIPT_DIR, "static", "MakeIt Labs Logo 2016.svg"),
os.path.join(SCRIPT_DIR, "MakeIt Labs Logo 2016.svg"),
os.path.join(SCRIPT_DIR, "..", "static", "makeit.png"),
os.path.join(SCRIPT_DIR, "static", "makeit.png"),
os.path.join(SCRIPT_DIR, "makeit.png")
]
for p in possible_paths:
if os.path.exists(p):
if p.endswith(".svg"):
try:
with open(p, "r", encoding="utf-8") as f:
svg_data = f.read()
if "viewBox" not in svg_data:
svg_data = svg_data.replace("<svg", '<svg viewBox="0 0 738.03394 130.13995"', 1)
import re
svg_data = re.sub(r'<\?xml[^>]*\?>', '', svg_data)
svg_data = re.sub(r'<!--.*?-->', '', svg_data, flags=re.DOTALL).strip()
return f'<div class="brand-logo-wrap" title="MakeIt Labs">{svg_data}</div>'
except Exception:
pass
elif p.endswith(".png"):
try:
with open(p, "rb") as f:
b64 = base64.b64encode(f.read()).decode("utf-8")
return f'<div class="brand-logo-wrap" title="MakeIt Labs"><img src="data:image/png;base64,{b64}" alt="MakeIt Labs Logo" class="brand-logo-img"></div>'
except Exception:
pass
# Self-contained fallback SVG if static directory is not mounted
return '''<div class="brand-logo-wrap" title="MakeIt Labs">
<svg viewBox="0 0 24 24" class="brand-fallback-bulb">
<path d="M12 2a7 7 0 0 0-7 7c0 2.38 1.19 4.47 3 5.74V17a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2.26c1.81-1.27 3-3.36 3-5.74a7 7 0 0 0-7-7zM9 21a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-1H9v1z"/>
</svg>
<span class="brand-fallback-text">MAKEIT LABS</span>
</div>'''
# ---------------------------------------------------------------------------
# Eventbrite API Client & Caching
# ---------------------------------------------------------------------------
def load_cache():
for path in (CACHE_FILE, "/tmp/makeit_classboard_cache.json"):
try:
with open(path, "r", encoding="utf-8") as f:
data = json.load(f)
if time.time() - data.get("timestamp", 0) < CACHE_TTL_SECONDS:
return data.get("classes"), data.get("last_updated")
except Exception:
continue
return None, None
def save_cache(classes, last_updated):
global CACHE_FILE
cache_dir = os.path.dirname(os.path.abspath(CACHE_FILE))
temp_path = None
try:
os.makedirs(cache_dir, exist_ok=True)
except Exception:
cache_dir = "/tmp"
CACHE_FILE = "/tmp/makeit_classboard_cache.json"
try:
with tempfile.NamedTemporaryFile(
"w",
dir=cache_dir,
delete=False,
encoding="utf-8",
prefix=".classboard_cache_",
suffix=".tmp"
) as f:
temp_path = f.name
json.dump({
"timestamp": time.time(),
"last_updated": last_updated,
"classes": classes
}, f)
f.flush()
os.fsync(f.fileno())
os.replace(temp_path, CACHE_FILE)
except Exception:
if temp_path and os.path.exists(temp_path):
try:
os.remove(temp_path)
except OSError:
pass
def fetch_events_from_eventbrite(force_refresh=False):
if not force_refresh:
cached_classes, last_updated = load_cache()
if cached_classes is not None:
return cached_classes, last_updated
if not TOKEN:
# Fall back to existing cache if token is not available
cached_classes, last_updated = load_cache()
if cached_classes is not None:
return cached_classes, last_updated
raise RuntimeError("Eventbrite TOKEN is not configured (missing in vars.py)")
all_events = []
page = 1
base_url = f"https://www.eventbriteapi.com/v3/organizations/{ORG_ID}/events/?status=live,started&token={TOKEN}&expand=ticket_availability,logo"
try:
while True:
req = urllib.request.Request(
f"{base_url}&page={page}",
headers={"User-Agent": "MakeItLabs-ClassBoard/2.0"}
)
with urllib.request.urlopen(req, timeout=12) as resp:
data = json.loads(resp.read().decode("utf-8"))
events = data.get("events", [])
all_events.extend(events)
if not data.get("pagination", {}).get("has_more_items"):
break
page += 1
if page > 10: # safety cap
break
except Exception as e:
for path in (CACHE_FILE, "/tmp/makeit_classboard_cache.json"):
try:
with open(path, "r", encoding="utf-8") as f:
data = json.load(f)
return data.get("classes", []), data.get("last_updated", "Cached")
except Exception:
continue
raise RuntimeError(f"Eventbrite API request failed: {e}")
now_dt = datetime.datetime.now()
now_iso = now_dt.strftime("%Y-%m-%dT%H:%M:%S")
now_date_str = now_dt.strftime("%Y-%m-%d")
groups = defaultdict(list)
for e in all_events:
key = e.get("series_id") or e.get("id")
groups[key].append(e)
classes = []
for key, items in groups.items():
# Keep upcoming instances where start date/time is today or in the future
upcoming_items = [
x for x in items
if x.get("start", {}).get("local", "") >= now_iso
or x.get("start", {}).get("local", "")[:10] >= now_date_str
]
if not upcoming_items:
continue
upcoming_items.sort(key=lambda x: x.get("start", {}).get("local", ""))
next_item = upcoming_items[0]
start_str = next_item.get("start", {}).get("local", "")
try:
next_dt = datetime.datetime.strptime(start_str, "%Y-%m-%dT%H:%M:%S")
except Exception:
next_dt = datetime.datetime.now()
formatted_day = next_dt.strftime("%A, %B %d")
time_part = next_dt.strftime("%I:%M %p").lstrip("0")
formatted_date = f"{formatted_day} • {time_part}"
title = next_item.get("name", {}).get("text", "Untitled Workshop").strip()
logo_url = None
if next_item.get("logo"):
logo_obj = next_item["logo"]
logo_url = logo_obj.get("original", {}).get("url") or logo_obj.get("url")
summary = next_item.get("summary") or ""
if not summary and next_item.get("description", {}).get("text"):
summary = next_item["description"]["text"][:140].strip() + "..."
cats = categorize_class(title)
# Calculate sold out status across upcoming instances
available_items = [
x for x in upcoming_items
if not x.get("ticket_availability", {}).get("is_sold_out", False)
]
available_count = len(available_items)
all_sold = (available_count == 0)
any_sold = (len(upcoming_items) > available_count)
# Check waitlist on next or upcoming item
waitlist_available = any(
bool(x.get("ticket_availability", {}).get("waitlist_available", False))
for x in upcoming_items
)
# Prefer master series URL for recurring classes so Eventbrite shows all dates,
# or link to the first open date if not a series
series_id = next_item.get("series_id")
base_item_url = next_item.get("url") or EVENTBRITE_PROFILE_URL
if series_id:
if "tickets-" in base_item_url:
event_url = re.sub(r"tickets-\d+", f"tickets-{series_id}", base_item_url)
else:
event_url = f"https://www.eventbrite.com/e/{series_id}"
elif available_items and available_items[0].get("url"):
event_url = available_items[0]["url"]
else:
event_url = base_item_url
if event_url.startswith("http://"):
event_url = "https://" + event_url[7:]
if logo_url and logo_url.startswith("http://"):
logo_url = "https://" + logo_url[7:]
classes.append({
"id": next_item.get("id"),
"series_id": next_item.get("series_id"),
"title": title,
"url": event_url,
"logo_url": logo_url,
"summary": summary,
"count": len(upcoming_items),
"available_count": available_count,
"all_sold": all_sold,
"any_sold": any_sold,
"waitlist_available": waitlist_available,
"next_dt_iso": next_dt.isoformat(),
"formatted_date": formatted_date,
"weekday": next_dt.strftime("%A"),
"time_str": time_part,
"categories": cats
})
classes.sort(key=lambda x: x["next_dt_iso"])
last_updated = datetime.datetime.now().strftime("%B %d, %Y at %I:%M %p")
save_cache(classes, last_updated)
return classes, last_updated
# ---------------------------------------------------------------------------
# HTML Page Rendering
# ---------------------------------------------------------------------------
def render_classes_page(force_refresh=False):
error_msg = None
try:
classes, last_updated = fetch_events_from_eventbrite(force_refresh=force_refresh)
except Exception as e:
classes = []
last_updated = datetime.datetime.now().strftime("%B %d, %Y at %I:%M %p")
error_msg = f"Unable to fetch classes from Eventbrite: {e}"
total_count = len(classes)
sold_out_count = sum(1 for c in classes if c["all_sold"])
logo_html = get_logo_html()
cards_html = []
for c in classes:
cats_str = " ".join(c["categories"])
is_sold_out = c["all_sold"]
# Build badges
badges_html = []
if is_sold_out:
if c["waitlist_available"]:
badges_html.append('<span class="badge badge-waitlist">Waitlist Available</span>')
else:
badges_html.append('<span class="badge badge-soldout">Sold Out</span>')
else:
if c["count"] > 1:
if c["any_sold"]:
badges_html.append(f'<span class="badge badge-multi">{c["count"]} dates ({c["available_count"]} open)</span>')
else:
badges_html.append(f'<span class="badge badge-multi">{c["count"]} dates available</span>')
else:
badges_html.append('<span class="badge badge-single">Tickets Available</span>')
badges_joined = "".join(badges_html)
if c["logo_url"]:
img_tag = f'<img src="{c["logo_url"]}" alt="{c["title"]}" loading="lazy" class="card-img">'
else:
img_tag = '''
<div class="card-img-placeholder">
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/>
</svg>
<span>MakeIt Labs Class</span>
</div>'''
summary_p = f'<p class="card-summary">{c["summary"]}</p>' if c["summary"] else ''
# Action button text & styling
if is_sold_out:
if c["waitlist_available"]:
btn_text = "Join Waitlist on Eventbrite"
btn_class = "btn-register btn-waitlist"
else:
btn_text = "Sold Out • View on Eventbrite"
btn_class = "btn-register btn-soldout"
else:
if c["count"] > 1:
btn_text = "Select a Date on Eventbrite"
btn_class = "btn-register"
else:
btn_text = "Register on Eventbrite"
btn_class = "btn-register"
soldout_attr = "true" if is_sold_out else "false"
card_extra_class = "is-sold-out" if is_sold_out else ""
card_html = f'''
<article class="class-card {card_extra_class}" data-title="{c["title"].lower()}" data-cats="{cats_str}" data-soldout="{soldout_attr}">
<a href="{c["url"]}" target="_blank" rel="noopener noreferrer" class="card-link" aria-label="Register for {c["title"]}">
<div class="card-media">
{img_tag}
<div class="card-overlay-badges">
{badges_joined}
</div>
</div>
<div class="card-body">
<div class="date-header">
<svg class="icon-clock" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<polyline points="12 6 12 12 16 14"/>
</svg>
<div class="date-details">
<span class="next-label">{"Next Class" if c["count"] > 1 else "Class Date"}</span>
<span class="date-value">{c["formatted_date"]}</span>
</div>
</div>
<h2 class="card-title">{c["title"]}</h2>
{summary_p}
<div class="card-action">
<span class="{btn_class}">
<span>{btn_text}</span>
<svg class="icon-arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="5" y1="12" x2="19" y2="12"/>
<polyline points="12 5 19 12 12 19"/>
</svg>
</span>
</div>
</div>
</a>
</article>'''
cards_html.append(card_html)
cards_joined = "\n".join(cards_html)
filter_buttons = []
for cat_id, cat_name in CATEGORIES:
active_class = "active" if cat_id == "all" else ""
filter_buttons.append(
f'<button type="button" class="filter-pill {active_class}" data-filter="{cat_id}">{cat_name}</button>'
)
filter_pills_html = "\n".join(filter_buttons)
error_banner = ""
if error_msg:
error_banner = f'''
<div class="alert-banner">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<line x1="12" y1="8" x2="12" y2="12"/>
<line x1="12" y1="16" x2="12.01" y2="16"/>
</svg>
<span>{error_msg}</span>
</div>'''
return f'''<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MakeIt Labs Classes & Workshops</title>
<meta name="description" content="Explore hands-on classes, tool authorizations, and creative workshops at MakeIt Labs in Nashua, NH.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@600;700;800&display=swap" rel="stylesheet">
<style>
:root {{
--bg-base: #f8fafc;
--bg-surface: #ffffff;
--bg-card: #ffffff;
--bg-card-hover: #ffffff;
--border-subtle: #e2e8f0;
--border-strong: #cbd5e1;
--border-focus: #0284c7;
--text-main: #0f172a;
--text-muted: #475569;
--text-dim: #64748b;
--accent-cyan: #0284c7;
--accent-blue: #2563eb;
--accent-amber: #d97706;
--accent-emerald: #059669;
--accent-rose: #e11d48;
--accent-glow: rgba(2, 132, 199, 0.12);
--radius-sm: 8px;
--radius-md: 14px;
--radius-lg: 20px;
--shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 14px rgba(0, 0, 0, 0.03);
--shadow-hover: 0 16px 32px -6px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
--transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}}
*, *::before, *::after {{
box-sizing: border-box;
margin: 0;
padding: 0;
}}
body {{
background-color: var(--bg-base);
color: var(--text-main);
font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
min-height: 100vh;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
overflow-x: hidden;
}}
.page-ambient {{
position: fixed;
top: 0;
left: 0;
right: 0;
height: 480px;
background: radial-gradient(circle at 50% -20%, rgba(2, 132, 199, 0.07), transparent 70%),
radial-gradient(circle at 85% 10%, rgba(245, 158, 11, 0.04), transparent 50%);
pointer-events: none;
z-index: 0;
}}
.container {{
position: relative;
z-index: 1;
width: 100%;
max-width: 1720px;
margin: 0 auto;
padding: 1.5rem 1.25rem 4rem;
}}
/* Header Navigation */
header.site-header {{
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 1.25rem;
padding-bottom: 1.75rem;
border-bottom: 1px solid var(--border-subtle);
margin-bottom: 2rem;
}}
.brand-block {{
display: flex;
align-items: center;
gap: 1.25rem;
text-decoration: none;
color: inherit;
}}
/* Official MakeIt Labs Logo (Directly on light background, no white box needed) */
.brand-logo-wrap {{
display: inline-flex;
align-items: center;
justify-content: center;
height: 48px;
flex-shrink: 0;
padding: 0;
background: transparent;
}}
.brand-logo-wrap svg {{
height: 38px;
width: auto;
max-width: 230px;
display: block;
}}
.brand-logo-wrap img.brand-logo-img {{
height: 38px;
width: auto;
max-width: 230px;
display: block;
object-fit: contain;
}}
.brand-fallback-bulb {{
width: 26px;
height: 26px;
fill: #e68726;
margin-right: 0.35rem;
}}
.brand-fallback-text {{
font-family: 'Outfit', sans-serif;
font-weight: 800;
color: #283b96;
font-size: 1.15rem;
letter-spacing: -0.02em;
}}
.brand-text h1 {{
font-family: 'Outfit', sans-serif;
font-size: 1.5rem;
font-weight: 800;
letter-spacing: -0.02em;
color: #0f172a;
}}
.brand-text p {{
font-size: 0.85rem;
color: var(--text-dim);
font-weight: 500;
}}
.header-actions {{
display: flex;
align-items: center;
gap: 0.75rem;
}}
.btn-header {{
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.6rem 1.15rem;
border-radius: var(--radius-sm);
font-size: 0.875rem;
font-weight: 600;
text-decoration: none;
transition: var(--transition);
border: 1px solid var(--border-strong);
background-color: #ffffff;
color: var(--text-main);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}}
.btn-header:hover {{
background-color: #f1f5f9;
border-color: #94a3b8;
transform: translateY(-1px);
}}
.btn-header-primary {{
background: linear-gradient(135deg, #0284c7, #2563eb);
border-color: transparent;
color: #ffffff;
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}}
.btn-header-primary:hover {{
background: linear-gradient(135deg, #0369a1, #1d4ed8);
box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}}
/* Hero Controls: Search & Filters */
.controls-panel {{
display: flex;
flex-direction: column;
gap: 1.25rem;
margin-bottom: 2.25rem;
background: #ffffff;
border: 1px solid var(--border-subtle);
border-radius: var(--radius-md);
padding: 1.25rem 1.5rem;
box-shadow: var(--shadow-card);
}}
.search-row {{
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
}}
.search-box {{
position: relative;
flex: 1;
min-width: 260px;
}}
.search-box svg {{
position: absolute;
left: 1rem;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
color: var(--text-dim);
pointer-events: none;
}}
.search-box input {{
width: 100%;
padding: 0.75rem 1rem 0.75rem 2.85rem;
background: #f8fafc;
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
color: var(--text-main);
font-size: 0.95rem;
outline: none;
transition: var(--transition);
}}
.search-box input:focus {{
background: #ffffff;
border-color: var(--border-focus);
box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}}
.search-box input::placeholder {{
color: #94a3b8;
}}
.controls-right {{
display: flex;
align-items: center;
gap: 0.75rem;
flex-wrap: wrap;
}}
/* Toggle Sold Out Button */
.btn-toggle-soldout {{
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.55rem 0.95rem;
border-radius: var(--radius-sm);
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
border: 1px solid var(--border-strong);
background: #ffffff;
color: var(--text-muted);
transition: var(--transition);
user-select: none;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}}
.btn-toggle-soldout:hover {{
background: #f1f5f9;
color: var(--text-main);
border-color: #94a3b8;
}}
.btn-toggle-soldout.active {{
background: #fff1f2;
border-color: #fda4af;
color: #be123c;
box-shadow: 0 1px 3px rgba(225, 29, 72, 0.1);
}}
.stats-badge {{
font-size: 0.85rem;
color: var(--text-muted);
white-space: nowrap;
background: #f1f5f9;
padding: 0.55rem 0.85rem;
border-radius: var(--radius-sm);
border: 1px solid var(--border-subtle);
}}
.stats-badge strong {{
color: var(--accent-cyan);
font-weight: 700;
}}
/* Filter Pills */
.filter-pills {{
display: flex;
align-items: center;
gap: 0.5rem;
flex-wrap: wrap;
overflow-x: auto;
padding-bottom: 0.25rem;
}}
.filter-pill {{
background: #f8fafc;
border: 1px solid var(--border-strong);
color: #475569;
padding: 0.45rem 1rem;
border-radius: 9999px;
font-size: 0.825rem;
font-weight: 600;
cursor: pointer;
transition: var(--transition);
white-space: nowrap;
}}
.filter-pill:hover {{
background: #f1f5f9;
color: var(--text-main);
border-color: #94a3b8;
}}
.filter-pill.active {{
background: linear-gradient(135deg, #0284c7, #2563eb);
color: #ffffff;
border-color: transparent;
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}}
/* The Grid */
.classes-grid {{
display: grid;
grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
gap: 1.5rem;
}}
/* Card Component */
.class-card {{
background: #ffffff;
border: 1px solid var(--border-subtle);
border-radius: var(--radius-md);
overflow: hidden;
display: flex;
flex-direction: column;
transition: var(--transition);
box-shadow: var(--shadow-card);
}}
.class-card:hover {{
transform: translateY(-5px);
border-color: #7dd3fc;
box-shadow: var(--shadow-hover);
}}
.class-card.is-sold-out {{
border-color: #fecdd3;
background: #fffafa;
}}
.class-card.is-sold-out:hover {{
border-color: #fda4af;
box-shadow: 0 16px 32px -6px rgba(225, 29, 72, 0.12), 0 4px 12px -2px rgba(225, 29, 72, 0.05);
}}
.card-link {{
text-decoration: none;
color: inherit;
display: flex;
flex-direction: column;
height: 100%;
}}
.card-media {{
position: relative;
width: 100%;
aspect-ratio: 16 / 9;
background: #e2e8f0;
overflow: hidden;
}}
.card-img {{
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.4s ease;
}}
.class-card:hover .card-img {{
transform: scale(1.04);
}}
.class-card.is-sold-out .card-img {{
filter: grayscale(35%) contrast(95%);
opacity: 0.88;
}}
.card-img-placeholder {{
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0.5rem;
color: var(--text-dim);
background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
font-size: 0.85rem;
font-weight: 600;
}}
.card-overlay-badges {{
position: absolute;
top: 0.75rem;
left: 0.75rem;
display: flex;
gap: 0.4rem;
flex-wrap: wrap;
z-index: 2;
}}
.badge {{
font-size: 0.75rem;
font-weight: 700;
padding: 0.3rem 0.65rem;
border-radius: 9999px;
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
letter-spacing: 0.01em;
}}
.badge-soldout {{
background: rgba(225, 29, 72, 0.94);
color: #ffffff;
box-shadow: 0 2px 8px rgba(225, 29, 72, 0.35);
text-transform: uppercase;
letter-spacing: 0.05em;
}}
.badge-waitlist {{
background: rgba(217, 119, 6, 0.94);
color: #ffffff;
box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
text-transform: uppercase;
letter-spacing: 0.05em;
}}
.badge-multi {{
background: rgba(5, 150, 105, 0.92);
color: #ffffff;
box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}}
.badge-single {{
background: rgba(15, 23, 42, 0.82);
color: #f8fafc;
border: 1px solid rgba(255, 255, 255, 0.2);
}}
.card-body {{
padding: 1.25rem 1.35rem;
display: flex;
flex-direction: column;
flex-grow: 1;
gap: 0.75rem;
}}
.date-header {{
display: flex;
align-items: flex-start;
gap: 0.65rem;
color: var(--accent-amber);
font-size: 0.85rem;
}}
.icon-clock {{
width: 18px;
height: 18px;
flex-shrink: 0;
margin-top: 0.15rem;
color: #d97706;
}}
.date-details {{
display: flex;
flex-direction: column;
}}
.next-label {{
font-size: 0.7rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--text-dim);
}}
.date-value {{
font-weight: 700;
color: #1e293b;
}}
.card-title {{
font-family: 'Outfit', sans-serif;
font-size: 1.15rem;
font-weight: 700;
line-height: 1.35;
color: #0f172a;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
transition: color 0.15s ease;
}}
.class-card:hover .card-title {{
color: var(--accent-cyan);
}}
.card-summary {{
font-size: 0.85rem;
color: var(--text-muted);
line-height: 1.45;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
margin-top: 0.15rem;
}}
.card-action {{
margin-top: auto;
padding-top: 0.75rem;
border-top: 1px solid #f1f5f9;
}}