/*
 * YS Note Child - current home/archive design layer
 * Extracted from the latest appended override block so new work can target
 * the live design without digging through legacy experiments.
 */

.hero-section {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-bottom: 40px !important;
}

.hero-section::before {
    display: none !important;
}

.series-spotlight {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

.series-spotlight__title,
.ys-archive-section-heading__title,
.unified-category-widget>h2,
.unified-category-widget>h3,
.unified-category-widget .wp-block-heading,
.featured-carousel .widget-title {
    color: var(--ys-text-meta) !important;
    font-weight: 500 !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    line-height: 1.2 !important;
    margin: 0 0 1.25rem !important;
    padding: 0 !important;
    border-bottom: none !important;
}

.series-spotlight__title,
.ys-archive-section-heading__title {
    margin-bottom: 1.25rem !important;
}

.ys-archive-section-heading__title {
    margin-bottom: 0 !important;
}

.series-spotlight__title::before {
    display: none !important;
}

.series-spotlight__track {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    padding-bottom: 0 !important;
}

.series-spotlight__card {
    background: var(--ys-bg-card) !important;
    border: 1px solid var(--ys-border) !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow: hidden !important;
    min-width: 0 !important;
}

.series-spotlight__card:hover {
    transform: translateY(-4px) !important;
    border-color: var(--ys-border-hover) !important;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06) !important;
}

[data-theme="dark"] .series-spotlight__card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3) !important;
}

