/* ---------------------------------
  MCC Padus – tyylit
  - Rakenne: perustyylit, skip-link, header/nav, main/hero, CTA:t, tapahtumat, footer, yhteystiedot, media-queryt, varoitusmodal.
  - Periaatteet: mobiili-first, WCAG-fokus- ja aria-tuki, clamp-typografia, CSS Grid/Flex.
  - Väripaletti: tausta #181818, teksti #fff, pääväri #E53935, sekundääri #FFCDD2.
---------------------------------*/

/* ==============================
  1. PERUSTYYLIT
  ============================== */

/* Body: perusvärit ja fontit */
body {
  background-color: #181818;
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
  font-size: 18px;
  margin: 0;
}

/* Otsikot */
h1, h2, h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

/* Navigaation h1 */
h1 {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: clamp(32px, 4vw, 40px);
}

/* Osioiden otsikot */
h2, h3 {
  font-size: 24px;
}

/* Linkillinen h2 */
h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

h2 a:hover {
  color: #FFCDD2;
}

h2 a:focus-visible {
  outline: 2px solid #FFCDD2;
  outline-offset: 4px;
  border-radius: 2px;
}

/* Hero-h1 */
.hero h1 {
  white-space: normal;
  flex-shrink: 1;
  font-size: clamp(32px, 7vw, 48px);
}

/* Hero-p */
.hero > p {
  font-size: clamp(16px, 4vw, 20px);
  line-height: 1.4;
}

/*
  Linkit: Valkoinen väri ilman alleviivausta.
  Korostus tulee hover/focus-tiloissa (ks. nav a:hover jne.).
*/
a {
  color: #ffffff;
  text-decoration: none;
}

/* "Näytä kaikki" -linkki */
.view-all-link {
  display: block;
  font-size: clamp(0.75rem, 0.8rem + 0.3vw, 0.95rem);
  margin-top: 0.75rem;
  text-align: center;
  font-style: italic;
  color: #FFCDD2;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.view-all-link:hover {
  color: #E53935;
  opacity: 1;
}

.view-all-link:focus-visible {
  outline: 2px solid #E53935;
  outline-offset: 2px;
}

/* CTA-painike */
.cta-btn {
  display: inline-block;
  background: #E53935;
  color: #ffffff;
  font-weight: 700;
  padding: 0.6rem 1.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
}

.cta-btn:hover {
  background: #d32f2f;
  box-shadow: 0 4px 8px rgba(255, 205, 210, 0.4);
}

.cta-btn:active {
  background: #b71c1c;
  box-shadow: 0 2px 4px rgba(255, 205, 210, 0.3);
}

/* CTA nuoli */
.cta-btn span {
  margin-left: 0.4rem;
}

/* Hero CTA */
.hero .cta-btn {
  padding: 0.65rem 1.5rem;
  font-size: clamp(0.95rem, 1rem + 0.2vw, 1.1rem);
  align-self: center;
}

/* ==============================
  2. SKIP-LINKKI (Saavutettavuus)
  ============================== */

/* Skip-link: hyppää pääsisältöön */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  color: #181818;
  z-index: 9999;
  border-radius: 4px;
  text-decoration: none;
}

/* ==============================
  3. HEADER + NAVIGAATIO
  ============================== */

/* Header */
header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* Burger-painike */
.burger {
  font-size: 2rem;
  background: none;
  color: #fff;
  border: none;
  cursor: pointer;
}

/* Navigaatio: mobiilissa suljettu, .open avaa */
nav {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 320ms ease, opacity 220ms ease, transform 220ms ease;
  background: #232323;
  border-radius: 0 0 8px 8px;
  padding: 0.25rem 0.5rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
}

