@charset "utf-8";

/* ========================================================
	ksc-search 共通
======================================================== */

/* コンテナクエリを有効に */
.ksc-search-wrapper {
	container-type: inline-size;
    padding: 0 40px;
    margin: 0 auto;
}

/* ---- タブボタン ---- */
.ksc-search-tab-buttons {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    margin-top: 40px;
}

.ksc-search-st-btn-wrap {
    display: flex;
    justify-content: center;
    gap: 20px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.ksc-search-st-btn {
	flex: 1;
	padding: 1.1em 3em;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
	text-align: center;
	background: var(--white);
	color: var(--black);
	border-top: 1px solid var(--black);
	border-right: 1px solid var(--black);
	border-left: 1px solid var(--black);
	border-bottom: none;
	margin-bottom: 0;
}

.ksc-search-st-btn.is-active {
	background: var(--black);
	color: var(--white);
}

.ksc-search-st-btn:hover:not(.is-active) {
	background: var(--gray-03);
	color: var(--black);
}

.ksc-search-tab-line {
    margin-left: -40px;
    margin-right: -40px;
    width: calc(100% + 80px);
    height: 1px;
    background: var(--black);
    position: relative;
    z-index: 16;
}

/* ---- コンテナ設定 ---- */
.ksc-search-container {
	position: relative;
	width: 100%;
    max-width: 900px;
	margin: 0 auto;
}

/* ---- カテゴリボタン ---- */
.ksc-search-categories {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	margin: 60px auto 30px auto;
    gap: 10px 16px;
}

.ksc-search-cat-btn {
	color: var(--black);
	background: var(--gray-03);
	border: none;
	border-right: 1.5px solid var(--black);
	border-bottom: 1.5px solid var(--black);
	padding: 10px 20px;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
	text-align: center;
	white-space: nowrap;
	min-width: 120px;
}

.ksc-search-cat-btn.is-active {
	background: var(--black);
	color: var(--white);
	border: none;
}

.ksc-search-cat-btn:hover:not(.is-active) {
	background: var(--gray-05);
	color: var(--black);
}

/* ---- プルダウン ---- */
.ksc-search-filter-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.ksc-search-filter-row select {
	padding: 10px 24px 10px 16px;
	background: var(--white);
	border: 1px solid var(--gray-05);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23333' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.8em center;
	min-width: 160px;
}

.ksc-search-filter-row select:focus {
	outline: none;
	border-color: var(--black);
}

/* ---- 検索・クリアボタン ---- */
.ksc-search-btn {
	padding: 0.7em 2.2em;
	background: var(--black);
	color: var(--white);
	border: 1px solid var(--black);
	cursor: pointer;
	transition: background 0.2s;
}

.ksc-search-btn:hover,
.ksc-search-btn:active {
	background: var(--red);
	border-color: var(--red);
	color: var(--white);
}

.ksc-clear-btn {
	padding: 0.7em 2.2em;
	background: var(--white);
	color: var(--black);
	border: 1px solid var(--gray-05);
	cursor: pointer;
	transition: background 0.2s;
}

.ksc-clear-btn:hover,
.ksc-clear-btn:active {
	background: var(--gray-03);
	color: var(--black);
}

/* ---- 自動生成リスト ---- */
.ksc-search-post-list {
	margin: 0 auto;
	margin-top:60px;
}

/* ---- グリッドレイアウト ---- */
.ksc-search-posts-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.ksc-search-post-item {
	width: 100%;
}

/* ---- サムネイル ---- */
.ksc-search-post-thumb {
	width: 100%;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	display: flex;
	box-shadow: 0 2px 8px var(--gray-08);
}

.ksc-search-post-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s cubic-bezier(.4, 0, .2, 1);
}

.ksc-search-post-item:hover .ksc-search-post-thumb img {
	transform: scale(1.08);
}

.ksc-search-dropdown .ksc-search-post-thumb {
    aspect-ratio: 1.2 / 1;
}

@container (max-width: 768px) {
.ksc-search-wrapper {
    padding: 0 5%;
}
    .ksc-search-post-thumb {
        aspect-ratio: 0.8 / 1;
    }
    .ksc-search-post-list {
	margin-top:30px;
}
}

.ksc-search-post-title {
    color: var(--black);
	text-align: left;
	margin-top: 0.5em;
}

.ksc-search-post-title:hover {
    color: var(--red);
}

/* ---- ページネーション ---- */
.ksc-search-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 16px;
	margin: 32px auto 32px auto;
}

.ksc-search-page-info {
	color: var(--black);
	margin: 0 4px;
	min-width: 2em;
	text-align: center;
}

.ksc-search-page-info.is-active {
	border-bottom: 1px solid var(--black);
	background-color: var(--gray-02);
}

/* ========================================================
	Container Queries - コンテナ幅で自動調整
======================================================== */

/* 狭いコンテナ（ヘッダードロップダウンなど） */
@container (max-width: 600px) {
	.ksc-search-tab-buttons {
		margin-top: 16px;
	}
	.ksc-search-st-btn-wrap {
		gap: 8px;
		max-width: 100%;
	}
	.ksc-search-st-btn {
		padding: 0.7em 1em;
	}
	.ksc-search-categories {
		gap: 6px 8px;
		margin: 16px auto;
		padding: 0 8px;
	}
  .ksc-search-cat-btn {
      padding: 8px 13px;
      min-width: 70px;
  }
  .ksc-search-filter-row {
      margin: 8px 8px;
      gap: 6px;
  }
  .ksc-search-filter-row select {
      min-width: 100px;
      padding: 8px 29px 8px 11px;
  }
  .ksc-search-btn,
  .ksc-clear-btn {
      padding: 8px 19px;
  }
	.ksc-search-posts-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}
}

