/**
 * Category Styles
 * 
 * @package CursorTheme
 */

/* Gray wrapper for entire category page content */
.category-gray-wrapper {
    background: #212121;
    border-radius: 20px;
    padding: 10px 0;
    margin: 10px auto;
    width: 1300px;
    box-shadow: 5px 5px 10px 5px rgb(0 0 0);
}

/* All containers inside gray wrapper should be 1300px */
.category-gray-wrapper .container {
    max-width: 1300px;
    width: 100%;
}

/* Categories section inside gray wrapper */
.category-gray-wrapper .categories-section {
    margin: 0;
    padding: 2rem 0;
}

.category-gray-wrapper .categories-section .container {
    max-width: 1300px;
    width: 100%;
}

/* Categories grid inside gray wrapper */
.category-gray-wrapper .categories-grid-section {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
}

/* Home Banner Section */
.home-banner-section {
    padding: 3rem 0;
}

.home-banner-wrapper {
    position: relative;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
}

.home-banner-placeholder {
    width: 100%;
    height: 500px;
    background-color: #b2dc26;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid #828282;
}

.home-banner-placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.50); /* dark overlay under the button */
    z-index: 1;
    border-radius: 20px;
}

.home-banner-placeholder .home-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-banner-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #E63946;
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    transition: all 0.3s ease;
    z-index: 10;
    white-space: nowrap;
}

.home-banner-button:hover {
    background: #b91c1c;
    transform: translate(-50%, -50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.6);
}

.page-header {
    padding: 3rem 0;
    background: #161719;
    text-align: center;
    margin-bottom: 3rem;
}

/* Specific styles for categories page header - reduce spacing */
.categories-page .page-header {
    padding: 2rem 0 !important; /* Ridotto da 3rem a 2rem */
    margin-bottom: 1.5rem !important; /* Ridotto da 3rem a 1.5rem */
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.categories-grid-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch; /* Assicura che tutte le card abbiano la stessa altezza */
}

/* Specific styles for categories page */
.categories-page .categories-section {
    padding: 0rem 0 !important; /* Ridotto padding della sezione */
    margin-bottom: 1rem !important;
}

.categories-page .categories-grid-section {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem !important; /* Ripristinato a 1rem */
    width: 100% !important;
    max-width: 1300px !important;
    box-sizing: border-box !important;
    margin-bottom: 1rem !important; /* Ridotto da 2rem a 1rem */
}

.categories-page section.categories-grid-section .container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

.category-card-grid {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.category-card-grid:hover {
    transform: scale(1.05);
}

.category-image-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: transparent;
    display: block;
    border-radius: 0;
    overflow: hidden;
}

.category-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
}

.category-info {
    padding: 15px 10px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-link {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    display: inline-block;
    transition: color 0.3s ease;
    word-wrap: break-word;
    white-space: normal;
}

.category-link a {
    color: white;
    text-decoration: none;
}

.category-link:hover,
.category-link a:hover {
    color: #E63946;
}

.no-categories {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    padding: 3rem 0;
}

.category-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
}

.category-description {
    margin-bottom: 2rem;
    border-bottom: 5px solid white;
    border-radius: 3px;
    padding-bottom: 1rem;
}

.category-description p {
    color: white;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 0;
    display: inline;
}

.category-description p strong {
    font-weight: 600;
}

.category-meta-description p {
    color: #B3B3B3;
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
}

#hidden-text {
    display: none;
}

#hidden-text.show {
    display: inline;
}

.read-more-link {
    color: #E63946;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    margin-left: 0.5rem;
}

.read-more-link:hover {
    color: #D62828;
}

/* Category Grid */
.category-posts-section {
    padding: 1rem 0;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1300px;
    margin: 0 auto;
}

.breadcrumb-container {
    padding: 0;
    margin-bottom: 0;
}

.post-item {
    display: flex;
    flex-direction: column;
    padding: 5px 20px;
    background: #212121;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.post-item:first-child {
    flex-direction: column;
    background: #212121;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 1rem;
}

