/* Piharati – siivottu piharati23.css (2026-01-22)
   - Korjaa Safarin iPhone-caption-ongelman
   - Poistaa rikkoutuneet sisäkkäiset @media-lohkot
   - Korjaa puuttuvat / ylimääräiset aaltosulut
   - Rajaa mobiilisäännöt modern-carousel -karuselliin
*/

/* ===============================
   Brändimuuttujat + Bootstrap overrides
   =============================== */
:root {
  --brand: #DE9E00;      /* Piharati-oranssi */
  --beige: #F4F2F1;
  --dark:  #443E3B;
  --black: #000000;
  --radius: 1rem;

  /* Karusellin nuolet (Bootstrap 5 muuttujat) */
  --bs-carousel-control-prev-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 24 24'%3e%3cpath d='M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59z'/%3e%3c/svg%3e");
  --bs-carousel-control-next-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 24 24'%3e%3cpath d='M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12l-4.58 4.59z'/%3e%3c/svg%3e");
}

/* ===============================
   Perusreset + typografia
   =============================== */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #111;
}

/* ===============================
   Yleisvärit ja utilit
   =============================== */
.bg-brand  { background: var(--brand); }
.bg-beige  { background: var(--beige); }
.bg-beige2 { background: #D9D3CF; }
.text-brand{ color: var(--brand) !important; }

.object-fit-cover { object-fit: cover; }
.rounded-3 { border-radius: var(--radius) !important; }

/* Jos haluat tasaiset välit jokaiseen sectioniin */
section { margin-top: 50px; }

/* ===============================
   Napit
   =============================== */
.btn { border-radius: 20px; font-weight: 500; }

.btn-brand {
  --bs-btn-color: #443E3B;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: #c68700;
  --bs-btn-hover-border-color: #F4F2F1;
  --bs-btn-focus-shadow-rgb: 222,158,0;
}

.btn-brand:hover {
  background-color: var(--dark);
  color: #FBF9F9;
}

.btn-light { --bs-btn-color: #111; }

/* ===============================
   Navigaatio
   =============================== */
.navbar.bg-white {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1050;

  background: linear-gradient(
    90deg,
    #fffdf8 0%,
    #ffffff 45%,
    #fffaf0 100%
  ) !important;

  border-bottom: 1px solid rgba(222, 158, 0, 0.18);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

/* Selkeä brändipalkki yläreunaan */
.navbar.bg-white::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(
    90deg,
    #DE9E00 0%,
    #f0c35c 20%,
    #DE9E00 45%,
    rgba(222, 158, 0, 0.45) 75%,
    rgba(222, 158, 0, 0.05) 100%
  );
}

/* Logo / brand */
.navbar .navbar-brand {
  color: #2d2d2d !important;
  font-weight: 800;
  letter-spacing: 0.4px;
}

/* Peruslinkit */
.navbar .navbar-nav .nav-link {
  color: #2f2f2f !important;
  font-weight: 600;
  padding: 10px 14px !important;
  border-radius: 999px;
  position: relative;
  transition:
    background-color 0.22s ease,
    color 0.22s ease,
    transform 0.18s ease,
    box-shadow 0.22s ease;
}

/* Hover – näkyvämpi mutta edelleen siisti */
.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link:focus {
  color: #a86f00 !important;
  background: linear-gradient(
    180deg,
    rgba(222, 158, 0, 0.16) 0%,
    rgba(222, 158, 0, 0.09) 100%
  );
  box-shadow:
    inset 0 0 0 1px rgba(222, 158, 0, 0.14),
    0 4px 10px rgba(222, 158, 0, 0.08);
  transform: translateY(-1px);
}

/* Aktiivinen kohta */
.navbar .navbar-nav .nav-link.active,
.navbar .navbar-nav .show > .nav-link {
  color: #a86f00 !important;
  background: rgba(222, 158, 0, 0.10);
}

/* Kapea kultainen alaviiva */
.navbar .navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 5px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(222, 158, 0, 0) 0%,
    #DE9E00 50%,
    rgba(222, 158, 0, 0) 100%
  );
  transform: scaleX(0);
  transition: transform 0.22s ease;
}

.navbar .navbar-nav .nav-link:hover::after,
.navbar .navbar-nav .nav-link:focus::after,
.navbar .navbar-nav .nav-link.active::after,
.navbar .navbar-nav .show > .nav-link::after {
  transform: scaleX(1);
}

