/*
 * Haitian Globe - Custom CSS Styles
 * Built on top of Tailwind CSS
 */

/* Custom Utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #1e40af;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #dc2626;
}

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

/* Professional Article Content Styling - Maximum Priority Override */
.article-content,
div.article-content,
.prose.article-content {
    font-family: 'Georgia', 'Times New Roman', serif !important;
    line-height: 1.8 !important;
    color: #374151 !important;
    max-width: none !important;
}

/* Override any prose styles that might conflict */
.prose.article-content p {
    margin-top: 0 !important;
    margin-bottom: 1.75rem !important;
}

.prose.article-content h1,
.prose.article-content h2,
.prose.article-content h3,
.prose.article-content h4,
.prose.article-content h5,
.prose.article-content h6 {
    margin-top: 2.5rem !important;
    margin-bottom: 1.25rem !important;
}

/* Universal paragraph styling for article content - Ultra Maximum Priority */
.article-content p,
.article-content .article-paragraph,
div.article-content p,
.prose.article-content p,
.prose-xl.article-content p,
.prose-gray.article-content p,
.max-w-none.article-content p,
.mb-12.article-content p,
.break-words.article-content p {
    margin-top: 0 !important;
    margin-bottom: 1.75rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    text-align: justify !important;
    text-indent: 1.5rem !important;
    font-size: 1.125rem !important;
    line-height: 1.8 !important;
    color: #374151 !important;
    display: block !important;
    font-family: 'Georgia', 'Times New Roman', serif !important;
    box-sizing: border-box !important;
}

.article-content p:first-child,
.article-content p:first-of-type,
.article-content .article-paragraph:first-child,
.article-content .article-paragraph:first-of-type,
div.article-content p:first-child {
    text-indent: 0 !important;
    font-weight: 500 !important;
    font-size: 1.25rem !important;
    margin-bottom: 2rem !important;
}

/* Universal heading styling - Maximum Priority */
.article-content h1, 
.article-content h2,
.prose.article-content h1,
.prose.article-content h2 {
    font-family: 'Inter', 'system-ui', sans-serif !important;
    font-size: 1.75rem !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin: 3rem 0 1.5rem 0 !important;
    padding: 0 0 0.75rem 0 !important;
    border-bottom: 3px solid #dc2626 !important;
    display: block !important;
    text-indent: 0 !important;
    line-height: 1.3 !important;
}

.article-content h3,
.prose.article-content h3 {
    font-family: 'Inter', 'system-ui', sans-serif !important;
    font-size: 1.375rem !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    margin: 2.5rem 0 1.25rem 0 !important;
    padding: 0 0 0.5rem 0 !important;
    border-bottom: 2px solid #1e40af !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    display: block !important;
    text-indent: 0 !important;
    line-height: 1.3 !important;
}

.article-content h4, 
.article-content h5, 
.article-content h6,
.prose.article-content h4,
.prose.article-content h5,
.prose.article-content h6 {
    font-family: 'Inter', 'system-ui', sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin: 2rem 0 1rem 0 !important;
    padding: 0 !important;
    font-style: italic !important;
    display: block !important;
    text-indent: 0 !important;
    line-height: 1.3 !important;
    border: none !important;
}

.article-content .article-paragraph {
    margin-bottom: 1.75rem !important;
    text-align: justify !important;
    text-indent: 1.5rem !important;
    font-size: 1.125rem !important;
    line-height: 1.8 !important;
    color: #374151 !important;
    display: block !important;
}

.article-content .article-paragraph:first-of-type {
    text-indent: 0 !important;
    font-weight: 500 !important;
    font-size: 1.25rem !important;
    margin-bottom: 2rem !important;
}

.article-content .article-subtitle {
    font-family: 'Inter', 'system-ui', sans-serif !important;
    font-size: 1.375rem !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    margin: 2.5rem 0 1.25rem 0 !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 2px solid #1e40af !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    display: block !important;
}