/* Avoin menu */
nav.open {
  max-height: 480px;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

nav ul {
  list-style: none;
  padding: 0.25rem 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: stretch;
}

/* Nav linkit */
nav a {
  display: block;
  padding: 0.6rem 1.8rem;
  text-align: right;
  border-radius: 6px;
  transition: background-color 220ms ease, color 220ms ease;
  font-weight: 500;
}

/* Nav linkkien focus-visible */
nav a:focus-visible {
  background: #FFCDD2;
  color: #181818;
  outline: 3px solid #FFCDD2;
  outline-offset: 3px;
  border-radius: 6px;
}

/* Nav linkkien hover */
nav a:hover {
  background: #FFCDD2;
  color: #181818;
}

/* Yleinen fokus linkille */
a:focus-visible {
  outline: 3px solid #FFCDD2;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Painikkeiden fokus */
.burger:focus-visible,
.cta-btn:focus-visible {
  outline: 3px solid #FFCDD2;
  outline-offset: 3px;
  border-radius: 6px;
  background: #FFCDD2;
  color: #181818;
}


/* ==============================
  4. MAIN + HERO-OSIO
  ============================== */

/* Main */
main {
  padding: 0 1rem 1rem 1rem;
  max-width: 100%;
  text-align: center;
}

/* Hero: gradientin päällä taustakuva pseudo-elementissä */
.hero {
  margin-bottom: 2.5rem;
  margin-top: 0;
  position: relative;
  background: linear-gradient(180deg, rgba(24,24,24,0.75), rgba(24,24,24,0.5));
  overflow: hidden;
  isolation: isolate;
  z-index: 0;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  padding: 1.5rem 1.25rem 1.5rem;
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.75rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Hero-taustakuvat per sivu */
.index_hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('img/index_hero_bg.webp') center center/cover no-repeat;
  z-index: -1;
  pointer-events: none;
}

.calendar_hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('img/calendar_hero_bg.webp') center center/cover no-repeat;
  z-index: -1;
  pointer-events: none;
}

.contact_hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('img/contact_hero_bg.webp') center center/cover no-repeat;
  z-index: -1;
  pointer-events: none;
}

/* Mobiileille omat taustakuvat */
@media (max-width: 599px) {
  .index_hero::before {
    background: url('img/index_hero_bg_mobile.webp') center center/cover no-repeat;
  }

  .calendar_hero::before {
    background: url('img/calendar_hero_bg_mobile.webp') center center/cover no-repeat;
  }

  .contact_hero::before {
    background: url('img/contact_hero_bg_mobile.webp') center center/cover no-repeat;
  }
}



/* ==============================
  5. CTA-PAINIKKEET
  ============================== */

/* CTA pieni versio */
.cta-btn--small {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

/* ==============================
  6. TAPAHTUMA-KORTIT
  ============================== */

/* ------------------------------
   TAPAHTUMAT – KORTIT (event-card)
  Korttimainen asettelu: grid-otsikkorivi, punainen päivämäärämerkki.
--------------------------------*/
.events-list {
  list-style: none;
  padding: 0;
  margin: 0.85rem 0 0;
  display: grid;
  gap: 0.65rem;
  text-align: left;
  justify-items: center;
}

.events-list li {
  display: flex;
  width: 100%;
  justify-content: center;
  max-width: 450px;
}

.event-card {
  background: #0f0f0f;
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.1rem;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
  border: 1px solid #262626;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.events-list li article {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Painikke event-cardissa: aina oikeassa alakulmassa */
.event-card .cta-btn {
  align-self: flex-end;
  margin-top: 1.2rem;
}

.event-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: start;
}

.event-head .title-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.35rem;
  width: 100%;
}

.event-title {
  margin: 0;
  font-size: clamp(1.15rem, 1.2rem + 0.6vw, 1.8rem);
  letter-spacing: 0.2px;
  flex-shrink: 1;
  min-width: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-date {
  background: #E53935;
  color: #ffffff;
  border-radius: 12px;
  padding: 0.25rem 0.6rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  justify-self: end;
  align-self: start;
}

.place {
  display: block;
  margin-top: 0.35rem;
  color: #FFCDD2;
  font-weight: 600;
}

.event-desc {
  margin: 0.8rem 0 0;
  padding: 0 1rem 0;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.15rem);
  color: #f1f1f1;
  opacity: 0.95;
  flex: 1;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card:hover,
.event-card:focus-within {
  transform: none;
  transition: box-shadow 160ms ease;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
}

@media (max-width: 399px) {
  .event-date {
    margin-left: auto;
  }
}

/* ------------------------------
   ETUSIVU – ESIKATSELU
--------------------------------*/
.events:not(.events--grid-2) .events-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.events:not(.events--grid-2) .events-list li {
  display: block;
  width: 100%;
  max-width: 500px;
}

.events:not(.events--grid-2) .events-list li > a {
  display: block;
}

.events:not(.events--grid-2) .event-head .title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.5rem;
  row-gap: 0.2rem;
  margin-bottom: 0.15rem;
  justify-items: start;
}