/* Dropdown */
.navbar .dropdown-menu {
  margin-top: 10px;
  border: 1px solid rgba(222, 158, 0, 0.16);
  border-radius: 18px;
  padding: 10px;
  min-width: 280px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 251, 242, 0.98) 100%
  );
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.10),
    0 6px 16px rgba(222, 158, 0, 0.08);
  backdrop-filter: blur(8px);
}

/* Dropdown item */
.navbar .dropdown-item {
  color: #333 !important;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 500;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.18s ease,
    padding-left 0.18s ease;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background: linear-gradient(
    90deg,
    rgba(222, 158, 0, 0.14) 0%,
    rgba(222, 158, 0, 0.05) 100%
  );
  color: #a86f00 !important;
  transform: translateX(2px);
  padding-left: 18px;
}

/* Dropdownin erotin */
.navbar .dropdown-divider {
  border-top: 1px solid rgba(222, 158, 0, 0.14);
}

/* Soita-painike */
.navbar .btn,
.navbar .soita-btn {
  background: linear-gradient(
    180deg,
    #e6ad22 0%,
    #d99700 100%
  );
  color: #fff !important;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  box-shadow:
    0 10px 22px rgba(222, 158, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.navbar .btn:hover,
.navbar .soita-btn:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow:
    0 14px 28px rgba(222, 158, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
  filter: brightness(1.02);
}
/* ===============================
   Badge-num (pyöreä numero)
   =============================== */
.badge-num {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid #000;
  border-radius: 50%;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  color: #000;
}
/* Moderni karuselli (hero) */
.modern-carousel .carousel-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: .75rem;
}

.modern-carousel .carousel-control-prev,
.modern-carousel .carousel-control-next {
  filter: none;
  z-index: 25;
}

/* Caption – desktop */
.modern-carousel .carousel-caption {
  position: absolute;
  left: 0;
  right: auto;
  bottom: 1rem;

  color: #fff;
  background: rgba(0, 0, 0, .35);

  padding: 1rem 1.25rem;
  border-radius: .75rem;
  border: 1px solid rgba(255, 255, 255, .25);

  max-width: min(90%, 540px);
  backdrop-filter: blur(8px) brightness(1.1);

  pointer-events: auto;
  z-index: 20;
}

.modern-carousel {
  position: relative;
  overflow: hidden;
  border-radius: .75rem;
}

/* Varmista, etteivät mahdolliset overlayt varasta klikkiä */
.carousel-item::after,
.carousel-item .overlay{ pointer-events:none; }

/* Kuvien käyttäytyminen */
.object-fit-cover{ object-fit:cover; }

/* Yleisiä kulmia */
.rounded-3{ border-radius:var(--radius)!important; }

/* Footer linkkien hover */
footer a:hover{ opacity:.85; text-decoration:underline; }

/* Navigaatio – dropdown-tyyli */
.dropdown-menu{
  border-radius:10px;
  border:1px solid rgba(0,0,0,0.08);
  box-shadow:0 4px 18px rgba(0,0,0,0.1);
 }
/* Rivi jossa kortit ovat */
.henkilot {
  display: grid;
  grid-template-columns: repeat(4, 1fr);   /* 4 vierekkäin isoilla näytöillä */
  gap: 2rem;
  max-width: 1300px;
  margin: 3rem auto;
  padding: 0 2rem;
  text-align: center;
}

/* Skaalaus tablet ja mobiili */
@media (max-width: 1024px) {
  .henkilot {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .henkilot {
    grid-template-columns: 1fr;
  }
}

/* Kortin taustalaatikko */
.kortti {
  background: #ffffff;
  border-radius: 14px;
  padding: 1.6rem 1.2rem 1.8rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  transition: box-shadow .28s ease, transform .28s ease;
}

.kortti:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  transform: translateY(-4px);
}

/* Kuva + hover-zoom */
.kortti img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.8rem;
  box-shadow: 0 5px 18px rgba(0,0,0,0.18);
  transition: transform .28s ease, box-shadow .28s ease;
}

.kortti:hover img {
  transform: scale(1.05);
  box-shadow: 0 8px 26px rgba(0,0,0,0.28);
}

/* Tekstien tyyli */
.kortti h4 {
  margin: 0.3rem 0;
  font-weight: 600;
  font-size: 1.15rem;
  transition: color .28s ease;
}

.kortti:hover h4 {
  color: #0FA49B; /* Piharatin tehosteväri */
}

.kortti .titteli {
  color: #0FA49B;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.kortti .puh a {
  color: #000;           /* musta teksti */
  text-decoration: none; /* poistaa alleviivauksen */
  font-weight: 600;
}

