/* ========== Beat by Mia — Styles ========== */
:root{
  --fuchsia:#E6007E;
  --black:#000000;
  --white:#ffffff;
  --gray-50:#FAFAFA;
  --gray-100:#F3F3F4;
  --gray-300:#D9D9DD;
  --text:#1B1B1F;
  --accent:var(--fuchsia);
  --radius:12px;
  --shadow:0 10px 30px rgba(0,0,0,.06);
}
*{ box-sizing:border-box; }
html,body{
  margin:0; padding:0;
  font-family:"Inter",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text); background:var(--gray-50);
  line-height:1.6;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;          /* estää yksittäisten elementtien vuodon */
  -webkit-text-size-adjust: 100%; /* estää Safarin automaatti-zoomit */
}
img { max-width: 100%; height: auto; } /* varmistus kaikkia kuvia varten */


h1,h2,h3{
  font-family:"Poppins",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  line-height:1.2; margin:0 0 .5rem 0; color:var(--black);
}
h1{ font-size:clamp(2.2rem,5vw,3.2rem); font-weight:800; }
h2{ font-size:clamp(1.4rem,2.8vw,2rem); font-weight:700; }
h3{ font-size:1.2rem; font-weight:600; }
p{ margin:0 0 1rem 0; }
.container{ width:min(1160px,92%); margin:0 auto; }

/* Header */
header{ background:var(--white); border-bottom:1px solid var(--gray-100); position:sticky; top:0; z-index:50; }
.nav{ display:flex; align-items:center; justify-content:space-between; padding:.9rem 0; }
.brand{ display:flex; align-items:center; gap:.65rem; font-weight:800; letter-spacing:.2px; }
.brand-logo{ width:42px; height:42px; border-radius:10px; background:radial-gradient(70% 70% at 30% 30%, #FF4FB8, var(--fuchsia)); box-shadow:var(--shadow); }
.brand-name{ font-weight:800; }
.brand-tagline {
  display: block;
  font-family: 'Inter', sans-serif;  /* eroaa logon fontista */
  font-size: 0.7rem;
  font-weight: 400;
  color: #555;   /* tummanharmaa */
  margin-top: 0.25rem;
}
nav a{ text-decoration:none; color:var(--text); font-weight:600; margin-left:1rem; }
nav a.cta{ padding:.65rem 1rem; border-radius:999px; color:var(--white); background:var(--accent); box-shadow:0 8px 18px rgba(230,0,126,.25); }

/* Hero */
.hero{
  background:
    radial-gradient(1200px 400px at 20% -10%, rgba(230,0,126,.12), transparent),
    radial-gradient(900px 300px at 90% 0%, rgba(230,0,126,.18), transparent);
  padding:56px 0 64px;
}
.hero-grid{ display:grid; grid-template-columns:1.1fr .9fr; gap:2rem; align-items:center; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gray-100);
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 1rem; /* 👈 lisää riviväli h1:n ja badge-tekstin väliin */
}
.badge .dot{ width:10px; height:10px; border-radius:999px; background:var(--accent); display:inline-block; }
.lead{ font-size:clamp(1.05rem,1.4vw,1.2rem); opacity:.9; }
.actions{ display:flex; gap:.8rem; flex-wrap:wrap; margin-top:.8rem; }
.btn{ display:inline-flex; align-items:center; gap:.5rem; text-decoration:none; font-weight:700; border-radius:12px; padding:.9rem 1.1rem; }
.btn.primary{ background:var(--accent); color:var(--white); box-shadow:0 10px 24px rgba(230,0,126,.3); }
.btn.ghost{ border:2px solid var(--black); color:var(--black); background:transparent; }

.hero-card{ background:var(--white); border-radius:var(--radius); box-shadow:var(--shadow); padding:1rem; display:grid; gap:.8rem; position:relative; }
.card-img{ position:relative; background:none; height:auto; border-radius:10px; overflow:hidden; }
.caption{
  position:absolute; bottom:16px; left:16px; right:16px; color:#fff; font-weight:700;
}
@media (max-width:600px){
  .caption{ position:static; color:var(--text); margin-top:.5rem; }
}

/* 4) TAULUKOT – rullaus pienissä levyissä (tiivistetään) */
/* Mobiilissa: rullaus wrapperissa, ei itse taulukossa */
@media (max-width: 800px){
  .table-wrap { 
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap .table{
    display: table;
    width: auto;          /* ohittaa .table { width:100% } */
    min-width: 720px;     /* Viikko-ohjelma 5 saraketta */
  }
  #tulokset .table{
    min-width: 680px;     /* Tulokset */
  }
  .table-wrap .table th,
  .table-wrap .table td{
    white-space: nowrap;  /* estää tekstin rivittymisen kapeilla ruuduilla */
    padding: 0.5rem 0.6rem;
    font-size: 0.95rem;
  }
}


.caption small{ display:block; font-weight:600; opacity:.9; }
.chips{ display:flex; gap:.6rem; flex-wrap:wrap; }

/* Services */
.services{ padding:40px 0; }
.cards{ display:grid; grid-template-columns:repeat(2,1fr); gap:1.1rem; margin-top:1rem; }
.card{ background:var(--white); border-radius:var(--radius); box-shadow:var(--shadow); padding:1.1rem; }
.chip{ display:inline-block; background:var(--gray-100); border-radius:999px; padding:.3rem .6rem; font-size:.82rem; font-weight:600; }
.pill{ background:var(--accent); color:var(--white); }

@media (max-width: 700px){
  .cards{
    grid-template-columns: 1fr; /* 👈 yksi sarake */
  }
}

/* Why */
.why{ background:var(--white); padding:40px 0; border-top:1px solid var(--gray-100); }
.why-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; }

