/* ========================================
   ARTICLES SYSTEM STYLES
   ========================================
   Comprehensive styles for:
   - Articles index page (/saveti)
   - Article show page (/clanak/{slug})

   Based on style guide patterns from app.css
   Mobile-first responsive design
   ======================================== */

/* ========================================
   ARTICLES INDEX PAGE
   ======================================== */

/* Intro Section */
.articles-intro-section {
    padding: 3rem 0;
    background: var(--bg-light);
}

.articles-intro-section .seo-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.articles-intro-section .seo-content p:last-child {
    margin-bottom: 0;
}

.articles-intro-section .seo-content strong {
    color: var(--primary);
    font-weight: 600;
}

/* Articles Grid Section */
.articles-grid-section {
    padding: 3rem 0;
}

.section-title-center {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.section-title-center i {
    color: var(--secondary);
    font-size: 1.5rem;
}

/* Articles Grid Layout */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Article Card */
.article-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.article-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-card-category {
    padding: 0.5rem 1.25rem 0.75rem;
    border-top: 1px solid var(--border-light, #f0f0f0);
}

.article-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-category-badge:hover {
    color: var(--primary);
}

/* Article Card Image */
.article-card-image {
    position: relative;
    padding-top: 60%; /* 5:3 aspect ratio */
    overflow: hidden;
    background: var(--bg-light);
}

.article-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.article-card-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
}

.article-card-image-placeholder i {
    font-size: 3rem;
    opacity: 0.7;
}

/* Article Card Content */
.article-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-card:hover .article-card-title {
    color: var(--secondary);
}

.article-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* Article Card Meta */
.article-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.article-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.article-card-meta i {
    color: var(--accent);
    font-size: 0.9rem;
}

/* Article Card Action */
.article-card-action {
    margin-top: auto;
}

.article-card-action .btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.article-card:hover .article-card-action .btn-link {
    gap: 0.75rem;
    color: var(--primary);
}

.article-card-action .btn-link i {
    transition: transform 0.3s ease;
}

.article-card:hover .article-card-action .btn-link i {
    transform: translateX(4px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-light);
    border-radius: 12px;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* CTA Section */
.articles-cta-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
}

.articles-cta-section .cta-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.articles-cta-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--white);
}

.articles-cta-section p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.95);
}

.articles-cta-section .cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.articles-cta-section .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========================================
   ARTICLE SHOW PAGE
   ======================================== */

/* Article Content Section */
.article-content-section {
    padding: 3rem 0;
}

/* Content Grid with Sidebar */
.content-grid-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

/* Main Article Content */
.article-main-content {
    min-width: 0; /* Prevent overflow */
}

