/* =========================================================
   ҚАЙЫПНАЗАР САЙТЫ
   category.php — жұмыс істейтін іздеу батырмасы + карточка
   ========================================================= */

.category-poems-page{
  background:#fbf3e9;
}

/* =========================================================
   HERO
   ========================================================= */

.category-hero{
  min-height:310px;
  position:relative;
  display:flex;
  align-items:center;
  background:
    linear-gradient(90deg, rgba(255,249,240,.96) 0%, rgba(255,249,240,.88) 42%, rgba(255,249,240,.2) 100%),
    var(--category-hero) center/cover no-repeat;
  border-bottom:1px solid #ead7bf;
}

.category-hero.no-image{
  min-height:220px;
  background:
    radial-gradient(circle at 20% 0%, rgba(226,153,44,.12), transparent 34%),
    #fff8ef;
}

.category-hero-inner{
  width:calc(100% - 80px);
  max-width:1180px;
  margin:0 auto;
}

.category-hero h1{
  margin:0 0 14px;
  max-width:620px;
  color:#061f3f;
  font-size:58px;
  line-height:1.02;
  font-weight:800;
  letter-spacing:-.03em;
}

.category-hero p{
  margin:0;
  max-width:610px;
  color:#173252;
  font-size:19px;
  line-height:1.55;
  font-weight:600;
}

/* =========================================================
   SECTION
   ========================================================= */

.category-poems-section{
  padding:38px 0 70px;
}

.category-poems-section .container{
  width:calc(100% - 80px);
  max-width:1180px;
  margin:0 auto;
}

/* =========================================================
   TOP ACTIONS
   ========================================================= */

.category-top-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  margin-bottom:18px;
}

.back-link,
.home-link{
  height:44px;
  padding:0 20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #ead7bf;
  border-radius:999px;
  background:#fffdf9;
  color:#b86416;
  font-size:15.5px;
  font-weight:800;
  text-decoration:none;
  box-shadow:0 8px 18px rgba(61,34,8,.055);
}

.back-link:hover,
.home-link:hover{
  border-color:#d98a28;
  color:#c26f1f;
}

/* =========================================================
   SEARCH + SORT
   ========================================================= */

.category-controls{
  display:grid;
  grid-template-columns:1fr auto;
  gap:18px;
  align-items:start;
  margin-bottom:26px;
}

.category-search-form{
  min-width:0;
}

.search-box{
  width:100%;
  min-height:54px;
  display:grid;
  grid-template-columns:46px 1fr 140px;
  align-items:center;
  background:#fffdf9;
  border:1px solid #ead7bf;
  border-radius:999px;
  box-shadow:0 12px 28px rgba(61,34,8,.07);
  overflow:hidden;
}

.search-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  color:#c26f1f;
  font-size:28px;
  line-height:1;
  font-weight:800;
}

.search-box input{
  width:100%;
  min-width:0;
  height:54px;
  border:0;
  outline:none;
  background:transparent;
  color:#061f3f;
  font-size:16px;
  font-weight:700;
  padding:0 12px 0 0;
}

.search-box input::placeholder{
  color:#9b8a78;
  font-weight:600;
}

.search-box button{
  height:44px;
  margin-right:5px;
  border:0;
  border-radius:999px;
  background:linear-gradient(180deg, #e7a142 0%, #c97418 100%);
  color:#fff;
  font-size:15.5px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 10px 20px rgba(194,111,31,.25);
}

.search-box button:hover{
  filter:brightness(1.03);
}

.clear-search{
  display:inline-flex;
  margin-top:10px;
  color:#b86416;
  font-size:14.5px;
  font-weight:800;
  text-decoration:none;
}

.clear-search:hover{
  text-decoration:underline;
}

.sort-form{
  display:flex;
  align-items:center;
  gap:10px;
  color:#061f3f;
  font-size:16px;
  font-weight:700;
}

.sort-form select{
  min-width:170px;
  height:54px;
  padding:0 18px;
  border:1px solid #ead7bf;
  border-radius:999px;
  background:#fffdf9;
  color:#061f3f;
  font-size:15px;
  font-weight:800;
  outline:none;
  box-shadow:0 8px 18px rgba(61,34,8,.055);
}

.search-result-label{
  margin:-8px 0 22px;
  color:#7c6a57;
  font-size:15px;
  font-weight:800;
}

/* =========================================================
   ӨЛЕҢ КАРТОЧКАЛАРЫ
   ========================================================= */

.category-poems-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:22px;
}

