/*
Theme Name: OSRS Guides Child
Template: generatepress
Version: 1.0.0
*/

/* CRITICAL FIX - Override GeneratePress footer-widgets background */
.footer-widgets,
body .footer-widgets,
.site .footer-widgets,
div.footer-widgets {
    background-color: transparent !important;
    background: transparent !important;
}

/* Footer grid - 20%, 40%, 40% (1fr 2fr 2fr) */
footer.site-footer .footer-widgets {
    grid-template-columns: 0.8fr 2fr 2.2fr !important;
}

/* Categories Column - 2 sub-columns SIDE BY SIDE */
.footer-categories .category-columns {
    display: grid !important;
    grid-template-columns: 0.5fr 0.5fr !important;
    gap: 30px !important;
}

/* ============================================
   GUIDES PAGE - CARD HEIGHTS & CATEGORY BADGES
   ============================================ */

/* Featured cards - 16:9 aspect ratio for 1280x720 images */
.featured-section .featured-card .card-thumbnail {
    width: 100% !important;
    aspect-ratio: 16/9 !important;
    position: relative !important;
    overflow: hidden !important;
}

.featured-section .featured-card .card-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* All guides grid - 16:9 aspect ratio */
.all-guides-section .guides-grid .guide-card .card-thumbnail {
    width: 100% !important;
    aspect-ratio: 16/9 !important;
    position: relative !important;
    overflow: hidden !important;
}

.all-guides-section .guides-grid .guide-card .card-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Category badge overlay - LIGHTER BLUE */
.card-thumbnail .overlay-category {
    position: absolute !important;
    bottom: 15px !important;
    right: 15px !important;
    background: rgba(107, 182, 255, 0.95) !important;
    color: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    z-index: 999 !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* Responsive - smaller screens */
@media (max-width: 480px) {
    .card-thumbnail .overlay-category {
        font-size: 0.75rem !important;
        padding: 6px 12px !important;
        bottom: 10px !important;
        right: 10px !important;
    }
}

/* Back to Top Button */
.back-to-top {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* ============================================
   ALL GUIDES SECTION - 4 COLUMN GRID
   ============================================ */

.all-guides-section .guides-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
}

/* Responsive breakpoints for the grid */
@media (max-width: 1200px) {
    .all-guides-section .guides-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 900px) {
    .all-guides-section .guides-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    .all-guides-section .guides-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   CATEGORY ARCHIVE PAGE
   ============================================ */

/* Category hero - slightly different color */
.category-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: #ffffff;
    padding: 50px 20px;
    text-align: center;
}

/* Other categories section */
.other-categories-section {
    background: #ffffff;
    border-top: 2px solid #e2e8f0;
    padding-top: 40px;
}

@media (max-width: 768px) {
    .category-hero {
        padding: 35px 15px;
    }
}

/* ============================================
   VIEW ALL GUIDES BUTTON
   ============================================ */

.browse-all-cta {
    text-align: center;
    margin-top: 50px;
}

.btn-browse-all {
    padding: 16px 50px;
    background: #2c5282;
    color: white !important;
    border: 2px solid #2c5282;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(44, 82, 130, 0.3);
}

.btn-browse-all:hover {
    background: #1e3a5f;
    border-color: #1e3a5f;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(44, 82, 130, 0.4);
}

/* ============================================
   CATEGORY ICON IMAGES
   ============================================ */

.category-icon-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
}

/* Make sure the icon container doesn't add background */
.category-card .category-icon {
    background: none !important;
}

/* ============================================
   DEFAULT PAGE TEMPLATE
   ============================================ */

/* Page Hero - Simple, clean header */
.page-hero {
    background: linear-gradient(135deg, #2c5282 0%, #1e3a5f 100%);
    color: #ffffff;
    padding: 50px 20px;
    text-align: center;
}

.page-hero .hero-container {
    max-width: 900px;
    margin: 0 auto;
}

.page-hero .hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

/* Page Content Section */
.page-content-section {
    background: #ffffff;
    padding: 60px 20px;
}

.page-container {
    max-width: 900px;
    margin: 0 auto;
}

.page-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #2d3748;
}

/* Content Typography */
.page-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c5282;
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.page-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d3748;
    margin: 30px 0 15px 0;
}

