/* Reset et variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Google Sans', system-ui, -apple-system, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #ab186b;
    --secondary-color: #000000;
    --bg-color: #464240;
    --accent-color: #7d7d7d;
    --radius: 16px;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #ddd;
    --white: #fff;
}


body {
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-gray);
}

a {
  transition: color 0.3s ease, background-color 0.3s ease;
}

body.night {
    --primary-color: #ab186b;
    --secondary-color: #d8b4cc;
    --bg-color: #26081e;
    --accent-color: #d625eb;
    --radius: 16px;
    --text-color: #ebe2f0;
    --light-gray: #200b1d;
    --border-color: #55334e;
    --white: #fcf8fc;
}

body.night {
    background-color: var(--light-gray);
    color: var(--text-color);
}

body.night .header,
body.night .footer {
    background-color: #090712;
}

body.night .page-subheader {
    background: #0c1121;
    border-top-color: #3b1f44;
}

body.night .breadcrumb {
    color: #e4cde4;
}

body.night .breadcrumb span,
body.night .article-meta,
body.night .footer-bottom,
body.night .footer-column a,
body.night .article-item p,
body.night .category-card p,
body.night .category-card a.liste-articles,
body.night .category-card a.tous-articles,
body.night .footer-link,
body.night .articles-section p {
    color: #c7adc7;
}

body.night .breadcrumb a,
body.night .nav a,
body.night .user-actions a,
body.night .article-item-link {
    color: var(--primary-color);
}

body.night .subheader-search input,
body.night .article-item,
body.night .category-card,
body.night .article-content,
body.night .article-body {
    background-color: #121827;
}

body.night .subheader-search input {
    border-color: #334155;
    color: #e2e8f0;
}

body.night .category-card {
    border: 1px solid #1f2937;
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

body.night .article-toc,
body.night .related-article-card {
    background-color: #0e172b;
    border-color: #334155;
}

body.night .related-article-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

body.night .article-item {
    border-color: #334155;
}

body.night .btn-primary {
    background-color: #2563eb;
}

body.night .btn-primary:hover,
body.night .subheader-search button:hover {
    background-color: var(--primary-color);
}

body.night .footer-column a:hover,
body.night .footer-link:hover,
body.night .breadcrumb a:hover,
body.night .article-item-link:hover {
    text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
    body:not(.light-mode) {
        background-color: var(--light-gray);
        color: var(--text-color);
    }
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background-color: var(--bg-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.page-subheader {
    border-top: 1px solid var(--border-color);
    background: var(--light-gray);
}

.page-subheader .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 30px 0 15px 0;
}

.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #555;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--secondary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #777;
}

.subheader-search {
    display: flex;
    width: min(100%, 560px);
}

.subheader-search input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 1rem;
}

.subheader-search button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0 18px;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
}

.subheader-search button:hover {
    background-color: var(--secondary-color);
}

.hp .subheader-search {
    margin: auto;
}

.hp .subheader-search input {
    font-size: 1.2rem;
}




@media (max-width: 768px) {
    .page-subheader .container {
        flex-direction: column;
        align-items: stretch;
    }

    .subheader-search {
        width: 100%;
    }

    .subheader-search input {
        min-width: 0;
    }

    .subheader-search input,
    .subheader-search button {
        border-radius: 0;
        height: 48px;
    }

    .subheader-search input {
        border-radius: var(--radius) 0 0 var(--radius);
    }

    .subheader-search button {
        border-radius: 0 var(--radius) var(--radius) 0;
        margin-top: 0;
    }

    .search-section h1 {
        font-size: 2em;
    }
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1em;
    color: var(--white);
    text-decoration: none;
}

.logo span {
    color: var(--white);
}

.logo:before {
  content: "";
  background: url("https://static.altituderando.com/images/svg/chamois.svg") center center no-repeat;
  background-size: 75%;
  height: 50px;
  width: 50px;
  background-position-y: 10px;
  margin-right: 12px;
  display: inline-block;
}

.nav a {
    margin: 0 15px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
}

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

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-actions a {
    text-decoration: none;
    color: var(--text-color);
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 8px 15px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: color-mix(in srgb, var(--accent-color) 75%, black 25%);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.18);
}

.theme-toggle i {
    width: 18px;
    text-align: center;
}

/* Main */
.main {
    padding: 40px 0;
}