.post-item:first-child .breadcrumb-container {
    order: -1;
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.post-item:first-child .category-title {
    margin: 0 0 1rem 0;
    color: white;
}

.post-item:first-child .category-description {
    margin: 0 0 1rem 0;
}


.post-item:first-child .post-content-wrapper {
    display: flex;
    gap: 2rem;
}

.post-item:not(:first-child) {
    flex-direction: row;
}

.post-item:hover {
    transform: none;
}

.post-item img {
    width: 30px;
    height: 30px;
    object-fit: cover;
}

.post-thumbnail {
    width: 200px;
    height: 200px;
    background: transparent;
    border-radius: 8px;
}

.post-info {
    flex: 1;
}

.post-info h2 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
}

.post-info h2 a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-info h2 a:hover {
    color: #E63946;
}

.post-info p {
    color: #ccc;
    line-height: 1.6;
}

.no-posts {
    padding: 4rem 0;
    text-align: center;
}

.no-posts h2 {
    color: white;
    font-size: 2rem;
}

/* Content Sections */
.content-section {
    padding: 3rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2rem;
    text-align: left;
    border-bottom: 5px solid white;
    border-radius: 3px;
    padding-bottom: 1rem;
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1300px;
    margin: 0 0 30px 0;
}

.site-item {
    background: #212121;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.site-link {
    text-decoration: none;
    color: inherit;
    position: relative;
    display: block;
}

/* Mobile overlay link - covers entire box on mobile */
.site-link-mobile {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: block;
}

/* Desktop: hide mobile overlay, show only buttons */
@media (min-width: 769px) {
    .site-link-mobile {
        display: none;
    }
}

.site-thumbnail {
    position: relative;
    overflow: hidden;
}

.site-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.6s ease;
    z-index: 1;
}

.site-link:hover .site-thumbnail::before {
    background: rgba(0, 0, 0, 0.5);
}

.site-buttons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 2;
}

/* Badges for FREE brands */
.ads-badge,
.free-badge {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    color: white;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    z-index: 3;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
}

.ads-badge {
    bottom: 8px;
    left: 8px;
}

.ads-badge .ads-level {
    color: white;
}

.ads-badge .ads-level.low {
    color: #4ade80; /* Green for LOW */
}

.ads-badge .ads-level.high {
    color: white; /* White for HIGH */
}

.free-badge {
    bottom: 8px;
    right: 8px;
}


.site-link:hover .site-buttons {
    opacity: 1;
}

.site-buttons a {
    text-decoration: none;
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
}

.site-buttons a:last-child {
    margin-bottom: 0;
}

.site-buttons a button {
    width: 100%;
    margin: 0;
}

.site-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.site-buttons button {
    background: #22c55e;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
    width: 100%;
}

.site-buttons button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.site-buttons button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.5);
    background: #16a34a;
}

.site-buttons button:hover::before {
    left: 100%;
}

.site-buttons button.secondary {
    background: #f97316;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.site-buttons button.secondary:hover {
    background: #ea580c;
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.5);
    transform: translateY(-3px) scale(1.02);
}

.site-item:hover {
    transform: none;
}

/* Category Footer Text */
.category-footer-text {
    padding: 3rem 0;
}

.footer-text-content {
    color: #B3B3B3;
    font-size: 16px;
    line-height: 1.8;
    margin: 0 auto;
    border-bottom: 5px solid white;
    border-radius: 3px;
    padding-bottom: 1rem;
}

.footer-paragraph {
    margin-bottom: 2rem;
}

.footer-paragraph:last-child {
    margin-bottom: 0;
}

.footer-paragraph-title {
    color: #E63946;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-text-content p {
    margin-bottom: 1rem;
}

.footer-text-content h3 {
line-height: 1.5;
}

.footer-text-content p:last-child {
    margin-bottom: 0;
}

.footer-text-content h1,
.footer-text-content h2,
.footer-text-content h3,
.footer-text-content h4,
.footer-text-content h5,
.footer-text-content h6 {
    color: white;
    margin:20px 0 5px 0;
    font-weight: 600;
}

.footer-text-content h1 {
    font-size: 2rem;
}

