/* ===============================
   Template List Page (LinkTasky風)
=============================== */

.template-list-page{
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 12px 44px;
}

/* =========================
   Breadcrumb
========================= */
.breadcrumb {
  font-size: 13px;
  line-height: 1.5;
  margin: 12px 0 16px;
  color: #555;
}

.breadcrumb a {
  color: #555;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.breadcrumb a:hover {
  opacity: 1;
  text-decoration: underline;
}

.breadcrumb span {
  margin: 0 4px;
  opacity: 0.45;
}

.breadcrumb .current {
  font-weight: 600;
  color: #222;
  opacity: 0.9;
}

/* モバイル調整 */
@media (max-width: 640px) {
  .breadcrumb {
    font-size: 12px;
    margin: 8px 0 12px;
  }
}


/* ===============================
   Hero（見出しエリア）
=============================== */

.template-hero{
  margin-bottom: 18px;
  padding: 18px 18px 20px;
  border-radius: 18px;
  border: solid 3px rgba(24, 90, 157, 0.12);
  background:
    linear-gradient(135deg,
      rgba(67, 206, 162, 0.18),
      rgba(24, 90, 157, 0.10)
    );
  box-shadow: 0 6px 16px rgba(0,0,0,0.10);
}

.template-hero h1{
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.template-hero .hero-sub{
  display: inline-block;
  margin-left: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.75);
  color: #185a9d;
  vertical-align: middle;
}

.template-hero .lead{
  margin: 6px 0 0;
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.9;
}

/* PCだけ改行 */
.pc-only{ display: none; }
@media (min-width: 768px){
  .pc-only{ display: inline; }
}

/* ===============================
   Controls（検索/絞り込み）
=============================== */

.template-controls{
  margin-top: 14px;
}

.ctrl-row{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.6fr auto;
  gap: 10px;
  align-items: center;
}

@media (max-width: 640px){
  .ctrl-row{
    grid-template-columns: 1fr;
  }
}

.template-controls .search,
.template-controls .select{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(24, 90, 157, 0.12);
  background: rgba(255,255,255,0.88);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  outline: none;
}

.template-controls .search:focus,
.template-controls .select:focus{
  border-color: rgba(24, 90, 157, 0.35);
  box-shadow: 0 0 0 4px rgba(24, 90, 157, 0.10);
}

.template-controls .filter-btn{
  padding: 12px 14px;
  border: none;
  border-radius: 14px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #43cea2, #185a9d);
  box-shadow: 0 6px 14px rgba(24, 90, 157, 0.18);
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease;
}

.template-controls .filter-btn:hover{
  transform: translateY(-1px);
  filter: brightness(0.95);
}

.ctrl-sub{
  margin-top: 10px;
}

.ctrl-sub .reset{
  font-size: 0.82rem;
  color: #185a9d;
  text-decoration: none;
  font-weight: 700;
  opacity: .9;
}

.ctrl-sub .reset:hover{
  text-decoration: underline;
}

/* ===============================
   Template Grid
=============================== */

.template-list{
  list-style: none;
  padding: 0;
  margin: 0;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 980px){
  .template-list{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px){
  .template-list{
    grid-template-columns: 1fr;
  }
}

/* ===============================
   Template Card
=============================== */

.template-card{
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  border: 1px solid rgba(2, 6, 11, 0.12);
  position: relative;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  gap: 10px;

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

/* 光エフェクト */
.template-card::before{
  content:"";
  position:absolute;
  inset: -40px -60px auto auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(67, 206, 162, 0.22),
    rgba(24, 90, 157, 0.10),
    transparent 70%
  );
  pointer-events:none;
}

.template-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.14);
  border-color: rgba(24, 90, 157, 0.18);
}

/* ===============================
   Card Link（詳細ページへ）
=============================== */

.template-card-link{
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 12px 12px 8px;
  border-radius: 14px;
  transition: background .18s ease;
}

.template-card:hover .template-card-link{
  background: rgba(24, 90, 157, 0.04);
}

.template-card-link:focus-visible{
  outline: 3px solid rgba(24, 90, 157, 0.25);
  outline-offset: 4px;
}

.template-card-link:hover h2{
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===============================
   Card Header
=============================== */

.template-head{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-bottom: 6px;
}

.template-head .emoji{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(24, 90, 157, 0.08);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  font-size: 1.25rem;
}

.template-head h2{
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===============================
   Description
=============================== */

.template-desc{
  margin: 8px 0 10px;
  font-size: 0.86rem;
  line-height: 1.7;
  opacity: 0.86;
  min-height: 3.4em;
}

/* ===============================
   Meta
=============================== */

.template-meta{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.template-meta .category{
  background: rgba(24, 90, 157, 0.08);
  color: #185a9d;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.template-meta .usage{
  font-size: 0.75rem;
  opacity: 0.75;
  white-space: nowrap;
}

/* ===============================
   CTA Button（グループ作成）
=============================== */

.template-card .cta{
  margin-top: auto;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  width: 100%;
  padding: 0.78rem 1rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;

  color: #fff;
  background: linear-gradient(135deg, #43cea2, #185a9d);
  box-shadow: 0 6px 14px rgba(24, 90, 157, 0.20);
  transition: filter 0.2s ease, transform 0.2s ease;
}

.template-card .cta:hover{
  filter: brightness(0.92);
  transform: translateY(-2px);
}

.template-card .cta:active{
  transform: translateY(0);
}

/* ===============================
   Pagination
=============================== */

.pagination{
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.pg{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.88rem;
  background: rgba(24, 90, 157, 0.08);
  color: #185a9d;
  transition: transform .2s ease, background .2s ease;
}

.pg:hover{
  background: rgba(24, 90, 157, 0.14);
  transform: translateY(-1px);
}

.pg.disabled{
  opacity: .45;
  pointer-events: none;
}

.pg.status{
  background: rgba(255,255,255,0.75);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  color: #333;
}

/* ===============================
   Empty State
=============================== */

.template-list > p{
  grid-column: 1 / -1;
  margin: 6px 0 0;
  padding: 14px 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  opacity: 0.85;
}

/* ===============================
   Mobile：下だけ点線
=============================== */

@media (max-width: 640px){
  .template-card::after{
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 1px;
    pointer-events: none;

    background-image: repeating-linear-gradient(
      90deg,
      rgba(24, 90, 157, 0.55) 0px,
      rgba(24, 90, 157, 0.55) 6px,
      transparent 6px,
      transparent 14px
    );
  }
}