.article-content .article-heading {
    font-family: 'Inter', 'system-ui', sans-serif !important;
    font-size: 1.75rem !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin: 3rem 0 1.5rem 0 !important;
    padding-bottom: 0.75rem !important;
    border-bottom: 3px solid #dc2626 !important;
    display: block !important;
}

.article-content .article-subheading {
    font-family: 'Inter', 'system-ui', sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin: 2rem 0 1rem 0 !important;
    font-style: italic !important;
    display: block !important;
}

.article-content blockquote {
    border-left: 4px solid #1e40af !important;
    background: #f8fafc !important;
    padding: 1.5rem !important;
    margin: 2rem 0 !important;
    font-style: italic !important;
    font-size: 1.125rem !important;
    color: #64748b !important;
    border-radius: 0 8px 8px 0 !important;
}

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

.article-content li {
    margin-bottom: 0.75rem !important;
    font-size: 1.125rem !important;
    line-height: 1.7 !important;
}

.article-content a {
    color: #1e40af !important;
    text-decoration: underline !important;
    font-weight: 500 !important;
    transition: color 0.2s ease !important;
}

.article-content a:hover {
    color: #dc2626 !important;
}

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

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

.article-content img {
    margin: 2rem auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

.article-content table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

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

.article-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.article-content code {
    background: #f3f4f6;
    color: #dc2626;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Mobile responsiveness for article content */
@media (max-width: 640px) {
    .article-content {
        font-size: 1rem;
    }
    
    .article-content .article-paragraph {
        font-size: 1rem;
        text-indent: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .article-content .article-paragraph:first-of-type {
        font-size: 1.125rem;
    }
    
    .article-content .article-subtitle {
        font-size: 1.25rem;
        margin: 2rem 0 1rem 0;
    }
    
    .article-content .article-heading {
        font-size: 1.5rem;
        margin: 2.5rem 0 1.25rem 0;
    }
}

/* Prose Styling for Article Content */
.prose {
    color: #374151;
    max-width: none;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: #111827;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h1 {
    font-size: 2.25rem;
}

.prose h2 {
    font-size: 1.875rem;
}

.prose h3 {
    font-size: 1.5rem;
}

.prose h4 {
    font-size: 1.25rem;
}

.prose p {
    margin-bottom: 1.5rem; /* keep vertical spacing */
    line-height: 1.9;      /* slightly taller for readability */
    font-size: 1.125rem;
    text-indent: 0;        /* default: no indentation */
}

/* Optional indented-first-paragraph utility
   Add class `prose--indent` to the content wrapper to enable
   a classic first-line indentation style while preserving
   spacing between paragraphs. */
.prose.prose--indent p {
    text-indent: 1.25rem;   /* indent each paragraph */
    margin-top: 0.25rem;
}

.prose.prose--indent p:first-child,
.prose.prose--indent p:has(img),
.prose.prose--indent h1 + p,
.prose.prose--indent h2 + p,
.prose.prose--indent h3 + p {
    text-indent: 0; /* do not indent after headings or media */
}

.prose a {
    color: #1e40af;
    text-decoration: underline;
    font-weight: 500;
}

.prose a:hover {
    color: #dc2626;
}

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

.prose em {
    font-style: italic;
}

.prose blockquote {
    border-left: 4px solid #1e40af;
    padding-left: 1.5rem;
    margin: 2rem 0;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    font-style: italic;
    color: #4b5563;
}

.prose ul, .prose ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.prose li {
    margin-bottom: 0.5rem;
    line-height: 1.75;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 2rem auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.prose figure {
    margin: 2rem 0;
    text-align: center;
}

.prose figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.prose th, .prose td {
    border: 1px solid #d1d5db;
    padding: 0.75rem;
    text-align: left;
}

.prose th {
    background: #f9fafb;
    font-weight: 700;
}

.prose code {
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #dc2626;
}

.prose pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.prose pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Custom Components */
.btn {
    @apply inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors;
}

.btn-primary {
    @apply bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500;
}

.btn-secondary {
    @apply bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500;
}

.btn-danger {
    @apply bg-red-600 text-white hover:bg-red-700 focus:ring-red-500;
}

.btn-success {
    @apply bg-green-600 text-white hover:bg-green-700 focus:ring-green-500;
}

.card {
    @apply bg-white shadow rounded-lg;
}

.card-header {
    @apply px-6 py-4 border-b border-gray-200;
}

.card-body {
    @apply p-6;
}

.form-group {
    @apply mb-4;
}

.form-label {
    @apply block text-sm font-medium text-gray-700 mb-2;
}

.form-input {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500;
}

.form-textarea {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 resize-vertical;
}

.form-select {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 bg-white;
}

.alert {
    @apply p-4 rounded-md mb-4;
}

.alert-success {
    @apply bg-green-50 border border-green-200 text-green-800;
}

.alert-error {
    @apply bg-red-50 border border-red-200 text-red-800;
}

.alert-warning {
    @apply bg-yellow-50 border border-yellow-200 text-yellow-800;
}

.alert-info {
    @apply bg-blue-50 border border-blue-200 text-blue-800;
}

/* Responsive Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.image-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    transition: transform 0.3s ease;
    cursor: pointer;
}

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

/* Breaking News Ticker */
.breaking-news-ticker {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    animation: ticker-scroll 80s linear infinite;
    will-change: transform;
}

.ticker-item {
    display: inline;
    white-space: nowrap;
}

.ticker-separator {
    color: rgba(255, 255, 255, 0.7);
    font-weight: bold;
    margin: 0 1.5rem;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(10%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Force animation even with reduced motion preference for essential news ticker */
.ticker-content {
    animation: ticker-scroll 60s linear infinite !important;
}

/* Pause animation on hover */
.breaking-news-ticker:hover .ticker-content {
    animation-play-state: paused !important;
}

/* Hero Slider General Styles */
.heroSwiper {
    position: relative;
}

.heroSwiper .swiper-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heroSwiper .swiper-slide img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.heroSwiper .swiper-button-next,
.heroSwiper .swiper-button-prev {
    z-index: 20;
}

/* Loading States */
.loading-spinner {
    @apply inline-block w-4 h-4 border-2 border-gray-300 border-t-blue-600 rounded-full animate-spin;
}

.skeleton {
    @apply bg-gray-200 animate-pulse rounded;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .prose {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .prose a {
        text-decoration: none;
        color: inherit;
    }
    
    .prose a::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .dark-mode-auto {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .dark-mode-auto .bg-white {
        background: #374151 !important;
    }
    
    .dark-mode-auto .text-gray-900 {
        color: #f9fafb !important;
    }
    
    .dark-mode-auto .border-gray-200 {
        border-color: #4b5563 !important;
    }
}

/* Custom Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInFromRight 0.6s ease-out;
}

/* Haiti Flag Colors */
.haiti-gradient {
    background: linear-gradient(135deg, #1e40af 0%, #dc2626 100%);
}

.haiti-flag {
    background: linear-gradient(to bottom, #1e40af 50%, #dc2626 50%);
}

/* Utility palette classes used in static pages (match Tailwind palette) */
.text-haiti-blue { color: #1e40af; }
.text-haiti-red { color: #dc2626; }
.text-haiti-yellow { color: #f59e0b; }
.bg-haiti-blue { background-color: #1e40af; }
.bg-haiti-red { background-color: #dc2626; }
.bg-haiti-yellow { background-color: #f59e0b; }
.hover\:text-haiti-red:hover { color: #dc2626; }
.hover\:text-haiti-blue:hover { color: #1e40af; }
.hover\:bg-yellow-500:hover { background-color: #eab308; }
.focus\:ring-haiti-blue:focus { box-shadow: 0 0 0 3px rgba(30,64,175,0.4); outline: none; }
.focus\:ring-haiti-red:focus { box-shadow: 0 0 0 3px rgba(220,38,38,0.4); outline: none; }

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .prose a {
        text-decoration: underline;
        text-decoration-thickness: 2px;
    }
    
    .btn {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .breaking-news-ticker {
        animation: none;
        white-space: normal;
    }
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .prose {
        font-size: 1rem;
    }
    
    .prose h1 {
        font-size: 1.875rem;
    }
    
    .prose h2 {
        font-size: 1.5rem;
    }
    
    .prose h3 {
        font-size: 1.25rem;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
    }
    
    /* Mobile Breaking News Ticker */
    .breaking-news-ticker {
        font-size: 0.875rem;
    }
    
    .ticker-content {
        animation-duration: 40s;
    }
    
    /* Mobile Image Optimizations */
    img {
        max-width: 100%;
        height: auto;
        object-fit: cover;
    }
    
    /* Mobile Navigation */
    .mobile-nav-open {
        overflow: hidden;
    }
    
    /* Hero Slider Mobile Optimizations */
    .heroSwiper {
        border-radius: 0.5rem;
        max-width: 100%;
        overflow: hidden;
    }
    
    .heroSwiper .swiper-slide {
        width: 100%;
        height: auto;
    }
    
    .heroSwiper .swiper-slide img {
        width: 100% !important;
        height: 18rem !important; /* 288px = h-72 */
        object-fit: cover !important;
        display: block !important;
    }
    
    .heroSwiper .swiper-button-next,
    .heroSwiper .swiper-button-prev {
        color: white !important;
        background: rgba(0, 0, 0, 0.5) !important;
        border-radius: 50% !important;
        width: 35px !important;
        height: 35px !important;
    }
    
    .heroSwiper .swiper-button-next:after,
    .heroSwiper .swiper-button-prev:after {
        font-size: 14px !important;
        font-weight: bold !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .hover\:scale-105:hover {
        transform: none;
    }
    
    /* Larger touch targets */
    .btn {
        min-height: 44px;
    }
    
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ======================================
   ADVERTISEMENT STYLES
   ====================================== */

/* Advertisement Container */
.advertisement-container {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: white;
}

/* Advertisement Item */
.advertisement-item {
    display: block;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.advertisement-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Advertisement Image */
.ad-image {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.advertisement-item:hover .ad-image {
    transform: scale(1.05);
}

/* Advertisement Text */
.ad-text {
    padding: 12px;
    font-size: 14px;
    text-align: center;
    color: #374151;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Carousel Styles */
.ad-carousel {
    position: relative;
    width: 100%;
    height: auto;
}

.ad-slide {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.ad-slide.active {
    display: block;
    opacity: 1;
}

/* Navigation Buttons */
.ad-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.ad-nav-prev,
.ad-nav-next {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    opacity: 0;
}

.advertisement-container:hover .ad-nav-prev,
.advertisement-container:hover .ad-nav-next {
    opacity: 1;
}

.ad-nav-prev:hover,
.ad-nav-next:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.ad-nav-prev {
    margin-left: 10px;
}

.ad-nav-next {
    margin-right: 10px;
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Animated Advertisement Classes */
.animated-ad {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.homepage-small-ad {
    animation: slideInRight 0.8s ease-out forwards;
    opacity: 0;
}

.sidebar-ad {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.sidebar-banner-ad {
    animation: slideInRight 0.6s ease-out forwards;
    opacity: 0;
}

.sidebar-medium-ad {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

/* Size-specific styles */
.homepage-large-ads,
.homepage-medium-ads,
.homepage-banner-ads {
    max-width: 100%;
    overflow: hidden;
}

/* Hover effects for same size ads */
.homepage-small-ad:hover,
.sidebar-ad:hover,
.sidebar-banner-ad:hover {
    animation: pulse 1s ease-in-out infinite;
}

/* Loading shimmer effect */
.ad-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Mobile Responsive Advertisement Styles */
@media (max-width: 768px) {
    .advertisement-container {
        margin: 0 auto;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .ad-navigation {
        display: none; /* Hide navigation on mobile */
    }
    
    .advertisement-item {
        margin-bottom: 15px;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .ad-link {
        display: block;
        min-height: 44px; /* Minimum touch target size */
        text-decoration: none;
        color: inherit;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        cursor: pointer;
    }
    
    .ad-link:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .ad-image {
        width: 100% !important;
        height: auto !important;
        max-height: 200px;
        object-fit: cover;
        border-radius: 6px;
    }
    
    .ad-text {
        padding: 15px;
        font-size: 16px;
        line-height: 1.4;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Size-specific mobile adjustments */
    .homepage-large-ads .advertisement-item,
    .homepage-medium-ads .advertisement-item {
        max-width: 100%;
        height: auto;
    }
    
    .homepage-large-ads .ad-image,
    .homepage-medium-ads .ad-image {
        width: 100%;
        height: auto;
        max-height: 150px;
        object-fit: cover;
    }
    
    /* Small ads on mobile */
    .homepage-small-ads .advertisement-item {
        max-width: 100%;
        margin: 0 auto 10px;
    }
    
    .homepage-small-ads .ad-image {
        width: 100%;
        height: auto;
        max-height: 120px;
    }
    
    /* Sidebar ads on mobile */
    .sidebar-ad .advertisement-item {
        margin-bottom: 20px;
    }
    
    .sidebar-ad .ad-image {
        width: 100%;
        height: auto;
        max-height: 180px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .advertisement-container {
        padding: 0 5px;
    }
    
    .ad-image {
        max-height: 150px;
    }
    
    .ad-text {
        padding: 12px;
        font-size: 14px;
    }
    
    .homepage-large-ads .ad-image,
    .homepage-medium-ads .ad-image {
        max-height: 120px;
    }
    
    .homepage-small-ads .ad-image {
        max-height: 100px;
    }
}

/* Print styles */
@media print {
    .advertisement-container,
    .advertisement-item,
    .animated-ad,
    .sidebar-ad,
    .homepage-small-ad {
        display: none !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .animated-ad,
    .homepage-small-ad,
    .sidebar-ad,
    .sidebar-banner-ad,
    .sidebar-medium-ad {
        animation: none !important;
        opacity: 1 !important;
    }
    
    .advertisement-item:hover {
        transform: none;
    }
    
    .advertisement-item:hover .ad-image {
        transform: none;
    }
}

/* Focus styles for accessibility */
.advertisement-item:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.ad-nav-prev:focus,
.ad-nav-next:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Mobile touch improvements */
@media (max-width: 768px) {
    .ad-link {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        cursor: pointer;
        touch-action: manipulation;
    }
    
    .ad-link:active {
        background-color: rgba(0, 0, 0, 0.05);
        transform: scale(0.98);
        transition: all 0.1s ease;
    }
    
    /* Ensure images inside links are not selectable */
    .ad-link img {
        pointer-events: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

/* Mobile menu enhancements */
@media (max-width: 767px) {
    /* Ensure mobile menu button is visible */
    #mobile-menu-button {
        display: block !important;
    }
    
    /* Ensure desktop nav is hidden */
    .hidden.md\:flex {
        display: none !important;
    }
    
    /* Mobile menu styling */
    #mobile-menu {
        background: white;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 50;
    }
    
    #mobile-menu a {
        transition: all 0.2s ease;
    }
    
    #mobile-menu a:hover {
        background-color: #f3f4f6 !important;
        color: #2563eb !important;
    }
    
    /* Ensure mobile menu shows when not hidden */
    #mobile-menu:not(.hidden) {
        display: block !important;
    }
}

@media (min-width: 768px) {
    /* Ensure mobile menu is hidden on desktop */
    #mobile-menu {
        display: none !important;
    }
    
    /* Ensure mobile button is hidden on desktop */
    #mobile-menu-button {
        display: none !important;
    }
    
    /* Ensure desktop nav is visible */
    .hidden.md\:flex {
        display: flex !important;
    }
}