/* Blog Styles for BOXY */

/* Language Toggle - Hide inactive language */
html[lang="es"] .lang-en {
    display: none !important;
}

html[lang="en"] .lang-es {
    display: none !important;
}

/* Default to Spanish if no lang attribute */
html:not([lang]) .lang-en {
    display: none !important;
}

/* Navigation Override for Blog Pages */
nav,
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-content,
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.5em;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.lang-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.lang-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cta-button {
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 122, 255, 0.3);
}

/* Blog Header */
.blog-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 140px 0 60px;
    text-align: center;
    margin-top: 60px;
}

.blog-header h1 {
    font-size: 3em;
    margin-bottom: 15px;
    font-weight: 700;
}

.blog-header p {
    font-size: 1.2em;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Posts Grid */
.blog-posts {
    padding: 60px 0;
    background: var(--background-color);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

/* Post Card */
.post-card {
    background: var(--card-background);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Card Link Wrapper - Makes entire card clickable */
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.card-link .post-title {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.card-link:hover .post-title {
    color: var(--primary-color);
}

.card-link .read-more {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.card-link:hover .read-more {
    transform: translateX(5px);
}

.post-image {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.post-image-moving {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
}

.post-image-nfc {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
}

.post-image-declutter {
    background: linear-gradient(135deg, #A8EDEA, #FED6E3);
}

.post-icon {
    font-size: 5em;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.post-card:hover .post-icon {
    transform: scale(1.1) rotate(5deg);
}

.post-content {
    padding: 30px;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.85em;
}

.post-category {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.post-date {
    color: var(--text-secondary);
    font-weight: 500;
}

.post-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    line-height: 1.3;
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 0.95em;
}

/* Blog CTA Section */
.blog-cta {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 60px 0;
    text-align: center;
    color: white;
}

.blog-cta .cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.blog-cta h2 {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.blog-cta p {
    font-size: 1.1em;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Blog Post Page Styles */
.post-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 140px 0 60px;
    margin-top: 60px;
    text-align: center;
}

.post-header .container {
    max-width: 900px;
}

.post-header h1 {
    font-size: 3em;
    margin-bottom: 20px;
    font-weight: 700;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.post-header-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    align-items: center;
    opacity: 0.9;
    font-size: 1em;
}

.post-header-meta .post-category {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

.post-body,
.blog-post-container {
    padding: 60px 0;
    background: var(--background-color);
}

.post-container,
.blog-post {
    max-width: 800px;
    margin: 0 auto;
}

.post-featured-image {
    width: 100%;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.post-container h2 {
    font-size: 2em;
    margin-top: 50px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.post-container h3 {
    font-size: 1.5em;
    margin-top: 40px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.post-container p {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.post-container ul, .post-container ol {
    margin-bottom: 30px;
    padding-left: 30px;
}

.post-container li {
    font-size: 1.05em;
    line-height: 1.8;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.post-container strong {
    color: var(--text-color);
    font-weight: 600;
}

.post-container a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.post-container a:hover {
    border-bottom-color: var(--primary-color);
}

.post-container blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-container img {
    max-width: 100%;
    border-radius: 15px;
    margin: 30px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.post-container code {
    background: var(--card-background);
    padding: 2px 8px;
    border-radius: 5px;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.post-container pre {
    background: var(--card-background);
    padding: 20px;
    border-radius: 15px;
    overflow-x: auto;
    margin: 30px 0;
}

.post-container pre code {
    background: none;
    padding: 0;
}

/* Call-to-Action Box */
.cta-box {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin: 50px 0;
}

.cta-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 2em;
}

.cta-box p {
    margin-bottom: 25px;
    opacity: 0.9;
    font-size: 1.1em;
    color: white;
}

.cta-box .app-store-badge {
    display: inline-block;
}

/* Back to Blog Link */
.back-to-blog {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 30px;
    transition: transform 0.2s ease;
}

.back-to-blog:hover {
    transform: translateX(-5px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-links {
        gap: 15px;
        font-size: 0.9em;
    }

    .logo a {
        font-size: 1.2em;
    }

    .logo-img {
        width: 32px;
        height: 32px;
    }

    .lang-toggle,
    .cta-button {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    .blog-header {
        padding: 100px 0 40px;
        margin-top: 50px;
    }

    .blog-header h1 {
        font-size: 2em;
    }

    .blog-header p {
        font-size: 1em;
        padding: 0 20px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 20px;
    }

    .post-card {
        border-radius: 15px;
    }

    .post-image {
        height: 150px;
    }

    .post-icon {
        font-size: 3.5em;
    }

    .post-content {
        padding: 20px;
    }

    .post-title {
        font-size: 1.3em;
    }

    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .blog-cta {
        padding: 40px 20px;
    }

    .blog-cta h2 {
        font-size: 1.8em;
    }

    .blog-cta p {
        font-size: 1em;
    }

    /* Blog Post Mobile */
    .post-header {
        padding: 120px 20px 40px;
        margin-top: 50px;
    }

    .post-header h1 {
        font-size: 1.8em;
        line-height: 1.2;
    }

    .post-header-meta {
        flex-wrap: wrap;
        gap: 15px;
    }

    .post-body {
        padding: 40px 20px;
    }

    .post-container h2 {
        font-size: 1.6em;
        margin-top: 40px;
    }

    .post-container h3 {
        font-size: 1.3em;
        margin-top: 30px;
    }

    .post-container p {
        font-size: 1em;
    }

    .post-container li {
        font-size: 1em;
    }

    .cta-box {
        padding: 30px 20px;
    }

    .cta-box h3 {
        font-size: 1.5em;
    }

    .cta-box p {
        font-size: 1em;
    }

    /* Footer Mobile */
    footer {
        padding: 40px 0 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 20px;
    }

    .footer-section {
        text-align: center;
    }

    .footer-bottom {
        padding: 20px;
    }
}

/* Footer Styles */
footer {
    background: rgba(26, 26, 26, 0.95);
    color: white;
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-section h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: white;
    display: block;
}

.footer-section h4 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: white;
    display: block;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    display: block;
}

.footer-section a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9em;
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
    .post-card {
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    }

    .post-card:hover {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }

    .post-container img {
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    }
}
