:root {
  --black: #222;
  --dark-gray: #444;
  --light-gray: #ddd;
  --white: #fff;
  --main-red: #ef2b2f;

  --gap: 1rem;

  --font-h1: 1.8rem;
  --font-h2: 1.6rem;
  --font-h3: 1.42rem;
  --font-h4: 1.27rem;
  --font-h5: 1.13rem;
  --font-h6: 0.89rem;
  --font-small: 0.79rem;
}

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

/**/

/*@font-face {
  font-family: "Fira Sans";
  src: url(/assets/fonts/FiraSans-Regular.woff2) format("woff2");
}

@font-face {
  font-family: "Fira Sans";
  font-weight: bold;
  src: url(/assets/fonts/FiraSans-SemiBold.woff2) format("woff2");
}

@font-face {
  font-family: "Fira Sans";
  font-style: italic;
  src: url(/assets/fonts/FiraSans-Italic.woff2) format("woff2");
}

@font-face {
  font-family: "Fira Sans";
  font-weight: bold;
  font-style: italic;
  src: url(/assets/fonts/FiraSans-SemiBoldItalic.woff2) format("woff2");
}*/

@font-face {
  font-family: "Nunito Sans";
  src: url(/assets/fonts/NunitoSans.woff2) format("woff2-variations");
  font-style: normal;
}

@font-face {
  font-family: "Nunito Sans Italic";
  src: url(/assets/fonts/NunitoSans-Italic.woff2) format("woff2-variations");
  font-weight: 300 800;
  font-style: italic;
}

/**/

@layer reset {

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
  font-size: clamp(1em, 20px, 1.25em);
}

@media screen and (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin-block-end: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

body {
  min-height: 100vh;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

input,
button,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

textarea:not([rows]) {
  min-height: 10em;
}

:target {
  scroll-margin-block: 5ex;
}
}
/**/

body {
  font-family:
    "Nunito Sans",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Helvetica Neue",
    sans-serif;
  font-synthesis: none;
  color: var(--black);
  background-color: var(--white);
  display: grid;
  grid-template-columns:
    [full-start] var(--gap)
    [margin-start] minmax(0, 1fr)
    [wide-start] clamp(0px, 10vi - 30px, 6em)
    [content-start] minmax(auto, 16em) [center]
    minmax(auto, 16em) [content-end]
    clamp(0px, 10vi - 30px, 6em) [wide-end]
    minmax(0, 1fr) [margin-end]
    var(--gap) [full-end];
  margin: 0;
}

h1, .h1 { font-size: var(--font-h1); }
h2, .h2 { font-size: var(--font-h2); }
h3, .h3 { font-size: var(--font-h3); }
h4, .h4 { font-size: var(--font-h4); }
h5, .h5 { font-size: var(--font-h5); }
h6, .h6 { font-size: var(--font-h6); }
small, .small {
  font-size: var(--font-small);
}

:where(h1, h2, h3, h4, h5, h6) {
  margin-block-start: 2.5em;
  margin-block-end: 1.5em;
}

p {
  margin: 0;
}

a {
  text-decoration-color: var(--main-red);
  text-decoration-thickness: 2px;

  &:visited {
    color: var(--dark-gray);
  }

  &:hover {
    text-decoration-color: var(--black);
  }
}

:focus-visible {
  outline: 2px solid royalblue;
  outline-offset: 2px;
}

/**/

a.cta {
  display: inline-block;
  border-radius: 999px;
  margin: 0.5rem 0;
  padding: 0.75rem 1.5rem;
  color: var(--white);
  background-color: var(--main-red);
  text-decoration: none;

  &:hover {
    background-color: color-mix(in srgb, var(--main-red) 80%, var(--black) 20%);
  }
}

/**/

#skiplink {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.5rem;
  color: var(--white);
  background-color: var(--main-red);

  &:not(:focus) {
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }
}

.site-header {
  grid-column: margin;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-block-end: 2rem;
}

.site-header .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.logo {
  padding-block-start: 0.5rem;
}