.page-content p {
    margin-bottom: 20px;
}

.page-content ul,
.page-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.page-content li {
    margin-bottom: 10px;
}

.page-content a {
    color: #2c5282;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.page-content a:hover {
    color: #1e3a5f;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.page-content blockquote {
    border-left: 4px solid #2c5282;
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: #4a5568;
}

/* Contact Form Styling (if using a form plugin) */
.page-content form {
    margin-top: 30px;
}

.page-content input[type="text"],
.page-content input[type="email"],
.page-content input[type="url"],
.page-content textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.page-content input[type="text"]:focus,
.page-content input[type="email"]:focus,
.page-content input[type="url"]:focus,
.page-content textarea:focus {
    outline: none;
    border-color: #2c5282;
}

.page-content textarea {
    min-height: 150px;
    resize: vertical;
}

.page-content button,
.page-content input[type="submit"] {
    background: linear-gradient(135deg, #2c5282 0%, #1e3a5f 100%);
    color: #ffffff;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-content button:hover,
.page-content input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .page-hero {
        padding: 35px 15px;
    }
    
    .page-hero .hero-title {
        font-size: 2rem;
    }
    
    .page-content-section {
        padding: 40px 15px;
    }
    
    .page-content {
        font-size: 1rem;
    }
    
    .page-content h2 {
        font-size: 1.5rem;
    }
    
    .page-content h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .page-hero .hero-title {
        font-size: 1.75rem;
    }
}

/* ============================================
   SEARCH AUTOCOMPLETE DROPDOWN - ALL PAGES
   ============================================ */

/* Live Search Dropdown */
.search-autocomplete {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-top: none !important;
    border-radius: 0 0 6px 6px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    z-index: 1000 !important;
    display: none !important;
}

.search-autocomplete.active {
    display: block !important;
}

.search-autocomplete-item {
    padding: 12px 15px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-decoration: none !important;
    color: #2d3748 !important;
}

.search-autocomplete-item:hover {
    background: #f7f8f9 !important;
}

.search-autocomplete-item:last-child {
    border-bottom: none !important;
}

.search-autocomplete-thumb {
    width: 60px !important;
    height: 40px !important;
    border-radius: 4px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

.search-autocomplete-content {
    flex: 1 !important;
}

.search-autocomplete-title {
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    margin-bottom: 3px !important;
}

.search-autocomplete-title mark {
    background: #fef08a !important;
    color: #2d3748 !important;
    padding: 0 2px !important;
    border-radius: 2px !important;
}

.search-autocomplete-category {
    font-size: 0.8rem !important;
    color: #526175 !important;
}

.search-autocomplete-loading {
    padding: 15px !important;
    text-align: center !important;
    color: #526175 !important;
    font-size: 0.9rem !important;
}

.search-autocomplete-empty {
    padding: 20px !important;
    text-align: center !important;
    color: #526175 !important;
}

/* Position for search form wrapper */
.hero-search,
.search-again {
    position: relative !important;
}

/* ============================================
   SEARCH RESULTS PAGE - CARD STYLING
   ============================================ */

/* Complete card styling for search results */
.search-results-section .search-results-grid .guide-card {
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

.search-results-section .search-results-grid .guide-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 25px rgba(44, 82, 130, 0.12) !important;
    border-color: #2c5282 !important;
}

/* Search results thumbnails - 16:9 aspect ratio */
.search-results-section .search-results-grid .guide-card .card-thumbnail {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    aspect-ratio: 16/9 !important;
    overflow: hidden !important;
    background: #e2e8f0 !important;
    position: relative !important;
}

.search-results-section .search-results-grid .guide-card .card-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.search-results-section .search-results-grid .guide-card:hover .card-thumbnail img {
    transform: scale(1.05) !important;
}

/* Category badge on search results - light blue */
.search-results-section .search-results-grid .guide-card .card-thumbnail .overlay-category {
    position: absolute !important;
    bottom: 15px !important;
    right: 15px !important;
    background: rgba(107, 182, 255, 0.95) !important;
    color: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    z-index: 999 !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.search-results-section .search-results-grid .guide-card .card-content {
    padding: 20px !important;
}

.search-results-section .search-results-grid .guide-card .card-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.3 !important;
}

.search-results-section .search-results-grid .guide-card .card-excerpt {
    font-size: 0.9rem !important;
    color: #526175 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

/* Responsive - smaller badge on mobile */
@media (max-width: 480px) {
    .search-results-section .search-results-grid .guide-card .card-thumbnail .overlay-category {
        font-size: 0.75rem !important;
        padding: 6px 12px !important;
        bottom: 10px !important;
        right: 10px !important;
    }
}

/* ============================================
   CRITICAL FIXES - MAXIMUM SPECIFICITY
   ============================================ */

/* FIX 1: Category badge color - LIGHT BLUE on all pages */
section.featured-section .featured-card .card-thumbnail span.overlay-category,
section.all-guides-section .guides-grid .guide-card .card-thumbnail span.overlay-category,
.related-guides-section .guide-card .card-thumbnail span.overlay-category,
.search-results-section .search-results-grid .guide-card .card-thumbnail span.overlay-category section {
    background: rgba(107, 182, 255, 0.95) !important;
}

/* FIX 2: Featured section - 16:9 aspect ratio instead of fixed height */
section.featured-section .featured-card .card-thumbnail {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    aspect-ratio: 16/9 !important;
}

/* FIX 3: All guides section - 16:9 aspect ratio instead of fixed height */
section.all-guides-section .guides-grid .guide-card .card-thumbnail {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    aspect-ratio: 16/9 !important;
}

/* FIX 4: Related guides - complete card styling */
.related-guides-section .related-guides-grid .guide-card {
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

.related-guides-section .related-guides-grid .guide-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 25px rgba(44, 82, 130, 0.12) !important;
    border-color: #2c5282 !important;
}

/* Related guides thumbnails - 16:9 aspect ratio */
.related-guides-section .related-guides-grid .guide-card .card-thumbnail {
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    aspect-ratio: 16/9 !important;
    overflow: hidden !important;
    background: #e2e8f0 !important;
    position: relative !important;
}

.related-guides-section .related-guides-grid .guide-card .card-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.related-guides-section .related-guides-grid .guide-card:hover .card-thumbnail img {
    transform: scale(1.05) !important;
}

.related-guides-section .related-guides-grid .guide-card .card-content {
    padding: 20px !important;
}

.related-guides-section .related-guides-grid .guide-card .card-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
    margin: 0 !important;
    line-height: 1.3 !important;
}

/* ============================================
   MOBILE HEADER - CRITICAL OVERRIDES
   ============================================ */

@media (max-width: 768px) {
    
    /* Remove border around entire video SECTION on mobile */
    .latest-video-section,
    .latest-video-section .osrs-container,
    section.latest-video-section,
    .osrs-full-width.latest-video-section {
        border: none !important;
        border-top: none !important;
        border-bottom: none !important;
        border-left: none !important;
        border-right: none !important;
        box-shadow: none !important;
        outline: none !important;
    }
    
    /* Ensure osrs-container doesn't have border */
    .latest-video-section .osrs-container,
    .latest-video-section > .osrs-container {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
    }
    
    .youtube-cta {
        margin: 30px auto !important;
    }

    /* FOOTER - Stack vertically on mobile */
    footer.site-footer .footer-widgets,
    .site-footer .footer-widgets {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
    }
    
    .footer-widget,
    .footer-links,
    .footer-about,
    .footer-categories {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Category columns side-by-side on tablets */
    .footer-categories .category-columns {
        grid-template-columns: 1fr 1fr !important;
    }
    
    /* CATEGORY CARDS - 2 columns on mobile */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

/* Smaller mobile screens */
@media (max-width: 480px) {
    
    /* Category columns stack on small mobile */
    .footer-categories .category-columns {
        grid-template-columns: 1fr !important;
    }
    
    /* Remove border around video section on small mobile too */
    .latest-video-section,
    .latest-video-section .osrs-container,
    section.latest-video-section,
    .osrs-full-width.latest-video-section {
        border: none !important;
        box-shadow: none !important;
        outline: none !important;
    }
}

.site-header *,
.site-header ::after,
.site-header ::before {
    box-sizing: border-box !important;
}