@charset "UTF-8";

/* ==================================================
       SWELLのレイアウト干渉を無効化
================================================== */
.c-pageTitle {
  display: none !important;
}

.post_content {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}
.l-mainContent__inner {
  padding: 0 !important;
  max-width: none !important;
}
.l-content {
  padding: 0 !important;
  margin: 0 auto;
}
.post_content > * {
  margin-bottom: 0;
}

#ts-app-wrapper {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background-color: var(--ts-bg-body);
  min-height: 100vh;
  font-family: "Open Sans", "Noto Sans JP", sans-serif;
  color: var(--ts-primary);
  box-sizing: border-box;
  padding-bottom: 80px;
}

body {
  overflow-x: hidden;
}

#after_main_content,
.l-articleBottom {
  display: none !important;
}

/* ==================================================
       アプリ固有スタイル
       ================================================== */
:root {
  --ts-primary: #333333;
  --ts-accent: #d32f2f;
  --ts-bg-body: #e5e7eb;
  --ts-bg-card: #ffffff;
  --ts-border: #d1d5db;
  --ts-text-sub: #666666;
  --ts-itra-color: #8bd03c;
  --ts-form-bg: #f3f4f6;
  --ts-bg-spec-row: #f3f4f6;
  --ts-radius-m: 8px;
  --ts-card-max-width: 500px;
  --ts-header-z-index: 1000;
}

#ts-app-wrapper * {
  box-sizing: border-box;
}

/* 固定ヘッダー */
.ts-sticky-header {
  position: sticky;
  top: 72px;
  z-index: var(--ts-header-z-index);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid #e5e7eb;
  width: 100%;
}

.ts-header-inner {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 0px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

/* ロゴ */
.ts-logo-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  margin-right: auto;
}
.ts-logo-img {
  height: 24px;
  width: auto;
  display: block;
  margin: 0;
}
.ts-by-carb {
  font-size: 11px;
  color: #333;
  font-weight: normal;
  line-height: 1.2;
  margin-bottom: 2px;
}

/* コントロール群 */
.ts-controls-area {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex: 1;
}

.ts-toggles-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-right: 24px;
  flex-shrink: 0;
}

.ts-filters-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* トグルスイッチ */
.ts-switch-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  flex-shrink: 0;
}
.ts-switch-input {
  display: none;
}

.ts-switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  background-color: #d1d5db;
  border-radius: 20px;
  transition: background-color 0.2s;
}
.ts-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.ts-switch-input:checked + .ts-switch-track {
  background-color: var(--ts-accent);
}
#ts-check-itra:checked + .ts-switch-track {
  background-color: var(--ts-itra-color);
}
.ts-switch-input:checked + .ts-switch-track::after {
  transform: translateX(16px);
}

/* UIパーツ: セレクト & 検索 */
.ts-ui-box {
  background-color: var(--ts-form-bg);
  border: 1px solid transparent;
  border-radius: 6px;
  height: 36px;
  display: flex;
  align-items: center;
  font-size: 13px;
  transition: all 0.2s;
  font-family: "Open Sans", "Noto Sans JP", sans-serif;
}
.ts-ui-box:hover {
  background-color: #e5e7eb;
}

.ts-select-wrapper {
  position: relative;
  flex-shrink: 0;
}

.ts-select {
  appearance: none;
  background-color: transparent;
  border: none;
  height: 100%;
  padding: 0 28px 0 32px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  outline: none;
  width: 100%;
  margin: 0 !important;
  font-family: inherit;
}

.ts-icon-img-left {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
  object-fit: contain;
}

.ts-select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-30%) rotate(45deg);
  width: 5px;
  height: 5px;
  border-right: 1.5px solid #999;
  border-bottom: 1.5px solid #999;
  pointer-events: none;
}

.ts-search-wrapper {
  position: relative;
  width: 180px;
}
.ts-search-input {
  width: 100%;
  height: 100%;
  background-color: transparent;
  border: none;
  padding: 0 10px 2px 34px;
  font-size: 13px;
  outline: none;
  margin: 0 !important;
  font-family: inherit;
  color: #333;
}
.ts-search-input::placeholder {
  font-size: 13px;
  color: #6b7280;
  opacity: 1;
}

.ts-search-icon-img {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  pointer-events: none;
  object-fit: contain;
}

/* --------------------------------------------------
           レスポンシブ (スマホ: 900px以下)
    -------------------------------------------------- */
