/* Custom styles for the blog - Only essential customizations with TailwindCSS */

/* Article Content Styles - Markdown 渲染樣式 */
#article-content,
.article-content {
    line-height: 1.8;
    color: #374151;
}

#article-content h1,
.article-content h1 {
    font-size: 2.25rem !important;
    font-weight: 700 !important;
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
    color: #111827 !important;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

#article-content h2,
.article-content h2 {
    font-size: 1.875rem !important;
    font-weight: 600 !important;
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
    color: #1f2937 !important;
}

#article-content h3,
.article-content h3 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
    color: #374151 !important;
}

#article-content h4,
.article-content h4 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
    color: #4b5563 !important;
}

#article-content p,
.article-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

#article-content strong,
#article-content b,
.article-content strong,
.article-content b {
    font-weight: 700 !important;
    color: #111827 !important;
}

#article-content em,
#article-content i,
.article-content em,
.article-content i {
    font-style: italic !important;
}

#article-content code,
.article-content code {
    background-color: #f3f4f6 !important;
    color: #dc2626 !important;
    padding: 0.125rem 0.375rem !important;
    border-radius: 0.25rem !important;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
}

#article-content pre,
.article-content pre {
    background-color: #1f2937 !important;
    color: #f9fafb !important;
    padding: 1rem !important;
    border-radius: 0.5rem !important;
    overflow-x: auto !important;
    margin: 1rem 0 !important;
    border-left: 4px solid #3b82f6 !important;
}

#article-content pre code,
.article-content pre code {
    background-color: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

.article-content blockquote {
    border-left: 4px solid #d1d5db;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #6b7280;
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.25rem;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.article-content ul li {
    list-style-type: disc;
    margin-bottom: 0.5rem;
}

.article-content ol li {
    list-style-type: decimal;
    margin-bottom: 0.5rem;
}

.article-content a {
    color: #3b82f6;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.article-content a:hover {
    color: #1d4ed8;
}

.article-content hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 2rem 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.article-content table th,
.article-content table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.article-content table th {
    background-color: #f3f4f6;
    font-weight: 600;
    color: #374151;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 程式碼語法高亮樣式 (Prism.js) */
.article-content .token.comment,
.article-content .token.prolog,
.article-content .token.doctype,
.article-content .token.cdata {
    color: #6b7280;
}

.article-content .token.punctuation {
    color: #9ca3af;
}

.article-content .token.property,
.article-content .token.tag,
.article-content .token.boolean,
.article-content .token.number,
.article-content .token.constant,
.article-content .token.symbol,
.article-content .token.deleted {
    color: #ef4444;
}

.article-content .token.selector,
.article-content .token.attr-name,
.article-content .token.string,
.article-content .token.char,
.article-content .token.builtin,
.article-content .token.inserted {
    color: #10b981;
}

.article-content .token.operator,
.article-content .token.entity,
.article-content .token.url,
.article-content .language-css .token.string,
.article-content .style .token.string {
    color: #f59e0b;
}

.article-content .token.atrule,
.article-content .token.attr-value,
.article-content .token.keyword {
    color: #8b5cf6;
}

.article-content .token.function,
.article-content .token.class-name {
    color: #3b82f6;
}

.article-content .token.regex,
.article-content .token.important,
.article-content .token.variable {
    color: #f97316;
}

/* Hero section background image */
.hero-bg {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%),
        url('https://images.unsplash.com/photo-1508780709619-79562169bc64?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80') center/cover;
    background-attachment: fixed;
}

/* Articles page header background */
.articles-header-bg {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.8) 0%, rgba(59, 130, 246, 0.8) 100%),
        url('https://images.unsplash.com/photo-1517180102446-f3ece451e9d8?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80') center/cover;
    background-attachment: fixed;
}

/* Portfolio page header background */
.portfolio-header-bg {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.8) 0%, rgba(239, 68, 68, 0.8) 100%),
        url('https://images.unsplash.com/photo-1558655146-d09347e92766?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80') center/cover;
    background-attachment: fixed;
}

/* Article card hover animations */
.article-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Mobile hamburger menu animation */
.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Custom gradient backgrounds for article cards */
.article-card:nth-child(1) .article-image {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%),
        url('https://images.unsplash.com/photo-1555066931-4365d14bab8c?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80') center/cover;
}

.article-card:nth-child(2) .article-image {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.9) 0%, rgba(255, 152, 0, 0.9) 100%),
        url('https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80') center/cover;
}

.article-card:nth-child(3) .article-image {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.9) 0%, rgba(34, 197, 94, 0.9) 100%),
        url('https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80') center/cover;
}

.article-card:nth-child(4) .article-image {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.9) 0%, rgba(73, 80, 87, 0.9) 100%),
        url('https://images.unsplash.com/photo-1558494949-ef010cbdcc31?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80') center/cover;
}

.article-card:nth-child(5) .article-image {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.9) 0%, rgba(32, 201, 151, 0.9) 100%),
        url('https://images.unsplash.com/photo-1556075798-4825dfaaf498?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80') center/cover;
}

.article-card:nth-child(6) .article-image {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.9) 0%, rgba(0, 86, 179, 0.9) 100%),
        url('https://images.unsplash.com/photo-1618477388954-7852f32655ec?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80') center/cover;
}

/* Notification styles */
.notification {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Loading animation */
.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {

    .hero-bg,
    .articles-header-bg,
    .portfolio-header-bg {
        background-attachment: scroll;
    }

    /* Simplify article card backgrounds on mobile */
    .article-card::before {
        background: rgba(120, 119, 198, 0.05);
    }
}