* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: #FAFAFA;
    color: #2B3E50;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー */
.page-header {
    background: linear-gradient(135deg, #F7F3F0 0%, #FFF8F3 100%);
    color: #2B3E50;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #E8DDD5;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23FF8C42' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: drift 20s linear infinite;
}

@keyframes drift {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(100px, 100px) rotate(360deg); }
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    letter-spacing: 0.05em;
}

.page-header p {
    font-size: 1.1rem;
    color: #5A6C7D;
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* 検索・フィルターセクション */
.filter-section {
    background: white;
    padding: 40px 0 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease-in-out;
}

/* Mini-header style for when user scrolls down */
.filter-section.mini-header {
    padding: 15px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.filter-section.mini-header .search-container {
    margin-bottom: 15px;
}

.filter-section.mini-header .filter-content,
.filter-section.mini-header .active-filters {
    display: none;
}

/* 検索ボックス */
.search-container {
    margin-bottom: 35px;
}

.search-box {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 16px 60px 16px 25px;
    border: 2px solid #E8E8E8;
    border-radius: 50px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #FAFAFA;
    font-weight: 400;
}

.search-input::placeholder {
    color: #999;
}

.search-input:focus {
    outline: none;
    border-color: #FF8C42;
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 140, 66, 0.08);
}

.search-button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: #FF8C42;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #FF7A2B;
    transform: translateY(-50%) scale(1.05);
}

.search-button:active {
    transform: translateY(-50%) scale(0.95);
}

.search-button svg {
    width: 22px;
    height: 22px;
    color: white;
}

/* フィルターコンテナ */
.filter-tabs-container {
    display: block; /* Show by default for desktop */
}

.filter-dropdowns-container {
    display: none; /* Hide by default */
}

.filter-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
  background: #F0F0F0;
  border-radius: 30px;
  padding: 4px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  transition: margin 0.3s ease-in-out;
}

.filter-section.mini-header .filter-tabs {
    margin-bottom: 0;
}

.filter-tab {
  flex: 1;
  padding: 12px 24px;
  border: none;
  background: transparent;
  border-radius: 26px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.filter-tab.active {
  background: white;
  color: #FF8C42;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.filter-tab svg {
  width: 18px;
  height: 18px;
}

.filter-content {
    /* Styles for the container of filter groups */
}

.filter-group {
    display: none; /* Hide groups by default */
    animation: fadeIn 0.3s ease;
}

.filter-group.active {
    display: block; /* Show active group */
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.filter-tag {
    padding: 8px 18px;
    border: 2px solid #E8E8E8;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #5A6C7D;
}

.filter-tag:hover {
    border-color: #FF8C42;
    color: #FF8C42;
}

.filter-tag.active {
    color: white;
    border-color: #FF8C42;
    background: #FF8C42;
}

/* 選択されたフィルター表示 */
.active-filters {
    margin: 25px auto 0;
    padding: 18px;
    background: #F8F8F8;
    border-radius: 12px;
    display: none;
    border: 1px solid #E8E8E8;
    max-width: 1160px;
}

.active-filters.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    color: #5A6C7D;
}

.clear-filters-button {
    background: none;
    border: none;
    color: #FF8C42;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-decoration: underline;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: white;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    color: #5A6C7D;
}

.remove-filter-button {
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
    font-size: 18px;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
}

.remove-filter-button:hover {
    color: #FF6B35;
}

/* No Results Message */
.no-results-message {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.no-results-message p {
    font-size: 1.1rem;
}

/* Case Study Cards */
.content-section {
    padding: 3rem 0;
}

/* カードコンポーネントのスタイル */
.card-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.case-study-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.card-category {
    color: #FF8C42;
    font-weight: 600;
}

.card-date {
    color: #999;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #2B3E50;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-summary {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin: 0 0 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .filter-tabs-container {
        display: none; /* Hide tabs on mobile */
    }

    .filter-dropdowns-container {
        display: flex; /* Show dropdowns on mobile */
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .filter-dropdown-wrapper {
        flex: 1;
    }

    .filter-dropdown {
        width: 100%;
        padding: 12px 40px 12px 16px;
        border: 2px solid #E8E8E8;
        border-radius: 10px;
        background: white;
        font-size: 15px;
        font-weight: 500;
        color: #2B3E50;
        cursor: pointer;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L7 7L13 1' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 16px center;
        transition: all 0.3s ease;
    }

    .filter-dropdown:focus {
        outline: none;
        border-color: #FF8C42;
        box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
    }
    
    .filter-group {
        display: block !important; /* Always show content for dropdowns */
    }

    .filter-tags {
        display: none; /* Hide tag boxes on mobile as they are replaced by dropdowns */
    }

    .page-header {
        padding: 50px 0;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .page-header p {
        font-size: 0.95rem;
        padding: 0 20px;
    }

    .filter-section, .filter-section.mini-header {
        padding: 25px 0 20px;
        position: static; /* Or 'relative' if needed, but not sticky on mobile */
    }

    .search-input {
        padding: 14px 50px 14px 20px;
        font-size: 15px;
    }

    .search-button {
        width: 40px;
        height: 40px;
    }
    
    .active-filters {
        padding: 14px;
        margin: 20px 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* グリッドレイアウトの修正 */
#case-studies-grid {
    display: grid;
    gap: 2rem;
    align-items: stretch;
}

/* PC版: 横3列で表示 */
@media (min-width: 1024px) {
    #case-studies-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* タブレット版: 横2列で表示 */
@media (min-width: 768px) and (max-width: 1023px) {
    #case-studies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* スマホ版: 1列で表示 */
@media (max-width: 767px) {
    #case-studies-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .card-image-wrapper {
        height: 180px;
    }
    
    .card-content {
        padding: 1.25rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-summary {
        font-size: 0.9rem;
    }
}

/* ページネーション */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding: 2rem 0;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #E8E8E8;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #5A6C7D;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #FF8C42;
    color: #FF8C42;
}

.pagination-btn.active {
    background: #FF8C42;
    color: white;
    border-color: #FF8C42;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-dots {
    color: #999;
    padding: 0 0.5rem;
}

@media (max-width: 768px) {
    .pagination-container {
        margin-top: 2rem;
        gap: 0.25rem;
    }
    
    .pagination-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
        min-width: 35px;
    }
}

/* カードタグのスタイル */
.case-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #F3F4F6;
    color: #5A6C7D;
    font-size: 0.75rem;
    border-radius: 100px;
    font-weight: 500;
    white-space: nowrap;
}

.case-tag-more {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    color: #999;
    font-size: 0.75rem;
    font-weight: 500;
}
