/**
 * Archive Page Styles
 * 
 * @package Forgeee
 * @since 1.0.0
 */

/* Archive Page Header - Same structure as single */
.fg-page-header--archive {
    margin-bottom: 2rem;
}

.fg-page-header--archive .fg-entry-header {
    margin-bottom: 0;
}

.fg-page-header--archive .fg-entry-title {
    font-size: 2.6rem;
    margin: 0 0 1rem 0;
    color: var(--fg-text-color, #333);
    font-weight: 400;
    letter-spacing: 2px;
}

.fg-entry-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin-top: 0.5rem;
}

/* Archive Display Switcher */
.fg-archive-display-switcher-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.fg-archive-display-switcher-line {
    width: 100%;
    height: 1px;
    background-color: #e0e0e0;
    margin-bottom: 1rem;
}

.fg-archive-display-switcher {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.fg-display-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.fg-display-toggle:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.fg-display-toggle .material-icons {
    font-size: 24px;
}

.fg-display-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.fg-display-options.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fg-display-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #666;
    font-size: 14px;
}

.fg-display-option:first-child {
    border-radius: 4px 4px 0 0;
}

.fg-display-option:last-child {
    border-radius: 0 0 4px 4px;
}

.fg-display-option:hover {
    background-color: #f5f5f5;
}

.fg-display-option.active {
    background-color: #eef0f4;
    color: #666666;
    font-weight: 600;
}

.fg-display-option .material-icons {
    font-size: 20px;
}

