/*
Theme Name: Karhu Basket Juniorit
Theme URI: https://kbjuniorit.fi
Author: Karhu Basket Juniorit ry
Author URI: https://kbjuniorit.fi
Description: Karhu Basket Juniorit ry:n virallinen verkkosivuteema. Oranssi-musta värimaailmalla, sisältää valmiit osiot joukkueille, harjoitusaikataululle, harrastemaksuille, ajankohtaisille uutisille ja ilmoittautumiselle.
Version: 1.0.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: karhubasket
Tags: orange, sports, basketball, custom-colors, custom-menu, featured-images, threaded-comments
*/

:root {
  --orange: #e8843a;
  --orange-dark: #b8651f;
  --orange-light: #f0a062;
  --black: #111111;
  --gray-dark: #1f1f1f;
  --gray: #2a2a2a;
  --gray-light: #f4f4f4;
  --white: #ffffff;
  --text: #222222;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--orange-dark); }

img { max-width: 100%; height: auto; }

/* HEADER & NAV */
.site-header {
  background: var(--black);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--white);
  text-decoration: none;
}

.logo-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  padding: 4px;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-text span { color: var(--orange); }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 6px;
  transition: all 0.2s;
}

.main-nav a:hover { background: var(--orange); color: var(--black); }

.main-nav a.cta { background: var(--orange); color: var(--black); }

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--black) 0%, var(--gray-dark) 100%);
  color: var(--white);
  padding: 80px 24px 100px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: ""; position: absolute; right: -100px; top: -100px;
  width: 400px; height: 400px; background: var(--orange);
  border-radius: 50%; opacity: 0.15;
}

.hero::after {
  content: ""; position: absolute; left: -50px; bottom: -80px;
  width: 250px; height: 250px; background: var(--orange);
  border-radius: 50%; opacity: 0.1;
}

.hero-content { max-width: 1200px; margin: 0 auto; position: relative; z-index: 2; }

.hero-logo {
  width: 220px; height: 220px; margin: 0 auto 24px;
  background: var(--white); border-radius: 16px; overflow: hidden;
  padding: 12px; box-shadow: 0 10px 30px rgba(232, 132, 58, 0.4);
}

.hero-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900;
  margin-bottom: 16px; line-height: 1.1;
}

.hero h1 span { color: var(--orange); }

.hero p { font-size: 1.2rem; max-width: 700px; margin-bottom: 30px; opacity: 0.9; }

.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 14px 28px; border-radius: 8px;
  text-decoration: none; font-weight: 700; font-size: 1rem;
  transition: all 0.2s; cursor: pointer; border: none;
}

.btn-primary { background: var(--orange); color: var(--black); }
.btn-primary:hover { background: var(--orange-light); transform: translateY(-2px); }

.btn-secondary { background: transparent; color: var(--white); border: 2px solid var(--white); }
.btn-secondary:hover { background: var(--white); color: var(--black); }

/* SECTIONS */
.section { padding: 70px 24px; }
.section-alt { background: var(--gray-light); }

.container { max-width: 1200px; margin: 0 auto; }

.section-title {
  font-size: 2.2rem; font-weight: 800; margin-bottom: 12px;
  color: var(--black); position: relative; display: inline-block;
}

.section-title::after {
  content: ""; position: absolute; bottom: -8px; left: 0;
  width: 60px; height: 4px; background: var(--orange); border-radius: 2px;
}

.section-subtitle { color: #666; margin-bottom: 40px; font-size: 1.1rem; }

/* TEAM SELECTOR */
.team-selector {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px;
  background: var(--gray-light); padding: 16px; border-radius: 12px;
}

.team-pill {
  padding: 10px 20px; border-radius: 999px; background: var(--white);
  color: var(--black); border: 2px solid transparent; cursor: pointer;
  font-weight: 600; font-size: 0.95rem; transition: all 0.2s;
}

.team-pill:hover { border-color: var(--orange); }
.team-pill.active { background: var(--orange); color: var(--black); }

.team-panel {
  display: none; background: var(--white); border-radius: 12px;
  padding: 32px; border: 1px solid #e5e5e5; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.team-panel.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.team-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
  padding-bottom: 20px; border-bottom: 2px solid var(--gray-light);
}

.team-badge {
  background: var(--black); color: var(--orange); padding: 8px 16px;
  border-radius: 8px; font-weight: 800; font-size: 1.1rem;
}

.team-panel h3 { font-size: 1.6rem; color: var(--black); }

.team-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px; margin-top: 16px;
}

.team-info-block h4 {
  color: var(--orange-dark); font-size: 1rem; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 8px;
}

.team-info-block p { margin-bottom: 4px; }

.practice-list { list-style: none; }

.practice-list li {
  padding: 10px 0;
  border-bottom: 1px dashed #e0e0e0;
  display: block;
}

