/* ================================================================
   YÜKSEK UÇUŞ - MENKIBE.CSS
   Ana sayfanın altındaki sade menkıbe kartı (yalnız metin)
   ve Ayarlar > Menkıbe formu (gösterim yerleri, kaynaklar, seçim).
   ================================================================ */

/* Sade kart: gölge, gradyan ve başlık yok; yalnız ince çerçeve. */
.home-menkibe {
  margin-top: var(--space-md);
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

/* `hidden` özniteliği, display tanımlı elemanlarda da çalışsın. */
.home-menkibe [hidden] {
  display: none !important;
}

/* ==================== KISSA ==================== */

.home-menkibe-body {
  padding: 0;
}

.home-menkibe-quote {
  max-width: 68ch;
}

.hm-quote {
  margin: 0;
}

.hm-quote-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dim);
  text-wrap: pretty;
}

.hm-quote-cite {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--text-muted);
}

/* ==================== İSKELET ==================== */

.hm-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 0;
}

.hm-skeleton span {
  height: 10px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    90deg,
    var(--bg-input) 25%,
    var(--border) 50%,
    var(--bg-input) 75%
  );
  background-size: 200% 100%;
  animation: hm-shimmer 1.4s ease-in-out infinite;
}

.hm-skeleton span:nth-child(1) {
  width: 92%;
}

.hm-skeleton span:nth-child(2) {
  width: 100%;
}

.hm-skeleton span:nth-child(3) {
  width: 64%;
}

@keyframes hm-shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ==================== AYARLAR ==================== */

.hm-settings {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-width: 0;
}

.hm-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.hm-hint strong {
  font-weight: 600;
  color: var(--text-dim);
}

.hm-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.hm-label {
  display: block;
  padding: 0;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.hm-label-hint {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.hm-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.hm-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.hm-check:hover {
  border-color: var(--border-strong);
}

.hm-check:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.hm-check input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.hm-check-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hm-check-text strong {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.hm-check-text small {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}

.hm-count {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* ==================== KISSA SEÇİCİ ==================== */

.hm-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}

.hm-picker summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.hm-picker summary::-webkit-details-marker {
  display: none;
}

.hm-picker summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--transition-fast);
}

.hm-picker[open] summary::after {
  transform: rotate(-135deg);
}

.hm-picker-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.hm-picker-body {
  padding: 0 10px 10px;
}

.hm-search {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
}

.hm-search svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.hm-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
}

.hm-search input::placeholder {
  color: var(--text-muted);
}

.hm-picker-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hm-pick {
  display: grid;
  grid-template-columns: 16px 1fr;
  column-gap: 8px;
  row-gap: 1px;
  padding: 7px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.hm-pick:hover {
  background: var(--bg-card);
}

.hm-pick input {
  grid-row: 1 / span 2;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.hm-pick-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-dim);
}

.hm-pick-cite {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: nowrap;
}

.hm-pick-grup {
  flex-shrink: 0;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-input);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.hm-pick-cite-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-picker-empty {
  padding: 16px 8px;
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.hm-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 8px;
}

/* ==================== KAYDET ÇUBUĞU ==================== */

.hm-savebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.hm-status {
  margin: 0;
  min-height: 16px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.hm-status.is-success {
  color: var(--success);
}

.hm-status.is-error {
  color: var(--danger);
}

.hm-status.is-warning {
  color: var(--warning);
}

.hm-status.is-loading {
  color: var(--accent);
}

.hm-savebar-actions {
  display: flex;
  gap: 6px;
}

/* ==================== ODAK ==================== */

.hm-check:has(input:focus-visible),
.hm-search:has(input:focus-visible),
.hm-picker summary:focus-visible,
.hm-pick:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==================== DUYARLILIK ==================== */

@media (max-width: 620px) {
  .home-menkibe {
    padding: 14px 16px;
  }

  .hm-options {
    grid-template-columns: 1fr;
  }

  .hm-savebar {
    align-items: stretch;
  }

  .hm-status {
    width: 100%;
  }

  .hm-savebar-actions {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hm-skeleton span {
    animation: none;
  }

  .hm-picker summary::after {
    transition: none;
  }
}
