/* ===================================
   NEWS Archive Page Styles
   =================================== */

/* 管理バーの余白を強制リセット */
html {
    margin-top: 0 !important;
}

#wpadminbar {
    display: none;
}

/* Reset top spacing */
.site-main {
    padding-top: 0 !important;
}

.news-archive-page {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* タイトル周りの空白を極限まで詰める */
.site-main .news-archive-page.container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.news-archive-page .page-title {
    margin-top: 0 !important;
    margin-bottom: 5px !important;
    padding-top: 0 !important;
}

.news-main-content {
    padding-top: 0 !important;
}

/* Archive Layout - Title on top, Sidebar on LEFT */
.news-archive-page {
    display: grid;
    grid-template-columns: 150px 1fr;
    grid-template-areas:
        "title title"
        "sidebar content";
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 40px;
}

.news-main-content {
    min-width: 0;
    grid-area: content;
}

/* Collapsible Post Styles */
.news-post {
    border-bottom: 1px solid #e0e0e0;
    padding: 30px 0;
}

.news-header {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.news-header:hover {
    opacity: 0.7;
}

.news-date {
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    min-width: 80px;
    font-weight: 300;
}

.news-thumbnail {
    flex-shrink: 0;
}

.news-thumb-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.news-post:not(.collapsed) .news-thumb-img {
    filter: grayscale(0%);
}

.news-title {
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin: 0;
    flex: 1;
}

.expand-icon {
    margin-left: auto;
    font-size: 1.5rem;
    font-weight: 300;
    min-width: 30px;
    text-align: center;
}

/* Content Wrapper */
.news-content-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.news-post:not(.collapsed) .news-content-wrapper {
    max-height: 10000px;
    margin-top: 30px;
    padding-left: 110px;
    /* Align with title */
}

.news-full-content {
    margin-bottom: 20px;
    line-height: 1.8;
}

.news-full-content img {
    max-width: 100%;
    height: auto;
}

/* Hyperlinks in content - more visible */
.news-full-content a {
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 2px solid var(--color-text);
    transition: opacity 0.2s ease;
    font-weight: 500;
}

.news-full-content a:hover {
    opacity: 0.6;
}

/* Tags */
.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.news-tag {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid #e0e0e0;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.news-tag:hover {
    background: var(--color-text);
    color: var(--color-bg);
}

/* Collapse Button */
.collapse-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 30px;
    background: transparent;
    border: 1px solid var(--color-text);
    cursor: pointer;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    font-weight: 500;
}

.collapse-button:hover {
    background: var(--color-text);
    color: var(--color-bg);
}

/* Pagination */
.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin: 60px 0 40px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}

.news-pagination a,
.news-pagination .disabled {
    text-decoration: none;
    color: var(--color-text);
    transition: opacity 0.2s ease;
}

.news-pagination a:hover {
    opacity: 0.6;
}

.news-pagination .disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.back-to-top {
    border-bottom: 1px solid #e0e0e0;
}

/* Sidebar - LEFT SIDE */
.news-sidebar {
    grid-area: sidebar;
    border-right: 1px solid #e0e0e0;
    padding-right: 30px;
}

.sidebar-section {
    margin-bottom: 40px;
}

.sidebar-section h3 {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--color-text);
    padding-bottom: 10px;
}

/* Page Title */
.page-title {
    grid-area: title;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0 !important;
    margin-bottom: 5px !important;
    padding-top: 10px;
}

/* Reset spacing for tight layout */
.news-archive-page {
    padding-top: 0 !important;
}

.news-main-content {
    padding-top: 0 !important;
}

.news-posts-list {
    margin-top: 0 !important;
}

/* Collapsible toggle (mobile only) */
.sidebar-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-icon {
    font-size: 1.2rem;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.sidebar-section.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.sidebar-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-section.collapsed .sidebar-content {
    max-height: 0;
}

.year-item,
.tag-item {
    display: block;
    padding: 8px 0;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: opacity 0.2s ease;
    border-bottom: 1px solid transparent;
}

.year-item:hover,
.tag-item:hover {
    opacity: 0.6;
}

.year-item.active,
.tag-item.active {
    font-weight: 700;
    border-bottom-color: var(--color-text);
}

/* Page Title */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 40px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .news-archive-page {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
        grid-template-areas:
            "title"
            "sidebar"
            "content";
    }

    .page-title {
        grid-area: title;
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .news-sidebar {
        grid-area: sidebar;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding-right: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .news-main-content {
        grid-area: content;
    }

    .sidebar-section {
        margin-bottom: 0;
    }

    .sidebar-section h3 {
        font-size: 0.75rem;
        margin-bottom: 10px;
        padding-bottom: 5px;
    }

    .year-item,
    .tag-item {
        padding: 5px 0;
        font-size: 0.8rem;
    }

    .news-header {
        flex-wrap: wrap;
    }

    .news-date {
        width: 100%;
        margin-bottom: 10px;
    }

    .news-title {
        font-size: 1rem;
    }

    .news-post {
        padding: 20px 0;
    }

    .news-post:not(.collapsed) .news-content-wrapper {
        margin-top: 15px;
    }

    .news-post:not(.collapsed) .news-content-wrapper {
        padding-left: 0;
    }

    .news-pagination {
        gap: 20px;
        font-size: 0.8rem;
        margin: 40px 0 20px;
    }
}