.search-section {
    text-align: center;
    margin-bottom: 50px;
}

.search-section h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}


/* Catégories */
.categories-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.category-card {
    background-color: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s;
}

/* Make category cards clickable links */
.category-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card i {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.category-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.category-card p {
    color: #666;
}

.category-card ul {
    text-align: left;
}

.category-card a.liste-articles {
    color: #666;
    text-decoration: none;
    padding: 4px;
    margin: 3px 0;
  display: block;
}

.category-card a:hover.liste-articles {
    color: var(--primary-color);
}

.category-card a.tous-articles {
    color: #666;
    text-align: left;
    display: block;
    margin: 22px;
}

.category-card a:hover.tous-articles {
    color: var(--primary-color);
}

/* Listes */
ul {
    padding-left: 1.4rem;
}

ul li {
    margin-left: 0.3rem;
}

.back-link,
.article-back-link {
    display: none;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    margin-bottom: 18px;
}

.back-link:hover,
.article-back-link:hover {
    text-decoration: underline;
}

/* Article list */
.articles-section h1 {
    margin-bottom: 6px;
}

.articles-section p {
    margin-bottom: 28px;
    color: #555;
}

.article-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.article-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 24px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid #e3e5e8;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.article-item:hover {
    transform: translateY(-2px);
    border-color: rgba(0,0,0,0.12);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.article-item h2 {
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.article-meta {
    margin-bottom: 12px;
    color: #777;
    font-size: 0.95rem;
}

/* Make entire article item clickable when used as an anchor */
.article-item {
    display: flex;
    color: inherit;
    text-decoration: none;
}

.article-item p {
    color: #666;
    line-height: 1.6;
    max-width: 720px;
}

.article-item-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
}

.article-item-link:hover {
    text-decoration: underline;
}



/*   Article / Texte   */   

.article-content .texte a {
    color: var(--secondary-color);  
}

.article-content .texte a:hover {
    color: var(--primary-color); 
    text-decoration: none;
}

.article-content .chapo p {
    font-size: 1.2em;
    margin: 20px 0 50px 0; 
}

.article-content .texte p {
    margin: 20px 0;
}

.article-content .texte img {
    display: block;
    margin: 40px auto;
    max-width: 100%;
    height: auto;
}

.article-content .texte h2.spip {
    margin-top: 50px;
    border-top: 1px solid #ccc;
    padding-top: 40px;
}

.article-content .texte h3 {
    border-left: 8px solid;
    padding-left: 10px;
}

.article-content .texte hr {
    margin: 50px 0;
  color: #ccc;
}

.article-content .article-author-avatar img {
    object-fit: cover;
    object-position: center;
    height: 70px;
    width: 70px;
    border-radius: 50%;
}

/*   Résultats de recherche   */  

.resultats.res_articles {
    margin: 0 0 50px 0;
}

.resultats.res_rubriques a,
.resultats.res_articles a {
    color: var(--secondary-color);
    padding: 5px;
    display: inline-block;
}

.resultats.res_rubriques a:hover,
.resultats.res_articles a:hover {
    text-decoration: none;
    color: var(--accent-color);
}


/* Footer */
.footer {
    background-color: var(--bg-color);
    color: var(--white);
    padding: 0px 0 20px;
    margin-top: 50px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-column a {
    display: block;
    color: #bdc3c7;
    text-decoration: none;
    margin-bottom: 10px;
}

.footer-column a:hover {
    color: var(--white);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    color: #bdc3c7;
    font-size: 0.9rem;
}

.footer-link {
    color: #bdc3c7;
    text-decoration: none;
    font-weight: 500;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .nav {
        margin: 15px 0;
    }

    .user-actions {
        width: 100%;
        justify-content: center;
    }

    .article-inner {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        display: none;
    }

    .article-list {
        grid-template-columns: 1fr;
    }

    .breadcrumb {
        display: none;
    }

    .back-link,
    .article-back-link {
        display: inline-flex;
    }

    .search-section h1 {
        font-size: 2em;
    }
}


@media (max-width: 320px) {
    .container {
        width: 100%;
        padding: 0 10px;
    }

    .article-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 20px;
    }

    .related-articles-grid {
        grid-template-columns: 1fr;
    }

    .article-hero {
        height: auto;
        min-height: 180px;
    }

    .article-body,
    .article-content {
        overflow-wrap: break-word;
    }
}

/* Article 2-Column Layout */
.article-content {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.article-inner {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
    align-items: start;
}

.article-sidebar {
    position: sticky;
    top: 100px;
}

.article-body {
    /* Content flows naturally */
}

.article-body h2 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-body h3 {
    margin-top: 25px;
    margin-bottom: 12px;
}

/* Article Table of Contents */
.article-toc {
    background-color: var(--white);
    border: 1px solid var(--border-color);

    padding: 18px 20px;
    border-radius: calc(var(--radius) - 4px);
}

.article-toc h3 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--secondary-color);
    font-weight: 600;
}

