.site-header, main, footer { padding: 22px max(6vw, 20px); }
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #c8ac79;
}
.site-header strong {
  color: #651e28;
  font: 900 1.125rem/1.15 Georgia, serif;
  text-shadow: .012em 0 currentColor, -.012em 0 currentColor;
  text-decoration: underline #be9557 2px;
  text-underline-offset: .2em;
}
.top-controls {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin-inline-start: clamp(1rem, 4vw, 4rem);
}
button { cursor: pointer; font: inherit; }
.top-controls button, .top-controls a, dialog button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .5rem 1rem;
  border: 1px solid #926d40;
  border-radius: 24px;
  background: transparent;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.top-controls .join-free { margin-inline-start: auto; }
.top-controls .join-free, #membership-button, #install-app {
  background: #741c29;
  color: #fff5e2;
  border-color: #d9b673;
  font-weight: 650;
}
.top-controls .app-updates-link { gap: .35rem; color: #651e28; font-weight: 650; }
.top-controls .app-updates-link:hover { background: #fff0d4; }
.local-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  padding: .4rem max(4vw, 12px);
  background: white;
}
.local-actions span { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.local-actions a { color: #752532; font-weight: 700; text-underline-offset: 4px; }
.local-actions .top-search, .local-actions .free-tickets-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: .38rem .72rem;
  border: 1px solid #976b24;
  border-radius: 1.4rem;
  background: #f1c45d;
  color: #481525;
  text-decoration: none;
}
.local-actions .free-tickets-link {
  min-height: 44px;
  padding: .35rem .9rem;
  border-color: #d9b673;
  background: #741c29;
  color: #fff5e2;
}
.local-actions .top-search:hover { background: #ffda86; }
.local-actions .free-tickets-link:hover { background: #59131f; }

.hero { background: #641d24; color: #fff5e2; padding-bottom: 1.6rem; border-bottom: 5px solid #bd9358; }
.hero-picture {
  position: relative;
  isolation: isolate;
  min-height: clamp(19rem, 41vw, 31rem);
  margin-bottom: .9rem;
  background: #b29a85;
}
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left bottom; }
.picture-caption { position: absolute; inset: .45rem 0 auto; }
.picture-caption p {
  padding: .35rem .3rem;
  background: #2b101ccb;
  color: #fff5df;
  font: 700 clamp(.66rem, 2.9vw, 1.3rem)/1.35 Georgia, serif;
  text-align: center;
}
.hero-actions {
  position: absolute;
  inset: clamp(2.3rem, 7vw, 3.3rem) clamp(.5rem, 3vw, 2rem) auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .3rem;
}
.hero-picture .join-free {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 44px;
  padding: .35rem 1rem;
  border: 1px solid #dec397;
  border-radius: 999px;
  background: #681f30;
  color: #fff8e8;
  font: 650 1rem/1.25 system-ui;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 2px 6px #30121a40;
}
.hero-picture .join-free:hover { background: #541420; }
.hero-picture .join-free:focus-visible { outline: 3px solid white; }
.new-to-sussex-actions { display: grid; justify-items: end; gap: .35rem; }
.qr-preview {
  display: grid;
  justify-items: center;
  gap: .2rem;
  padding: .35rem .5rem;
  border: 1px solid #dec397;
  border-radius: .65rem;
  background: #fffaf1;
  color: #611c29;
  font: 700 .875rem/1.25 system-ui;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 2px 6px #30121a40;
}
.qr-preview img { display: block; width: 6rem; height: 6rem; }
.qr-preview:hover { background: #ffedc5; }
.hero-community-actions {
  position: absolute;
  inset: 68% auto auto 50%;
  translate: -50% -50%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .45rem;
  width: max-content;
  max-width: calc(100% - 1rem);
}
.hero-community-actions .join-free { background: #ffdb8d; color: #49151e; font-weight: 800; }
.hero-community-actions .join-free:hover { background: #ffeabc; }
.hero > small, .hero h1, .hero-links { margin-inline: max(6vw, 20px); }
.hero > small { display: block; color: #f1ce91; letter-spacing: .13em; }
.hero h1 { max-width: none; margin-block: 20px; font: 400 clamp(1.25rem, 2.5vw, 1.65rem)/1.22 Georgia, serif; letter-spacing: normal; }
.hero-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.hero-links a {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: .35rem .65rem;
  border-radius: .4rem;
  background: #e0bd76;
  color: #51202a;
  font: 600 .875rem/1.35 system-ui;
  text-decoration: none;
}
.hero-links a:hover { background: #edce91; }
.hero-links a.support-link { background: #b4192c; border: 2px solid #fff0dc; color: white; font-weight: 800; }
.picture-community {
  position: absolute;
  inset: auto clamp(.45rem, 3vw, 2rem) .6rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .42rem;
}
.picture-community a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 44px;
  padding: .4rem .25rem;
  border: 1px solid #e9c47d;
  border-radius: .65rem;
  background: #fff1d0;
  color: #561b2a;
  font: 750 .9rem/1.35 system-ui;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 2px 9px #2d111d55;
}
.picture-community a:hover { background: #ffdf98; }
.picture-community [aria-hidden] { font-size: 1.15em; line-height: 1; }

main h2, .feature-section h2, .membership h2, .section-heading h2 { font: 400 1.125rem/1.3 Georgia, serif; }
main h3, main summary, .search-label { font-size: 1rem; line-height: 1.35; }
#photo-gallery { margin: 0 0 .7rem; }
.views { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 36px; }
.views button { display: block; width: 100%; border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.views button:focus-visible { outline: 3px solid #915e24; outline-offset: 3px; }
.views img { display: block; width: 100%; height: auto; aspect-ratio: 3/2; object-fit: cover; border-radius: 10px; }
dialog { border: 1px solid #c8ac79; border-radius: .7rem; background: #fffaf1; color: #352522; max-width: min(90vw, 32rem); padding: 1.1rem; }
dialog::backdrop { background: #25151aad; }
dialog h2, dialog p { margin-bottom: .7rem; }
#art-view { padding: .45rem; border-color: #cfad72; border-radius: 12px; background: #39141b; max-width: 92vw; }
#art-view::backdrop { background: #210d13df; }
#art-view img { display: block; max-width: 85vw; max-height: 76vh; border-radius: 6px; }
#art-view button { position: absolute; top: .7rem; right: .7rem; justify-content: center; padding: 0; background: #fff8e9; color: #581d28; border: 0; width: 44px; font-size: 24px; }
.explore { padding-block: 0 2rem; }
.section-heading { margin-bottom: .8rem; }
.area-guides { font-size: .9375rem; line-height: 1.4; }
.area-guides p { margin: .35rem 0 .65rem; }
#search { display: block; width: 100%; max-width: 36rem; margin: .3rem 0 1rem; padding: .65rem; border: 1px solid #ad936c; border-radius: .4rem; font: inherit; }
#directory-search .filters { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 1rem; }
#directory-search select { min-width: 10rem; max-width: 100%; border-color: #ad936c; }
#directory-search button {
  padding: .65rem 1.8rem;
  background: #791d26;
  border: 1px solid #791d26;
  border-radius: 30px;
  color: white;
  font-weight: 650;
}
.cards {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: .375rem;
  align-items: start;
}
.card { display: block; padding: 0; border: 1px solid #ddc9a9; border-radius: 0; background: #fffdf8; }
.card summary { padding: .4rem .65rem; color: #791d26; font-weight: 650; cursor: pointer; }
.card > :not(summary) { margin: .2rem .65rem .45rem; }
.card .card-town { margin: .2rem .65rem .45rem; }
.card .card-actions { width: auto; padding: 0; }
.social-invitation { border: 1px solid #ddc9a9; padding: .6rem; margin-block: .6rem; }
.social-invitation p, #profile-status:not(:empty) { margin-top: .35rem; }
.member-profile { margin-top: .7rem; }
.member-profile form { max-width: 35rem; }
.feature-section button { padding: .4rem .7rem; border: 1px solid #ddc9a9; border-radius: .5rem; background: #fffdf8; color: #741c29; font-weight: 650; }
.feature-section button:hover { background: #fff0d4; }
.event-organiser {
  margin-top: .7rem;
  padding: .55rem .65rem;
  border: 1px solid #ddc9a9;
  border-radius: .45rem;
  background: #fffaf1;
}
.event-organiser summary { color: #741c29; font-weight: 750; cursor: pointer; }
.event-organiser dl { margin: .55rem 0; }
.event-organiser dt { font-weight: 650; }
.event-organiser dd { margin: 0 0 .35rem; }
.event-organiser .event-contact { margin: 0; padding: 0; list-style: none; }
.event-organiser .event-contact a { margin-top: 0; }
footer { border-top: 1px solid #ddc9a9; color: #775d48; }
footer p { margin-top: .4rem; }

@media (max-width: 740px) {
  .site-header { padding: 10px 8px; gap: .45rem; }
  .site-header strong { flex-basis: 100%; font-size: calc(1.125rem * var(--mobile-type-fit, 1)); }
  .top-controls { flex-basis: 100%; margin: 0; gap: 3px; }
  .top-controls .join-free { margin: 0; }
  .top-controls button, .top-controls a {
    min-height: 40px;
    padding: .4rem clamp(3px, 1.3vw, 9px);
    font-size: calc(clamp(.78rem, 2.65vw, .98rem) * var(--mobile-type-fit, 1) * var(--toolbar-text-fit, 1));
    line-height: 1.15;
  }
  #install-app { display: none; }
}
@media (min-width: 520px) and (max-width: 740px) {
  .local-actions { display: grid; grid-template-columns: max-content minmax(0, 1fr); justify-items: start; }
  .local-actions .free-tickets-link { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .hero-picture {
    --hero-gutter: clamp(.5rem, 3vw, 2rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: .45rem var(--hero-gutter) .6rem;
    background: #641d24;
  }
  .site-header, .local-actions, .hero-picture { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  .local-actions { font-size: calc(1rem * var(--mobile-type-fit, 1)); }
  .hero-photo {
    position: static;
    grid-area: 2 / 1;
    z-index: -1;
    display: block;
    width: calc(100% + 2 * var(--hero-gutter));
    height: min(72vw, 24rem);
    margin-inline: calc(-1 * var(--hero-gutter));
  }
  .picture-caption, .hero-actions, .hero-community-actions, .picture-community { position: static; }
  .picture-caption { grid-row: 1; margin-inline: calc(-1 * var(--hero-gutter)); }
  .picture-caption p { font-size: calc(clamp(.6rem, 2.9vw, 1.3rem) * var(--mobile-type-fit, 1)); text-wrap: balance; }
  .hero-actions {
    display: grid;
    grid-area: 2 / 1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-self: start;
    padding-top: .35rem;
  }
  .new-to-sussex-actions { min-width: 0; }
  .qr-preview { max-width: 100%; font-size: calc(.875rem * var(--mobile-type-fit, 1)); }
  .qr-preview img { max-width: 100%; height: auto; }
  .hero-community-actions {
    translate: none;
    justify-self: center;
    max-width: 100%;
    margin-block: .65rem clamp(.65rem, 4vw, 1.5rem);
  }
  .hero-picture .join-free { padding: .25rem .55rem; font-size: calc(.9rem * var(--mobile-type-fit, 1)); }
  .picture-community { gap: .25rem; }
  .picture-community a {
    flex-direction: column;
    justify-content: flex-start;
    gap: .2rem;
    padding: .35rem .125rem;
    font-size: calc(clamp(.65rem, 2.2vw, .8125rem) * var(--mobile-type-fit, 1));
    line-height: 1.15;
    overflow-wrap: anywhere;
  }
  .picture-community a span { max-width: 100%; }
}
@media (max-width: 600px) {
  .hero-actions { padding-bottom: .35rem; }
  .hero-photo { grid-row: 3; }
}
@media (max-width: 700px) {
  .hero h1 { margin-block: 6px; font-size: 1.2rem; }
  .hero small { font-size: .72rem; line-height: 1.35; letter-spacing: .06em; }
  .views { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
}
