/* =========================================================================
   CCNY Makerspace — styled to match The City College of New York's website
   (ccny.cuny.edu / ccny_theme): Trebuchet MS system fonts, CCNY purple +
   gold, squared corners, uppercase nav. Built to a higher accessibility bar
   (WCAG AA contrast, visible focus, semantic structure, reduced motion).
   ========================================================================= */

:root {
  /* CCNY brand */
  --purple:      #7d55c7;   /* primary (white text on this = 5.26:1, AA) */
  --purple-dark: #5b3a94;   /* hover / deeper */
  --purple-deep: #491b75;   /* footer / strong */
  --gold:        #f3cf45;   /* accent (borders / rules only, not small text) */
  --gold-dark:   #a97f00;   /* gold-family text that passes AA on white */

  /* Neutrals */
  --ink:    #111111;        /* headings */
  --body:   #454545;        /* body text (7.4:1 on white) */
  --muted:  #5f5f5f;
  --bg:     #ffffff;
  --bg-alt: #f4f1f9;        /* light lavender-gray section */
  --surface:#ffffff;
  --border: #d9d3e4;
  --border-strong: #c3b9d6;

  --link:   #6a3aa8;        /* underlined links (6.0:1 on white) */
  --link-alt:#7d55c7;

  --maxw: 1180px;
  --pad-x: clamp(1rem, 4vw, 2rem);
  --section-y: clamp(3rem, 6vw, 4.5rem);
  --radius: 2px;

  --shadow: 0 2px 6px rgba(17,17,17,.10);
  --shadow-lg: 0 8px 24px rgba(73,27,117,.16);

  --font: "Trebuchet MS", "Segoe UI", Tahoma, Verdana, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;

  --focus: 3px solid #1a1a1a;
  --focus-offset: 2px;
}

/* Dark theme (faithful darkening of the CCNY palette). Kept understated. */
@media (prefers-color-scheme: dark) {
  :root {
    --purple:      #9b7ae0;
    --purple-dark: #b79aec;
    --purple-deep: #2a1c40;
    --gold:        #f3cf45;
    --gold-dark:   #f3cf45;

    --ink:    #f2eef8;
    --body:   #cfc8dd;
    --muted:  #a79fbb;
    --bg:     #17121f;
    --bg-alt: #1e1829;
    --surface:#211a2e;
    --border: rgba(255,255,255,.14);
    --border-strong: rgba(255,255,255,.24);

    --link:   #c3aef2;
    --link-alt:#c3aef2;

    --shadow: 0 2px 6px rgba(0,0,0,.5);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.6);
    --focus: 3px solid #f3cf45;
  }
}

/* ---- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
ul { list-style: none; padding: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--purple-dark); }

:focus-visible { outline: var(--focus); outline-offset: var(--focus-offset); }
::selection { background: var(--purple); color: #fff; }

h1, h2, h3, h4 { color: var(--ink); font-weight: 700; line-height: 1.2; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-x); }
.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--purple-deep); color: #fff; padding: .8rem 1.2rem; text-decoration: none; font-weight: 700;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Typography helpers ------------------------------------------------- */
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .12em;
  font-size: .8rem; font-weight: 700; color: var(--gold-dark);
}
.section__head { max-width: 60ch; margin-bottom: 2rem; }
.section__title { font-size: clamp(1.5rem, 3vw, 2.05rem); position: relative; padding-bottom: .75rem; }
.section__title::after { /* CCNY-style gold rule */
  content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 4px; background: var(--gold);
}
.section__intro { margin-top: 1rem; color: var(--muted); font-size: 1.1rem; max-width: 62ch; }
.lead { font-size: 1.15rem; color: var(--body); }
.muted { color: var(--muted); }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: .98rem; text-decoration: none;
  padding: .75rem 1.4rem; border-radius: var(--radius);
  border: 2px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.btn svg { width: 1.05em; height: 1.05em; }
