/*
  PERALA_BIG_REDESIGN_02B
  Isompi visuaalinen uudistus Perälän portille.
  Ei JavaScriptiä. Ei ulkoisia resursseja. Ei automaattista päivitystä.
  Säilyttää Google/GTM/consent/mainospaikkojen yhteensopivuuden.
*/

:root {
  --pp-yö: #010503;
  --pp-syvä: #041008;
  --pp-metsä: #0b1d10;
  --pp-sammal: #86a96b;
  --pp-kulta: #d8a832;
  --pp-kupari: #9d6b30;
  --pp-teksti: #f4e7be;
  --pp-himmeä: rgba(244, 231, 190, 0.78);
  --pp-lasi: rgba(4, 13, 7, 0.78);
  --pp-lasi-vahva: rgba(3, 9, 5, 0.92);
  --pp-reuna: rgba(235, 202, 116, 0.30);
  --pp-reuna-vahva: rgba(235, 202, 116, 0.52);
  --pp-varjo: rgba(0, 0, 0, 0.58);
}

html {
  background: var(--pp-yö);
}

body {
  color: var(--pp-teksti);
  background:
    radial-gradient(circle at 50% 5rem, rgba(216, 168, 50, 0.28), transparent 16rem),
    radial-gradient(circle at 12% 22rem, rgba(134, 169, 107, 0.22), transparent 24rem),
    radial-gradient(circle at 88% 34rem, rgba(75, 117, 64, 0.16), transparent 26rem),
    linear-gradient(180deg, rgba(1, 5, 3, 0.18), rgba(1, 5, 3, 0.78) 34rem, var(--pp-yö) 100%),
    url("/assets/peralan-portti-hero.png") center top / min(2200px, 178vw) auto no-repeat,
    var(--pp-yö) !important;
  text-rendering: optimizeLegibility;
}

/* Yleinen pääkehys */
main,
.wrap {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

main {
  position: relative;
  padding-block: clamp(1rem, 3vw, 2.4rem);
}

/* Etusivun iso porttihero */
body > section.hero {
  min-height: clamp(620px, 82vh, 920px) !important;
  display: grid !important;
  align-items: center !important;
  position: relative;
  overflow: clip;
  margin: 0;
  border-bottom: 1px solid rgba(235, 202, 116, 0.32);
  background:
    linear-gradient(90deg, rgba(1, 5, 3, 0.96) 0%, rgba(4, 14, 7, 0.72) 42%, rgba(1, 5, 3, 0.86) 100%),
    radial-gradient(circle at 66% 42%, rgba(216, 168, 50, 0.26), transparent 18rem),
    url("/assets/peralan-portti-hero.png") center center / cover no-repeat !important;
  box-shadow:
    inset 0 -8rem 7rem rgba(1, 5, 3, 0.92),
    0 2rem 5rem rgba(0, 0, 0, 0.55);
}

body > section.hero::before {
  content: "";
  position: absolute;
  inset: clamp(0.8rem, 2vw, 1.6rem);
  pointer-events: none;
  border: 1px solid rgba(235, 202, 116, 0.30);
  border-radius: clamp(1.1rem, 2.4vw, 2.2rem);
  box-shadow:
    inset 0 0 0 1px rgba(255, 244, 199, 0.06),
    inset 0 0 5rem rgba(216, 168, 50, 0.09),
    0 0 4rem rgba(216, 168, 50, 0.10);
}

body > section.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), transparent 18%, rgba(1,5,3,0.86) 100%),
    radial-gradient(circle at 50% 100%, rgba(134, 169, 107, 0.18), transparent 30rem);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px !important;
  padding: clamp(1.1rem, 3vw, 2.4rem);
  border-left: 3px solid rgba(216, 168, 50, 0.56);
  background:
    linear-gradient(90deg, rgba(1, 5, 3, 0.68), rgba(1, 5, 3, 0.25), transparent);
  border-radius: 1.4rem;
}

body > section.hero h1,
:where(main > header.hero, main > section.hero-section, main > section.card:first-of-type) h1 {
  font-size: clamp(2.8rem, 8vw, 6.8rem) !important;
  line-height: 0.88 !important;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  text-shadow:
    0 0.25rem 1rem rgba(0, 0, 0, 0.86),
    0 0 2.6rem rgba(216, 168, 50, 0.34);
}

