/* 4004 news - Custom Styles */

/* Typography */
body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.newspaper-title {
    font-family: 'Playfair Display', Georgia, serif;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.article-title {
    font-family: 'Lora', Georgia, serif;
    line-height: 1.3;
}

.modal-article-title {
    font-family: 'Playfair Display', Georgia, serif;
    line-height: 1.2;
}

.article-summary {
    font-family: 'Lora', Georgia, serif;
    line-height: 1.8;
}

/* Line clamping for text truncation */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Article Card Animations */
.article-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

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

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #000000, #4b5563);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card:hover::before {
    opacity: 1;
}

/* Image Container */
.article-image-container img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Modal Animations */
.modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Scrollbar Styling */
.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Blockquote Styling */
blockquote {
    position: relative;
}

blockquote::before {
    content: '"';
    position: absolute;
    left: -20px;
    top: -10px;
    font-size: 4rem;
    opacity: 0.1;
    font-family: 'Playfair Display', Georgia, serif;
    line-height: 1;
}

/* Date Picker Custom Styling */
#date-picker {
    font-family: 'Source Sans 3', sans-serif;
    cursor: pointer;
}

#date-picker::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0);
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Prose Styling for Article Content */
.prose {
    max-width: 65ch;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    font-family: 'Playfair Display', Georgia, serif;
}

.prose p {
    margin-bottom: 1.25em;
}

.prose strong {
    font-weight: 600;
    color: #111827;
}

.prose a {
    color: #2563eb;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.prose a:hover {
    color: #1e40af;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .newspaper-title {
        font-size: 3rem;
    }
    
    .modal-article-title {
        font-size: 1.875rem;
    }
    
    .modal-content {
        margin: 1rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .article-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    header,
    footer,
    #article-modal {
        display: none !important;
    }
}

/* Focus Styles for Accessibility */
button:focus,
input:focus,
a:focus {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

.article-card:focus {
    outline: 2px solid #000000;
    outline-offset: 4px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Newspaper-style dividers */
.border-newspaper {
    border-style: double;
    border-width: 3px;
}

/* Hover effects for interactive elements */
button,
a {
    transition: all 0.2s ease-in-out;
}

button:active {
    transform: scale(0.98);
}

/* Custom Badge Styling */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 9999px;
}

/* Grid Layout Enhancement */
#articles-grid {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Empty State Styling */
#empty-state {
    animation: fadeInUp 0.6s ease-out;
}

#empty-state > div {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Error State Styling */
#error {
    animation: wiggle 0.6s ease-in-out;
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(-3deg);
    }
    40% {
        transform: rotate(3deg);
    }
    60% {
        transform: rotate(-3deg);
    }
    80% {
        transform: rotate(3deg);
    }
}

/* Category and Tag Pills */
.category-pill,
.tag-pill {
    transition: all 0.2s ease;
}

.category-pill:hover,
.tag-pill:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Insight and Action Item Cards */
.insight-card,
.action-card {
    transition: all 0.3s ease;
}

.insight-card:hover,
.action-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

/* Modal Backdrop */
#article-modal {
    backdrop-filter: blur(4px);
    transition: backdrop-filter 0.3s ease;
}

/* Newspaper Border Effect */
.newspaper-border {
    border: 1px solid #e5e7eb;
    border-top: 4px solid #000000;
}

/* Custom Selection Color */
::selection {
    background-color: #000000;
    color: #ffffff;
}

::-moz-selection {
    background-color: #000000;
    color: #ffffff;
}

/* Link Underline Animation */
a {
    position: relative;
}

a.underline-animate::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

a.underline-animate:hover::after {
    width: 100%;
}