@media (max-width: 700px){
  .why-grid{
    grid-template-columns: 1fr; /* 👈 yksi sarake mobiilissa */
  }
}

.why-item{ background:var(--gray-50); border:1px solid var(--gray-100); border-radius:var(--radius); padding:1rem; }
.why-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.why-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #e91e63; /* fuksia/pinkki */
  color: #fff;
  font-size: 1.5rem;
  margin-right: 0.5rem;
}

/* Jumppamobiili */
.jumppamobiili{ padding:40px 0; background:var(--white); border-top:1px solid var(--gray-100); }
.jumppa-box{ background:var(--gray-50); border:1px solid var(--gray-100); border-radius:var(--radius); padding:1.5rem; text-align:center; }

/* Schedule */
.schedule{ padding:40px 0; }
.table{
  display: table;            /* desktop */
}
@media (max-width: 900px){
  .hero-grid{ 
    grid-template-columns: 1fr; 
    gap: 1rem;
  }
  /* navi alle brändin jos tila loppuu */
  .container.nav{
    flex-wrap: wrap;
  }
  nav{
    width: 100%;
    justify-content: flex-end;   /* tai center */
    margin-top: .5rem;
  }
}

/* 2) HEADER PIENEMMÄKSI MOBIILISSA */
@media (max-width: 600px){
  header .nav{ padding: .5rem 0; }
  header img[alt="ReBeat logo"]{ max-height: 44px; }
  .brand-name{
    font-size: clamp(1.2rem, 5.5vw, 1.6rem);
    line-height: 1.05;
  }
  .brand-tagline{
    font-size: .66rem;
    opacity: .85;
  }
}

/* Extra: kaikkein pienimmillä näytöillä piilota tagline, jos vielä ahdasta */
@media (max-width: 380px){
  .brand-tagline{ display: none; }
}

.table th,.table td{ padding:.9rem 1rem; border-bottom:1px solid var(--gray-100); }
.table th{ background:var(--black); color:var(--white); text-align:left; }
.table tr:last-child td{ border-bottom:none; }