.events:not(.events--grid-2) .event-date {
  background: #E53935;
  color: #ffffff;
  border-radius: 12px;
  padding: 0.25rem 0.6rem;
  font-weight: 600;
  line-height: 1;
  align-self: center;
}

/* Pienemmät event-kortit etusivulle (vähentää CSS-spesifisyyttä) */
.event-card--small {
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
}

/* Etusivun korteissa painike ei täytä leveyttä, sijaitsee alareunassa */
.event-card--small .cta-btn {
  align-self: flex-start;
  margin-top: auto;
}

.events-list p {
  margin: 0.4rem 0 0;
}

/* ------------------------------
  ALATUNNISTE
--------------------------------*/
footer {
  padding: 1rem;
  text-align: center;
  opacity: 0.85;
}

footer p {
  margin: 0 0 0.75rem 0;
}

/* Footer some-linkit */
.footer-social ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(229, 57, 53, 0.1);
  color: #FFCDD2;
  font-size: 1.25rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.footer-social a:hover {
  background: rgba(229, 57, 53, 0.25);
  color: #E53935;
}

.footer-social a:focus-visible {
  outline: 2px solid #E53935;
  outline-offset: 2px;
}

/* ------------------------------
  YHTEYSTIEDOT
--------------------------------*/
.contact {
  max-width: 600px;
  margin: 0 auto;
}

.contact h2 {
  margin-bottom: 1rem;
}

.contact > p {
  margin-bottom: 2rem;
  opacity: 0.9;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.contact-form label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  background: #232323;
  border: 1px solid #404040;
  border-radius: 6px;
  padding: 0.75rem;
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  background: #2a2a2a;
  border-color: #FFCDD2;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form .cta-btn {
  margin-top: 1rem;
  align-self: center;
  font-weight: 700;
}

/* Sosiaalilinkit */
.social-links {
  margin: 1.5rem 0;
  text-align: center;
}

.social-label {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.social-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #232323;
  border-radius: 8px;
  font-size: 1.4rem;
  transition: background-color 180ms ease, transform 180ms ease;
  font-weight: 600;
}

.social-links a:hover,
.social-links a:focus {
  background: #E53935;
  transform: translateY(-2px);
  outline: none;
}

/* ------------------------------
   MEDIA QUERYT – TABLET (min-width: 600px)
--------------------------------*/
@media (min-width: 600px) {
  .burger {
    display: none;
  }

  nav {
    display: block;
    position: static;
    max-height: none;
    overflow: visible;
    opacity: 1;
    transform: none;
    transition: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    visibility: visible;
    pointer-events: auto;
  }

  nav ul {
    flex-direction: row;
    gap: 1.5rem;
    align-items: center;
    justify-content: flex-end;
  }

  nav a {
    padding: 5px 15px;
  }
}

/* ------------------------------
   MEDIA QUERYT – DESKTOP (min-width: 900px)
--------------------------------*/
@media (min-width: 900px) {
  .hero {
    min-height: 500px;
    padding: 2rem 1.25rem 1.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }

  main {
    max-width: 950px;
    margin: 0 auto;
  }

  header,
  footer {
    max-width: 950px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  header {
    text-align: left;
  }

  .events--grid-2 .events-list {
    grid-template-columns: 1fr 1fr;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
  }

  .events:not(.events--grid-2) .events-list {
    max-width: 500px;
    margin: 0 auto;
  }

  .events:not(.events--grid-2) .event-title,
  .events:not(.events--grid-2) .event-date {
    font-size: 1.125rem;
  }
}

/* ------------------------------
  VAROITUSPOPUP – WARNING MODAL
--------------------------------*/
.warning-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.warning-modal.active {
  display: flex;
}

.warning-modal-content {
  background: #232323;
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.warning-modal-content p {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  color: #ffffff;
}

.warning-modal-btn {
  background-color: #E53935;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.8rem 1.4rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 180ms ease;
}

.warning-modal-btn:hover,
.warning-modal-btn:focus {
  background-color: #d32f2f;
  outline: 3px solid #FFCDD2;
  outline-offset: 3px;
}

