/* ==========================================================================
   Game Single Template Styles
   ========================================================================== */

/*-------------------------------------------
   1. GLOBAL & LAYOUT
-------------------------------------------*/
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Section headers */
.game-about h2,
.game-info-sidebar h2,
.game-trophies-psn h2,
.game-wiki-entries h2,
.game-related-posts h2 {
    margin-bottom: 1.2rem;
}

/*-------------------------------------------
   2. HERO HEADER (with video background)
-------------------------------------------*/
.game-header-hero {
    display: flex;
    flex-direction: column;
    min-height: 500px;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 2rem;
}

/* Background video/image */
.game-header-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.game-header-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.45;
    z-index: 1;
}

.game-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.4) 100%);
    z-index: 2;
}

.game-header-youtube {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
.game-header-youtube iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main content area (title, ratings, thumbnail) */
.game-header-content {
    flex: 1;
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 2rem 5%;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
}

.game-header-left {
    flex: 1;
    min-width: 300px;
}

.game-header-right {
    flex-shrink: 0;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.game-title {
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    color: #fff;
}

/* Platforms */
.game-platforms {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}
.game-platforms img {
    width: auto;
    height: 20px;
    opacity: 0.9;
    transition: opacity 0.2s;
}
.game-platforms img:hover {
    opacity: 1;
}

/* Ratings */
.game-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin: 15px 0;
}

/* Trophy counts */
.game-trophies {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    background: rgba(244, 242, 242, 0.227);
    padding: 10px 15px;
    border-radius: 8px;
    margin: 15px 0 10px;
    width: auto;
}
.trophy-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95rem;
}
.trophy-item img {
    width: 20px;
    height: 20px;
}
.trophy-count {
    font-weight: 600;
    color: #f8f9fa;
}

/* Quick links + PEGI row */
.game-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}
.game-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}
.quick-link {
    display: inline-block;
    background: rgba(244, 242, 242, 0.227);
    padding: 8px 15px;
    border-radius: 8px;
    color: #f8f9fa;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}
.quick-link:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}
.game-pegi {
    flex-shrink: 0;
}
.game-pegi img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Featured image */
.game-featured-image img {
    width: 220px;
    height: 220px;
    object-fit: cover;
    aspect-ratio: 1/1;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-width: 100%;
    height: auto;
}

/*-------------------------------------------
   3. HERO CAROUSEL (Slick inside hero)
-------------------------------------------*/
.game-header-carousel {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 1rem 5%;
    background: rgba(244, 242, 242, 0.227);
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Override Slick defaults */
.game-header-carousel .slick-list {
    margin: 0 -1.5px;
}
.game-header-carousel .slick-slide {
    margin: 0 1.5px;
    width: 124px; /* Fixed width for items */
}

/* Ensure anchor is positioned for overlay */
.game-header-carousel .carousel-item a {
    display: block;
    position: relative;
}

.game-header-carousel .carousel-item {
    width: 124px;
    box-sizing: border-box;
}
.game-header-carousel .carousel-item img {
    width: 124px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

/* Play overlay for videos */
.game-header-carousel .play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}
.game-header-carousel .play-overlay img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    background: transparent;
}

