/* Homepage Design Styles */

/* Hero Search Section */
.hero-search {
    background: linear-gradient(135deg, var(--studio-blue) 0%, var(--studio-blue-dark) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 3rem;
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

/* Ensure hero title is white to match site theme and contrast with background */
.hero-title, .hero-title a { color: #ffffff !important; }

.hero-tagline { color: rgba(255,255,255,0.95); }

.hero-tagline {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.5;
}

.search-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
    color: var(--studio-gray-900);
    background: transparent;
}

.search-box input:focus {
    outline: none;
}

.search-box button {
    padding: 1rem 1.5rem;
    border: none;
    background: var(--studio-green);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-box button:hover {
    background: var(--studio-green-dark);
}

/* Section Styling */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.8rem;
    margin: 0;
    color: var(--studio-gray-900);
    font-weight: 800;
}

/* Filters and Tag Cloud */
.filters-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 1rem;
}
.filters-row .category-tabs { flex-wrap: wrap; }
.filters-row .tag-cloud { justify-self: end; }
.category-tabs {
    display: flex;
    gap: 0.5rem;
}
.category-tabs .tab {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1px solid rgba(37,99,235,0.12);
    background: #eef6ff; /* light blue */
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #084e8a;
    transition: background-color 0.18s ease, transform 0.12s ease, box-shadow 0.12s ease;
}
.category-tabs .tab.active {
    background: var(--studio-blue);
    color: white;
    box-shadow: 0 8px 20px rgba(37,99,235,0.08);
    border-color: var(--studio-blue);
}
.tag-cloud {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.tag-cloud .tag-btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: var(--studio-blue-dark); /* darker blue */
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.12rem 0.35rem; /* smaller containers */
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.72rem; /* smaller text */
    transition: background-color 0.12s ease, color 0.12s ease, transform 0.08s ease;
    display: inline-flex;
    margin-right: 0.3rem;
    align-items: center;
    gap: 0.35rem;
}

/* Post card visuals */
.post-card.animate-in {
    animation: fadeUp 300ms ease both;
}
.post-card.animate-in {
    animation: fadeUp 300ms ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.card-image img { border-radius: 0; }
.card-meta .category { text-transform: none; }

/* Category pills on post cards */
.post-card .card-meta .category {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid var(--border-color, #eaf2f2);
}

/* Category color mapping */
.post-card[data-category="Tutorials"] .category { background: #eef6ff; color: #084e8a; border-color: #d7e9ff; }
.post-card[data-category="News"] .category { background: #fff8e6; color: #8a5200; border-color: #fff2cc; }
.post-card[data-category="Reviews"] .category { background: #fff5f4; color: #7a2633; border-color: #ffdcd9; }
.post-card[data-category="Opinion"] .category { background: #f3f7e8; color: #2d5a2d; border-color: #e7f0df; }
/* Category pseudo-element icons removed to keep pills icon-free */
.post-card .category::before,
.category-tabs .tab::before {
    content: none !important;
    display: none !important;
}

.category-tabs .tab:focus, .category-tabs .tab:hover { transform: translateY(-2px); outline: none; }
.category-tabs .tab:focus { box-shadow: 0 0 0 3px rgba(43,122,120,0.12); }

/* Recommended reads section */
/* learning paths section hidden (replaced by Recommended Reads) */
.learning-paths { display: none; }
.path-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.path-card { background: #fff; border-radius: 8px; padding: 1rem; border: 1px solid var(--border-color, #eaf2f2); }
.path-card a { color: var(--studio-blue); text-decoration: none; }
.path-card.active { border-color: var(--studio-blue); box-shadow: 0 8px 20px rgba(37,99,235,0.06); transform: translateY(-2px); }

.view-all {
    color: var(--studio-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.view-all:hover {
    color: var(--studio-blue-dark);
    text-decoration: underline;
}

/* Featured Article */
.featured-article {
    margin-bottom: 4rem;
    padding: 0 1rem;
}

.featured-card {
    display: flex;
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.featured-image {
    flex: 0 0 300px;
}

.featured-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.featured-content {
    flex: 1;
    padding: 2rem;
}

.featured-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--studio-text-secondary);
}

.category {
    background: var(--studio-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-weight: 500;
}

.featured-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.featured-content h3 a {
    color: var(--studio-gray-900);
    text-decoration: none;
}

.featured-content h3 a:hover {
    color: var(--studio-blue, #2563eb);
}

.featured-summary {
    color: var(--text-color-light, #5D7B7A);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Button styles now handled by post-cards.css */

/* Latest Posts Grid */
.latest-posts {
    margin-bottom: 4rem;
    padding: 0 1rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* post card visuals are handled in post-cards.css; only keep animation here */

.post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-color-light, #5D7B7A);
}

.post-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.post-card h3 a {
    color: var(--text-color, #17252A);
    text-decoration: none;
}

.post-card h3 a:hover {
    color: var(--primary-color, #2B7A78);
.card-image { aspect-ratio: 16/9; height: auto; }
}

.post-summary {
    color: var(--text-color-light, #5D7B7A);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.tag-cloud .tag-btn:focus, .tag-cloud .tag-btn:hover { background: var(--studio-blue); color: white; border-color: transparent; transform: translateY(-1px); box-shadow: 0 6px 12px rgba(37,99,235,0.08); }
.tag-cloud .tag-btn.active { box-shadow: 0 8px 18px rgba(37,99,235,0.12); }

.category-pill { padding:0.25rem 0.6rem; border-radius: 999px; background: #eef6f6; color: #0b3b3a; font-weight:600; }

/* Read more styles now handled by post-cards.css */

/* Popular Tools */
.popular-tools {
    margin-bottom: 4rem;
    padding: 0 1rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: white;
    border: 1px solid var(--border-color, #DEF2F1);
    border-radius: 8px;
    padding: 1.5rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tool-card:hover {
    border-color: var(--primary-color, #2B7A78);
}

/* keep learning-paths hidden (replaced by recommended-reads) */
.learning-paths { display: none; }

/* Recommended Reads */

.recommended-reads { padding: 0 1rem 2rem; margin-bottom: 2rem; }
.recommended-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}
.recommended-card {
    background: var(--studio-card-bg);
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(37,99,235,0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1.5px solid #eaf2f2;
    min-height: 340px;
}
.recommended-card:hover {
    box-shadow: 0 8px 32px rgba(37,99,235,0.13);
    transform: translateY(-3px) scale(1.02);
    border-color: #bae6fd;
}
.recommended-card .card-image {
    width: 100%;
    height: 170px;
    background: #f3f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.recommended-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.2s;
}
.recommended-card:hover .card-image img {
    transform: scale(1.04);
}
.recommended-card .card-body {
    flex: 1;
    padding: 1.2rem 1.2rem 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.recommended-reads .label {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.recommended-reads .label.trending { background: linear-gradient(90deg,#f59e0b,#f97316); }
.recommended-reads .label.editor { background: linear-gradient(90deg, var(--studio-blue, #2563eb) 0%, var(--studio-blue-light, #3b82f6) 100%); }
.recommended-card h4 {
    margin: 0 0 8px 0;
    font-size: 1.13rem;
    font-weight: 700;
    line-height: 1.3;
}
.recommended-card h4 a {
    color: var(--studio-blue);
    text-decoration: none;
    transition: color 0.18s;
}
.recommended-card h4 a:hover {
    color: #0ea5e9;
}
.recommended-card p {
    margin: 0 0 10px 0;
    color: var(--muted, #64748b);
    font-size: 0.98rem;
    line-height: 1.5;
    flex: 1;
}
.recommended-card .views {
    font-size: 0.92rem;
    color: #64748b;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 0.4em;
}
.recommended-card .views i {
    color: #f59e0b;
    font-size: 1em;
}

@media (max-width: 900px) {
    .recommended-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .path-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .path-grid { grid-template-columns: 1fr; }
    /* On small screens, stack recommended cards vertically for readability */
    .recommended-card { 
        flex-direction: column; 
        min-height: auto; /* let content determine height */
    }
    .recommended-card .card-image {
        height: 140px; /* slightly larger touch-friendly image */
    }
    .recommended-card .card-body {
        padding: 1rem; /* reduce padding for mobile */
    }
    .recommended-card .card-footer {
        padding: 0.75rem 1rem;
        display: flex;
        gap: 0.6rem;
        justify-content: space-between;
        align-items: center;
    }
    .recommended-card .card-image img { object-position: center; }
}
.tool-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--studio-gray-900);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

.tool-description {
    color: var(--studio-gray-700);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-weight: 500;
}

.tool-example {
    background: var(--studio-gray-100);
    color: var(--studio-gray-800);
    padding: 0.75rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: block;
    overflow-x: auto;
    font-weight: 500;
}

.tool-meta {
    display: flex;
    justify-content: flex-end;
}

.difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.difficulty.beginner {
    background: #e8f5e8;
    color: #2d5a2d;
}

.difficulty.intermediate {
    background: #fff3cd;
    color: #856404;
}

.difficulty.advanced {
    background: #f8d7da;
    color: #721c24;
}

/* Community Section */
.community-picks {
    margin-bottom: 4rem;
    padding: 0 1rem;
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.community-card {
    background: white;
    border-left: 4px solid var(--primary-color, #2B7A78);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.community-card h4 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.community-card h4 a {
    color: var(--text-color, #17252A);
    text-decoration: none;
}

.community-card h4 a:hover {
    color: var(--primary-color, #2B7A78);
}

.community-card p {
    color: var(--text-color-light, #5D7B7A);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.community-type {
    background: var(--accent-color, #DEF2F1);
    color: var(--primary-color, #2B7A78);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Newsletter Section */
.newsletter {
    background: var(--accent-color, #DEF2F1);
    padding: 3rem 1rem;
    text-align: center;
    margin-bottom: 3rem;
}

.newsletter-container {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-color, #17252A);
}

.newsletter p {
    color: var(--text-color-light, #5D7B7A);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.newsletter-form {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
    gap: 0.5rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #DEF2F1);
    border-radius: 4px;
    font-size: 1rem;
}

.newsletter-form button {
    background: var(--primary-color, #2B7A78);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background: var(--primary-color-dark, #17252A);
}

/* Safeguard: ensure key homepage sections are visible */
.hero-search,
.featured-article,
.latest-posts,
.learning-paths {
    display: block !important; /* fallback for legacy templates */
    visibility: visible !important;
    opacity: 1 !important;
}

.featured-image img {
    display: block !important;
    max-width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-tagline {
        font-size: 1rem;
    }
    
    .featured-card {
        flex-direction: column;
    }
    
    .featured-image {
        flex: none;
    }
    
    .featured-image img {
        height: 200px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .community-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-search {
        padding: 3rem 0;
    }
    
    .search-box {
        flex-direction: column;
        border-radius: 8px;
    }
    
    .search-box input,
    .search-box button {
        border-radius: 0;
    }
    
    .search-box input {
        border-radius: 8px 8px 0 0;
    }
    
    .search-box button {
        border-radius: 0 0 8px 8px;
    }
}

/* Additional tag and pagination styles */
.tag-cloud .tag-btn.active {
    background: var(--primary-color, #2B7A78);
    color: white;
    border-color: transparent;
}
.tag-cloud .tag-btn.tag-size-1 { font-size: 0.72rem; opacity: 0.95; }
.tag-cloud .tag-btn.tag-size-2 { font-size: 0.78rem; opacity: 0.98; }
.tag-cloud .tag-btn.tag-size-3 { font-size: 0.86rem; font-weight:700; }
.tag-cloud .tag-btn.tag-size-4 { font-size: 0.94rem; font-weight:700; }
.tag-cloud .tag-btn.tag-size-5 { font-size: 1.02rem; font-weight:800; }

.pagination-controls { margin: 1.5rem 0; }
.pagination-controls .load-more { background: var(--studio-blue); }
.post-card.filtered-out { display: none !important; }