.article-toc ul {
    list-style: none;
    padding-left: 10px;
}

.article-toc li {
    margin-bottom: 8px;
    list-style-type: disc;
}

.article-toc a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* Related Articles Section */
.related-articles {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.related-articles h3 {
    margin-bottom: 20px;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.related-article-card {
    text-decoration: none;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--white);
    transition: box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.related-article-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.related-article-card h4 {
    color: var(--secondary-color);
    margin: 0;
}

.related-article-card p {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

.related-article-card span {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-top: auto;
}

/* Article Page Styles */
.article-back-link {
    margin-bottom: 15px;
    color: var(--primary-color);
    text-decoration: none;
}

.article-back-link:hover {
    text-decoration: underline;
}

.article-title {
    margin-bottom: 8px;
    font-size: 2.6em;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: #777;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.article-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3e3f0;
    color: #7a1f5a;
    text-decoration: none;
    border: 1px solid transparent;
    font-size: 0.85rem;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.article-tag:hover {
    background: #ebd0e5;
    color: #5d1148;
    border-color: #d7b0ce;
}

body.night .article-tag {
    background: rgba(255, 255, 255, 0.08);
    color: #f1d9f2;
    border-color: rgba(255, 255, 255, 0.16);
}

body.night .article-tag:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.article-hero {
    width: 100%;
    height: 300px;
    background: #e9ecef;
    border-radius: calc(var(--radius) - 4px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #999;
}

.article-feedback {
    margin-top: 20px;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--light-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
}

.article-feedback-question {
    font-weight: 600;
}

.article-feedback-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 360px;
}

.article-feedback-button,
.article-feedback-button-no {
    padding: 8px 12px;
    border-radius: var(--radius);
    flex: 1;
    width: 100%;
    max-width: 160px;
    background: rgba(0, 0, 0, 0.08);
    color: var(--secondary-color);
    border: 1px solid rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.article-feedback-button.btn-primary {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.4);
}

body.night .article-feedback-button,
body.night .article-feedback-button-no,
body.night .article-feedback-button.btn-primary {
    background: transparent;
    color: var(--secondary-color);
    border-color: var(--border-color);
}

.article-feedback-button:hover,
.article-feedback-button-no:hover,
.article-feedback-button.btn-primary:hover {
    background-color: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
}

body.night .article-feedback-button:hover,
body.night .article-feedback-button-no:hover,
body.night .article-feedback-buttons .btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.28);
}

.article-feedback-thanks {
    color: var(--primary-color);
    font-weight: 600;
}

.article-actions {
    margin-top: 25px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 80px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.article-author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
}

.article-author-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.article-author-name {
    margin: 0;
    color: var(--secondary-color);
    font-weight: 700;
}

.article-author-date {
    margin: 0;
    color: #777;
    font-size: 0.95rem;
}

.article-toc ul ul {
    padding-left: 20px;
    margin-top: 6px;
}

.article-toc ul ul li {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .article-inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .article-sidebar {
        position: relative;
        top: auto;
    }

    .article-toc {
        display: none;
    }

    .related-article-card span {
        display: none;
    }
}

@media (max-width: 768px) {
    .article-content {
        padding: 20px;
    }

    .article-toc {
        padding: 14px 16px;
    }

    .article-toc h3 {
        font-size: 0.9rem;
    }
}