.language-switcher {
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.language-switcher li a {
  display: block;
  text-decoration: none;
  border-block-start: 4px solid transparent;

  &[aria-current="true"] {
    font-weight: bold;
    border-block-start-color: var(--main-red);
  }

  &:hover {
    text-decoration: underline var(--main-red);
  }
}

.header-links {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: right;
}

.header-links .contact a::before {
  content: "✉️ ";
  display: inline-block;
  padding-inline-end: 0.25rem;
  text-decoration: none;
}

.header-links .communi a {
  position: relative;

  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: -1.25rem;
    width: 1em;
    height: 100%;
    background-image: url('/assets/img/communi-square.svg');
    background-size: contain;
    background-position: right center;
    background-repeat: no-repeat;
  }
}

/**/

.banner {
  grid-column: margin;
  max-height: 280px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-block-end: 2rem;

  picture, img {
    width: 100%;
    /*height: auto;
    object-fit: cover;
    object-position: center;*/
  }
}

/**/

:where(body) > .wrapper {
  grid-column: full;
  display: grid;
  grid-template-columns: subgrid;
}

:where(body:not(.home)) main {
  grid-column: wide;
}

main p {
  margin-block: 1rem;
}

/**/

.site-footer {
  grid-column: full;
  display: grid;
  grid-template-columns: subgrid;
  margin-block-start: 2rem;
  padding-block: 4rem;
  background-color: var(--light-gray);
}

.site-footer .wrapper {
  grid-column: margin;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 1rem;
}

/**/

:where(body.home) > .wrapper {
  grid-column: margin;
  margin-block-start: 3rem;
  display: grid;
  grid-template-columns: subgrid;

  @media screen and (min-width: 768px) {
    grid-template-columns: minmax(0, 65ch) minmax(0, 32.5ch);
    justify-content: center;
    gap: 2rem;
  }
}

:where(body.home) main {
  grid-column: wide;
  @media screen and (min-width: 768px) {
    grid-column: 1;
  }
}

:where(body.home) main > h1 {
  margin-block-start: 0;
}

:where(body.home) aside {
  grid-column: wide;
  border-block-start: 1px solid var(--light-gray);
  @media screen and (min-width: 768px) {
    grid-column: 2;
    padding-inline-start: 2rem;
    border-inline-start: 1px solid var(--light-gray);
    border-block-start: none;
  }
}

:where(body.home) aside > h2 {
  @media screen and (min-width: 768px) {
    margin-block-start: 0;
  }
}

.upcoming-events {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-block-start: 2rem;
  display: flex;
  flex-direction: column;
  /*gap: 1.5rem;*/
}

.upcoming-events li.day {
  font-weight: bold;

  &::before {
    content: "🗓️ ";
    display: inline-block;
  }

  & + li.day {
    margin-block-start: 2rem;
    padding-block-start: 2rem;
    border-block-start: 1px solid var(--light-gray);
  }
}

.upcoming-events li.day ul {
  list-style: none;
  padding: 0;
  font-weight: normal;
}

.upcoming-events li.day > ul {
  margin-block-start: 0.5rem;
  margin-inline-start: 1.25rem;
}

:where(.upcoming-events) .event {
  font-size: var(--font-small);

  &+ .event {
    margin-block-start: 1rem;
    padding-block-start: 1rem;
    border-block-start: 1px solid var(--light-gray);
  }
}

.upcoming-events .name {
  font-weight: bold;
}

.upcoming-events .time::before {
  content: "🕒 ";
  display: inline-block;
  width: 1.5rem;
}

.upcoming-events .location::before {
  content: "📍 ";
  display: inline-block;
  width: 1.5rem;
}

.upcoming-events .organizer::before {
  content: "👤 ";
  display: inline-block;
  width: 1.5rem;
}

.upcoming-events .link a::before {
  content: "🔗 ";
  display: inline-block;
  width: 1.5rem;
}

.upcoming-events .ics-download a::before {
  content: "📅 ";
  display: inline-block;
  width: 1.5rem;
}