.category-poem-card{
  position:relative;
  min-height:188px;
  padding:30px 30px 26px !important;
  background:#fffdf9;
  border:1px solid #ead7bf;
  border-radius:20px;
  box-shadow:0 12px 28px rgba(61,34,8,.065);
  box-sizing:border-box;
  overflow:hidden;
  transition:transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.category-poem-card:hover{
  transform:translateY(-2px);
  border-color:rgba(210,151,82,.9);
  box-shadow:0 18px 38px rgba(61,34,8,.105);
}

/* Белгішелер жоқ */
.category-poem-card .poem-card-feather,
.category-poem-card .poem-card-icon,
.category-poem-card .poem-icon,
.category-poem-card .icon-square,
.category-poem-card .cat-icon,
.category-poem-card .feather-png,
.category-poem-card .feather-fallback,
.category-poem-card > img:first-child,
.category-poem-card > svg:first-child,
.category-poem-card > span:first-child:not(.read-more){
  display:none !important;
  visibility:hidden !important;
  width:0 !important;
  height:0 !important;
  min-width:0 !important;
  min-height:0 !important;
  max-width:0 !important;
  max-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  overflow:hidden !important;
}

.category-poem-card h2{
  margin:0 0 18px;
  color:#082a52;
  font-size:20px;
  line-height:1.18;
  font-weight:900 !important;
  letter-spacing:-.01em;
}

.category-poem-card p{
  margin:0 0 20px;
  color:#1e3654;
  font-size:15.5px;
  line-height:1.45;
  font-weight:600;
}

.category-poem-card .read-more{
  display:inline-flex;
  align-items:center;
  color:#c26f1f;
  font-size:15.5px;
  line-height:1;
  font-weight:800;
  text-decoration:none;
  white-space:nowrap;
}

.category-poem-card .read-more:hover{
  text-decoration:underline;
}

.poems-count{
  margin-top:34px;
  color:#56657a;
  font-size:16px;
  font-weight:800;
  text-align:center;
}

/* =========================================================
   ПАГИНАЦИЯ
   ========================================================= */

.pagination{
  margin:26px auto 0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  flex-wrap:wrap;
}

.page-numbers{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
}

.page-btn,
.page-number{
  min-width:42px;
  height:42px;
  padding:0 16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:1px solid #ead7bf;
  background:#fffdf9;
  color:#082a52;
  font-size:15px;
  font-weight:800;
  text-decoration:none;
  box-shadow:0 8px 18px rgba(61,34,8,.055);
  box-sizing:border-box;
}

.page-number{
  padding:0;
}

.page-btn:hover,
.page-number:hover{
  border-color:#d98a28;
  color:#c26f1f;
}

.page-number.active{
  background:#082a52;
  border-color:#082a52;
  color:#fff;
}

.page-btn.disabled{
  opacity:.45;
  cursor:not-allowed;
  pointer-events:none;
}

.page-number.ellipsis{
  border-color:transparent;
  background:transparent;
  box-shadow:none;
  color:#b86416;
  pointer-events:none;
}

/* =========================================================
   EMPTY
   ========================================================= */

.empty-poems{
  padding:56px 32px;
  text-align:center;
  background:#fffdf9;
  border:1px solid #ead7bf;
  border-radius:22px;
}

.empty-poems h2{
  margin:0 0 10px;
  color:#061f3f;
  font-size:28px;
}

.empty-poems p{
  margin:0;
  color:#1e3654;
  font-size:17px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media(max-width:1100px){
  .category-poems-grid{
    grid-template-columns:repeat(3, minmax(0,1fr));
  }

  .category-controls{
    grid-template-columns:1fr;
  }

  .sort-form{
    justify-content:flex-start;
  }
}

@media(max-width:820px){
  .category-hero h1{
    font-size:42px;
  }

  .category-top-actions{
    flex-direction:column;
    align-items:flex-start;
  }

  .category-poems-grid{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}

@media(max-width:560px){
  .category-hero-inner,
  .category-poems-section .container{
    width:calc(100% - 32px);
  }

  .search-box{
    grid-template-columns:42px 1fr;
    border-radius:24px;
    padding:6px;
  }

  .search-box button{
    grid-column:1 / -1;
    width:100%;
    margin:6px 0 0;
  }

  .sort-form{
    flex-direction:column;
    align-items:flex-start;
  }

  .sort-form select{
    width:100%;
  }

  .category-poems-grid{
    grid-template-columns:1fr;
  }

  .category-poem-card{
    padding:28px 24px 24px !important;
  }

  .pagination{
    gap:10px;
  }

  .page-btn{
    width:100%;
  }
}
