@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  --linen:  #efebe6;
  --black:  #000000;
  --white:  #ffffff;
  --subtle: #d0c9c1;
  --gap:    8px;
  --pad:    16px;
  --font:   'Space Grotesk', Verdana, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { width: 100%; height: 100%; overflow: hidden; }

body {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--linen);
  font-family: var(--font);
  color: var(--black);
  -webkit-tap-highlight-color: transparent;
}

/* ── SHELL ── */
.shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

/* ── HEADER ── */
header {
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  border-bottom: 2px solid var(--black);
  flex-shrink: 0;
  gap: var(--pad);
  min-width: 0;
  height: 70px;
}

.header-logo { flex-shrink: 0; }
.header-logo img { height: 42px; width: auto; display: block; }

.header-cta {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.vote-cta {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--black);
  white-space: nowrap;
}

/* Voting closed banner (replaces vote-cta when date-gated) */
.voting-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #888;
  white-space: nowrap;
}

/* ── HEADER RESPONSIVE ── */
@media (max-width: 768px) {
  header { height: 58px; gap: 12px; }
  .header-logo img { height: 32px; }
  .vote-cta { font-size: 11px; }
}

@media (max-width: 520px) {
  header { height: auto; flex-wrap: wrap; padding: 10px var(--pad); gap: 6px; }
  .header-logo { order: 1; }
  .header-cta { order: 2; flex: 0 0 100%; justify-content: center; margin-block: 2px -6px; }
  .header-logo img { height: 26px; }
  .vote-cta { font-size: 10px; }
}

/* ── MAIN ── */
main {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

/* ── ARTWORK GRID — JS justified rows ── */
.artwork-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: var(--pad);
}

.art-row {
  display: flex;
  gap: calc(var(--gap) * 2);
  align-items: flex-start;
  flex-shrink: 0;
}

.artwork-card {
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
  transition: opacity 0.2s ease;
}

.card-mount {
  width: 100%;
  position: relative;
  background: var(--linen);
  border: clamp(2px, 0.5vw, 5px) solid var(--white);
}

.card-mount img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Selection ring */
.artwork-card.selected .card-mount {
  outline: 3px solid var(--black);
  outline-offset: -3px;
}

/* Checkmark badge */
.sel-mark {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

.sel-mark svg { width: 11px; height: 11px; }

.artwork-card.selected .sel-mark {
  opacity: 1;
  transform: scale(1);
}

/* Label strip */
.card-label { padding: 5px 0 4px; max-width: 200px; }

.card-artist {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title {
  font-size: 9px;
  font-weight: 300;
  font-style: italic;
  color: #888;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artwork-card.dimmed { opacity: 0.28; }

/* ── FOOTER ── */
footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--pad);
  border-top: 2px solid var(--black);
  flex-shrink: 0;
  min-width: 0;
  height: 68px;
}

.footer-lockup {
  display: flex;
  align-items: center;
  padding-right: var(--pad);
  border-right: 1px solid var(--subtle);
  flex-shrink: 0;
  height: 100%;
}

.footer-lockup img {
  height: 34px;
  width: auto;
  display: block;
  filter: brightness(0);
}

.sponsor-groups {
  display: flex;
  align-items: center;
  overflow: hidden;
  min-width: 0;
  height: 100%;
}

.sponsor-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0 var(--pad);
  border-right: 1px solid var(--subtle);
  gap: 3px;
  flex-shrink: 0;
  height: 100%;
}

.sponsor-group:last-child { border-right: none; }

.sponsor-label {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aaa;
  white-space: nowrap;
}

.sponsor-group img { height: 22px; width: auto; display: block; }

/* ── FOOTER RESPONSIVE ── */
@media (max-width: 768px) {
  footer { height: 58px; }
  .footer-lockup { padding-right: 10px; }
  .footer-lockup img { height: 26px; }
  .sponsor-group { padding: 0 10px; }
  .sponsor-group img { height: 17px; }
  .sponsor-label { font-size: 6px; }
}

