/* Planet Notion - Shared Template Card Styles */
/* Import fonts for consistency */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@400;500;600;700&display=swap');

/* Common Template Card Base Styles */
.template-card-base {
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: block;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    position: relative;
}

.template-card-base:hover {
    text-decoration: none;
    color: inherit;
}

/* Template Card Background */
.template-card-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Template Card Overlay - Desktop */
.template-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.6));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
}

.template-card-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-card-base:hover .template-card-overlay::after {
    opacity: 1;
}

/* Template Card Content - Desktop (Hidden by Default) */
.template-card-content {
    color: #FFFFFF;
    opacity: 0;
    transition: all 0.4s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(20px);
    text-align: center;
    width: 90%;
    z-index: 2;
}

.template-card-base:hover .template-card-content {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
}

/* Template Card Title */
.template-card-title {
    font-family: 'Bebas Neue', cursive;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #FFFFFF;
}

/* Template Card Author */
.template-card-author {
    font-family: 'Bebas Neue', cursive;
    font-weight: 400;
    margin: 0;
    color: #FFFFFF;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Template Card Category (for explore cards) */
.template-card-category {
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    font-weight: 400;
    margin: 0;
    color: #FFFFFF;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Template Card Badge */
.template-card-badge {
    font-family: 'Outfit', sans-serif;
    background: #222222;
    color: #FFFFFF;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    align-self: flex-end;
    letter-spacing: 0.5px;
    z-index: 3;
    position: relative;
    margin-top: auto;
    opacity: 0.9;
}

.template-card-badge.free {
    background: #6C4EFF;
    /* Deep Purple from brand palette */
    color: #FFFFFF;
}

.template-card-badge.price {
    background: rgba(34, 34, 34, 0.8);
    color: #FFFFFF;
    backdrop-filter: blur(4px);
}

/* Hero Cards (index.php) - Specific Sizing */
.template-card-hero {
    height: 100%;
    /* Will be defined by grid container */
}

.template-card-hero .template-card-title {
    font-size: 22px;
}

.template-card-hero .template-card-author {
    font-size: 14px;
}

/* Explore Cards (explore.php) - Specific Sizing */
.template-card-explore {
    height: 220px;
}

.template-card-explore .template-card-title {
    font-size: 18px;
}

.template-card-explore .template-card-author {
    font-size: 12px;
}

.template-card-explore:hover {
    transform: translateY(-4px);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {

    /* Mobile: Show title and author in center of card */
    .template-card-content {
        opacity: 1;
        /* Always visible on mobile */
        position: absolute;
        top: 50%;
        /* Center vertically */
        left: 50%;
        transform: translate(-50%, -50%);
        /* Center both horizontally and vertically */
        background: none;
        height: auto;
        padding: 20px 16px;
        width: calc(100% - 32px);
        /* Account for padding */
        text-align: center;
        z-index: 2;
    }

    /* Enhanced overlay for better text readability on mobile */
    .template-card-overlay {
        background: rgba(0, 0, 0, 0.5);
        /* Slightly darker overlay for better text contrast */
    }

    /* Remove hover effects on mobile */
    .template-card-base:hover .template-card-overlay::after {
        opacity: 0;
    }

    /* Hero Cards Mobile Sizing */
    .template-card-hero {
        height: 320px;
        border-radius: 16px;
    }

    .template-card-hero .template-card-title {
        font-size: 22px;
        /* Increased from 18px */
        line-height: 1.1;
        margin-bottom: 8px;
    }

    .template-card-hero .template-card-author {
        font-size: 14px;
        /* Increased from 12px */
    }

    /* Explore Cards Mobile Sizing */
    .template-card-explore {
        height: 320px;
        /* Increased to match hero cards */
    }

    .template-card-explore .template-card-title {
        font-size: 20px;
        /* Increased from default */
        line-height: 1.1;
        margin-bottom: 8px;
    }

    .template-card-explore .template-card-author {
        font-size: 13px;
        /* Increased from default */
    }

    /* Badge Mobile Sizing */
    .template-card-badge {
        font-size: 10px;
        padding: 3px 10px;
    }
}

@media (max-width: 480px) {

    /* Smaller Mobile Optimizations */
    .template-card-hero {
        height: 300px;
        border-radius: 12px;
    }

    .template-card-explore {
        height: 300px;
        border-radius: 12px;
    }

    .template-card-content {
        padding: 16px 12px;
        width: calc(100% - 24px);

        top: auto;
        bottom: 0.5rem;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .template-card-hero .template-card-title {
        font-size: 20px;
        /* Increased from 16px */
        line-height: 1.1;
        margin-bottom: 6px;
    }

    .template-card-hero .template-card-author {
        font-size: 13px;
        /* Increased from 11px */
    }

    .template-card-explore .template-card-title {
        font-size: 18px;
        /* Increased from 16px */
        line-height: 1.1;
        margin-bottom: 6px;
    }

    .template-card-explore .template-card-author {
        font-size: 12px;
        /* Increased from 11px */
    }

    .template-card-badge {
        font-size: 9px;
        padding: 2px 8px;
    }
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    .template-card-content,
    .template-card-overlay::after {
        transition: none;
    }
}