main{
    background-image: linear-gradient(rgba(210, 210, 210, 0.4) 1px, transparent 1px), linear-gradient(to right, rgba(210, 210, 210, 0.4) 1px, transparent 1px);
    background-size: 20px 20px;
    padding: 10px 0px;
        min-height: 70vh;
}

.none{
  display: none;
}


.list-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
}

.filter-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-form select,
.filter-form button {
  padding: 6px 8px;
  font-size: 0.9em;
}

.fav-link {
  text-align: right;
  margin-bottom: 12px;
}

.post-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 8px 16px 10px;
  margin-bottom: 20px;
  min-height: 115px; /*返信ラベルが本文にかぶらないように*/
  position: relative;
}

.post-card > a{
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
}

.post-footer a{
  position: relative;
  z-index: 2;

}




.post-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.80em;
  color: #666;
}

.post-user {
  font-weight: bold;
  font-family: 'Noto Sans JP';
}


.post-title {
  color: #333;
    margin: 0 0 6px;
    font-size: 1.05em;
    font-weight: 800;
    font-family: 'Noto Sans JP';
}

.post-title a {
  color: #333;
  text-decoration: none;
}

.post-snippet {
    font-size: 0.80em;
    margin: 0 0 12px;
    color: #444;
    line-height: 1.4;
}

.fav-btn {
  font-size: 0.9em;
  text-decoration: none;
  color: #c33;
}




.post-cards{
    width: 94%;
    margin: 0 auto;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  position: absolute;
    bottom: 8px;
    right: 10px;
}

.badge.replied {
  background-color: #2e7d32;
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.7em;
}


/*検索部分*/
form.search-form {
    margin-bottom: 5px;
}

.search-form-5 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 80%;
    overflow: hidden;
    background-color: #f2f2f2;
    border-radius: 13px;
    margin: 10px auto;
}

.search-form-5 input {
    height: 35px;
    width: 100%;
    padding: 5px 18px;
    border: none;
    box-sizing: border-box;
    background-color: white;
    font-size: 0.8em;
    outline: none;
}

.search-form-5 input::placeholder {
    color: #777777;
}

.search-form-5 button {
    display: flex
;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 40px;
    border: none;
    background-color: transparent;
    cursor: pointer;
}

.search-form-5 button::after {
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%20%3Cpath%20d%3D%22M23.7%2020.8%2019%2016.1c-.2-.2-.5-.3-.8-.3h-.8c1.3-1.7%202-3.7%202-6C19.5%204.4%2015.1%200%209.7%200S0%204.4%200%209.7s4.4%209.7%209.7%209.7c2.3%200%204.3-.8%206-2v.8c0%20.3.1.6.3.8l4.7%204.7c.4.4%201.2.4%201.6%200l1.3-1.3c.5-.5.5-1.2.1-1.6zm-14-5.1c-3.3%200-6-2.7-6-6s2.7-6%206-6%206%202.7%206%206-2.6%206-6%206z%22%20fill%3D%22%23777777%22%3E%3C%2Fpath%3E%20%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    content: '';
}

.search-form-5 label {
    width: calc(100% - 45px);
        margin-bottom: 1px;
}

fieldset{
  width: 40%;
}

h4 {
    border-bottom: 2px solid #d0d0d0;
    margin-top: 10px;
}

.category-flex {
    display: flex;
    flex-direction: row;
    margin-left: 16px;
    gap: 20px;
}


.category-in-flex {
    display: flex;
    flex-direction: column;
    margin-left: 0px;
    margin-top: 8px;
    padding-bottom: 10px;
    color: #333;
}


/*検索アコーディオン*/
.category-ac {
    margin-bottom: 7px;
    width: 80%;
    margin-left: 10%;
    font-size: 14px;
    color: #333;
}

.category-ac summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    color: #333333;
    font-weight: 600;
    padding: 8px 12px;
    cursor: pointer;
        border-left: solid 5px #9b2c2c;
}

.category-ac summary::-webkit-details-marker {
    display: none;
}

.category-ac summary::after {
    transform: translateY(-25%) rotate(45deg);
    width: 7px;
    height: 7px;
    margin-left: 10px;
    border-bottom: 3px solid #333333b3;
    border-right: 3px solid #333333b3;
    content: '';
    transition: transform .3s;
}

.category-ac[open] summary::after {
    transform: rotate(225deg);
}

.category-ac p {
    transform: translateY(-10px);
    opacity: 0;
    margin: 0;
    padding: .3em 2em 1.5em;
    color: #333333;
    transition: transform .5s, opacity .5s;
}

.category-ac[open] p {
    transform: none;
    opacity: 1;
}


.category-width{
  width: 44%;
}

.buttons{
      position: relative;
    height: 30px;
    margin-top: 15px;

}

.buttons .btn-search {
    display: block;
    width: 180px;
    padding: 5px;
    background-color: var(--jukenred);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin: 0 auto;
    position: absolute;
    left: 36%;
    transform: translateX(-50%);
}

.btn-clear {
    display: block;
    width: 90px;
    padding: 5px;
    background-color: gray;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    margin: 0 auto;
    position: absolute;
    left: 75%;
    transform: translateX(-50%);
}

.output-count{
  margin-bottom: 20px;
}
.output-count p{
  text-align: center;
  color: #333;
  font-size: 14px;
}

.output-count span{
  color: var(--jukenred);
  font-size: 20px;
}



/*ページャー*/


/* ページ番号をフレックスで横並び */
.pagination ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  gap: 0rem;
  justify-content: center;
  align-items: center;
}

/* 各 li */
.pagination li {
  display: inline-block;
}

/* 通常ページリンク */
.pagination a {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    line-height: 1.4rem;
    background-color: white;
    color: #333;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 50%;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    margin: 0 0.2rem;
}

/* 矢印リンクは丸ではなく四角形に */
.pagination a.arrow {
  border-radius: 4px;
  width: auto;
  padding: 0 0.3rem;
}

/* ホバー時 */
.pagination a:hover {
  background: #f0f0f0;
}

/* 現在ページ */
.pagination a.active {
  background: #333;
  color: #fff;
  border-color: #333;
}

/* 省略記号 */
.pagination .ellipsis {
  display: block;
  width: auto;
  padding: 0rem;
  color: #999;
  cursor: default;
}

/* 下部の大きな「最後へ」ボタン */
.pagination-action {
  text-align: center;
  margin-top: 1rem;
}

.btn-last {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid #333;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.btn-last:hover {
  background: #333;
  color: #fff;
}


nav.pagination {
    height: 50px;
    margin-top: 30px;
}