@media (max-width: 900px) {
  .ts-header-inner {
    flex-wrap: wrap;
    padding: 10px 15px;
    gap: 12px 0;
  }
  .ts-logo-area {
    margin-right: 0;
    width: auto;
    order: 1;
  }
  .ts-toggles-wrapper {
    margin-right: 0;
    margin-left: auto;
    gap: 10px;
    order: 2;
  }
  .ts-filters-wrapper {
    width: 100%;
    order: 3;
    gap: 8px;
  }
  .ts-select-wrapper {
    flex: 1;
    min-width: 0;
  }
  .ts-search-wrapper {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .ts-select {
    padding: 0 20px 0 28px;
    font-size: 12px;
  }
  .ts-search-input {
    padding: 0 8px 2px 30px;
    font-size: 12px;
  }
  .ts-search-input::placeholder {
    font-size: 12px;
  }

  .ts-icon-img-left,
  .ts-search-icon-img {
    left: 8px;
  }
  .ts-select-arrow {
    right: 6px;
  }
}

/* 結果エリア & カード */
.ts-result-area {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 16px;
}

#trail-search-app {
  max-width: var(--ts-card-max-width);
  margin: 0 auto;
  width: 100%;
}

.ts-count-area {
  font-size: 12px;
  color: var(--ts-text-sub);
  margin-bottom: 12px;
  text-align: center;
}
.ts-count-num {
  font-weight: bold;
  color: var(--ts-primary);
}

.ts-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ts-card {
  display: block;
  text-decoration: none;
  background-color: var(--ts-bg-card);
  border-radius: var(--ts-radius-m);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 8px 13px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  border: 1px solid transparent;
  color: inherit;
}
.ts-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  color: inherit;
}

.ts-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 5px;
}
.ts-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1;
}
.ts-date {
  font-weight: 700;
  font-size: 15px;
  color: var(--ts-primary);
  letter-spacing: 0.03em;
}

.ts-pref {
  color: var(--ts-primary);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  font-weight: 500;
}
.ts-card-pin-icon {
  width: 14px;
  height: 14px;
  display: block;
  object-fit: contain;
}

.ts-tag {
  font-size: 8px;
  padding: 5px 4px;
  border-radius: 4px;
  font-weight: 500;
  border: 1px solid transparent;
  line-height: 1;
}
.ts-tag-cat {
  background-color: transparent;
  color: #9ca3af;
  border: 1px solid #9ca3af;
}
.ts-tag-itra {
  color: var(--ts-itra-color);
  border: 1px solid var(--ts-itra-color);
  font-weight: 700;
}

.ts-status {
  font-size: 10px;
  font-weight: 500;
  padding: 5px;
  border-radius: 3px;
  white-space: nowrap;
  margin-left: 8px;
  flex-shrink: 0;
  line-height: 1;
}
.ts-status.open {
  background-color: #fff1f2;
  color: var(--ts-accent);
  font-weight: 700;
}
.ts-status.closed {
  background-color: #f3f4f6;
  color: #9ca3af;
}

.ts-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 5px;
  color: var(--ts-primary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}
.ts-icon-external-img {
  width: 12px;
  height: 12px;
  object-fit: contain;
  margin-left: 2px;
  vertical-align: middle;
}

.ts-specs-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 5px;
}
.ts-spec-row {
  background-color: var(--ts-bg-spec-row);
  border-radius: 5px;
  padding: 6px;
  font-size: 12px;
  color: var(--ts-primary);
  font-family: "Open Sans", "Noto Sans JP", sans-serif;
  font-weight: 500;
  line-height: 1;
}

.ts-msg-area {
  text-align: center;
  padding: 60px 0;
  color: #999;
  font-size: 14px;
}
/* ==================================================
                swell固定ヘッダー＆管理バー調整
       ================================================== */
.l-fixHeader {
  display: none !important;
}
.l-header {
  position: -webkit-sticky !important;
  position: sticky !important;
  z-index: 1001; /* アプリヘッダーより上に */
}
.ts-sticky-header {
  position: -webkit-sticky;
  top: 72px;
}
/* 管理者（ログイン時）への上書き設定 */
.admin-bar .l-header {
  top: 32px;
}
.admin-bar .ts-sticky-header {
  top: 104px;
}
/* --- スマホ (900px以下) --- */
@media (max-width: 900px) {
  .ts-sticky-header {
    top: 50px;
  }
  /* 管理者（ログイン時）への上書き設定 */
  .admin-bar .l-header {
    top: 46px;
  }
  .admin-bar .ts-sticky-header {
    top: 96px;
  }
}