.series-spotlight__image {
    display: block !important;
    width: 100% !important;
    height: 140px !important;
    background-size: cover !important;
    background-position: center !important;
    border-bottom: 1px solid var(--ys-border) !important;
    border-radius: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.series-spotlight__info {
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    flex: 1 !important;
}

.series-spotlight__count {
    order: -1 !important;
    align-self: flex-start !important;
    padding: 3px 10px !important;
    margin: 0 0 2px 0 !important;
    background: var(--ys-accent-soft) !important;
    color: var(--ys-accent) !important;
    border: none !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    font-size: 0.72rem !important;
    line-height: 1.6 !important;
    box-shadow: none !important;
}

.series-spotlight__name {
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    color: var(--ys-text-title) !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

.series-spotlight__desc {
    color: var(--ys-text-body) !important;
    font-size: 0.88rem !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ys-archive-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem !important;
}

.archive-layout-toggle-wrapper {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

body.home .content-area,
body.home .widget-area,
body.home .right-sidebar,
body.blog .content-area,
body.blog .widget-area,
body.blog .right-sidebar,
body.archive .content-area,
body.archive .widget-area,
body.archive .right-sidebar,
body.search .content-area,
body.search .widget-area,
body.search .right-sidebar {
    margin-top: 0 !important;
}

body.home .inside-right-sidebar,
body.blog .inside-right-sidebar,
body.archive .inside-right-sidebar,
body.search .inside-right-sidebar {
    position: sticky;
    top: calc(var(--ys-header-offset) + 20px);
    align-self: start;
    max-height: calc(100vh - var(--ys-header-offset) - 44px);
    overflow-y: auto;
    overflow-x: visible;
    padding: 4px 10px 8px 0;
}

body.home .inside-right-sidebar::-webkit-scrollbar,
body.blog .inside-right-sidebar::-webkit-scrollbar,
body.archive .inside-right-sidebar::-webkit-scrollbar,
body.search .inside-right-sidebar::-webkit-scrollbar {
    width: 6px;
}

body.home .inside-right-sidebar::-webkit-scrollbar-thumb,
body.blog .inside-right-sidebar::-webkit-scrollbar-thumb,
body.archive .inside-right-sidebar::-webkit-scrollbar-thumb,
body.search .inside-right-sidebar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 999px;
}

.unified-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.unified-cat-item {
    margin-bottom: 10px;
}

.unified-cat-item:last-child {
    margin-bottom: 0;
}

.unified-series-list {
    list-style: none;
    margin: 8px 0 0 !important;
    padding: 8px 0 0 14px;
    max-height: 420px;
    overflow-y: auto;
    border-left: 1px solid var(--ys-border);
    scrollbar-width: thin;
    position: relative;
}

.unified-series-list::-webkit-scrollbar {
    width: 6px;
}

.unified-series-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 999px;
}

.unified-series-item {
    margin-bottom: 6px;
}

.unified-series-item:last-child {
    margin-bottom: 0;
}

.unified-series-item a {
    display: block;
    padding: 8px 12px;
    color: var(--ys-text-meta);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.55;
    transition: background 0.2s ease, color 0.2s ease;
}

.unified-series-item a:hover {
    background: var(--ys-accent-soft);
    color: var(--ys-text-title);
}

.unified-series-item.is-current-post a {
    background: var(--ys-accent-soft);
    color: var(--ys-accent);
    font-weight: 600;
}

.series-number {
    margin-right: 4px;
    opacity: 0.6;
}

.ys-grid-card-meta {
    display: none;
}

@media (min-width: 561px) {
    html[data-archive-layout="grid"] .posts-grid-wrapper {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 40px 28px !important;
    }

    html[data-archive-layout="grid"] .posts-grid-wrapper .post {
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
        transition: none !important;
    }

    html[data-archive-layout="grid"] .posts-grid-wrapper .post:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    html[data-archive-layout="grid"] .posts-grid-wrapper .post .inside-article {
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        background: transparent !important;
        flex: 1 !important;
    }

    html[data-archive-layout="grid"] .posts-grid-wrapper .post .post-image {
        margin: 0 0 14px 0 !important;
        width: 100% !important;
        flex-shrink: 0 !important;
        order: -1 !important;
    }

    html[data-archive-layout="grid"] .posts-grid-wrapper .post .post-image img {
        width: 100% !important;
        aspect-ratio: 16 / 10 !important;
        height: auto !important;
        object-fit: cover !important;
        border-radius: 14px !important;
        display: block !important;
        transition: opacity 0.25s ease !important;
    }

    html[data-archive-layout="grid"] .posts-grid-wrapper .post:hover .post-image img {
        opacity: 0.88 !important;
    }

    html[data-archive-layout="grid"] .posts-grid-wrapper .post .entry-header {
        padding: 0 !important;
        margin: 0 !important;
    }

    html[data-archive-layout="grid"] .posts-grid-wrapper .post .entry-header .entry-meta,
    html[data-archive-layout="grid"] .posts-grid-wrapper .post footer.entry-meta,
    html[data-archive-layout="grid"] .posts-grid-wrapper .post .entry-summary {
        display: none !important;
    }

    html[data-archive-layout="grid"] .posts-grid-wrapper .post .ys-grid-card-meta {
        display: flex !important;
        align-items: center;
        gap: 6px;
        margin-bottom: 8px;
        font-size: 0.82rem;
        color: var(--ys-text-meta);
        line-height: 1;
    }

    .ys-grid-card-meta__cat {
        color: var(--ys-text-title) !important;
        font-weight: 600;
        text-decoration: none;
        transition: color 0.2s;
    }

    .ys-grid-card-meta__cat:hover {
        color: var(--ys-accent) !important;
    }

    .ys-grid-card-meta__sep {
        color: var(--ys-text-meta);
        opacity: 0.5;
    }

    .ys-grid-card-meta__date {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        color: var(--ys-text-meta);
    }

    .ys-grid-card-meta__date svg {
        opacity: 0.6;
        flex-shrink: 0;
    }

    html[data-archive-layout="grid"] .posts-grid-wrapper .post .entry-title {
        color: var(--ys-text-title) !important;
        font-weight: 500 !important;
        font-size: 1.1rem !important;
        line-height: 1.45 !important;
        margin: 0 !important;
    }

    html[data-archive-layout="grid"] .posts-grid-wrapper .post .entry-title a {
        color: inherit !important;
        text-decoration: none !important;
        transition: color 0.2s !important;
    }

    html[data-archive-layout="grid"] .posts-grid-wrapper .post:hover .entry-title a {
        color: var(--ys-accent) !important;
    }

    html[data-archive-layout="list"] .posts-grid-wrapper {
        display: block !important;
    }

    html[data-archive-layout="list"] .site-main .post {
        background: transparent !important;
        border: none !important;
        border-bottom: 1px solid var(--ys-border) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 0 0 28px 0 !important;
        margin-bottom: 28px !important;
    }

    html[data-archive-layout="list"] .site-main .post:last-child {
        border-bottom: none !important;
    }

    html[data-archive-layout="list"] .site-main .post:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    html[data-archive-layout="list"] .site-main .post .inside-article {
        display: grid !important;
        grid-template-columns: 220px minmax(0, 1fr) !important;
        grid-template-areas:
            "thumb header"
            "thumb summary" !important;
        gap: 0 24px !important;
        align-items: start !important;
        padding: 0 !important;
        background: transparent !important;
    }

    html[data-archive-layout="list"] .site-main .post .post-image,
    html[data-archive-layout="list"] .site-main .post .inside-article .post-image {
        grid-area: thumb !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
    }

    html[data-archive-layout="list"] .site-main .post .post-image img {
        width: 100% !important;
        aspect-ratio: 16 / 10 !important;
        height: auto !important;
        object-fit: cover !important;
        border-radius: 12px !important;
        display: block !important;
        transition: opacity 0.25s ease !important;
    }

    html[data-archive-layout="list"] .site-main .post:hover .post-image img {
        opacity: 0.88 !important;
    }

    html[data-archive-layout="list"] .site-main .post .entry-header {
        grid-area: header !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    html[data-archive-layout="list"] .site-main .post .ys-grid-card-meta {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 0 0 8px 0 !important;
        font-size: 0.82rem !important;
        color: var(--ys-text-meta) !important;
        line-height: 1 !important;
        order: -1 !important;
    }

    html[data-archive-layout="list"] .site-main .post .entry-header .entry-meta,
    html[data-archive-layout="list"] .site-main .post footer.entry-meta {
        display: none !important;
    }

    html[data-archive-layout="list"] .site-main .post .entry-title {
        color: var(--ys-text-title) !important;
        font-weight: 500 !important;
        font-size: 1.2rem !important;
        line-height: 1.4 !important;
        margin: 0 !important;
        letter-spacing: -0.01em !important;
    }

    html[data-archive-layout="list"] .site-main .post .entry-title a {
        color: inherit !important;
        text-decoration: none !important;
        transition: color 0.2s !important;
    }

    html[data-archive-layout="list"] .site-main .post:hover .entry-title a {
        color: var(--ys-accent) !important;
    }

    html[data-archive-layout="list"] .site-main .post .entry-summary {
        grid-area: summary !important;
        margin: 8px 0 0 0 !important;
        color: var(--ys-text-meta) !important;
        font-size: 0.9rem !important;
        line-height: 1.65 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
}

.sidebar .widget,
.featured-carousel,
.unified-category-widget {
    box-shadow: none !important;
}

.unified-category-widget {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.unified-category-widget>h2,
.unified-category-widget>h3,
.unified-category-widget .wp-block-heading,
.featured-carousel .widget-title {
    margin-bottom: 1.25rem !important;
}

.unified-category-widget>h2::before,
.unified-category-widget>h3::before,
.unified-category-widget .wp-block-heading::before,
.featured-carousel .widget-title::before {
    display: none !important;
}

.unified-cat-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 0 !important;
}

.unified-cat-link {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--ys-text-body) !important;
    font-size: 0.9rem !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    border: none !important;
}

.unified-cat-link:hover {
    background: var(--ys-accent-soft) !important;
    color: var(--ys-text-title) !important;
}

.unified-cat-item.is-active .unified-cat-link,
.unified-cat-item.is-active .unified-cat-link:hover {
    background: var(--ys-accent-soft) !important;
    color: var(--ys-accent) !important;
}

.unified-cat-item.is-active .unified-cat-header {
    background: transparent !important;
}

.unified-cat-link .count {
    background: transparent !important;
    border: none !important;
    color: var(--ys-text-meta) !important;
    font-size: 0.8rem !important;
}

.unified-cat-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto;
    margin-left: auto !important;
    padding: 8px 0 8px 8px !important;
    color: var(--ys-text-meta) !important;
    background: transparent !important;
    border: none !important;
}

.unified-cat-item.is-active .unified-cat-toggle {
    color: var(--ys-accent) !important;
    background: transparent !important;
}

.featured-carousel {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.archive-layout-toggle {
    background: var(--ys-bg-card) !important;
    border: 1px solid var(--ys-border) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    padding: 3px !important;
}

.archive-layout-toggle .layout-btn {
    width: 42px;
    height: 42px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 0 !important;
    color: var(--ys-text-meta) !important;
    background: transparent !important;
    border: none !important;
    border-radius: 8px !important;
}

.archive-layout-toggle .layout-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

.archive-layout-toggle .layout-btn:hover {
    color: var(--ys-text-title) !important;
    background: var(--ys-accent-soft) !important;
}

.archive-layout-toggle .layout-btn.is-active {
    background: var(--ys-accent-soft) !important;
    color: var(--ys-accent) !important;
    box-shadow: none !important;
}

@media (max-width: 1024px) {
    .series-spotlight__track {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 560px) {
    .series-spotlight__track {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        gap: 12px !important;
    }

    .series-spotlight__card {
        scroll-snap-align: start !important;
        flex: 0 0 80vw !important;
    }

    .ys-archive-header {
        margin-bottom: 20px !important;
    }

    .ys-archive-header .archive-layout-toggle-wrapper {
        display: none;
    }
}