/* ============================================================
   kalori-hesaplayici.css — Kalori Hesaplayıcı sayfasına özel
   - SADECE kalori-hesaplayici.php tarafından yüklenir.
   - Kapsam: tüm seçiciler .kh-page ile başlar (globali ezmez).
   - !important yok, hack'li media query yok.
   - Çift scroll yok: overflow-x yönetimi kapsam içinde (clip).
   ============================================================ */

.kh-page {
  box-sizing: border-box;
  overflow-x: clip;
  background: #f8f9fa;
  color: #2c3e50;
  line-height: 1.6;
  font-family: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.kh-page *,
.kh-page *::before,
.kh-page *::after {
  box-sizing: inherit;
}

.kh-page :where(h1, h2, h3, h4, p, ul, ol, figure) {
  margin: 0;
}

.kh-banner-emoji {
  display: inline-block;
  margin-right: 10px;
  font-size: 32px;
  vertical-align: middle;
}

/* Yerleşim */
.kh-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* Hero / giriş */
.kh-hero {
  text-align: center;
  margin-bottom: 40px;
}

.kh-hero-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 25px;
}

.kh-lead {
  width: 100%;
  line-height: 1.8;
  color: #444;
  font-size: 1.15em;
  text-align: left;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

/* YMYL yazar kutusu */
.kh-author-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #166534;
  margin-bottom: 30px;
}

.kh-author-box svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Sunucu tarafı hata kutusu */
.kh-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc3545;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 25px;
  color: #7f1d1d;
}

.kh-errors ul {
  margin: 8px 0 0 20px;
  padding: 0;
}

/* Gönder butonu */
.kh-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
  color: #fff;
  padding: 16px 32px;
  border: none;
  border-radius: 50px;
  font-size: 1.125rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  margin-top: 25px;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.kh-submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
  background: linear-gradient(135deg, #45a049 0%, #2e7d32 100%);
}

.kh-submit-btn:active {
  transform: translateY(-1px);
}

.kh-submit-btn:focus-visible {
  outline: 3px solid rgba(76, 175, 80, 0.55);
  outline-offset: 3px;
}

/* Modern inline validasyon */
.kh-page .kh-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.kh-error-msg {
  color: #dc3545;
  font-size: 0.8125rem;
  font-weight: 500;
  display: block;
  margin-top: 5px;
  animation: kh-fade-in 0.3s ease;
}

@keyframes kh-fade-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sonuç kutusu */
.kh-result {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 30px;
  border-radius: 15px;
  margin-bottom: 30px;
  scroll-margin-top: 20px;
}

.kh-result-title {
  color: #166534;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.kh-result-value {
  font-size: 1.2em;
  margin-bottom: 10px;
}

.kh-result-note {
  display: block;
  font-size: 0.7em;
  color: #666;
  font-weight: 400;
}

.kh-result-value-big {
  font-size: 1.4em;
  color: #15803d;
  margin-bottom: 10px;
}

.kh-result-details {
  color: #4a5568;
  font-style: italic;
}

/* Hedef kartları */
.kh-goals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
  list-style: none;
  padding: 0;
}

.kh-goal-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.kh-goal-card h4 {
  margin-bottom: 10px;
  font-size: 1.05rem;
  color: #1f2937;
}

.kh-goal-card p {
  color: #4a5568;
  font-size: 0.95rem;
  line-height: 1.7;
}

.kh-suggest {
  margin-bottom: 30px;
  color: #4a5568;
}

.kh-suggest h3 {
  margin-bottom: 12px;
  font-size: 1.15rem;
  color: #1f2937;
}

.kh-suggest p + p {
  margin-top: 8px;
}

.kh-suggest a {
  color: #15803d;
  font-weight: 600;
}

/* Bilgi kartları */
.kh-info-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin: 30px 0;
}

.kh-info-card-accent {
  border-left: 4px solid #4caf50;
}

.kh-info-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.kh-info-icon {
  font-size: 3rem;
}

.kh-info-title {
  color: #1f2937;
  font-size: 1.375rem;
  font-weight: 700;
}

.kh-info-text {
  color: #4a5568;
  line-height: 1.8;
  font-size: 1rem;
}

.kh-tip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.kh-tip {
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.kh-tip-green {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.kh-tip h4 {
  color: #059669;
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 600;
}

.kh-tip ul {
  margin: 0;
  padding-left: 20px;
  color: #4a5568;
  font-size: 0.875rem;
  line-height: 1.6;
}

.kh-tip-note {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  border: 1px solid #f59e0b;
}

.kh-tip-note h4 {
  color: #92400e;
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 600;
}

.kh-tip-note p {
  margin: 0;
  color: #78350f;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* SSS akordeonu (long-tail SEO) */
.kh-faq-item {
  border: 1px solid #e5e9ef;
  border-radius: 10px;
  margin-bottom: 12px;
  background: #fff;
  overflow: hidden;
}

.kh-faq-item:last-child {
  margin-bottom: 0;
}

.kh-faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 1rem;
  color: #4caf50;
  cursor: pointer;
  list-style: none;
}

.kh-faq-question::-webkit-details-marker {
  display: none;
}

.kh-faq-question::after {
  content: "+";
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
}

.kh-faq-item[open] .kh-faq-question::after {
  content: "−";
}

.kh-faq-question:focus-visible {
  outline: 3px solid rgba(76, 175, 80, 0.55);
  outline-offset: -3px;
}

.kh-faq-answer {
  padding: 0 18px 16px;
  color: #4a5568;
  font-size: 0.875rem;
  line-height: 1.7;
}

/* Kaynakça (YMYL) */
.kh-references {
  margin-top: 40px;
  padding: 20px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.75rem;
  color: #718096;
  line-height: 1.6;
}

.kh-references strong {
  color: #4a5568;
  display: block;
  margin-bottom: 8px;
}

.kh-references ol {
  margin: 0;
  padding-left: 15px;
}

/* Duyarlı tasarım (standart media query) */
@media (max-width: 768px) {
  .kh-wrapper {
    padding: 15px;
  }

  .kh-author-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .kh-lead {
    padding: 20px;
    font-size: 1em;
  }

  .kh-result {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kh-page *,
  .kh-page *::before,
  .kh-page *::after {
    animation-duration: 0.01ms;
    transition-duration: 0.01ms;
  }
}
