/*
Theme Name: Parallel Universe Encyclopedia
Theme URI: https://canon.empyre.co
Author: Your Name
Version: 1.0
Requires at least: 7.0
Tested up to: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: parallel-universe
Tags: custom-theme, encyclopedia, carousel
*/

/* Root CSS variables */
:root {
    --primary: #ee1c25; /* default, overridden by Customizer */
    --bg: #ffffff;
    --text: #000000;
}

/* Global styles */
html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Adobe Text Pro", serif;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Trajan Pro", serif;
    margin: 0;
    line-height: 1.2;
}

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

a:hover {
    text-decoration: underline;
}

/* Header */
.site-header {
    background: var(--primary);
    padding: 1rem;
    text-align: center;
}
.site-logo {
    max-height: 80px;
    width: auto;
}

/* Header intro text */
.header-intro {
    margin: 0.5rem 0 0;
    text-align: center;
    font-size: 1.1rem;
    color: #fff;
}

/* Featured article */
.featured-article {
    display: grid;
    grid-template-columns: minmax(300px, 1.2fr) minmax(260px, 0.8fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(2.5rem, 5vw, 4.5rem) 1.5rem;
}
.featured-content {
    text-align: left;
}
.featured-content .eyebrow {
    margin-bottom: 0.5rem;
}
.featured-title {
    font-size: clamp(1.75rem, 3.2vw, 2.6rem);
    margin-bottom: 1rem;
    color: var(--primary);
}
.featured-body {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #3d3a3a;
}
.featured-image {
    position: relative;
    width: clamp(280px, 36vw, 460px);
    height: clamp(280px, 36vw, 460px);
    overflow: hidden;
    border-radius: 1rem;
    justify-self: end;
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}
.featured-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Section framing */
.section-heading {
    text-align: center;
    margin-bottom: 1.5rem;
}
.section-heading h2 {
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    color: var(--primary);
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    color: #444;
    margin-bottom: 0.3rem;
}

/* Swiper carousel */
.carousel-section {
    padding: clamp(3rem, 6vw, 5rem) 1rem 4rem;
    background: linear-gradient(135deg, #fff9f4 0%, #f3f6ff 100%);
}
.swiper-container {
    width: min(96%, 1320px);
    margin: 0 auto;
    border-radius: 1.4rem;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 30px 55px rgba(0,0,0,0.14);
}
.swiper-slide {
    width: 100%;
    height: auto;
    display: block;
}
.slide-content {
    display: grid;
    grid-template-columns: minmax(280px, 1.1fr) minmax(240px, 0.9fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    padding: clamp(2rem, 4vw, 3.5rem);
}
.slide-text {
    text-align: left;
    color: #1f1c1c;
    max-width: 560px;
}
.slide-text h2 {
    font-size: clamp(1.85rem, 3.4vw, 2.8rem);
    margin: 0 0 0.75rem;
}
.slide-text p {
    margin: 0 0 1.5rem;
    font-size: 1.05rem;
    line-height: 1.55;
    color: #3d3a3a;
}
.slide-divider {
    width: 80px;
    height: 4px;
    background: var(--primary);
    border-radius: 999px;
    margin: 0.75rem 0 1.25rem;
}
.slide-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    padding: 0.65rem 1.35rem;
    border-radius: 999px;
    box-shadow: 0 12px 25px rgba(238,28,37,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.slide-link::after {
    content: '\2192';
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}
.slide-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(238,28,37,0.28);
}
.slide-link:hover::after {
    transform: translateX(4px);
}
.slide-media {
    position: relative;
    justify-self: center;
    width: clamp(320px, 42vw, 560px);
    height: clamp(320px, 42vw, 560px);
    overflow: hidden;
    border-radius: 1.2rem;
    box-shadow: 0 18px 32px rgba(0,0,0,0.16);
}
.slide-media .slide-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.swiper-button-next,
.swiper-button-prev {
    color: var(--primary);
}
.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 1.6rem;
}

.highlights {
    padding: 1rem 2rem 3rem;
}
.highlights-grid {
    display: grid;
    grid-gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.highlights .card {
    background: #fff;
    border-radius: 1.2rem;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.08);
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.highlights .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}
.highlights .card-media {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    height: 0;
    overflow: hidden;
    margin-bottom: 0.75rem;
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
}
.highlights .card-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.highlights .card:hover .card-media img {
    transform: scale(1.05);
}
.highlights .card h3 {
    margin: 0.5rem 0 1rem;
    font-size: 1.15rem;
    color: var(--primary);
    padding: 1.25rem 1rem 1rem;
}
.highlights .card-excerpt {
    color: #3d3a3a;
    line-height: 1.55;
    font-size: 0.95rem;
    padding: 0 1.25rem 1.5rem;
}
.highlights .card-excerpt p {
    margin: 0;
}

/* Search */
.search-section {
    padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #fff 0%, #f8f8ff 100%);
}
.search-form {
    max-width: 820px;
    margin: 0 auto;
}
.search-suggestion {
    display: block;
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    color: #3d3a3a;
}
.search-suggestion-label {
    font-weight: 400;
}
.search-suggestion-cycle {
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    border-bottom: 1px dashed currentColor;
    transition: opacity 0.3s ease;
}
.search-suggestion-cycle:hover {
    opacity: 0.8;
}
.search-field-wrap {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.search-field {
    flex: 1 1 280px;
    min-width: 0;
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    border: 2px solid rgba(0,0,0,0.12);
    border-radius: 999px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(238,28,37,0.15);
}
.search-submit {
    padding: 1rem 2.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.search-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(238,28,37,0.25);
}

/* Footer */
.site-footer {
    background: var(--primary);
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* Single encyclopedia entry */
.single-article {
    max-width: 880px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) 1.5rem;
}
.entry-header {
    text-align: center;
    margin-bottom: 2rem;
}
.entry-title {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    margin: 0 0 0.75rem;
    color: var(--primary);
}
.entry-lead {
    font-size: 1.15rem;
    color: #555;
    max-width: 620px;
    margin: 1rem auto 0;
    line-height: 1.6;
}
.entry-hero-image {
    width: min(420px, 80vw);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 1.2rem;
    margin: 0 auto 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.14);
}
.entry-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.entry-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #2a2727;
}
.entry-content p,
.entry-content li {
    margin-bottom: 1.1rem;
}
.entry-terms {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 0.95rem;
    color: #555;
}
.entry-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    flex-wrap: wrap;
}
.entry-nav a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}
.entry-nav a:hover {
    text-decoration: underline;
}
.entry-nav .next-link {
    margin-left: auto;
}

