/*
Theme Name: XPacks Modern
Description: Modernized layout for xpacks.org with responsive cards and improved readability.
Version: 2.0.0
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;700&display=swap');

:root {
    --bg: #0a0d11;
    --bg-soft: #121823;
    --panel: #12161d;
    --panel-2: #1a212d;
    --text: #e7edf4;
    --text-soft: #9da8b9;
    --line: #273243;
    --accent: #ff7f2a;
    --accent-2: #ffb347;
    --danger: #ff4b4b;
    --radius: 14px;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background:
        radial-gradient(1100px 500px at 10% -10%, rgba(255, 127, 42, 0.16), transparent 60%),
        radial-gradient(900px 400px at 90% 0%, rgba(70, 130, 180, 0.14), transparent 60%),
        var(--bg);
    line-height: 1.55;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent-2);
    text-decoration: none;
}

a:hover {
    color: #ffd6a8;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.01em;
    margin: 0;
}

.container {
    width: min(1220px, calc(100% - 36px));
    margin: 0 auto;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: relative;
    padding-top: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(to bottom, rgba(15, 19, 26, 0.92), rgba(10, 13, 17, 0.82));
    backdrop-filter: blur(8px);
}

.site-header__halo {
    position: absolute;
    top: -120px;
    left: 50%;
    width: min(860px, 90vw);
    height: 240px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 127, 42, 0.25), transparent 70%);
    pointer-events: none;
}

.site-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    position: relative;
    z-index: 1;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
}

.site-brand__mark {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #111;
    background: linear-gradient(125deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 24px rgba(255, 127, 42, 0.32);
}

.site-brand__text {
    display: grid;
    gap: 3px;
}

.site-brand__title {
    font-size: clamp(26px, 3.1vw, 36px);
    line-height: 1;
    color: #ffffff;
}

.site-brand__subtitle {
    color: var(--text-soft);
    font-size: 14px;
}

.site-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(440px, 52vw);
}

.site-search input {
    flex: 1;
    min-width: 0;
    background: var(--panel-2);
    border: 1px solid #2a3649;
    color: var(--text);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
}

.site-search input:focus {
    outline: none;
    border-color: #3d5779;
    box-shadow: 0 0 0 2px rgba(70, 130, 180, 0.25);
}

.site-search button {
    border: 0;
    border-radius: 10px;
    padding: 12px 16px;
    font-weight: 600;
    color: #111;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    cursor: pointer;
}

.site-search button:hover {
    filter: brightness(1.06);
}

.site-header__nav-wrap {
    position: relative;
    z-index: 1;
    margin-top: 26px;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-list li {
    margin: 0;
}

.nav-list a {
    display: inline-block;
    border: 1px solid #304159;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #ccd8e8;
    background: rgba(21, 28, 39, 0.7);
}

.nav-list a:hover {
    color: #fff;
    border-color: #3f5878;
    background: #1e2735;
}

.site-main {
    padding-top: 44px;
    padding-bottom: 36px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.layout--single {
    grid-template-columns: minmax(0, 1fr);
}

.content-area {
    min-width: 0;
}

.archive-header {
    margin-bottom: 18px;
}

.archive-title {
    font-size: clamp(24px, 2.7vw, 34px);
    color: #ffffff;
}

.category-strip {
    margin-bottom: 20px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(26, 33, 45, 0.72), rgba(18, 22, 29, 0.92));
}

.category-strip__title {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-strip__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-strip__list li {
    margin: 0;
}

.category-strip__list a {
    display: inline-flex;
    align-items: center;
    border: 1px solid #304159;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #d7e5f9;
    background: rgba(22, 30, 42, 0.82);
}

.category-strip__list a:hover {
    color: #fff;
    border-color: #40638e;
    background: #1c2736;
}

.post-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.post-card {
    background: linear-gradient(180deg, rgba(26, 33, 45, 0.78), rgba(18, 22, 29, 0.94));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.post-card__media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0f131a;
}

.post-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.post-card:hover .post-card__media img {
    transform: scale(1.04);
}

.post-card__image--fallback {
    object-fit: cover;
    object-position: center;
    filter: saturate(0.96);
}

.content-image--fallback {
    max-height: 520px;
    object-fit: contain;
    background: #121b29;
}

.post-card__body {
    padding: 12px 12px 14px;
}

.post-card__meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 9px;
}

.post-card__views {
    white-space: nowrap;
}

.post-card__title {
    font-size: 16px;
    line-height: 1.32;
}

.post-card__title a {
    color: #f2f6fb;
}

.post-card__title a:hover {
    color: #ffcc95;
}

.pagination-wrap {
    margin-top: 22px;
}

.pagination,
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-numbers {
    display: inline-block;
    min-width: 36px;
    padding: 8px 12px;
    text-align: center;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #131926;
    color: #d2deee;
}

.page-numbers.current,
.page-numbers:hover {
    border-color: #4a678f;
    background: #243045;
    color: #fff;
}

.pagination-wrap--infinite .navigation,
.pagination-wrap--infinite .pagination,
.pagination-wrap--infinite .nav-links {
    display: none !important;
}

.infinite-scroll-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #304159;
    background: rgba(18, 27, 40, 0.92);
    color: #d9e5f7;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    letter-spacing: 0.02em;
}

.infinite-scroll-status::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #3c526f;
    box-shadow: 0 0 0 0 rgba(255, 179, 71, 0.48);
}

.pagination-wrap--infinite[data-scroll-state='loading'] .infinite-scroll-status::before {
    background: var(--accent-2);
    animation: pulse-dot 1s ease infinite;
}

.pagination-wrap--infinite[data-scroll-state='error'] .infinite-scroll-status::before {
    background: var(--danger);
}

.pagination-wrap--infinite[data-scroll-state='end'] .infinite-scroll-status::before {
    background: #6bbf8f;
}

.infinite-scroll-sentinel {
    height: 2px;
    margin-top: 8px;
    opacity: 0;
}

@keyframes pulse-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 179, 71, 0.56);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(255, 179, 71, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 179, 71, 0);
    }
}

.single-post {
    background: linear-gradient(180deg, rgba(26, 33, 45, 0.78), rgba(18, 22, 29, 0.94));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.single-post__title {
    font-size: clamp(26px, 3.2vw, 38px);
    line-height: 1.1;
}

.single-post__meta {
    margin-top: 10px;
    display: flex;
    gap: 14px;
    font-size: 13px;
    color: var(--text-soft);
}

.single-post__content {
    margin-top: 18px;
    font-size: 16px;
    line-height: 1.7;
    color: #edf3fa;
}

.single-post__content img {
    width: 100%;
    max-width: 860px;
    border-radius: 12px;
    margin: 14px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.single-post__content a {
    color: #9ec3ff;
    text-decoration: underline;
}

.related-posts {
    margin-top: 24px;
}

.related-posts h2 {
    font-size: 22px;
    margin-bottom: 12px;
}

.sidebar {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 16px;
}

.widget {
    background: linear-gradient(180deg, rgba(22, 30, 42, 0.9), rgba(14, 20, 30, 0.96));
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.widget-t {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.2;
    color: #fff;
    letter-spacing: 0.01em;
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.widget li {
    font-size: 14px;
    color: var(--text-soft);
}

.widget a {
    color: #d7e5f9;
}

.widget a:hover {
    color: #fff;
}

.sidebar .widget .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sidebar .widget .menu li {
    margin: 0;
}

.sidebar .widget .menu a {
    display: inline-flex;
    align-items: center;
    border: 1px solid #304159;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(23, 32, 46, 0.85);
    color: #d7e5f9;
}

.sidebar .widget .menu a:hover {
    background: #1d2a3b;
    border-color: #3e5d86;
}

.sidebar .wpp-widget-placeholder {
    display: block;
    min-height: 164px;
    border-radius: 12px;
    border: 1px dashed #31445f;
    background: rgba(16, 23, 34, 0.92);
    position: relative;
}

.sidebar .wpp-widget-placeholder::after {
    content: 'Loading feed...';
    position: absolute;
    left: 12px;
    top: 12px;
    color: #95a6bf;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar .wpp-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.sidebar .wpp-list li {
    margin: 0;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #2b3f5a;
    background: rgba(17, 25, 38, 0.88);
    display: grid;
    grid-template-columns: 94px 1fr;
    gap: 10px;
    align-items: start;
}

.sidebar .wpp-list li:hover {
    border-color: #43648d;
    background: rgba(22, 32, 48, 0.95);
}

.sidebar .wpp-list li a {
    color: #eaf2fb;
}

.sidebar .wpp-list li a:hover {
    color: #ffd09d;
}

.sidebar .wpp-thumbnail {
    width: 94px !important;
    height: 66px !important;
    border-radius: 10px !important;
    object-fit: cover;
    object-position: center;
    margin: 0 !important;
    float: none !important;
    display: block;
    border: 0;
}

.sidebar .wpp-post-title {
    display: block;
    font-size: 16px;
    line-height: 1.28;
    font-weight: 600;
    margin: 0;
}

.sidebar .wpp-meta,
.sidebar .post-stats,
.sidebar .wpp-views,
.sidebar .wpp-date {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.25;
    color: #9eb0c8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.tag-cloud a {
    display: inline-block;
    margin: 4px 4px 0 0;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid #2f3d53;
    color: #d9e7f8;
    background: #18202d;
}

.tag-cloud a:hover {
    color: #fff;
    border-color: #456189;
    background: #1f2a3a;
}

.tagcloud a,
.wp-block-tag-cloud a {
    display: inline-block !important;
    margin: 5px 5px 0 0 !important;
    padding: 5px 9px !important;
    border-radius: 999px !important;
    border: 1px solid #2f3d53 !important;
    color: #d9e7f8 !important;
    background: #18202d !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    text-decoration: none !important;
}

.tagcloud a:hover,
.wp-block-tag-cloud a:hover {
    color: #fff !important;
    border-color: #456189 !important;
    background: #1f2a3a !important;
}

.tags-columns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.column {
    min-width: 0;
}

.tag-title {
    margin: 0 0 8px;
    color: var(--accent-2);
    font-size: 16px;
    text-transform: uppercase;
}

.tagcol p {
    margin: 0 0 7px;
    color: var(--text-soft);
    font-size: 14px;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 30px 0 36px;
    background: #0c1118;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 20px;
}

.site-footer h2 {
    font-size: 14px;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

.site-footer p,
.site-footer li,
.site-footer a {
    font-size: 14px;
    color: var(--text-soft);
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
}

.site-footer a:hover {
    color: #fff;
}

.site-footer__copyright {
    margin-top: 12px;
}

.empty-state {
    color: var(--text-soft);
    background: #131926;
    border: 1px dashed #33435d;
    border-radius: 12px;
    padding: 18px;
}

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: static;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .container {
        width: min(1220px, calc(100% - 24px));
    }

    .site-header__top {
        flex-direction: column;
        align-items: stretch;
    }

    .site-search {
        min-width: 0;
        width: 100%;
    }

    .site-brand__title {
        font-size: 27px;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .tags-columns {
        grid-template-columns: 1fr 1fr;
    }

    .site-footer__grid {
        grid-template-columns: 1fr;
    }
}