body > section.hero p,
.hero-inner p {
  max-width: 62ch;
  font-size: clamp(1.05rem, 1.45vw, 1.28rem);
  color: rgba(244, 231, 190, 0.92);
}

/* Alasivujen hero: näyttävä, mutta ei vie koko metsää panttivangiksi */
:where(main > header.hero, main > section.hero-section, main > section.card:first-of-type) {
  position: relative;
  overflow: clip;
  min-height: clamp(420px, 56vh, 680px) !important;
  display: grid;
  align-content: center;
  border-radius: clamp(1.2rem, 2.2vw, 2rem) !important;
  border: 1px solid var(--pp-reuna-vahva) !important;
  background:
    linear-gradient(90deg, rgba(1, 5, 3, 0.94), rgba(5, 18, 9, 0.62), rgba(1, 5, 3, 0.84)),
    radial-gradient(circle at 70% 38%, rgba(216, 168, 50, 0.20), transparent 17rem),
    url("/assets/peralan-portti-hero.png") center center / cover no-repeat !important;
  box-shadow:
    0 2rem 5rem rgba(0, 0, 0, 0.48),
    inset 0 0 0 1px rgba(255, 244, 199, 0.06);
}

:where(main > header.hero, main > section.hero-section, main > section.card:first-of-type)::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), transparent 22%, rgba(0,0,0,0.18)),
    radial-gradient(circle at 28% 100%, rgba(134, 169, 107, 0.18), transparent 26rem);
}

:where(main > header.hero, main > section.hero-section, main > section.card:first-of-type) > * {
  position: relative;
  z-index: 1;
}

/* Navigaatio ja toimintanapit */
nav,
.navlinks,
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.navlinks,
main > nav,
header.hero nav {
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(235, 202, 116, 0.24);
  border-radius: 999px;
  background: rgba(2, 8, 4, 0.64);
  box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.28);
}

a.button,
.button,
button,
input[type="submit"],
input[type="button"] {
  min-height: 44px;
  border-radius: 999px !important;
  border: 1px solid rgba(235, 202, 116, 0.45) !important;
  background:
    linear-gradient(180deg, rgba(216, 168, 50, 0.30), rgba(93, 123, 68, 0.28)),
    rgba(5, 16, 8, 0.92) !important;
  color: var(--pp-teksti) !important;
  box-shadow:
    0 0.8rem 1.6rem rgba(0, 0, 0, 0.32),
    0 0 1.4rem rgba(216, 168, 50, 0.13);
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

a.button:hover,
.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 232, 160, 0.74) !important;
  box-shadow:
    0 1.1rem 2.2rem rgba(0, 0, 0, 0.38),
    0 0 2.2rem rgba(216, 168, 50, 0.20);
}

.button.primary,
a.button.primary {
  background:
    linear-gradient(180deg, rgba(240, 196, 82, 0.48), rgba(113, 139, 71, 0.34)),
    rgba(8, 23, 11, 0.96) !important;
  border-color: rgba(255, 228, 145, 0.70) !important;
}

/* Kortit: ilmoitustaulu + metsämaja, ei geneerinen laatikko */
section,
article,
.card,
.panel,
.box,
form {
  border-radius: 1.35rem !important;
}

:where(main section:not(:first-of-type), article, .card, .panel, .box, form) {
  position: relative;
  border: 1px solid var(--pp-reuna) !important;
  background:
    linear-gradient(180deg, rgba(255, 245, 203, 0.060), rgba(255, 245, 203, 0.018)),
    linear-gradient(135deg, rgba(15, 42, 20, 0.66), rgba(3, 10, 5, 0.88)),
    var(--pp-lasi) !important;
  box-shadow:
    0 1.3rem 3.2rem rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(8px);
}

:where(main section:not(:first-of-type), article, .card, .panel, .box, form)::before {
  content: "";
  position: absolute;
  left: 1.15rem;
  right: 1.15rem;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(235, 202, 116, 0.55), transparent);
}

.grid {
  gap: clamp(1rem, 2vw, 1.4rem) !important;
}

.grid > article.card,
.perala-join-process article.card {
  min-height: 100%;
}

