/* =============================================
   Trip Finder  /  home.php
   ============================================= */

/* --- Hero (page_title) --- */

#page_title {
  position: relative;
  width: 100%;
  height: 30vh;
  min-height: 170px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tf_bg_mosaic {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.tf_bg_img {
  background-size: cover;
  background-position: center center;
}

.tf_bg_overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

#page_title h1 {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: clamp(28px, 5vw, 50px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.1;
}

/* --- Category filter --- */

section.category {
  max-width: 1200px;
  margin: 28px auto;
  padding: 0 20px;
}

.tf_cat_group {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.tf_cat_label {
  flex-shrink: 0;
  min-width: 44px;
  padding-top: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #aaa;
  text-align: right;
}

.tf_cat_buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tf_cat_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 18px;
  border-radius: 30px;
  border: 1px solid #ddd;
  background-color: #f0f0f0;
  color: #888;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
  font-family: inherit;
  line-height: 1;
}

.tf_cat_btn:hover {
  background-color: #e0e0e0;
  color: #333;
}

.tf_cat_btn.active {
  background-color: #18655d;
  border-color: #18655d;
  color: #fff;
}

/* All button: default = active (green) */
.tf_cat_btn.all_btn {
  background-color: #18655d;
  border-color: #18655d;
  color: #fff;
}

/* All button when a category is selected */
.tf_cat_btn.all_btn.inactive {
  background-color: #f0f0f0;
  border-color: #ddd;
  color: #888;
}

/* --- Main grid --- */

main#page,
main#fav_main {
  width: 100%;
  margin: 0;
  padding: 40px 0;
  background: linear-gradient(160deg, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 20%, rgba(250,255,247,1) 40%, rgba(247,255,242,1) 72%, rgba(255,255,255,1) 74%, rgba(251,255,245,1) 91%, rgba(245,255,251,1) 100%);
}

.tf_grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- フィルターアニメーション --- */

@keyframes tf_fadein {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================
   Favorites Page Hero
   ============================================= */

.fav_hero {
  background-color: #18655d;
  padding: 106px 20px 48px;
  text-align: center;
  color: #fff;
}

.fav_hero h1 {
  font-size: clamp(22px, 5vw, 38px);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.fav_hero_count {
  font-size: 14px;
  opacity: 0.8;
  letter-spacing: 0.04em;
}

.fav_empty {
  text-align: center;
  padding: 80px 20px;
  color: #aaa;
  font-size: 15px;
  line-height: 2;
  grid-column: 1 / -1;
}

.fav_empty i {
  color: #18655d;
}

/* Item */

.tf_item {
  position: relative;
  display: flex;
  flex-direction: column;
  animation: tf_fadein 0.4s ease both;
  background-color: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

/* favボタンは tf_img_wrap 内に配置 → 画像枠（position:relative）が基準 */
.tf_img_wrap .favorite_button {
  position: absolute;
  top: auto;
  right: 8px;
  bottom: 8px;
  z-index: 2;
}

.tf_item a {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

/* Image wrapper */

.tf_img_wrap {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background-color: #e8e8e8;
}

.tf_img_wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.tf_item:hover .tf_img_wrap img {
  transform: scale(1.06);
}

/* Teaser overlay (hover only) */

.tf_teaser {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.62);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
  opacity: 0;
  transition: opacity 0.3s;
  text-align: center;
}

.tf_item:hover .tf_teaser {
  opacity: 1;
}

/* Item info */

.tf_info {
  padding: 12px 14px 14px;
  flex: 1;
}

.tf_info .area_cats {
  font-size: 11px;
  color: #18655d;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.4;
}

.tf_info .area_cats li::before {
  font-family: "Font Awesome 7 Free";
  content: '\f3c5';
  font-weight: 900;
  padding-right: 3px;
  font-size: 10px;
}

.tf_info h3 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  line-height: 1.45;
}

/* No results */

.tf_no_results {
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
  font-size: 15px;
  grid-column: 1 / -1;
  max-width: 1200px;
  margin: 0 auto;
}

/* Pagination */

.tf_pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 48px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;
}

.tf_page_btn {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: none;
  color: #555;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tf_page_btn:hover {
  background-color: #18655d;
  border-color: #18655d;
  color: #fff;
}

.tf_page_btn.active {
  background-color: #18655d;
  border-color: #18655d;
  color: #fff;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 1000px) {
  .tf_grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  #page_title {
    height: 20vh;
  }

  section.category {
    margin: 16px auto;
  }

  .tf_cat_group {
    flex-direction: column;
    gap: 8px;
  }

  .tf_cat_label {
    text-align: left;
    padding-top: 0;
  }

  .tf_grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 12px;
  }

  .tf_bg_mosaic {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(5, 1fr);
  }
}

@media (max-width: 480px) {
  .tf_grid {
    gap: 12px 10px;
  }

  .tf_info h3 {
    font-size: 12px;
  }

  .tf_cat_btn {
    font-size: 12px;
    padding: 6px 14px;
  }
}