.practice-day { display: block; font-weight: 600; color: var(--black); margin-bottom: 2px; }
.practice-place { display: block; color: #666; font-size: 0.9rem; }

.coach-card {
  background: var(--gray-light); padding: 14px; border-radius: 8px;
  border-left: 3px solid var(--orange); margin-bottom: 10px;
}

.coach-name { font-weight: 700; color: var(--black); }
.coach-role { font-size: 0.88rem; color: #666; }

/* SCHEDULE */
.schedule-table {
  width: 100%; background: var(--white); border-radius: 12px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-collapse: collapse;
}

.schedule-table th {
  background: var(--black); color: var(--white); padding: 14px 16px;
  text-align: left; font-weight: 700;
}

.schedule-table th:first-child { color: var(--orange); }
.schedule-table td { padding: 14px 16px; border-bottom: 1px solid #efefef; }
.schedule-table tr:last-child td { border-bottom: none; }
.schedule-table tr:hover { background: #fff8f2; }
.table-wrapper { overflow-x: auto; }

/* FEES */
.fees-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px; margin-bottom: 50px;
}

.fee-card {
  background: var(--white); border: 2px solid #ececec; border-radius: 12px;
  padding: 24px; text-align: center; transition: all 0.2s;
}

.fee-card:hover {
  transform: translateY(-4px); border-color: var(--orange);
  box-shadow: 0 10px 25px rgba(232, 132, 58, 0.15);
}

.fee-age { font-size: 1.6rem; font-weight: 900; color: var(--orange); margin-bottom: 8px; }
.fee-price { font-size: 2rem; font-weight: 800; color: var(--black); margin-bottom: 12px; }
.fee-price span { font-size: 0.85rem; font-weight: 500; color: #888; margin-left: 4px; }
.fee-desc { font-size: 0.9rem; color: #666; line-height: 1.5; }

.fees-info {
  background: var(--gray-light); border-radius: 16px; padding: 36px;
  border-left: 6px solid var(--orange);
}

.fees-info h3 { color: var(--black); font-size: 1.6rem; margin-bottom: 12px; }
.fees-intro { color: #555; margin-bottom: 24px; max-width: 800px; }

.usage-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px;
}

.usage-item {
  background: var(--white); padding: 18px; border-radius: 10px;
  border-top: 3px solid var(--orange);
}

.usage-percent { font-size: 1.8rem; font-weight: 900; color: var(--orange); line-height: 1; margin-bottom: 4px; }
.usage-item h4 { color: var(--black); font-size: 1.02rem; margin-bottom: 6px; }
.usage-item p { font-size: 0.88rem; color: #666; line-height: 1.5; }

.fees-note {
  background: var(--white); padding: 18px 22px; border-radius: 8px;
  font-size: 0.95rem; color: #444; border-left: 4px solid var(--black);
}

.fees-note strong { color: var(--orange-dark); }

/* NEWS */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }

.news-card {
  background: var(--white); border-radius: 12px; overflow: hidden;
  border: 1px solid #eaeaea; transition: all 0.2s;
}

.news-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

.news-image {
  height: 160px; background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--black);
}

.news-image img { width: 100%; height: 100%; object-fit: cover; }

.news-content { padding: 20px; }
.news-date { color: var(--orange-dark); font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; }
.news-card h3 { color: var(--black); margin-bottom: 10px; font-size: 1.2rem; }
.news-card p { color: #555; font-size: 0.95rem; }

/* CONTACT */
.contact-section { background: var(--black); color: var(--white); }
.contact-section .section-title { color: var(--white); }
.contact-section .section-subtitle { color: #aaa; }

.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px; margin-top: 20px;
}

.contact-card {
  background: var(--gray); padding: 24px; border-radius: 12px;
  border-left: 4px solid var(--orange);
}

.contact-card h3 { color: var(--orange); margin-bottom: 12px; }
.contact-card a { color: var(--white); text-decoration: none; }
.contact-card a:hover { color: var(--orange-light); }

/* FOOTER */
.site-footer {
  background: #000; color: #888; text-align: center;
  padding: 24px; font-size: 0.9rem; border-top: 3px solid var(--orange);
}

.site-footer a { color: var(--orange); text-decoration: none; }

/* FORM */
.form-hero {
  background: linear-gradient(135deg, var(--black) 0%, var(--gray-dark) 100%);
  color: var(--white); padding: 50px 24px; text-align: center;
}

.form-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 10px; }
.form-hero h1 span { color: var(--orange); }
.form-hero p { opacity: 0.85; max-width: 600px; margin: 0 auto; }

.form-wrapper {
  max-width: 760px; margin: -30px auto 40px; background: var(--white);
  border-radius: 16px; padding: 40px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08); position: relative; z-index: 2;
}

.form-section { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid #eee; }
.form-section:last-of-type { border-bottom: none; padding-bottom: 0; }

.section-num {
  display: inline-block; background: var(--orange); color: var(--black);
  width: 28px; height: 28px; border-radius: 50%; text-align: center;
  line-height: 28px; font-weight: 800; margin-right: 10px; font-size: 0.95rem;
}

.form-section h2 { color: var(--black); font-size: 1.3rem; margin-bottom: 18px; display: flex; align-items: center; }

label { display: block; font-weight: 600; color: var(--black); margin-bottom: 6px; font-size: 0.95rem; }
.required::after { content: " *"; color: var(--orange); }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], select, textarea {
  width: 100%; padding: 12px 14px; border: 2px solid #e0e0e0;
  border-radius: 8px; font-size: 1rem; font-family: inherit;
  transition: border-color 0.2s; background: var(--white);
}

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-field { margin-bottom: 16px; }

.option-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.option-card { position: relative; }
.option-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.option-card label {
  display: block; cursor: pointer; padding: 20px; border: 2px solid #e0e0e0;
  border-radius: 12px; transition: all 0.2s; text-align: center; margin: 0;
}
.option-card label:hover { border-color: var(--orange-light); }
.option-card input[type="radio"]:checked + label { border-color: var(--orange); background: #fff4ec; }

.option-icon { font-size: 2rem; margin-bottom: 8px; }
.option-title { font-weight: 700; color: var(--black); margin-bottom: 4px; font-size: 1.05rem; }
.option-desc { font-size: 0.85rem; color: #666; font-weight: 400; }

.team-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.team-option { position: relative; }
.team-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.team-option label {
  display: block; cursor: pointer; padding: 14px; border: 2px solid #e0e0e0;
  border-radius: 10px; transition: all 0.2s; text-align: center; margin: 0; font-size: 0.92rem;
}
.team-option label:hover { border-color: var(--orange-light); }
.team-option input[type="radio"]:checked + label { border-color: var(--orange); background: var(--orange); color: var(--black); font-weight: 700; }

.team-tag {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--orange-dark); margin-bottom: 2px; letter-spacing: 0.5px;
}

.team-option input[type="radio"]:checked + label .team-tag { color: var(--black); }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; }
.checkbox-row input[type="checkbox"] { margin-top: 4px; accent-color: var(--orange); width: 18px; height: 18px; }
.checkbox-row label { font-weight: 400; color: #444; margin: 0; font-size: 0.95rem; }

.submit-row { text-align: center; margin-top: 16px; }
.btn-submit {
  background: var(--orange); color: var(--black); padding: 16px 40px;
  border: none; border-radius: 10px; font-size: 1.1rem; font-weight: 800;
  cursor: pointer; transition: all 0.2s; letter-spacing: 0.3px;
}
.btn-submit:hover { background: var(--orange-light); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(232, 132, 58, 0.4); }

.form-note {
  background: #fff4ec; padding: 14px 18px; border-radius: 8px;
  margin-top: 18px; font-size: 0.9rem; color: #555; border-left: 3px solid var(--orange);
}

/* RESPONSIVE */
@media (max-width: 700px) {
  .nav-container { padding: 12px 16px; }
  .main-nav ul { gap: 0; }
  .main-nav a { padding: 6px 10px; font-size: 0.85rem; }
  .hero { padding: 50px 20px 70px; }
  .section { padding: 50px 20px; }
  .section-title { font-size: 1.7rem; }
  .team-panel { padding: 20px; }
}
@media (max-width: 600px) {
  .form-wrapper { padding: 24px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .option-cards { grid-template-columns: 1fr; }
}


/* Klikattava uutiskortti */
.news-card-link {
	text-decoration: none;
	color: inherit;
	display: block;
}
.news-card-link:hover .news-card {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* JAOSTO — leveä taulukko border-spacingilla */
.jaosto-wrapper {
	margin-top: 20px;
}
.jaosto-table {
	background: var(--white);
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
}
.jaosto-table tr {
	border-bottom: 1px solid #efefef;
}
.jaosto-table tr:hover td {
	background: #fff8f2;
}
.jaosto-table td {
	padding: 24px 24px;
	vertical-align: middle;
	border-bottom: 1px solid #efefef;
	white-space: nowrap;
}
.jaosto-table tr:last-child td {
	border-bottom: none;
}
.jaosto-table td.jaosto-nimi {
	font-weight: 700;
	color: var(--black);
	font-size: 1.05rem;
	border-left: 4px solid var(--orange);
	padding-right: 80px;
	padding-left: 32px;
}
.jaosto-table td.jaosto-titteli {
	color: #555;
	padding-right: 80px;
}
.jaosto-table td.jaosto-email {
	padding-right: 32px;
}
.jaosto-table td.jaosto-email a {
	color: var(--orange-dark);
	text-decoration: none;
	font-weight: 500;
}
.jaosto-table td.jaosto-email a:hover {
	text-decoration: underline;
}

@media (max-width: 600px) {
	.jaosto-table td,
	.jaosto-table td.jaosto-nimi,
	.jaosto-table td.jaosto-titteli,
	.jaosto-table td.jaosto-email {
		padding: 12px 14px;
		white-space: normal;
		font-size: 0.92rem;
	}
}