@media (max-width: 600px) {
  footer {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 10px var(--pad);
    gap: 10px;
    overflow: visible;
  }
  .footer-lockup { height: auto; border-right: none; border-bottom: 1px solid var(--subtle); padding: 0 0 10px; }
  .footer-lockup img { height: 28px; }
  .sponsor-groups { height: auto; overflow: visible; flex-wrap: wrap; gap: 4px; }
  .sponsor-group { height: auto; border-right: none; padding: 4px 12px 4px 0; gap: 2px; }
  .sponsor-group img { height: 18px; }
  .sponsor-label { font-size: 6.5px; }
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(239,235,230,0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 100;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--white);
  border: 1.5px solid var(--black);
  width: min(680px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-recap {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.modal-thumb-wrap {
  width: 110px;
  height: unset;
  min-height: 110px;
  background: var(--linen);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  flex-shrink: 0;
}

.modal-thumb-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

.modal-recap-info {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.modal-recap-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #bbb;
  margin-bottom: 3px;
}

.modal-recap-artist { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.modal-recap-title  { font-size: 13px; font-weight: 300; font-style: italic; color: #555; }
.modal-recap-medium { font-size: 10px; color: #aaa; margin-top: 3px; }
.modal-recap-school { font-size: 10px; color: #bbb; font-weight: 500; }

.modal-close {
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-left: 1px solid #eee;
  flex-shrink: 0;
  color: #bbb;
  font-size: 18px;
  font-family: var(--font);
  transition: color 0.15s;
}

.modal-close:hover { color: var(--black); }

/* Artist statement */
.modal-statement { padding: 14px 20px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0; }

.modal-statement p {
  font-size: 12px;
  font-weight: 300;
  color: var(--black);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Voting closed state */
.modal-voting-closed {
  display: none;
  padding: 24px;
  text-align: center;
}

.modal-voting-closed p {
  font-size: 13px;
  color: #888;
  font-weight: 300;
  line-height: 1.5;
}

/* Form */
.modal-body { padding: 18px 24px 22px; overflow-y: auto; }

.modal-form-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--black);
  text-transform: none;
  margin-bottom: 14px;
}

/* ── Override Gravity Forms orbital theme styles ── */
.modal-body .gform_wrapper { margin: 0 !important; }

.modal-body .gform_wrapper .gfield_label {
  font-family: var(--font) !important;
  font-size: 9px !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: #aaa !important;
  margin-bottom: 4px !important;
}

.modal-body .gform_wrapper input[type="text"],
.modal-body .gform_wrapper input[type="email"] {
  background: transparent !important;
  border: none !important;
  border-bottom: 1.5px solid var(--subtle) !important;
  border-radius: 0 !important;
  padding: 8px 0 !important;
  font-family: var(--font) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: var(--black) !important;
  box-shadow: none !important;
  width: 100% !important;
}

.modal-body .gform_wrapper input[type="text"]:focus,
.modal-body .gform_wrapper input[type="email"]:focus {
  border-bottom-color: var(--black) !important;
  outline: none !important;
  box-shadow: none !important;
}

.modal-body .gform_wrapper .gform_fields {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
}

.modal-body .gform_wrapper .gfield--type-checkbox,
.modal-body .gform_wrapper .gfield--type-html,
.modal-body .gform_wrapper .gfield--type-hidden {
  grid-column: 1 / -1 !important;
}

.modal-body .gform_wrapper .gfield_checkbox .gchoice {
  font-size: 12px !important;
  color: #555 !important;
  line-height: 1.4 !important;
  margin-bottom: 8px !important;
}

.modal-body .gform_wrapper .gform_footer {
  margin-top: 4px !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
}

.modal-body .gform_wrapper .gform_button {
  background: var(--black) !important;
  color: var(--white) !important;
  border: none !important;
  padding: 12px 28px !important;
  font-family: var(--font) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  border-radius: 0 !important;
}

.modal-body .gform_wrapper .gform_button:hover { background: #333 !important; }

/* Gravity Forms confirmation */
.gform_confirmation_wrapper {
  padding: 44px 24px 36px;
  text-align: center;
}

.gform_confirmation_message {
  font-family: var(--font);
  font-size: 13px;
  color: #777;
  font-weight: 300;
  line-height: 1.5;
}

/* Cancel link */
.modal-cancel {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 11px;
  color: #aaa;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  display: none;
}

.gform_wrapper ~ .modal-cancel { display: inline; }

/* Hide/show states */
.modal-body.hide, .modal-recap.hide, .modal-statement.hide { display: none; }

/* ── FORM FIXES ── */

/* Remove fieldset border and visually hide its legend (keep in DOM for GF validation) */
.modal-body .gform_wrapper fieldset {
  border: none;
  padding: 0;
  margin: 0;
}
.modal-body .gform_wrapper fieldset .gfield_label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Validation messages */
.modal-body .gform_wrapper .gfield_validation_message,
.modal-body .gform_wrapper .validation_message {
  font-size: 11px;
  font-weight: 400;
  color: #c0392b;
  margin-top: 4px;
  padding: 0;
  background: none;
  border: none;
}

.modal-body .gform_wrapper .gform_validation_errors {
  font-size: 11px;
  font-weight: 500;
  color: #c0392b;
  padding: 8px 0;
  background: none;
  border: none;
  box-shadow: none;
}

.modal-body .gform_wrapper .gform_validation_errors h2,
.modal-body .gform_wrapper .gform_validation_errors * {
  font-size: 11px;
  font-weight: 500;
  color: #c0392b;
}

/* Required indicator: show * instead of the word "Required" */
.modal-body .gform_wrapper .gfield_required_text {
  display: none;
}
.modal-body .gform_wrapper .gfield_required::after {
  content: ' *';
  color: #aaa;
  font-weight: 400;
}

/* Hide character count warning on textareas */
.warningTextareaInfo { display: none !important; }

/* ── SCROLL HINT ── */
.scroll-hint {
  position: fixed;
  bottom: calc(50% - 20px);
  right: calc(50% - 20px);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  opacity: 1;
  pointer-events: none;
  animation: scrollBounce 1.6s ease-in-out infinite;
  transition: opacity 0.4s ease;
  z-index: 10;
  background: rgba(1, 1, 1, 0.3);
  border-radius: 50%;
}

.scroll-hint.hidden { opacity: 0; }

.scroll-hint svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(7px); }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint { animation: none; }
}