.btn--primary { background: var(--purple); color: #fff; }
.btn--primary:hover { background: var(--purple-dark); color: #fff; }
.btn--outline { background: transparent; color: var(--link); border-color: var(--purple); }
.btn--outline:hover { background: var(--purple); color: #fff; }
.btn--onpurple { background: #fff; color: var(--purple-deep); }
.btn--onpurple:hover { background: var(--gold); color: #111; }
.btn--onpurple-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }
.btn--onpurple-outline:hover { background: rgba(255,255,255,.14); color: #fff; }

.textlink { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; }
.textlink svg { width: 1em; height: 1em; }

/* ---- Header / nav (CCNY purple bar) ------------------------------------- */
.site-header { background: var(--purple); color: #fff; }
@media (prefers-color-scheme: dark) { .site-header { background: var(--purple-deep); } }

.header__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 84px; padding-block: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__word { font-family: var(--font-serif); font-weight: 700; font-size: 2rem; line-height: 1; letter-spacing: .01em; }
.brand__divider { width: 1px; height: 34px; background: rgba(255,255,255,.55); }
.brand__name { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 1.05rem; line-height: 1.1; }
.brand__name small { display: block; font-weight: 400; text-transform: none; letter-spacing: .02em; font-size: .72rem; color: rgba(255,255,255,.85); margin-top: 3px; }

.nav { border-top: 1px solid rgba(255,255,255,.22); }
.nav__list { display: flex; flex-wrap: wrap; gap: .25rem; }
.nav__list a {
  display: block; color: #fff; text-decoration: none;
  text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; font-weight: 700;
  padding: .9rem .85rem; border-bottom: 3px solid transparent;
}
.nav__list a:hover { color: #fff; background: rgba(255,255,255,.12); }
.nav__list a[aria-current="page"] { border-bottom-color: var(--gold); }

.nav__toggle { display: none; align-items: center; gap: .5rem; color: #fff; text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; font-weight: 700; padding: .8rem .25rem; }
.nav__toggle svg { width: 22px; height: 22px; }
.nav__toggle .icon-close { display: none; }
.nav.is-open .nav__toggle .icon-open { display: none; }
.nav.is-open .nav__toggle .icon-close { display: inline; }

@media (max-width: 860px) {
  .nav__toggle { display: inline-flex; }
  .nav__list { display: none; flex-direction: column; gap: 0; padding-bottom: .5rem; }
  .nav.is-open .nav__list { display: flex; }
  .nav__list a { padding: .95rem .5rem; border-bottom: 1px solid rgba(255,255,255,.14); }
  .nav__list a[aria-current="page"] { border-left: 4px solid var(--gold); border-bottom: 1px solid rgba(255,255,255,.14); padding-left: calc(.5rem - 4px + .5rem); }
}

/* ---- Hero (purple band with gold-bordered caption, echoing CCNY) -------- */
.hero { position: relative; overflow: hidden; background: var(--purple-deep); color: #fff; padding-block: clamp(2.75rem, 6vw, 4.5rem); }
.hero__inner { max-width: 62ch; }
.hero h1 { color: #fff; font-size: clamp(2rem, 4.5vw, 3rem); }
.hero__rule { width: 64px; height: 5px; background: var(--gold); margin: 1.1rem 0 1.25rem; }
.hero p { color: rgba(255,255,255,.92); font-size: 1.2rem; }
.hero__actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .8rem; }

/* Interior page banner */
.page-banner { background: var(--purple); color: #fff; padding-block: clamp(2rem, 4vw, 3rem); }
.page-banner h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-banner .breadcrumb { color: rgba(255,255,255,.85); font-size: .9rem; margin-bottom: .6rem; }
.page-banner .breadcrumb a { color: #fff; }
.page-banner__intro { margin-top: .9rem; color: rgba(255,255,255,.92); max-width: 65ch; font-size: 1.1rem; }

/* ---- Grid + cards ------------------------------------------------------- */
.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { .grid--3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--purple);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s;
}
.card--link:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.card p { color: var(--muted); }
.card__link { margin-top: 1rem; }
.card__num { font-weight: 700; color: var(--purple); font-size: 1.05rem; letter-spacing: .05em; margin-bottom: .5rem; }

.tag { display: inline-block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--purple-deep); background: #ece5f7; padding: .28rem .55rem; border-radius: var(--radius); }
@media (prefers-color-scheme: dark) { .tag { color: #e6dbff; background: rgba(155,122,224,.22); } }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Definition / spec list */
.specs { margin-top: 1rem; }
.specs > div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.specs > div:last-child { border-bottom: 0; }
.specs dt { color: var(--muted); }
.specs dd { font-weight: 700; text-align: right; color: var(--ink); }

/* Prose blocks */
.prose { max-width: 68ch; }
.prose p { margin-bottom: 1.1rem; }
.prose h2 { font-size: 1.5rem; margin: 2rem 0 .75rem; }
.prose h3 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.prose ul.bullets { list-style: disc; padding-left: 1.25rem; margin-bottom: 1.1rem; }
.prose ul.bullets li { margin-bottom: .4rem; }
.prose a { font-weight: 600; }

/* Callout (gold-bordered box, echoing CCNY caption) */
.callout { border: 2px solid var(--gold); background: var(--bg-alt); padding: 1.25rem 1.4rem; border-radius: var(--radius); }
.callout h3 { margin-bottom: .4rem; }

/* Info list (contact, hours) */
.infolist { display: grid; gap: 1.25rem; }
.infolist__item h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.infolist__item p, .infolist__item address { font-style: normal; color: var(--body); }

/* Split layout */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* ---- CTA strip ---------------------------------------------------------- */
.cta { background: var(--purple); color: #fff; }
@media (prefers-color-scheme: dark) { .cta { background: var(--purple-deep); } }
.cta__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: clamp(2rem, 4vw, 3rem); }
.cta h2 { color: #fff; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.cta p { color: rgba(255,255,255,.9); margin-top: .4rem; }
.cta__actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---- Footer (deep purple, CCNY-style) ---------------------------------- */
.site-footer { background: var(--purple-deep); color: #fff; padding-block: clamp(2.5rem, 5vw, 3.5rem) 1.5rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--gold); }
.footer__top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 2rem; }
@media (max-width: 820px) { .footer__top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer__top { grid-template-columns: 1fr; } }
.footer__brand .brand__word { font-size: 1.7rem; }
.footer__brand p { color: rgba(255,255,255,.82); margin-top: .9rem; max-width: 32ch; font-size: .95rem; }
.footer__col h2 { color: #fff; text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; margin-bottom: .9rem; padding-bottom: .5rem; border-bottom: 2px solid var(--gold); display: inline-block; }
.footer__col ul { display: grid; gap: .55rem; }
.footer__col a { text-decoration: none; font-size: .95rem; color: rgba(255,255,255,.9); }
.footer__col a:hover { color: var(--gold); text-decoration: underline; }
.footer__col address { font-style: normal; color: rgba(255,255,255,.9); font-size: .95rem; line-height: 1.7; }
.footer__bottom { margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.22); display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between; color: rgba(255,255,255,.75); font-size: .85rem; }
.footer__bottom a { color: rgba(255,255,255,.85); }

/* ---- Hero with photo (overlaid, echoing CCNY's masthead) --------------- */
.hero--photo { background-size: cover; background-position: center; isolation: isolate; }
.hero--photo::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(38,14,64,.94) 0%, rgba(73,27,117,.86) 48%, rgba(73,27,117,.60) 100%);
}
.hero--photo .container { position: relative; z-index: 1; }
@media (prefers-color-scheme: dark) {
  .hero--photo::before { background: linear-gradient(90deg, rgba(9,6,16,.95) 0%, rgba(26,16,42,.9) 48%, rgba(26,16,42,.68) 100%); }
}

/* ---- Equipment cards with product thumbnails (NYU-style) --------------- */
.eq-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.eq-card__media {
  background: #fff; height: 172px; display: flex; align-items: center; justify-content: center;
  padding: 1rem; border-bottom: 1px solid var(--border); overflow: hidden;
}
.eq-card__media a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.eq-card__media img { max-height: 100%; max-width: 100%; width: auto; object-fit: contain; }
.eq-card__body { padding: 1.25rem 1.4rem 1.5rem; }
.eq-card__body .tag { margin-bottom: .55rem; }
.eq-card__body h3 { font-size: 1.12rem; margin-bottom: .4rem; }
.eq-card__body p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Reveal (subtle; respects reduced motion) -------------------------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---- Utilities ---------------------------------------------------------- */
.mt-2 { margin-top: 2rem; }
.center { text-align: center; }
.map-embed { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); aspect-ratio: 16 / 9; }
.calendar-embed { display: block; max-width: 1000px; margin: 2rem auto; }

/* Google Calendar embed follows the theme. The classic embed is cross-origin
   and has no dark mode, so in dark mode we invert it and correct the hues
   (this also shifts the event colors, an accepted trade-off). */
@media (prefers-color-scheme: dark) {
  .calendar-embed { filter: invert(1) hue-rotate(180deg); }
}

/* ---- Equipment detail page -------------------------------------------- */
.detail-media { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.detail-media img { display: block; width: 100%; height: auto; object-fit: contain; }
.resource-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.resource-list li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.resource-list li:last-child { border-bottom: 0; }
.spec-sheet { margin: 0; max-width: 900px; }
.spec-sheet__row { display: flex; gap: 1.5rem; padding: .8rem 0; border-top: 1px solid var(--border); }
.spec-sheet__row:last-child { border-bottom: 1px solid var(--border); }
.spec-sheet__row dt { flex: 0 0 32%; margin: 0; font-weight: 700; color: var(--ink); }
.spec-sheet__row dd { flex: 1; margin: 0; color: var(--body); }
.spec-sheet__group { margin: 1.75rem 0 .1rem; font-weight: 700; font-size: 1.1rem; color: var(--ink); }
@media (max-width: 640px) {
  .spec-sheet__row { flex-direction: column; gap: .15rem; }
  .spec-sheet__row dt { flex-basis: auto; }
}


/* ================= CCNY off-CMS institutional header / footer =================
   CCNY Off-site CMS Header/Footer spec V4: purple #7D55C7 header bar with the round
   CCNY seal + "The City College of New York" serif wordmark (left-aligned); black #000
   footer with that lockup + CUNY seal (left), social icons (center), copyright (right),
   spread across the width. Brand colors fixed (no dark-mode override). Seal + CUNY seal
   hotlinked from the CCNY theme; social icons inline SVG. */
.ccny-bar { background: #7d55c7; border-bottom: 1px solid rgba(255,255,255,.28); }
.ccny-bar__inner { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad-x); min-height: 65px; display: flex; align-items: center; }
.ccny-bar__logo, .ccny-foot__logo { display: inline-flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.ccny-bar__logo--desktop { display: inline-flex; align-items: center; gap: .75rem; }
.ccny-bar__logo--mobile { display: none; }
.ccny-bar__logo:focus-visible, .ccny-foot a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.ccny-seal { display: block; }
.ccny-bar .ccny-seal { width: 42px; height: 42px; }
.ccny-wordmark { font-family: var(--font-serif); font-weight: 400; color: #fff; line-height: 1.12; }
.ccny-bar .ccny-wordmark { font-size: 1.15rem; white-space: nowrap; }

.ccny-foot { background: #000; color: #fff; }
.ccny-foot__inner { max-width: var(--maxw); margin: 0 auto; padding: 1.25rem var(--pad-x); min-height: 180px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem 2.5rem; flex-wrap: wrap; }
.ccny-foot__brand { display: flex; align-items: center; gap: 1.75rem; }
.ccny-foot .ccny-seal { width: 58px; height: 58px; }
.ccny-foot .ccny-wordmark--stack { font-size: 1.1rem; }
.ccny-foot__cuny { height: 50px; width: auto; display: block; }
.ccny-foot__social { list-style: none; display: flex; align-items: center; gap: 1.1rem; margin: 0; padding: 0; }
.ccny-foot__social a { display: inline-flex; color: #fff; padding: 4px; }
.ccny-foot__social svg { width: 26px; height: 26px; fill: currentColor; }
.ccny-foot__social a:hover svg, .ccny-foot__social a:focus-visible svg { opacity: .8; }
.ccny-foot__copy { margin: 0; font-family: "Trebuchet MS", var(--font); font-size: 16px; color: #fff; }
@media (max-width: 900px) {
  .ccny-bar__inner { justify-content: center; }
  .ccny-bar__logo--desktop { display: none; }
  .ccny-bar__logo--mobile { display: block; height: 50px; width: auto; }
  .ccny-foot__inner { flex-direction: column; text-align: center; gap: 1rem; min-height: 0; }
  .ccny-foot__brand { gap: 1rem; }
  .ccny-foot .ccny-seal { width: 55px; height: 55px; }
  .ccny-foot__cuny { height: 45px; }
}