@media (max-width: 768px) {
	.ksc-search-container {
		width: 100%;
		padding: 0;
	}
	.ksc-search-categories {
		gap: 8px;
		margin: 20px 10px;
	}
	.ksc-search-cat-btn {
		min-width: 80px;
		padding: 0.6em 1em;
	}
	.ksc-search-posts-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
	.ksc-search-post-list {
		padding: 20px 5%;
	}
}

/* ========================================================
    ksc-news-widget
======================================================== */

.ksc-news-widget {
  width: 100%;
  padding: 0 40px;
  margin: 0 auto;
}

.ksc-news-widget-wrap{
    max-width: 800px;
    margin: 0 auto;
}

.ksc-news-widget-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    align-items: start;
}

.ksc-news-widget-item {
    display: block;
    text-decoration: none;
    color: var(--black);
    transition: opacity 0.2s;
}

.ksc-news-widget-item:hover {
    opacity: 0.75;
}

.ksc-news-widget-thumb {
    width: 100%;
    aspect-ratio: 1 / 1.1;
    overflow: hidden;
}

.ksc-news-widget-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ksc-news-widget-item:hover .ksc-news-widget-thumb img {
    transform: scale(1.05);
}

.ksc-news-widget-no-thumb {
    width: 100%;
    aspect-ratio: 1 / 1.1;
    background: var(--gray-03);
}

.ksc-news-widget-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.ksc-news-widget-badge {
    display: inline-block;
    color: var(--white);
    padding: 3px 8px;
    white-space: nowrap;
}

.ksc-news-widget-date {
    color: var(--gray-08);
}

.ksc-news-widget-title {
    margin-top: 6px;
    line-height: 1.6;
}

.ksc-news-widget-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .ksc-news-widget {
        padding: 0 16px 60px;
    }
    .ksc-news-widget-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px 12px;
    }
    .ksc-news-widget-item:nth-child(4) {
        display: none;
    }
}

/* ========================================================
    ksc-news-archive アーカイブページ
======================================================== */

.ksc-news-archive-main {
    width: 100%;
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 60px;
}

.ksc-news-archive-wrapper {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 60px;
    align-items: start;
}

/* ---- サイドバー ---- */
.ksc-news-archive-sidebar-inner {
    position: sticky;
    top: 120px;
    border: 1px solid var(--gray-05);
    padding: 24px 20px;
}

.ksc-news-archive-sidebar-title {
    font-weight: 400;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-05);
}

.ksc-news-archive-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ksc-news-archive-sidebar-list li {
    margin-bottom: 4px;
}

.ksc-news-archive-sidebar-link {
    display: block;
    padding: 8px 10px;
    color: var(--black);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}

.ksc-news-archive-sidebar-link:hover {
    background: var(--gray-03);
}

.ksc-news-archive-sidebar-link.is-active {
    border-left-color: var(--black);
    font-weight: 600;
    background: var(--gray-03);
}

/* ---- メインコンテンツ ---- */
.ksc-news-archive-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 400;
    margin-bottom: 40px;
}

.ksc-news-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

.ksc-news-archive-item {
    display: block;
    text-decoration: none;
    color: var(--black);
    transition: opacity 0.2s;
}

.ksc-news-archive-item:hover {
    opacity: 0.75;
}

.ksc-news-archive-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.ksc-news-archive-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ksc-news-archive-item:hover .ksc-news-archive-thumb img {
    transform: scale(1.05);
}

.ksc-news-archive-no-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--gray-03);
}

.ksc-news-archive-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.ksc-news-archive-badge {
    display: inline-block;
    color: var(--white);
    padding: 3px 8px;
    white-space: nowrap;
}

.ksc-news-archive-date {
    color: var(--gray-08);
}

.ksc-news-archive-item-title {
    margin-top: 6px;
    line-height: 1.6;
}

.ksc-news-archive-empty {
    grid-column: 1 / -1;
    color: var(--gray-08);
}

/* ---- ページネーション ---- */
.ksc-news-archive-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 48px;
}

.ksc-news-archive-page-btn {
    color: var(--black);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--black);
    transition: background 0.2s, color 0.2s;
}

.ksc-news-archive-page-btn:hover {
    background: var(--black);
    color: var(--white);
}

.ksc-news-archive-page-num {
    color: var(--black);
    text-decoration: none;
    padding: 4px 8px;
    transition: color 0.2s;
}

.ksc-news-archive-page-num.is-active {
    font-weight: 600;
    border-bottom: 2px solid var(--black);
}

.ksc-news-archive-page-num:hover:not(.is-active) {
    color: var(--gray-08);
}

/* ---- レスポンシブ ---- */
@media (max-width: 1024px) {
    .ksc-news-archive-wrapper {
        grid-template-columns: 180px 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .ksc-news-archive-main {
        padding: 0 16px;
        margin: 40px auto;
    }
    .ksc-news-archive-wrapper {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .ksc-news-archive-sidebar-inner {
        position: static;
    }
    .ksc-news-archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}