/* Article Body */
.article-body {
    padding: 2.5rem;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.article-body h2:first-child {
    margin-top: 0;
}

.article-body h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-body h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-body p {
    margin-bottom: 1.25rem;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body a {
    color: var(--secondary);
    text-decoration: underline;
}

.article-body a:hover {
    color: var(--primary);
}

.article-body strong {
    font-weight: 600;
    color: var(--text-primary);
}

.article-body blockquote {
    padding: 1.5rem;
    border-left: 4px solid var(--accent);
    background: var(--bg-light);
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.article-body code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent);
}

.article-body pre {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
}

.article-body pre code {
    background: none;
    padding: 0;
}

/* Article Gallery */
.article-gallery {
    padding: 2rem;
    margin-top: 2rem;
}

.article-gallery .section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.gallery-item {
    position: relative;
    padding-top: 100%; /* 1:1 aspect ratio */
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: var(--bg-light);
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 58, 95, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    font-size: 2rem;
    color: var(--white);
}

/* Social Sharing */
.article-share {
    padding: 2rem;
    margin-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.article-share h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.share-facebook {
    background: #1877F2;
    color: var(--white);
}

.share-facebook:hover {
    background: #166FE5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.share-twitter {
    background: #1DA1F2;
    color: var(--white);
}

.share-twitter:hover {
    background: #1A94DA;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

.share-linkedin {
    background: #0A66C2;
    color: var(--white);
}

.share-linkedin:hover {
    background: #095196;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 102, 194, 0.3);
}

.share-whatsapp {
    background: #25D366;
    color: var(--white);
}

.share-whatsapp:hover {
    background: #20BA5A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* ========================================
   SIDEBAR
   ======================================== */

.article-sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-card:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-title i {
    color: var(--secondary);
}

/* Related Articles */
.related-articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-article-item {
    display: flex;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.related-article-item:hover {
    background: var(--bg-light);
    transform: translateX(4px);
}

.related-article-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-light);
}

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

.related-article-content {
    flex-grow: 1;
    min-width: 0;
}

.related-article-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.related-article-item:hover .related-article-content h4 {
    color: var(--secondary);
}

.related-article-date {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Sidebar CTA Boxes */
.sidebar-cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
}

.sidebar-cta .sidebar-title {
    color: var(--white);
}

.sidebar-cta .sidebar-title i {
    color: var(--accent);
}

.sidebar-cta p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.sidebar-cta-secondary {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
}

.sidebar-cta-secondary p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* ========================================
   RELATED ARTICLES MOBILE SECTION
   ======================================== */

.related-articles-mobile-section {
    display: none; /* Hidden by default, shown only on mobile */
    padding: 3rem 0;
    background: var(--bg-light);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Desktop (1200px+) - Default styles above */

/* Tablet (768px - 1199px) */
@media (max-width: 1199px) {
    /* Articles Grid */
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Content Grid - Stack sidebar */
    .content-grid-sidebar {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .sidebar-card {
        margin-bottom: 0;
    }
}

/* Mobile Large (481px - 767px) */
@media (max-width: 767px) {
    /* Articles Grid - Single column */
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Section Titles */
    .section-title-center {
        font-size: 1.5rem;
    }

    /* Article Body */
    .article-body {
        padding: 1.5rem;
        font-size: 1rem;
    }

    .article-body h2 {
        font-size: 1.5rem;
    }

    .article-body h3 {
        font-size: 1.25rem;
    }

    /* Gallery Grid */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Social Sharing */
    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        justify-content: center;
    }

    /* Sidebar */
    .article-sidebar {
        grid-template-columns: 1fr;
    }

    /* Show related articles mobile section, hide sidebar version */
    .related-articles-mobile-section {
        display: block;
    }

    .article-sidebar .related-articles-list {
        display: none;
    }

    /* CTA Section */
    .articles-cta-section h2 {
        font-size: 1.5rem;
    }

    .articles-cta-section p {
        font-size: 1rem;
    }

    .articles-cta-section .cta-actions {
        flex-direction: column;
    }

    .articles-cta-section .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile Small (up to 480px) */
@media (max-width: 480px) {
    /* Sections */
    .articles-intro-section {
        padding: 2rem 0;
    }

    .articles-grid-section {
        padding: 2rem 0;
    }

    .article-content-section {
        padding: 2rem 0;
    }

    /* Section Titles */
    .section-title-center {
        font-size: 1.25rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Article Card */
    .article-card-content {
        padding: 1.25rem;
    }

    .article-card-title {
        font-size: 1.05rem;
    }

    .article-card-excerpt {
        font-size: 0.85rem;
    }

    .article-card-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Article Body */
    .article-body {
        padding: 1.25rem;
        font-size: 0.95rem;
    }

    .article-body h2 {
        font-size: 1.3rem;
        margin-top: 2rem;
    }

    .article-body h3 {
        font-size: 1.15rem;
    }

    .article-body h4 {
        font-size: 1.05rem;
    }

    /* Gallery */
    .article-gallery {
        padding: 1.5rem;
    }

    .gallery-grid {
        gap: 0.75rem;
    }

    /* Social Sharing */
    .article-share {
        padding: 1.5rem;
    }

    .share-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    /* Sidebar */
    .sidebar-card {
        padding: 1.25rem;
    }

    .sidebar-title {
        font-size: 1rem;
    }

    /* Related Articles */
    .related-article-item {
        flex-direction: column;
    }

    .related-article-image {
        width: 100%;
        height: 160px;
    }

    /* CTA Section */
    .articles-cta-section {
        padding: 3rem 0;
    }

    .articles-cta-section h2 {
        font-size: 1.35rem;
    }

    .articles-cta-section p {
        font-size: 0.95rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .breadcrumb-section,
    .article-sidebar,
    .article-share,
    .articles-cta-section,
    .related-articles-mobile-section {
        display: none;
    }

    .article-body {
        padding: 0;
    }

    .article-body h2,
    .article-body h3,
    .article-body h4 {
        page-break-after: avoid;
    }

    .article-body img {
        max-width: 100%;
        page-break-inside: avoid;
    }
}