/* Single entry enhancements */
.entry-breadcrumb {
    display: inline-block;
    position: sticky;
    top: 0.5rem;
    z-index: 10;
    margin-bottom: 1rem;
    padding: 0.4rem 0.8rem;
    background: #fff;
    color: var(--primary);
    font-weight: 600;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.entry-breadcrumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.entry-tools {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
}
.entry-tools button {
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.entry-tools button:hover {
    background: var(--primary);
    color: #fff;
}
.entry-toc {
    max-width: 620px;
    margin: 0 auto 2.5rem;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border-radius: 1rem;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}
.entry-toc h2 {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    color: var(--primary);
}
.entry-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.entry-toc li {
    margin-bottom: 0.4rem;
}
.entry-toc a {
    color: #3d3a3a;
    text-decoration: none;
    border-bottom: 1px dashed transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.entry-toc a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.related-entries {
    margin-top: 3rem;
}
.related-entries h2 {
    text-align: center;
    margin-bottom: 1.25rem;
    color: var(--primary);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}
.related-card {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}
.related-card a {
    display: block;
    color: var(--primary);
    text-decoration: none;
}
.related-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.related-card h3 {
    padding: 0.75rem 1rem;
    margin: 0;
    font-size: 1rem;
}
.entry-content a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
}
.entry-content a:hover {
    border-bottom-style: solid;
}

/* Search results */
.search-results-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) 1.5rem;
}
.search-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.search-title {
    font-size: clamp(1.75rem, 4vw, 2.6rem);
    color: var(--primary);
    margin: 0 0 0.5rem;
}
.search-title span {
    color: #1f1c1c;
}
.search-count {
    color: #6b6b6b;
    font-size: 1.05rem;
    margin: 0;
}
.search-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.post-card {
    background: #fff;
    border-radius: 1.2rem;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}
.post-thumb {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.post-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}
.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.post-card:hover .post-thumb img {
    transform: scale(1.05);
}
.post-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.post-title {
    font-size: 1.25rem;
    margin: 0 0 0.75rem;
}
.post-title a {
    color: #1f1c1c;
    text-decoration: none;
    transition: color 0.2s ease;
}
.post-title a:hover {
    color: var(--primary);
}
.post-excerpt {
    color: #3d3a3a;
    line-height: 1.55;
    font-size: 0.95rem;
}
.post-excerpt p {
    margin: 0;
}
.no-results {
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
    padding: clamp(3rem, 8vw, 6rem) 1.5rem;
}
.no-results h1 {
    color: var(--primary);
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    margin: 0 0 1rem;
}
.no-results .search-form {
    margin-top: 1.5rem;
}
.pagination {
    margin-top: 2.5rem;
    text-align: center;
}
.pagination .nav-links {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.pagination a,
.pagination .current {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}
.pagination a {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.pagination a:hover {
    background: var(--primary);
    color: #fff;
}
.pagination .current {
    background: var(--primary);
    color: #fff;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .featured-article {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
    }
    .featured-image {
        justify-self: center;
    }
    .slide-content {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    .slide-media {
        width: min(80vw, 360px);
        height: min(80vw, 360px);
    }
}