.kortti .puh a:hover {
  color: #DE9E00; ;        /* hoverissa tehosteväri (valinnainen) */
  text-decoration: underline;
}

.org-contact a {
  color: #000;               /* musta teksti */
  text-decoration: none;     /* ei alleviivaa */
  font-weight: 600;          /* vähän jämäkkyyttä */
}

.org-contact a:hover {
  text-decoration: underline; /* vain hoverissa korostus */
  color: #000;                /* pysyy mustana */
}

.sep {
  margin: 0 .35rem;
  color: #666; /* pieni visuaalinen väli-ero, ei pakollinen */
}
@media (max-width: 767.98px) {

  /* Rajataan mobiilisäännöt vain modern-carousel-karuselliin */
  .modern-carousel .carousel-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
  }

  /* Caption pysyy kuvan päällä myös mobiilissa */
  .modern-carousel .carousel-caption {
    position: absolute !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 12px !important;

    width: auto;
    max-width: none;
    margin: 0;
    padding: .65rem .85rem;

    text-align: left;
    color: #fff;
    background: rgba(0, 0, 0, .45);
    border-radius: .75rem;
    z-index: 20;
  }

  .modern-carousel .carousel-caption h3,
  .modern-carousel .carousel-caption .h5 {
    font-size: 1rem;
    color: #ffcc66;
    margin-bottom: .25rem;
  }

  .modern-carousel .carousel-caption p {
    font-size: .85rem;
    margin-bottom: 0;
  }
}

.border-bottom.shadow-sm {
  border-color: rgba(0,0,0,0.05) !important;
}
/* valkoinen kehys */
.img-card123 {
  background: #fff;
  border-radius: 1rem;
  padding: 6px; /* valkoinen kehys */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
	
}/* Valkoinen kehys + varjo karusellikuville */
.modern-carousel .carousel-item img {
  border: 5px solid #fff;                /* valkoinen kehys */
  border-radius: 1rem;                   /* pyöristys sama kuin muissa */
  box-shadow: 0 8px 20px rgba(0,0,0,0.25); /* pehmeä varjo */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modern-carousel .carousel-item img:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}
/* Siirrä karusellin tekstilaatikkoa */
.modern-carousel .carousel-caption {
  left: 25px;          /* siirtää 100px oikealle eli keskemmälle */
  bottom: 40px;        /* nostaa 100px ylöspäin */
}
.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 42px;
  height: 42px;
  background-size: 24px 24px;      /* nuolen koko sisällä */
  padding: 10px;
  border-radius: 50%;
  background-color: #ff5e00;       /* Piharati-oranssi tausta */
  box-shadow: 0 0 10px rgba(0,0,0,0.35);
}

/* Varmistetaan että nuolet näkyvät kaikkien päällä */
.carousel-control-prev,
.carousel-control-next {
  z-index: 9999;
}

/* Indikaattorit (pallot) aina kuvan päälle */
.modern-carousel .carousel-indicators {
  position:inherit;
  left: 0;
  right: 0;
  bottom: clamp(5px, 2vw, 5px);
  margin: 0;
  z-index: 60;          /* pallot captionin päälle */
  pointer-events: auto;
}

.modern-carousel .carousel-indicators [data-bs-target] {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: #ffcc66;
}

.modern-carousel .carousel-indicators .active {
  background-color: #ffcc66;
}
/* Logojen ruudukko: 3 vierekkäin, pinoutuu pienillä */
.ykp-logos {
  list-style: none;
  margin: 0;
  padding: 0;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: center;
}
@media (max-width: 768px) {
  .ykp-logos {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .ykp-logos {
    grid-template-columns: 1fr;
  }
}

/* Jokainen logo keskelle, kuva skaalautuu */
.ykp-logos li {
  display: grid;
  place-items: center;
  padding: 0.75rem 1rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.ykp-logos img {
  max-width: 100%;
  height: auto;
  max-height: 56px;         /* rajoita korkeutta yhtenäisyyden vuoksi */
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  filter: grayscale(0);
  transition: filter .2s ease, transform .2s ease;
}

.ykp-logos a:hover img,
.ykp-logos a:focus img {
  filter: grayscale(.2);
  transform: scale(1.02);
}
@media (prefers-reduced-motion: reduce) {
  .ykp-logos img { transition: none; }
}
/* Pienet näytöt -> pallot 50px alemmas */
@media (max-width: 576px) {
  .banner-carousel .carousel-indicators {
    transform: translateY(50px);
  }

  /* ettei pallot leikkaannu pois jos menevät "ulos" kuvasta */
  .banner-carousel {
    padding-bottom: 50px;
  }
}
