/**
 * APAP - Custom Styles
 * Stili personalizzati per il sito pubblico
 */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f6ad55;
    --text-dark: #2d3748;
    --text-muted: #718096;
    --bg-light: #f7fafc;
    --border-color: #e2e8f0;
}

/* General */
body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: #fcfcfc;
}

/* Top Bar */
.bg-dark .container a {
    transition: opacity 0.3s ease;
}

.bg-dark .container a:hover {
    opacity: 0.8;
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-light .navbar-nav .nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: var(--primary-color);
}

.navbar-light .navbar-nav .nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,101.3C1248,85,1344,75,1392,69.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

/* Breadcrumb */
.breadcrumb-section {
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    font-size: 1.2rem;
}

/* Page Sections */
.page-section {
    padding: 3rem 0;
}

.page-section.section-hero {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.page-section.section-content {
    padding: 4rem 0;
}

/* Article Cards - Advanced Styles */
.article-card,
.card-preview {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    overflow: hidden;
    min-height: 280px;
    max-height: 450px;
    height: auto;
    display: flex;
    flex-direction: column;
}

.article-card:hover,
.card-preview:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3) !important;
}

.article-image,
.card-preview .card-image {
    height: 40%;
    min-height: 120px;
    max-height: 220px;
    overflow: hidden;
    background: #f5f5f5;
}

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

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

.card-preview .card-body {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-preview .card-content {
    flex: 1;
    overflow: hidden;
}

.article-card .card-title,
.card-preview h4 {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.article-card .card-text,
.card-preview .strillo {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card-preview h6 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #666;
}

.card-preview .card-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #eee;
    text-align: right;
    margin-top: auto;
    background: transparent;
}

/* Badge Autore */
.badge-autore,
.SZ4 h3 {
    font-style: italic;
    font-size: 12px;
    font-weight: 600;
    color: #393939;
    line-height: 1.5;
    border: 1px solid #ff000024;
    background-color: #ffd70024;
    border-radius: 8px;
    width: fit-content;
    padding: 5px;
    margin-bottom: 0.5rem;
    display: inline-block;
}

/* Widgets */
.page-widget {
    margin-bottom: 2rem;
}

.widget-slider,
.widget-gallery,
.widget-banner {
    border-radius: 12px;
    overflow: hidden;
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Footer */
.footer {
    background: #1a202c;
    color: #a0aec0;
}

.footer h5 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
}

.footer-menu li {
    margin-bottom: 0.5rem;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* Error 404 */
.error-404 {
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.error-404 .display-1 {
    font-size: 8rem;
    font-weight: 800;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .article-image {
        height: 180px;
    }
    
    .error-404 .display-1 {
        font-size: 5rem;
    }
}

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

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

/* Utilities */
.bg-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-soft {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
