/* ==========================================================================
   CRYSTAL WIKI (水晶百科) STYLES
   ========================================================================== */

.crystal-wiki-page {
    background-color: #f8f9fa;
    padding-bottom: 0;
}

/* 1. Hero / Banner */
.wiki-hero {
    position: relative;
    width: 100%;
    background: #000;
}

.wiki-banner-img {
    width: 100%;
    min-height: 750px; /* Forces the banner to be at least 750px tall */
    height: 750px;     /* Ensures it stays exactly 750px regardless of the image's original size */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wiki-banner-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* CRITICAL: This prevents the image from looking stretched or squished */
    object-position: center; /* Keeps the center of the image in view */
    display: block;
}

.wiki-hero-content {
    text-align: center;
    padding: 40px 20px;
    background: #f1f2f6;
}

.wiki-hero-content h1 {
    font-size: 3.5rem;
    font-weight: 500;
    color: #171c3e;
    margin-bottom: 15px;
}

.wiki-hero-content p {
    font-size: 1.6rem;
    font-weight: 400;
    color: #000;
    max-width: 700px;
    margin: 0 auto 30px auto;
    line-height: 1.6;
}

/* Search Bar */
.wiki-search-form {
    display: flex;
    justify-content: center;
    max-width: 650px; /* Matches the width in the image */
    margin: 0 auto;
    position: relative;
}

.wiki-search-form input {
    flex: 1; /* Takes up all available space */
    padding: 18px 24px;
    font-size: 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-right: none; /* Remove right border so it merges with the button */
    border-radius: 6px 0 0 6px; /* Rounded left corners */
    outline: none;
    transition: border-color 0.2s;
    color: #333;
}

.wiki-search-form input::placeholder {
    color: #9ca3af; /* Light gray placeholder text */
}

.wiki-search-form input:focus {
    border-color: #cdae77; /* Gold highlight when typing */
}

.wiki-search-form button {
    background: #172057; /* ✅ UPDATED to your requested blue */
    color: #cdae77;      /* Gold icon color */
    border: none;
    padding: 0 32px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.wiki-search-form button:hover {
    background: #101638; /* Slightly darker shade of #172057 for hover */
    color: #ffffff;      /* Icon turns white on hover */
}

/* Adjust icon size inside button */
.wiki-search-form button svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

/* 2. Crystal Grid */
.wiki-grid-section {
    padding: 60px 0;
    backgorund: var(--color-white);
}

/* ---------- Swiper Container ---------- */
.crystal-swiper {
    width: 100%;
    padding-bottom: 20px;
}

.crystal-swiper .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
}

/* ---------- Page Grid (3 columns × 2 rows = 6 items) ---------- */
.crystal-page-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 30px;
    width: 100%;
}

/* ---------- Card Design ---------- */
.crystal-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.crystal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.crystal-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #f9f9f9;
}

.crystal-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.crystal-card:hover .crystal-card-img img {
    transform: scale(1.05);
}

.crystal-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: center;
}

.crystal-card-body h3 {
    font-size: 1.3rem;
    color: #171c3e;
    margin-bottom: 10px;
    font-weight: 700;
}

.crystal-desc {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.btn-crystal-more {
    display: inline-block;
    padding: 8px 24px;
    border: 1px solid #cdae77;
    color: #cdae77;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    align-self: center;
}

.btn-crystal-more:hover {
    background: #cdae77;
    color: #fff;
}

/* ---------- Pagination ---------- */
.swiper-pagination {
    position: relative !important;
    bottom: auto !important;
    width: 100%;
    margin-top: 30px;
    display: flex !important;
    justify-content: center;
    gap: 8px;
}

.swiper-pagination-bullet {
    width: 40px;
    height: 40px;
    border-radius: 4px !important;
    background: #ffffff;
    color: #6b7280;
    opacity: 1 !important;
    border: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swiper-pagination-bullet:hover {
    background: #f4f6f9;
    border-color: #cdae77;
}

.swiper-pagination-bullet-active {
    background: #cdae77 !important;
    color: #ffffff !important;
    border-color: #cdae77 !important;
    box-shadow: 0 4px 10px rgba(205, 174, 119, 0.3);
}

/* ---------- Responsive: Mobile ---------- */
@media (max-width: 768px) {
    .crystal-page-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 15px;
    }
    .crystal-card-body { padding: 16px; }
    .crystal-card-body h3 { font-size: 1.1rem; }
}

/* 3. You May Also Like (Articles) */
.wiki-articles-section {
    background: #0d102f;
    padding: 80px 20px;
    color: #fff;
}

.wiki-articles-section h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 50px;
    color: #fff;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.article-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.article-card-img {
    width: 40%;
    overflow: hidden;
    flex-shrink: 0;
}

.article-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #333;
}

.article-card-content h3 {
    font-size: 1.2rem;
    color: #171c3e;
    margin-bottom: 10px;
    font-weight: 700;
}

.article-card-content p {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-article-more {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid #cdae77;
    color: #cdae77;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    align-self: flex-start;
}

.btn-article-more:hover {
    background: #cdae77;
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .wiki-banner-img {
        min-height: 400px; /* Shorter on mobile so it doesn't fill the whole phone screen */
        height: 400px;
    }
    .wiki-hero-content h1 {
        font-size: 1.8rem;
    }
    .wiki-hero-content p {
        font-size: 0.95rem;
    }
    .articles-grid {
        grid-template-columns: 1fr;
    }
    .article-card {
        flex-direction: column;
    }
    .article-card-img {
        width: 100%;
        height: 180px;
    }
}