/* Testimonials */
.testimonials{ padding:40px 0; background:var(--white); }
.testi-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; }
.bubble{ background:var(--gray-50); border:1px solid var(--gray-100); border-radius:12px; padding:1rem; }
@media (max-width: 1000px){
  .testi-grid{
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 700px){
  .testi-grid{
    grid-template-columns: 1fr;
  }
}

/* Footer */
footer{ background:var(--black); color:var(--white); padding:28px 0; margin-top:40px; }
footer a{ color:var(--white); opacity:.9; text-decoration:none; }
.foot-flex{ display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; }

/* Responsive */
@media (max-width: 600px){
  .caption{
    position: static;
    color: var(--text);
    margin-top: .5rem;
  }
  header .nav{
    padding: .6rem 0;
  }
  header img[alt="ReBeat logo"]{
    max-height: 52px;
  }
  .brand-tagline{
    font-size: .72rem;
  }
}

.brand-name{
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem); /* reagoi näyttöön */
  line-height: 1.1;
}

.brand-highlight{ 
  color: var(--accent);
  display:inline-block;
  transform-origin:center;
}

.brand-name:hover .brand-highlight{ animation: pulse 1.8s infinite; }

.dot {
  height: 12px;
  width: 12px;
  background-color: hotpink; /* pinkki pallura */
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  animation: pulse 1.5s infinite; /* animaatio päälle */
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.85;
  }
}

.card {
  position: relative;
}

.ribbon {
  position: absolute;
  top: 0.8rem;
  right: -0.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  transform: rotate(15deg);
  border-radius: 3px;
}

.container.nav {
  display: flex;
  justify-content: space-between; /* brand vasemmalle, nav oikealle */
  align-items: center;
}

nav {
  display: flex;
  gap: 1.5rem; /* väli linkkien välille */
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem; /* hieman tiiviimpi fontti */
}

.table th, .table td {
  padding: 0.6rem 0.8rem; /* pienempi padding */
  border-bottom: 1px solid #eee;
  text-align: left;
}

.table thead {
  background: #f8f8f8;
  font-weight: 600;
}

.table .vuores {
  background: #fafafa;
}
.table .koikkari {
  background: #fdf9fb;
}
.table .kaukajarvi {
  background: #f9fcfd;
}

.table .hervanta {
  background: #f9fcfd;
}

.table .crossbeat {
  background: #fbf9fd; /* vaalea violetti */
}

.schedule h2,
.services h2,
.why h2 {
  margin-bottom: 1.5rem;
}

.jumppamobiili-img{ 
  width: 100%; 
  height: auto; 
  display: block; 
  border-radius: 10px; 
}


.promo-text {
  font-size: 0.9rem;   /* pienempi teksti kuin ennen */
  font-weight: 600;
  line-height: 1.4;
}

.rules {
  font-size: 0.6rem;   /* hyvin pieni, lähes disclaimer-tyyli */
  color: #000000;         /* fontin väri */
}

header img[alt="ReBeat logo"]{
  height: auto;
  max-height: 70px;
}

.card { position: relative; overflow: hidden; }  /* 👈 tärkeä */
.ribbon {
  right: .5rem;          /* ei negatiivista arvoa */
  transform: rotate(12deg);
}

