﻿/* ==============================
   Proverbs Page (Scoped)
============================== */

body.proverbs {
  --proverbs-title-height: 50px;
  --proverbs-search-stack-height: 104px;
  padding: 20px 20px 170px 80px; /* left spacing fixed + footer clearance */
  color: inherit;
  overflow-y: auto;
  font-family: 'Noto Sans Telugu', sans-serif;
}

/* Container */
.proverbs-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

/* ==============================
   Title (Sticky)
============================== */

.proverbs-title {
  position: sticky;
  top: 0;
  z-index: 5;

  height: var(--proverbs-title-height);
  display: flex;
  align-items: center;

  font-size: 26px;
  font-weight: 600;

  background: rgb(90, 90, 90);
  color: #ff9933;
}

.proverbs-search {
  position: sticky;
  top: var(--proverbs-title-height);
  z-index: 4;

  padding: 8px 0 4px 0;
  background: rgb(90, 90, 90);
}

.proverbs-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid rgba(255, 153, 51, 0.45);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.proverbs-search-input::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.proverbs-search-input:focus {
  border-color: #ff9933;
  box-shadow: 0 0 0 2px rgba(255, 153, 51, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.proverbs-search-input:disabled {
  cursor: progress;
  opacity: 0.72;
}

.proverbs-filter-toggle {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.proverbs-filter-toggle input {
  accent-color: #ff9933;
  margin: 0;
  position: relative;
  top: -2px; /* To align Text box with Text */
  flex-shrink: 0;
}

.proverbs-filter-toggle span {
  display: inline-block;
  line-height: 1;
}

.proverbs-search-meta {
  min-height: 0px;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

/* ==============================
   Index (Letters)
============================== */

.proverbs-index {
  position: sticky;
  top: calc(var(--proverbs-title-height) + var(--proverbs-search-stack-height));
  z-index: 3;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(24px, 1fr));
  gap: 4px;
  align-items: end;

  padding: 6px 0 4px 0;
  background: rgb(90, 90, 90);
  border-bottom: 1px solid #ff9933; /* orange separator */
}

.proverbs-index-letters {
  display: contents;
}

/* Letter links */
.proverbs-index a {
  margin: 0;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: bold;

  color: #ff9933;
  opacity: 0.7;

  border-radius: 6px;
  transition: all 0.2s ease;
}

/* Hover */
.proverbs-index a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

/* Active letter */
.proverbs-index a.active {
  color: #ff9933;
  opacity: 1;

  padding-bottom: 4px;
  box-shadow: inset 0 -2px 0 #ff9933;

  font-size: 20px;
  font-weight: 700;
}

.proverbs-index-toggle {
  margin: 0;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: #ff9933;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  border-radius: 0;
  box-shadow: none;
  appearance: none;
  cursor: pointer;
  opacity: 0.7;
}

.proverbs-index-toggle:hover {
  opacity: 1;
  background: none;
}

.proverbs-index-spacer {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.proverbs-index.is-collapsed .letter-link {
  display: none;
}

/* ==============================
   Content
============================== */

.proverb-section {
  margin-top: 12px;
}

/* Individual proverb */
.proverb-item {
  margin: 6px 0;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;

  color: #ffffff;
  transition: all 0.2s ease;
}

/* Hover effect */
.proverb-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(4px);
}

.proverb-text {
  color: inherit;
  user-select: text;
}

.proverb-meta {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.45;
  user-select: text;
}

.proverb-detail {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 153, 51, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  user-select: text;
}

.proverb-detail-row + .proverb-detail-row {
  margin-top: 12px;
}

.proverb-detail-label {
  margin-bottom: 5px;
  color: #ff9933;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.proverb-detail-value {
  color: #ffffff;
  line-height: 1.55;
}

.proverb-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proverb-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 153, 51, 0.12);
  color: #ffd2a8;
  font-size: 13px;
  line-height: 1.2;
  user-select: text;
}

.proverbs-empty {
  padding: 14px 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.05);
}

/* Selected proverb */
.proverb-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ff9933;
}

/* ==============================
   Responsive
============================== */

@media (max-width: 600px) {
  body.proverbs {
    --proverbs-title-height: 45px;
    --proverbs-search-stack-height: 104px;
    padding: 15px 15px 150px 60px; /* slightly reduced left spacing + footer clearance */
  }

  .proverbs-title {
    font-size: 22px;
  }

  .proverbs-search {
  }

  .proverbs-index a {
    padding: 5px 8px;
    font-size: 13px;
  }

  .proverbs-search-input {
    padding: 10px 12px;
  }
}