.footer-text-content h2 {
    font-size: 1.75rem;
}

.footer-text-content h3 {
    font-size: 1.5rem;
    color:#B3B3B3
}

.footer-text-content strong,
.footer-text-content b {
    font-weight: 600;
}

.footer-text-content ul,
.footer-text-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.footer-text-content li {
    margin-bottom: 0.5rem;
}

.footer-text-content a {
    color: #22c55e;
    text-decoration: underline;
}

.footer-text-content a:hover {
    color: #16a34a;
}



.placeholder-image {
    width: 100%;
    height: 100%;
    background: #2a2a2a;
}

/* Responsive */
@media (max-width: 768px) {
    /* Prevent horizontal overflow on mobile */
    body {
        overflow-x: hidden;
    }
    
    .categories-page {
        overflow-x: hidden;
        width: 100%;
        box-sizing: border-box;
    }
    
    .category-gray-wrapper {
        width: 100% !important;
        padding: 0 20px;
        border-radius: 0;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .category-gray-wrapper .container {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .post-item {
        padding: 5px 10px;
        box-sizing: border-box;
        width: 100%;
        overflow-x: hidden;
    }
    
    .category-title {
        font-size: 1.5rem !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .category-title .section-icon-img {
        max-width: 28px;
        height: auto;
    }
    
    .category-description {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .category-description p {
        font-size: 13px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Hide text after "sites" in disclaimer on mobile, but show when Read More is clicked */
    .category-description p .disclaimer-mobile-hidden {
        display: none;
    }
    
    /* Show the hidden text when Read More is clicked */
    .category-description p #hidden-text.show {
        display: inline !important;
    }
    
    /* Show parent container when it has show class (added by JavaScript) */
    .category-description p .disclaimer-mobile-hidden.show {
        display: inline !important;
    }
    
    /* Fallback: Show parent container when child has show class - using :has() selector */
    .category-description p .disclaimer-mobile-hidden:has(#hidden-text.show) {
        display: inline !important;
    }
    
    .category-meta-description {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .category-meta-description p {
        font-size: 16px;
        font-weight: 400;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .section-title {
        font-size: 1.5rem !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .posts-list {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .breadcrumb-container {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .content-section{
        padding:1rem 0;
    }
    
    .category-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .category-header h1 {
        font-size: 2rem;
    }
    
    .sites-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* Disable hover effects on mobile */
    .site-link:hover .site-thumbnail::before {
        background: rgba(0, 0, 0, 0);
    }
    
    .site-link:hover .site-buttons {
        opacity: 0;
    }
    
    .site-overlay {
        display: none !important;
    }
    
    .site-buttons {
        display: none !important;
    }

    .container{
        padding: 0;
    }
    
    .category-gray-wrapper .categories-section {
        padding-top: 0.5rem;
    }

    .category-footer-text{
        padding:0;
    }

    .category-gray-wrapper .categories-grid-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Categories page grid responsive */
    .categories-page .categories-section .categories-grid-section,
    .categories-page .categories-grid-section,
    .categories-grid-section {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important; /* Ripristinato a 1rem */
        max-width: 100% !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    .categories-page .categories-section .container,
    .categories-page .container {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 20px !important;
        box-sizing: border-box !important;
    }
    
    .page-header {
        padding: 2rem 0 !important;
        margin-bottom: 2rem !important;
    }
    
    /* Specific for categories page on mobile */
    .categories-page .page-header {
        padding: 0.5rem 0 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .page-header h1 {
        font-size: 2rem !important;
    }
    
    .page-header .container {
        padding: 0 20px !important;
        box-sizing: border-box !important;
    }
    
    .category-card-grid {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .category-image-placeholder {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .category-image-placeholder img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: cover !important;
        box-sizing: border-box !important;
    }

    /* Badges mobile adjustments */
    .ads-badge,
    .free-badge {
        padding: 3px 7px;
        font-size: 0.75rem;
        bottom: 6px;
    }

    .ads-badge {
        left: 6px;
    }

    .free-badge {
        right: 6px;
    }

}