@media (max-width: 900px){
  .hero-grid{
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .container.nav { flex-wrap: wrap; }
  nav { width: 100%; justify-content: flex-end; margin-top: .5rem; }
}

/* Täynnä-nappi: passiivinen harmaa */
a.btn.full{
  background-color:#999 !important;
  color:#fff !important;
  cursor:not-allowed;
  pointer-events:none;
  opacity:.85;
}
a.btn.full:hover,
a.btn.full:focus{
  background-color:#999 !important;
}

/* -------- Tietosuojasivun tyylit -------- */
.policy .policy-header { text-align:center; margin-bottom: 1.5rem; }
.policy .policy-logo { height: 56px; margin-bottom: .75rem; }
.policy h1 { margin: 0 0 .25rem 0; }
.policy .policy-updated { color: #666; font-size: .95rem; }
.policy h2 { margin-top: 1.5rem; }
.policy .notice {
  background: #f2f7ff;
  border: 1px solid #cfe2ff;
  border-radius: 10px;
  padding: .9rem 1rem;
  margin: 1rem 0 1.25rem;
}

.notice {
  background: #fff3cd; /* vaalea keltainen */
  border: 1px solid #ffeeba;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

/* --- Omatoimirivien kevyt korostus --- */
.table tr.omatoimi td {
  background: #fffdf5;
  font-style: italic;
}
.table tr.omatoimi td:first-child {
  font-style: normal;
  font-weight: 600;
}

/* --- Taulukot rullaamaan mobiilissa (wrap scrollaa, ei table) --- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
}

/* Varmiste: jos jossain olisi overflow hidden, pääsee wrap silti skrollaamaan */
.schedule .container { overflow: visible; }

/* Mobiilisäädöt: pidä <table> taulukkona ja anna min-leveys, jotta voi pyyhkäistä */
@media (max-width: 800px){
  .table-wrap .table {
    display: table !important;
    width: auto;          /* ohittaa .table { width:100% } tarvittaessa */
  }
  #viikko-ohjelma .table { min-width: 720px; }  /* 5 saraketta */
  #tulokset       .table { min-width: 680px; }  /* 6 saraketta */

  .table-wrap .table th,
  .table-wrap .table td{
    white-space: nowrap;
    padding: 0.5rem 0.6rem;
    font-size: 0.95rem;
  }
}

/* --- Taulukot rullaamaan mobiilissa --- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.schedule .container { overflow: visible; }

@media (max-width: 800px){
  .table-wrap .table {
    display: table !important;
    width: auto;
    min-width: 720px;  /* tämän kalenterin minimi */
  }
  .table-wrap .table th,
  .table-wrap .table td {
    white-space: nowrap;
    padding: 0.5rem 0.6rem;
    font-size: 0.95rem;
  }
}

/* ---- Aikataulutaulukko skrollaavaksi kaikilla ruuduilla ---- */
#aikataulu-es .table-wrap {
  width: 100%;
  overflow-x: auto;              /* sallii vaakaskrollin */
  -webkit-overflow-scrolling: touch;
}

#aikataulu-es .table {
  width: max-content;            /* tärkein: taulukko saa olla leveämpi kuin kontti */
  min-width: 860px;              /* järkevä minimi tälle sarakemäärälle */
  table-layout: auto;
  display: table !important;     /* varmistaa ettei jokin muu sääntö muuta displaytä */
}

@media (max-width: 900px){
  #aikataulu-es .table {
    min-width: 720px;            /* tiukempi minimi pienille ruuduille */
  }
  #aikataulu-es .table th,
  #aikataulu-es .table td{
    white-space: nowrap;         /* pitää solut yhdellä rivillä -> skrollattava */
    padding: 0.5rem 0.6rem;
    font-size: 0.95rem;
  }
}

/* --- Päättyneet jaksot taulukossa --- */
.table tr.ended td {
  color: #777;                /* harmaampi fontti */
  background: #f6f6f6;        /* kevyt taustasävy */
}
.table tr.ended td:first-child {
  font-weight: 600;           /* lajin nimi hieman vahvempi */
  color: #666;
}
.table tr.ended a.btn.full {
  opacity: .7;                /* nappi jo on harmaa – himmennetään hieman lisää */
}

/* pieni status-merkki "Päättynyt" */
.status-ended {
  display: inline-block;
  margin-left: .35rem;
  padding: .1rem .45rem;
  font-size: .72rem;
  font-weight: 700;
  color: #666;
  background: #eee;
  border: 1px solid #ddd;
  border-radius: 999px;
  vertical-align: middle;
}

.table tr.divider td {
  border-bottom: 2px solid #ccc;   /* näkyvä viiva */
  padding: 0;                      /* ilman ylimääräistä tyhjää */
  height: .4rem;                   /* ohut kaista */
  background: transparent;
}

