/* ========================================
   Arthrose Prévention - Design System
   Palette: Teal médical + accents orange
   ======================================== */

:root {
    --primary: #1ba296;
    --primary-dark: #158a7e;
    --primary-light: #e8f6f4;
    --accent: #e67e22;
    --accent-dark: #d35400;
    --text: #2c3e50;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border: #e9ecef;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 5px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    line-height: 1.7;
    background-color: var(--bg-light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

/* Navbar */
.navbar {
    padding: 0;
    transition: var(--transition);
}

.logo-main {
    max-height: 70px;
    width: auto;
    height: auto;
}

.nav-menu-bar {
    border-top: 2px solid var(--primary);
    padding: 0;
}

.nav-menu-bar .navbar-nav {
    gap: 0;
}

.nav-menu-bar .nav-link {
    padding: 0.6rem 0.7rem !important;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.nav-menu-bar .nav-link:hover,
.nav-menu-bar .nav-link.active {
    border-bottom-color: var(--primary);
    background-color: var(--primary-light);
}

.brand-text {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary);
}

.navbar .nav-link {
    font-weight: 500;
    color: var(--text);
    padding: 0.5rem 0.45rem;
    font-size: 0.82rem;
    transition: var(--transition);
    white-space: nowrap;
}

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

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

/* Search autocomplete */
.nav-search-form {
    min-width: 220px;
}

.nav-search-form .form-control {
    border-radius: 20px 0 0 20px;
    border-color: var(--border);
    font-size: 0.85rem;
}

.nav-search-form .btn-primary {
    border-radius: 0 20px 20px 0;
    background-color: var(--primary);
    border-color: var(--primary);
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1050;
    max-height: 400px;
    overflow-y: auto;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: var(--primary-light);
}

.autocomplete-item img {
    width: 40px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}

.autocomplete-item .title {
    font-weight: 600;
    font-size: 0.85rem;
}

.autocomplete-item .excerpt {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, #0d7a6f 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background: var(--hero-bg, none) center/cover no-repeat;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 33%);
    mask-image: linear-gradient(to right, transparent 0%, black 33%);
}

.hero-section h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-section p {
    color: rgba(255,255,255,0.9);
    font-size: 1.15rem;
    max-width: 600px;
}

.hero-search {
    max-width: 500px;
    margin-top: 1.5rem;
}

.hero-search .form-control {
    border-radius: 25px 0 0 25px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 0.75rem 1.2rem;
    font-size: 1rem;
}

.hero-search .form-control::placeholder {
    color: rgba(255,255,255,0.7);
}

.hero-search .form-control:focus {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    box-shadow: none;
    color: white;
}

.hero-search .btn {
    border-radius: 0 25px 25px 0;
    background: var(--accent);
    border-color: var(--accent);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

.hero-search .btn:hover {
    background: var(--accent-dark);
}

.hero-stats {
    margin-top: 2rem;
    display: flex;
    gap: 2rem;
}

.hero-stat {
    text-align: center;
    color: white;
}

.hero-stat .number {
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
    line-height: 1;
}

.hero-stat .label {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.article-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.article-card .card-body {
    padding: 1.25rem;
}

.article-card .card-title {
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
    font-family: 'Merriweather', serif;
    line-height: 1.4;
}

.article-card .card-title a {
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

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

.article-card .card-text {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.6;
}

.article-card .card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-light);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* Category cards */
.category-card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
    display: block;
    overflow: hidden;
}

.category-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    color: var(--text);
}

.category-card img {
    height: 160px;
    width: 100%;
    object-fit: cover;
}

.category-card .card-body {
    padding: 1.2rem;
}

.category-card h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: var(--primary-dark);
}

.category-card p {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 0;
}

.category-card .article-count {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Section headings */
.section-heading {
    position: relative;
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.section-heading.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Badges */
.badge-primary {
    background-color: var(--primary);
    color: white;
    font-weight: 500;
    padding: 0.35em 0.75em;
    border-radius: 20px;
    font-size: 0.78rem;
}

.badge-accent {
    background-color: var(--accent);
    color: white;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-accent:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
    color: white;
}

/* Article page */
.article-header {
    padding: 2.5rem 0 1.5rem;
}

.article-header .breadcrumb {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.article-header .breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.article-header h1 {
    font-size: 2rem;
    line-height: 1.35;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    align-items: center;
    color: var(--text-light);
    font-size: 0.88rem;
}

.article-meta i {
    color: var(--primary);
    margin-right: 0.3rem;
}

.article-featured-img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

/* Article content */
.article-content {
    background: white;
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    font-size: 1.02rem;
}

.article-content h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
    color: var(--primary-dark);
}

.article-content h3 {
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.article-content p {
    margin-bottom: 1.2rem;
}

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

.article-content li {
    margin-bottom: 0.4rem;
}

.article-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

.article-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--primary-light);
    padding: 1.2rem 1.5rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 1.5rem 0;
    font-style: italic;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.article-content table th {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
}

.article-content table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
}

.article-content table tr:nth-child(even) {
    background: var(--bg-light);
}

/* TOC Box */
.toc-box {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.toc-box .toc-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toc-box .toc-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: white;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.toc-box .toc-header .badge {
    background: rgba(255,255,255,0.2);
    font-size: 0.72rem;
    padding: 0.25em 0.6em;
}

.toc-box .toc-body {
    padding: 1rem 1.25rem;
}

.toc-box .toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.toc-box .toc-list li {
    counter-increment: toc-counter;
}

.toc-box .toc-list li a {
    display: flex;
    align-items: flex-start;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.3;
    transition: var(--transition);
}

.toc-box .toc-list li a::before {
    content: counter(toc-counter);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.toc-box .toc-list li a:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

@media (max-width: 768px) {
    .toc-box .toc-list {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.sidebar-widget {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-widget h4 {
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.sidebar-article {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.sidebar-article:last-child {
    border-bottom: none;
}

.sidebar-article img {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar-article .title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    transition: var(--transition);
}

.sidebar-article:hover .title {
    color: var(--primary);
}

/* FAQ Section */
.faq-section {
    background: var(--primary-light);
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 2rem;
}

.faq-section h2 {
    border-bottom: none;
    color: var(--primary-dark);
}

.faq-item {
    background: white;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.faq-question {
    padding: 1rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--bg-light);
}

.faq-question::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
    color: var(--primary);
    transition: var(--transition);
}

.faq-item.active .faq-question::after {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 1.25rem 1rem;
}

/* Related articles */
.related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

/* Category page */
.category-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 3rem 0;
    color: white;
}

.category-header .breadcrumb a {
    color: white;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.category-header .breadcrumb a:hover {
    color: rgba(255,255,255,0.8);
}

.category-header .breadcrumb,
.category-header .breadcrumb-item,
.category-header .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.8);
}

.category-header h1 {
    color: white;
    font-size: 2rem;
}

.category-header p,
.category-description {
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 800px;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary);
    border-radius: var(--radius-sm);
    margin: 0 0.15rem;
    border: none;
    font-weight: 500;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Footer */
.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 991px) {
    .hero-section {
        padding: 3rem 0;
    }
    .hero-section h1 {
        font-size: 1.8rem;
    }
    .hero-stats {
        gap: 1.5rem;
    }
    .article-content {
        padding: 1.5rem;
    }
}

@media (max-width: 767px) {
    .hero-section h1 {
        font-size: 1.5rem;
    }
    .hero-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }
    .article-header h1 {
        font-size: 1.5rem;
    }
    .article-content {
        padding: 1.2rem;
    }
    .article-content h2 {
        font-size: 1.3rem;
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* Contact form */
.contact-form {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
}

.contact-form .form-control {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    padding: 0.65rem 1rem;
}

.contact-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(27, 162, 150, 0.15);
}

/* Glossary */
.glossary-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    transition: var(--transition);
}

.glossary-letter:hover {
    background: var(--primary-dark);
    color: white;
    transform: scale(1.1);
}

.glossary-term {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.glossary-term dt {
    color: var(--primary-dark);
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.glossary-term dd {
    margin-bottom: 0;
    color: var(--text-light);
    font-size: 0.92rem;
}

/* Share buttons */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.share-btn:hover {
    transform: translateY(-2px);
    color: white;
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.linkedin { background: #0a66c2; }
.share-btn.whatsapp { background: #25d366; }

/* Author Box */
.author-box {
    margin: 2.5rem 0;
    padding: 0;
}
.author-box-inner {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: linear-gradient(135deg, #f8fffe 0%, #f0faf9 100%);
    border: 1px solid rgba(27, 162, 150, 0.15);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(27, 162, 150, 0.08);
}
.author-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    flex-shrink: 0;
}
.author-info {
    flex: 1;
}
.author-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.author-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--heading);
    margin: 0 0 0.75rem 0;
    padding: 0;
    border: none;
}
.author-bio {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #555;
    margin: 0;
}
@media (max-width: 576px) {
    .author-box-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .author-avatar {
        width: 90px;
        height: 90px;
    }
}

/* Search page */
.search-result {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.search-result:hover {
    box-shadow: var(--shadow-lg);
}

.search-result h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.search-result h3 a {
    color: var(--text);
    text-decoration: none;
}

.search-result h3 a:hover {
    color: var(--primary);
}

.search-result .excerpt {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Admin styles */
.admin-sidebar {
    background: var(--text);
    min-height: 100vh;
    padding: 1.5rem 0;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

/* Print styles */
@media print {
    .navbar, footer, .sidebar-widget, .share-buttons, .related-articles, .toc-box {
        display: none !important;
    }
    .article-content {
        box-shadow: none;
        padding: 0;
    }
}
