/* PERUS */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: #ffffff;
}

/* --- Global page padding --- */
:root {
  --side-space: clamp(16px, 5vw, 40px);
}

.page-container {
  width: 100%;
  padding-left: var(--side-space);
  padding-right: var(--side-space);
  box-sizing: border-box;
}

button,
.add-gallery-card,
.add-person-card,
.sort-controls button {
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}
@media (max-width:768px){

  button,
  .add-gallery-card,
  .add-person-card {
    width: 100%;
    max-width: 400px;
  }

}

h1 {
  font-size: clamp(32px, 6vw, 70px);
  font-weight: 400;
  text-shadow: 2px 8px 6px rgba(0,0,0,0.2), 0px -5px 35px rgba(255,255,255,0.3), 2px 2px 2px rgba(206,89,55,0);

}

h2 {
  font-size: clamp(32px, 6vw, 44px);
  font-weight: 400;
}

/* YLÄRIVI */
#upper-row-wrapper {
  position: relative;
  height: 100px;
}

#upper-row-background {
  position: fixed;
  top: 0px;
  width: 100%;
  height: 100px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  z-index: 10;
}

#upper-row-content {
  position: fixed;
  top: 0;
  width: 100%;
  max-width: 1100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100px;
  padding: 0 20px;
  z-index: 20;
}

#upper-row-logo {
  width: 200px;
  height: 100px;
  background: url('img/logo-tumma.png') no-repeat center / contain;
}

#upper-row-phone {
  color: #4A1942;
  font-size: 20px;
  text-decoration: none;
}

/* HERO */
#hero-wrapper {
  position: relative;
}

#hero-image {
  height: 700px;
  background: url('img/background.png') center / cover no-repeat;
}

#hero-image-cut {
  position:relative;
  background: #4A1942;
  transform: skew(0deg, -3deg);
  padding: 150px 0 100px 0; /* antaa tilaa sisällölle */
  margin-top:0px;
}


#hero-content {
  max-width: 1100px;
  margin: -150px auto 0;
  padding: 0 20px;
  color: #ffffff;
  margin-top: -650px;
  padding-bottom:100px;
  position:relative;
  text-align:center;
}

#hero-content-2 {
  max-width: 1100px;
  margin: -100px auto 0;
  padding: 0 20px;
  color: #ffffff;
  text-align:center;
  transform: skew(0deg, 3deg);

}

/* CONTENT */
.content-section {
  padding: 50px 0;
}

.content-inner {
  max-width: 1100px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 60px;
}

.content-section.reverse .content-inner {
  flex-direction: row-reverse;
  background-color: #ececec;
  padding: 40px;
}

.content-image {
  flex: 1;
  min-height: 400px;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
}

.content-textbox {
  flex: 1;
  color: #4A1942;
}

.content-textbox p {
  font-size: 18px;
  line-height: 1.6;
}

/* FOOTER */
#footer-wrapper {
  position: relative;
  margin-top: 100px;
}

#footer-background {
  position: relative;
  height: 350px;
  background: #4A1942;
  border-radius: 30px 30px 0 0;
  margin: 0 auto;
  max-width: 1100px;
}

#footer-content {
  position:relative;
  max-width: 1100px;
  margin: -320px auto 0;
  padding: 0 20px;
  text-align: center;
  color: #ffffff;
}

#footer-logo {
  width: 200px;
  height: 100px;
  margin: 0 auto 20px;
  background: url('img/logo.png') no-repeat center / contain;
}

/* MOBIILI */
@media (max-width: 768px) {

  #upper-row-wrapper {
    height: 120px;
  }

  #upper-row-background {
    height: 160px;
  }

  #upper-row-content {
    flex-direction: column;
    gap: 10px;
  }
  #upper-row-logo {
padding-top:50px;
padding-bottom:50px;
  }


  #hero-content {
    text-align: center;
    margin-top:-500px;
  }
  #footer-background {
    border-radius: 0 0 0 0;
    left:0%;
    width: 100%;
  }

  .content-inner {
    flex-direction: column;
    text-align: center;
  }

  .content-section.reverse .content-inner {
    flex-direction: column;
  }

  .content-image {
    min-height: 250px;
    width: 100%;
  }
}
.content-section {
    position: relative;
}

.delete-section {
    position: absolute;
    top: -30px;
    right: 0px;
    background: #ff4d4f;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.delete-section:hover {
    background: #d9363e;
}
.sort-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 5;
}

.sort-controls button {
    padding: 6px 10px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    background: #000;
    color: #fff;
    border-radius: 4px;
}

.sort-controls button:hover {
    background: #ff9800;
}
.person-card-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 300px));
    justify-content: center;   /* 🔥 keskittää koko gridin */
    gap: 40px;
    padding: 0px;
    width: 100%;
}

.person-card {
    text-align: center;
    padding-bottom: 30px;
    padding-top: 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

.person-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background-size: cover;
    background-position: center;
}
.person-add-wrapper {
    width: 100%;
    text-align: center;
    margin-top: 30px;
}

.add-person-card {
    background: #4A1942;
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 8px 20px rgba(0,0,0,.15);
}

.add-person-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0,0,0,.25);
}

.add-person-card:active {
    transform: translateY(0);
    box-shadow: 0 6px 15px rgba(0,0,0,.15);
}
.person-card {
    position: relative;
}

.delete-person-card {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    transition: all .2s ease;
}

.delete-person-card:hover {
    background: #ff3b3b;
    color: #fff;
}
.person-section-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}
/* --- Gallery --- */
/* --- Gallery --- */
.gallery-wrapper {
    display: flex;              /* flexbox käyttöön */
    flex-wrap: wrap;            /* rivinvaihto sallittu */
    justify-content: center;    /* keskittää kuvat horisontaalisesti */
    gap: 16px;                  /* väli kuvien välillä */
    margin-top: 20px;
}

.gallery-card {
    width: 200px;               /* kuvien leveys */
    height: 150px;              /* kuvien korkeus */
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f8f8;
    flex-shrink: 0;             /* ei kutistu */
}

.gallery-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.delete-gallery-card {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2;
}

/* Lisää painike keskelle */
.add-gallery-card {
  background: #4A1942;
  color: #fff;
  border: none;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all .25s ease;
  margin: 30px auto 0 auto; /* ← keskittää horisontaalisesti */
  display: block;           /* ← tarvitaan, jotta margin auto toimii */
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
}
.add-gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(0,0,0,.25);
}
.add-gallery-card:active {
    transform: translateY(0);
    box-shadow: 0 6px 15px rgba(0,0,0,.15);
}


.drag-ghost {
    opacity: 0.4;
}
.gallery-card {
    cursor: grab;
}
.gallery-card:active {
    cursor: grabbing;
}
#image-zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;              /* 🔥 tärkein */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
}

#image-zoom-overlay.active {
    display: flex;              /* näkyy vain kun active */
}

#image-zoom-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
}