/* --- Mainospalkki sivun yläreunaan --- */
.topbar{
  background: #fff3fa;                 /* vaalea fuksia-tausta */
  border-bottom: 1px solid #ffd4ef;    /* hienovarainen rajaus */
  color: var(--text);
}
.topbar .topbar-inner{
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .5rem 0;
  position: relative;                  /* closen sijoittelua varten */
}
.topbar .top-pill{
  display: inline-block;
  font-weight: 800;
  font-size: .8rem;
  background: #FF9800; /* lämmin oranssi */
  color: #fff;
  padding: .2rem .6rem;
  border-radius: 999px;
}
.topbar .top-text{
  font-size: .95rem;
}
.topbar .muted{
  color: #666;
  font-weight: 600;
}
.topbar .btn.small{
  background: #00BCD4;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0,188,212,.25);
  padding: .45rem .7rem;
  font-size: .9rem;
  border-radius: 999px;
}

}
.topbar .btn.small:hover{
  background: #0097A7;
}

.topbar .top-close{
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
  color: #666;
  cursor: pointer;
  padding: .25rem .2rem;
}
.topbar .top-close:hover{ color: #000; }

/* Mobiilissa rivitetään nätisti */
@media (max-width: 700px){
  .topbar .topbar-inner{
    flex-wrap: wrap;
    gap: .5rem .6rem;
    padding-right: 2rem; /* tilaa sulje-napille */
  }
}

.topbar{
  overflow: hidden;                      /* tarvitaan, ettei sisältö valu */
  opacity: 1;
  transition: opacity .3s ease, max-height .3s ease;
}
.topbar.fade-out{
  opacity: 0;
  max-height: 0;                         /* animoi kohti nollaa */
}

#aikataulu-es { scroll-margin-top: 90px; } /* säädä 70–110px headerin koon mukaan */

.pill-new {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: #FF9800;   /* sama oranssi kuin topbar-pillissä */
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}

/* — Taulukon oma kulmamerkki, EI konflikteja korttien .ribbonin kanssa — */
.table td.with-tag{ 
  position: relative; 
}
.rb-tag{
  position: absolute;
  top: 6px;
  left: -8px;                 /* vähän ulos solusta kulmamerkiksi */
  display: inline-block;
  background: #FF9800;        /* sama oranssi kuin topbar-pillissä */
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  transform: rotate(-12deg);
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  z-index: 2;
  pointer-events: none;        /* ei häiritse linkkien klikkauksia */
  white-space: nowrap;         /* teksti yhdellä rivillä */
}

/* Mobiilissa suoristetaan ja siirretään sisään soluun */
@media (max-width: 600px){
  .rb-tag{
    left: 0;
    transform: none;
    border-radius: 999px;
  }
}

.brand-sub {
  font-size: 1rem;
  font-weight: 600;
  color: #444;
  margin-top: .15rem;
}


/* Mobiilissa aavistuksen pienempi */
@media (max-width:600px){
  .brand-sub{ font-size:.78rem; }
}

.brand-name {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
}

.brand-name strong {
  font-weight: 800;
}

.brand-name .brand-highlight {
  color: var(--accent); /* esim. pinkki #E6007E */
}

.brand-tagline {
  display: block;
  margin-top: .3rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #555;
}

/* --- Kuvagalleria --- */
.gallery{
  padding: 40px 0;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
}
.gallery-sub{
  color:#555;
  margin: .25rem 0 1rem;
}
.gallery-grid{
  display: grid;
  gap: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.gitem{
  margin:0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow);
}
.gimg{
  width: 100%;
  aspect-ratio: 4/3;        /* vakaa ristikko, ei layout-hyppyä */
  object-fit: cover;
  display: block;
  transition: transform .25s ease, filter .25s ease;
}
.gitem:hover .gimg{
  transform: scale(1.03);
  filter: saturate(1.05);
}

/* hieman tiiviimpi mobiilissa */
@media (max-width: 700px){
  .gallery-grid{
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .7rem;
  }
}

/* --- Ohjaaja-osio --- */
.coach{
  padding: 60px 0;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
}
.coach-grid{
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: start;
}
.coach-photo{
  text-align: center;
}
.coach-img{
  max-width: 240px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.coach-text h2{
  margin-top: 0;
  font-weight: 700;
}
.coach-text p{
  margin: 0 0 1rem;
  line-height: 1.6;
}
@media (max-width: 800px){
  .coach-grid{
    grid-template-columns: 1fr;
    text-align: center;
  }
  .coach-text{
    text-align: left;
  }
}
