/* Funny Snails - Clean & Modern Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #0163ad;
    --primary-dark: #014d87;
    --secondary-color: #10B981;
    --accent-color: #F59E0B;
    --text-color: #1F2937;
    --text-light: #6B7280;
    --background-color: #F9FAFB;
    --white: #ffffff;
    --border-color: #E5E7EB;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 40px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --border-radius-large: 16px;
    --max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #000;
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

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

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.logo-text span {
    color: var(--primary-color);
}

.logo-img {
    height: 64px;
    width: auto;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 4px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
    cursor: pointer;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
}

/* Hero Section */
.hero {
    background: url('/img/background1.jpg') center center / cover no-repeat;
    padding: 80px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-color);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
.main {
    padding: 48px 0;
    min-height: calc(100vh - 400px);
    background: var(--white);
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 32px;
    text-align: center;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* Joke Card */
.joke-card {
    background: #f3f3f3;
    border-radius: var(--border-radius-large);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.joke-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.joke-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.joke-category {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    align-self: flex-start;
}

.joke-setup {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 16px;
    flex-grow: 1;
    line-height: 1.6;
}

.joke-punchline {
    color: var(--secondary-color);
    font-weight: 600;
    padding: 16px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--border-radius);
}

.joke-card-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.read-more {
    color: var(--primary-color);
    font-weight: 500;
}

/* Joke Card Image */
.joke-card-image {
    display: block;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.joke-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.joke-card:hover .joke-card-image img {
    transform: scale(1.05);
}

/* Punchline Wrapper */
.joke-punchline-wrapper {
    margin-top: auto;
    padding-top: 16px;
}

/* Joke Sections */
.jokes-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.section-cta {
    text-align: center;
    margin-top: 24px;
}

/* Category Cards */
.category-card {
    background: var(--white);
    border-radius: var(--border-radius-large);
    border: 1px solid var(--border-color);
    padding: 32px;
    text-align: center;
    transition: all 0.2s ease;
}

.category-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.category-count {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Single Joke Page */
.joke-single {
    background: var(--white);
    border-radius: var(--border-radius-large);
    border: 1px solid var(--border-color);
    padding: 48px;
    max-width: 800px;
    margin: 0 auto;
}

.joke-single .joke-setup {
    font-size: 1.5rem;
    margin-bottom: 24px;
    font-weight: 600;
}

.joke-single .joke-punchline {
    font-size: 1.25rem;
    padding: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: var(--border-radius);
    text-align: center;
}

.joke-actions {
    max-width: 800px;
    margin: 32px auto;
    display: flex;
    justify-content: center;
}

.joke-image {
    margin-bottom: 24px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.joke-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

/* Subscribe Form */
.subscribe-section {
    background: #000;
    padding: 64px 0;
    text-align: center;
    color: var(--white);
    border-top: 4px solid #ea580c;
}

.subscribe-section h2 {
    margin-bottom: 12px;
    font-size: 2rem;
    font-weight: 700;
    color: #ea580c;
}

.subscribe-section p {
    color: rgba(255, 255, 255, 0.8);
}

.subscribe-form {
    display: flex;
    justify-content: center;
    gap: 12px;
    max-width: 480px;
    margin: 24px auto 0;
}

.subscribe-form input[type="email"] {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.subscribe-form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.subscribe-form input[type="email"]:focus {
    outline: none;
    border-color: #ea580c;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: #ea580c;
    color: var(--white);
}

.btn-primary:hover {
    background: #c2410c;
    color: var(--white);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #ea580c;
    color: var(--white);
}

.btn-secondary:hover {
    background: #c2410c;
    color: var(--white);
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .current {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* About & Legal Pages */
.about-content,
.legal-content {
    background: var(--white);
    border-radius: var(--border-radius-large);
    border: 1px solid var(--border-color);
    padding: 48px;
    max-width: 800px;
    margin: 0 auto;
}

.about-content h2,
.legal-content h1,
.legal-content h2 {
    color: var(--text-color);
    margin-bottom: 16px;
    font-weight: 700;
}

.about-content p,
.legal-content p,
.legal-content ul {
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.7;
}

.legal-content ul {
    padding-left: 24px;
}

/* Messages */
.message {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-weight: 500;
}

.message-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid #10B981;
}

.message-error {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
    border: 1px solid #EF4444;
}

/* Footer */
.footer {
    background: #f3f3f3;
    color: var(--text-color);
    padding: 48px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-light);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ea580c;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--text-color);
    border-radius: 8px;
    color: var(--white);
    transition: all 0.2s ease;
}

.social-link:hover {
    background: #ea580c;
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 16px;
        gap: 8px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-hover);
    }

    .nav-list.active {
        display: flex;
    }

    .nav .nav-list .nav-link {
        color: #1F2937;
        padding: 12px 16px;
        border-radius: var(--border-radius);
        background: transparent;
    }

    .nav .nav-list .nav-link:hover {
        color: #0163ad;
        background: #F9FAFB;
    }

    .nav .nav-list .nav-link.active {
        color: #0163ad;
        background: rgba(1, 99, 173, 0.1);
    }

    .hero h1 {
        font-size: 2rem;
    }

    .subscribe-form {
        flex-direction: column;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .joke-single,
    .about-content,
    .legal-content {
        padding: 24px;
    }
}

/* Empty & Loading States */
.empty-state {
    text-align: center;
    padding: 64px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.loading {
    text-align: center;
    padding: 48px;
    color: var(--text-light);
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
    color: var(--text-light);
    font-weight: 500;
}

.back-link:hover {
    color: var(--primary-color);
}

/* Blog */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.blog-card {
    background: var(--white);
    border-radius: var(--border-radius-large);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.2s ease;
}

.blog-card:hover {
    box-shadow: var(--shadow-hover);
}

.blog-card-image {
    height: 180px;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 2rem;
}

.blog-card-content {
    padding: 24px;
}

.blog-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.blog-card-excerpt {
    color: var(--text-light);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.blog-card-meta {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 40px;
}

/* Article Card */
.article-card {
    transition: all 0.2s ease;
}

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

.article-card-link {
    display: block;
    color: inherit;
}

.article-card-link:hover {
    color: inherit;
}

.article-card-image {
    width: 100%;
    height: 190px;
    overflow: hidden;
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.article-card:hover .article-card-image img {
    transform: scale(1.05);
}

.article-card-content {
    padding: 8px 0 0 0;
    text-align: left;
}

.article-card-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.4;
}

/* Single Article Page */
.article-single {
    background: var(--white);
    border-radius: var(--border-radius-large);
    border: 1px solid var(--border-color);
    padding: 48px;
    max-width: 800px;
    margin: 0 auto;
}

.article-featured-image {
    margin-bottom: 32px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

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

.article-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 32px;
    line-height: 1.3;
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-color);
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 32px 0 16px;
    color: var(--text-color);
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-color);
}

.article-content p {
    margin-bottom: 16px;
}

.article-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 24px 0;
}

.article-content img.article-image {
    max-width: 100%;
    border-radius: var(--border-radius);
    margin: 16px 0;
}

/* Article Joke Cards */
.article-joke {
    background: #f3f3f3;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin: 24px 0;
}

.article-joke-image {
    width: 100%;
    max-height: 300px;
    overflow: hidden;
}

.article-joke-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-joke-content {
    padding: 24px;
}

.article-joke-setup {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 16px;
}

.article-joke-punchline-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-joke-punchline {
    color: var(--secondary-color);
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--border-radius);
    margin: 0;
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
}

.article-joke-punchline.show {
    max-height: 200px;
    padding: 16px;
    opacity: 1;
}

/* Article Share Icons */
.article-share {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.share-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: #fff;
}

.share-icon svg {
    width: 26px;
    height: 26px;
}

.share-icon:hover {
    transform: translateY(-2px);
    color: #fff;
}

.share-facebook {
    background: #1877F2;
}

.share-facebook:hover {
    background: #0d65d9;
}

.share-pinterest {
    background: #E60023;
}

.share-pinterest:hover {
    background: #c7001f;
}

.share-x {
    background: #000;
}

.share-x:hover {
    background: #333;
}

.share-email {
    background: var(--primary-color);
}

.share-email:hover {
    background: var(--primary-dark);
}

.article-cta {
    text-align: center;
    margin-top: 40px;
}

/* Responsive for articles */
@media (max-width: 992px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .article-single {
        padding: 24px;
    }

    .article-title {
        font-size: 1.5rem;
    }
}

/* Form loading states */
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}
