.cat-album {
  padding: 24px 16px;

}

.cat-item {
  border: none;
  background: transparent;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor:pointer;
}

.cat-item:hover img {
  transform: scale(1.02);
  filter: brightness(1.03);
}

.cat-item:active img {
  transform: scale(0.99);
}

.cat-grid{
  margin-top: 70px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.cat-grid img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.cat-modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.75);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
}
.cat-modal-img{
  max-width:min(92vw, 1100px);
  max-height:92vh;
  border-radius:12px;
}
.cat-modal-close{
  position:absolute;
  top:16px;
  right:16px;
  font-size:28px;
  line-height:1;
  border:0;
  background:rgba(255,255,255,.15);
  color:#fff;
  width:44px;
  height:44px;
  border-radius:999px;
  cursor:pointer;
}
.cat-modal[hidden] { display: none !important; }
.cat-modal-img {
  background: #000;
}
@media (max-width: 600px){
  .cat-item.wide{ grid-column: span 1; }
}

/* グリッド本体 */
.cat-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: 8px;        /* 小さめがコツ */
  grid-auto-flow: dense;
  gap: 14px;
}


/* アイテム共通 */
.cat-item{
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}


/* 画像 */
.cat-item img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

/* アクセント：2列 */
.cat-item.wide{ grid-column: span 2; }

@media (max-width: 900px){
  .cat-item.wide{ grid-column: span 1; }
}

.cat-modal{
  opacity: 0;
  transition: opacity .18s ease;
}
.cat-modal:not([hidden]){
  opacity: 1;
}

.cat-item{ position: relative; }

.cat-like{
  position: absolute;
  right: 10px;
  bottom: 25px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.cat-like:hover{ background: rgba(0,0,0,.6); }

.cat-like-count{
    color: #fff;
}

.cat-controls{
  position: fixed;
  display:flex;
  justify-content:space-between;
  width: 100%;
  gap:12px;
  align-items:center;
  margin: 0 0 14px;
  z-index: 9990;
  background-color: #eeeef46e;
  left: 0;
  right: 0;
  width: auto;
  padding: 0px 50px;

}

.cat-filters{ display:flex; gap:8px; flex-wrap:wrap;align-items: center; }
.cat-chip{
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration:none;
  background: rgba(255,255,255,.06);
}
.cat-chip.is-active{ background: rgba(255,255,255,.16); }

.cat-sorts{ display:flex; gap:10px; align-items: center;}
.cat-sort{ text-decoration:none; opacity:.75; }
.cat-sort.is-active{ opacity:1; text-decoration: underline; }

.cat-like.is-liked{
  opacity: 1;
  transform: scale(1.03);
}

/* cat-album だけヘッダーを消す（bodyクラスは環境で違うので後述） */
body.page-id-6 #header {
  display: none !important;
}

body.page-id-6 hr{
  display: none;
}

.cat-album-head{
  position:fixed;
  height: 16.9%;
  top: 0;
  left: 0;
  right: 0;  
  z-index: 9998;
  padding: 50px;
  background-color: #eeeef46e;
}

.nav-back-here{
  position: absolute;
  top: 40%;
  right: 50px;
  cursor: pointer;
  width: 10%;
  max-width: 100px;
  height: 100px;
}
.nav-back-here img{
  position: absolute;
  width: 100%;
  height: auto;
  top: 0px;
  right: 0px;
  cursor: pointer;

}

.backto img{
  position: absolute;
  inset: 0;
  transition: opacity .25s ease;
}

/* 初期状態 */
.ladybug{
  opacity: 1;
  z-index: 9999;
  transform-origin:bottom right;
  transition: transform 1s cubic-bezier(.2,.8,.2,1), opacity .25s ease;
  transform: translateX(0);
}

.arrow{
  opacity: 0;
  z-index: 1;
}

/* ホバー時に入れ替え */
.nav-back-here:hover .ladybug,
.nav-back-here.is-active .ladybug{
  opacity: 1;
  animation: arrowFlash 1200ms forwards 1;
}

.nav-back-here:hover .arrow,
.nav-back-here.is-active .arrow{
  opacity: 1;
}

@keyframes arrowFlash{
  0%   { opacity:1; transform: rotate(0deg) translateY(0px) translateX(px) }
  5%  { opacity:0; transform: rotate(0deg) translateY(0px) translateX(0px)}
  50% { opacity:1; transform: rotate(0deg) translateY(0px) translateX(0px)}
  100%{opacity:1; transform:  rotate(-70deg) translateY(-40px) translateX(-5px)}
}

.cat-album{
  padding-top: 200px;
}




.cat-album-title{
  font-family:"Zen Loop", sans-serif; 
  font-size: 8.0rem;
  font-weight: 500;
  line-height: 1.0rem;
  color: rgb(249, 143, 3);
}





/**********************************************************************************************/
@media (min-width:768px) and (max-width:1199px){
  .cat-album-head{
    height: 140px;
    padding:10px  50px ;
  }

  .nav-back-here{
    top: 40px;
    right: 20px;
  }

  .cat-album{
    padding-top: 140px;
  }

  .cat-grid{
    margin-top: 50px;
  }

  .cat-album-title{
  font-size:clamp(86px,11vw, 120px);
  }
}

/**********************************************************************************************/
@media (max-width:767px){
.cat-album-head{
  padding: 30px;
  height: 100px;
}
.cat-album-title{
  font-size: clamp(48px, 11vw, 86px);
  line-height: 0px;
}

.nav-back-here{
  top: 40%;
  right: 20px;
  width: 10%;
  max-width: 100px;
  height: auto;
}

.cat-album{
  padding:100px 6px;
}

.cat-controls{
  padding: 5px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0px;
}
.cat-filter,.cat-sorts{
  gap :5px;
}

.cat-filters p,.cat-sorts p{
  margin: 5px 0px;
}
.cat-chip{
  font-size:14px;
  padding: 5px 5px;
}

.cat-grid{
  margin-top: 70px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
}