/* Posts Archive Container */
.fg-posts-archive {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* List Display */
.fg-posts-archive--list .fg-post-item {
    display: flex;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.fg-posts-archive--list .fg-post-item:last-child {
    border-bottom: none;
}

.fg-posts-archive--list .fg-post-thumbnail {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    overflow: hidden;
}

.fg-posts-archive--list .fg-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.fg-posts-archive--list .fg-post-content {
    flex: 1;
    position: relative;
}

/* Card Display */
.fg-posts-archive--card {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.fg-posts-archive--card .fg-post-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.fg-posts-archive--card .fg-post-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.fg-posts-archive--card .fg-post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    box-shadow: none;
    border-radius: 8px 8px 0 0;
}

.fg-posts-archive--card .fg-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fg-posts-archive--card .fg-post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Post Item Common Styles */
.fg-post-item {
    margin: 0;
}

.fg-post-header {
    margin-bottom: 1rem;
}

.fg-post-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.fg-post-title a {
    color: var(--fg-text-color, #333);
    text-decoration: none;
    transition: color 0.3s ease;
}

.fg-post-title a:hover {
    color: var(--fg-primary-color, #1297b0);
}

.fg-post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #666;
    flex-wrap: wrap;
}

.fg-post-date {
    color: #666;
}

.fg-post-category {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

/* アーカイブ一覧のカテゴリーバッジスタイル */
.fg-posts-archive .fg-category-link {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background-color: var(--fg-primary-color, #1297b0);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 10px;
    border: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    line-height: 1.3;
}

.fg-posts-archive .fg-category-link:hover {
    background-color: var(--fg-primary-color, #1297b0);
    color: #fff;
    text-decoration: none;
    opacity: 0.85;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(18, 151, 176, 0.4);
}

.fg-post-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding-right: 2.5rem;
}

.fg-post-link {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #ffffff;
    color: var(--fg-primary-color, #1297b0);
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(18, 151, 176, 0.3);
    z-index: 1;
    border: 1px solid var(--fg-primary-color, #1297b0);
}

.fg-post-link:hover {
    background-color: #ffffff;
    color: var(--fg-primary-color, #1297b0);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(18, 151, 176, 0.4);
}

.fg-post-link .material-icons {
    font-size: 20px;
    line-height: 1;
}

/* Pagination */
.fg-pagination {
    margin: 3rem 0;
    text-align: center;
}

.fg-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.fg-pagination .page-numbers li {
    margin: 0;
}

.fg-pagination .page-numbers a,
.fg-pagination .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.fg-pagination .page-numbers a .material-icons,
.fg-pagination .page-numbers span .material-icons {
    border: none;
    padding: 0;
    min-width: auto;
    height: auto;
}

.fg-pagination .page-numbers a:hover {
    background-color: var(--fg-primary-color, #1297b0);
    border-color: var(--fg-primary-color, #1297b0);
    color: #fff;
}

.fg-pagination .page-numbers .current {
    background-color: var(--fg-primary-color, #1297b0);
    border-color: var(--fg-primary-color, #1297b0);
    color: #fff;
    font-weight: 600;
}

.fg-pagination .page-numbers .prev,
.fg-pagination .page-numbers .next {
    font-weight: 600;
}

.fg-pagination .page-numbers .material-icons {
    font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .fg-page-header--archive .fg-entry-title,
    .fg-page-header--search .fg-entry-title {
        font-size: 1.8rem;
    }
    
    .fg-posts-archive--list .fg-post-item,
    .fg-posts-search--list .fg-post-item {
        flex-direction: column;
    }
    
    .fg-posts-archive--list .fg-post-thumbnail,
    .fg-posts-search--list .fg-post-thumbnail {
        width: 100%;
    }
    
    .fg-posts-archive--card,
    .fg-posts-search--card {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Search Page Styles
   ======================================== */

/* Search Page Header */
.fg-page-header--search {
    margin-bottom: 2rem;
}

.fg-page-header--search .fg-entry-header {
    margin-bottom: 0;
}

.fg-page-header--search .fg-entry-title {
    font-size: 2.6rem;
    margin: 0 0 1rem 0;
    color: var(--fg-text-color, #333);
    font-weight: 400;
    letter-spacing: 2px;
}

.fg-search-query {
    color: var(--fg-primary-color, #1297b0);
    font-weight: 600;
}

.fg-search-count {
    font-size: 1rem;
    color: #666;
    margin: 0.5rem 0 1rem 0;
}

.fg-search-form-wrapper {
    margin-top: 1.5rem;
}

.fg-search-form-wrapper .search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 500px;
}

.fg-search-form-wrapper .search-field {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.fg-search-form-wrapper .search-field:focus {
    outline: none;
    border-color: var(--fg-primary-color, #1297b0);
}

.fg-search-form-wrapper .search-submit {
    padding: 0.75rem 1rem;
    background-color: var(--fg-primary-color, #1297b0);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    height: auto;
}

.fg-search-form-wrapper .search-submit:hover {
    background-color: var(--fg-primary-color, #1297b0);
    opacity: 0.9;
}

/* Search Results Container */
.fg-posts-search {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* List Display */
.fg-posts-search--list .fg-post-item {
    display: flex;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.fg-posts-search--list .fg-post-item:last-child {
    border-bottom: none;
}

.fg-posts-search--list .fg-post-thumbnail {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    overflow: hidden;
}

.fg-posts-search--list .fg-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.fg-posts-search--list .fg-post-content {
    flex: 1;
    position: relative;
}

/* Card Display */
.fg-posts-search--card {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.fg-posts-search--card .fg-post-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.fg-posts-search--card .fg-post-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.fg-posts-search--card .fg-post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    box-shadow: none;
    border-radius: 8px 8px 0 0;
}

.fg-posts-search--card .fg-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fg-posts-search--card .fg-post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Search Highlight */
.fg-search-highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 0.1em 0.2em;
    border-radius: 2px;
    font-weight: 600;
}

/* Search Results - Category Links */
.fg-posts-search .fg-category-link {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background-color: var(--fg-primary-color, #1297b0);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 10px;
    border: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    line-height: 1.3;
}

.fg-posts-search .fg-category-link:hover {
    background-color: var(--fg-primary-color, #1297b0);
    color: #fff;
    text-decoration: none;
    opacity: 0.85;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(18, 151, 176, 0.4);
}

/* No Results */
.fg-no-results {
    text-align: center;
    padding: 3rem 1rem;
}

.fg-no-results-icon {
    margin-bottom: 1.5rem;
}

.fg-no-results-icon .material-icons {
    font-size: 4rem;
    color: #ccc;
}

.fg-no-results-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--fg-text-color, #333);
}

.fg-no-results-message {
    font-size: 1rem;
    color: #666;
    margin: 0 0 2rem 0;
}

.fg-search-suggestions {
    text-align: left;
    max-width: 600px;
    margin: 2rem auto 0;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.fg-search-suggestions h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--fg-text-color, #333);
}

.fg-search-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fg-search-suggestions li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #666;
}

.fg-search-suggestions li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--fg-primary-color, #1297b0);
    font-weight: bold;
}

/* Recent Posts in Search */
.fg-recent-posts {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.fg-recent-posts-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--fg-text-color, #333);
}

.fg-recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fg-recent-posts-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.fg-recent-posts-item:last-child {
    border-bottom: none;
}

.fg-recent-posts-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: var(--fg-text-color, #333);
    transition: color 0.3s ease;
}

.fg-recent-posts-link:hover {
    color: var(--fg-primary-color, #1297b0);
}

.fg-recent-posts-title-text {
    flex: 1;
}

.fg-recent-posts-date {
    font-size: 0.875rem;
    color: #666;
    margin-left: 1rem;
}