/* Custom arrows for hero carousel */
.game-header-carousel .slick-prev,
.game-header-carousel .slick-next {
    width: 40px !important;
    height: 40px !important;
    background: rgba(0,0,0,0.5) !important;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.game-header-carousel .slick-prev img,
.game-header-carousel .slick-next img {
    width: 20px;
    height: 20px;
    display: block;
}
.game-header-carousel .slick-prev {
    left: 10px;
}
.game-header-carousel .slick-next {
    right: 10px;
}
/* Remove default Slick arrow pseudo-elements */
.game-header-carousel .slick-prev:before,
.game-header-carousel .slick-next:before {
    content: none !important;
    display: none !important;
}

/* Responsive adjustments for hero carousel */
@media (max-width: 768px) {
    .game-header-carousel .slick-slide,
    .game-header-carousel .carousel-item,
    .game-header-carousel .carousel-item img {
        width: 104px;
        height: 60px;
    }
}
@media (max-width: 480px) {
    .game-header-carousel .slick-slide,
    .game-header-carousel .carousel-item,
    .game-header-carousel .carousel-item img {
        width: 124px;
        height: 70px;
    }
}

/*-------------------------------------------
   4. TWO-COLUMN CONTENT (About + Game Info)
-------------------------------------------*/
.game-content-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
}
.game-about {
    flex: 2;
    min-width: 300px;
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.game-info-sidebar {
    flex: 1;
    min-width: 250px;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Game info table */
.game-info-table {
    width: 100%;
    border-collapse: collapse;
}
.game-info-table tr {
    border-bottom: 1px solid #dee2e6;
}
.game-info-table tr:last-child {
    border-bottom: none;
}
.game-info-table td {
    padding: 10px 0;
}
.game-info-table td:first-child {
    font-weight: 600;
    color: #495057;
    width: 40%;
}

/* Guides section (inside left column) */
.game-guides-section {
    margin-top: 2rem;
}
.game-guides-section h2 {
    margin-bottom: 1rem;
}
.game-guides-section ul {
    list-style: none;
    padding: 0;
}
.game-guides-section li {
    margin-bottom: 10px;
}
.game-guides-section a {
    color: #0073aa;
    text-decoration: none;
}
.game-guides-section a:hover {
    text-decoration: underline;
}

/*-------------------------------------------
   5. PSN TROPHIES SECTION
-------------------------------------------*/
.game-trophies-psn {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.game-trophies-psn h2 {
    margin-top: 0;
    color: #333;
    font-size: 1.5rem;
}

/* Tabs */
.trophy-tabs .tab-links {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    border-bottom: 2px solid #dee2e6;
}
.trophy-tabs .tab-links li {
    margin-right: 5px;
}
.trophy-tabs .tab-links li a {
    display: block;
    padding: 10px 20px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    border: 1px solid #dee2e6;
    border-bottom: none;
}
.trophy-tabs .tab-links li.active a {
    background: #fff;
    color: #0073aa;
    font-weight: bold;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
}
.trophy-tabs .tab-content {
    display: none;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0 8px 8px 8px;
    background: #fff;
}
.trophy-tabs .tab-content.active {
    display: block;
}

/*-------------------------------------------
   6. WIKI ENTRIES CAROUSEL
-------------------------------------------*/
.game-wiki-entries {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wiki-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.wiki-view-all {
    background: #c23434;
    color: #f2eeee;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
}
.wiki-view-all:hover {
    color: #bddc0e;
}

.wiki-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}
.carousel-track-container {
    overflow: hidden;
    width: 100%;
}
.carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.3s ease;
}
.wiki-carousel .carousel-item {
    flex: 0 0 calc(33.333% - 14px); /* 3 items with gap */
    min-width: 200px;
}

/* Wiki card */
.wiki-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    margin-bottom: 5px;
}
.wiki-card-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.wiki-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wiki-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    padding: 15px;
}
.wiki-card-title {
    color: #fff;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
}
.wiki-card-title a {
    color: #fff;
    text-decoration: none;
}
.wiki-card-title a:hover {
    text-decoration: underline;
}
.wiki-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    opacity: 0.9;
    align-items: center;
}
.wiki-card-meta a {
    color: #fff;
    text-decoration: underline;
}
.wiki-card-excerpt {
    padding: 15px;
    font-size: 0.9rem;
    color: #333;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3; /* Standard property for compatibility */
    line-height: 1.5;
    min-height: 95px;
}

/* Wiki carousel arrows (not Slick, custom) */
.wiki-carousel .carousel-arrow {
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
}
.wiki-carousel .carousel-arrow:hover {
    background: rgba(0,0,0,0.8);
}
.wiki-carousel .carousel-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/*-------------------------------------------
   7. RELATED POSTS SECTION
-------------------------------------------*/
.game-related-posts {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.game-related-posts h2 {
    margin-top: 0;
    color: #333;
    font-size: 1.5rem;
}
.game-related-posts ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}
.game-related-posts li {
    background: #fff;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.2s;
}
.game-related-posts li:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0,115,170,0.1);
}
.game-related-posts a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
}
.game-related-posts a:hover {
    color: #0073aa;
}

/*-------------------------------------------
   8. RESPONSIVE DESIGN
-------------------------------------------*/
@media (max-width: 768px) {
    .game-header-hero {
        min-height: auto;
    }
    .game-header-content {
        flex-direction: column;
        text-align: center;
    }
    .game-header-right {
        order: -1;
        max-width: 200px;
        align-items: center;
    }
    .game-title {
        font-size: 1.8rem;
    }
    .game-platforms,
    .game-ratings,
    .game-trophies {
        justify-content: center;
    }
    .wiki-carousel .carousel-item {
        flex: 0 0 100%; /* 1 item on mobile for wiki */
    }
}

@media (max-width: 600px) {
    .game-header-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    .game-pegi {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .game-trophies {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}