.card.notice,
.perala-admin-notice,
#eventit-lyhyesti {
  border-color: rgba(216, 168, 50, 0.42) !important;
  background:
    linear-gradient(135deg, rgba(216, 168, 50, 0.13), rgba(5, 20, 9, 0.78)),
    var(--pp-lasi-vahva) !important;
}

.card.morko {
  border-color: rgba(174, 91, 64, 0.42) !important;
  background:
    radial-gradient(circle at 14% 20%, rgba(174, 91, 64, 0.22), transparent 16rem),
    linear-gradient(135deg, rgba(18, 7, 5, 0.82), rgba(4, 12, 6, 0.88)) !important;
}

/* Otsikot ja teksti */
h1,
h2,
h3 {
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.55rem) !important;
  line-height: 1.06;
  margin-bottom: 0.75rem;
  text-shadow: 0 0.22rem 0.8rem rgba(0,0,0,0.55);
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.45rem) !important;
}

p,
li {
  line-height: 1.72;
}

a {
  color: #f0c65f;
  text-underline-offset: 0.18em;
}

/* Lomakkeet: hakemus näyttää kutsulta, ei virastolapulta */
form {
  padding: clamp(1rem, 2.4vw, 1.6rem);
}

label {
  color: rgba(244, 231, 190, 0.88);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border-radius: 0.95rem !important;
  border: 1px solid rgba(235, 202, 116, 0.34) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01)),
    rgba(2, 8, 4, 0.86) !important;
  color: var(--pp-teksti) !important;
  box-shadow: inset 0 0.35rem 1rem rgba(0,0,0,0.22);
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(216, 168, 50, 0.62) !important;
  outline-offset: 2px;
}

/* Status / pienet rivit */
.statusline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(235, 202, 116, 0.26);
  border-radius: 999px;
  background: rgba(1, 7, 4, 0.62);
  color: rgba(244, 231, 190, 0.86);
}

/* Mainospaikat: näkyvät, siistit, ei peitetä eikä tehdä stickyä */
.perala-ad-placeholder,
[data-perala-ad-placeholder] {
  position: relative !important;
  z-index: 1;
  isolation: isolate;
  overflow: visible;
  border-style: dashed !important;
  border-color: rgba(235, 202, 116, 0.34) !important;
  background:
    linear-gradient(135deg, rgba(216, 168, 50, 0.075), rgba(6, 19, 9, 0.70)),
    rgba(3, 10, 5, 0.78) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.035),
    0 1rem 2.4rem rgba(0,0,0,0.26);
}

.perala-ad-placeholder::before,
[data-perala-ad-placeholder]::before {
  content: "";
  position: absolute;
  inset: 0.5rem;
  pointer-events: none;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,0.035);
}

/* Footer */
footer {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  border-top: 1px solid rgba(235, 202, 116, 0.22);
  background: rgba(1, 5, 3, 0.50);
}

/* Erikoissivut, joilla on vain consent.css + tämä kerros */
body:has(.navlinks) main {
  max-width: 980px;
}

/* Mobiili ja näköystävällisyys */
@media (max-width: 760px) {
  main,
  .wrap {
    width: min(100% - 1rem, 1180px);
  }

  body > section.hero {
    min-height: clamp(520px, 76vh, 760px) !important;
    background-position: center top !important;
  }

  .hero-inner {
    border-left-width: 2px;
    padding: 1rem;
  }

  body > section.hero h1,
  :where(main > header.hero, main > section.hero-section, main > section.card:first-of-type) h1 {
    font-size: clamp(2.45rem, 14vw, 4.2rem) !important;
  }

  :where(main > header.hero, main > section.hero-section, main > section.card:first-of-type) {
    min-height: clamp(340px, 54vh, 560px) !important;
  }

  .navlinks,
  main > nav,
  header.hero nav {
    border-radius: 1.1rem;
  }

  nav a,
  .navlinks a,
  .button,
  a.button,
  button {
    width: auto;
  }
}

@media (max-width: 480px) {
  .cta,
  nav,
  .navlinks {
    align-items: stretch;
  }

  .cta a,
  .navlinks a,
  header.hero nav a {
    flex: 1 1 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
