/* ==========================================================================
   Horizon Rando — Main Stylesheet
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    background: #fff;
}

a { color: #05668d; text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.3; }

/* --- Header --- */
.hr-header {
    background: linear-gradient(135deg, #05668d 0%, #028090 50%, #69A3BA 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.hr-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.hr-logo {
    color: #fff;
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.hr-main-menu ul {
    list-style: none;
    display: flex;
    gap: 4px;
}

.hr-main-menu a {
    color: rgba(255,255,255,0.85);
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.95em;
    transition: background 0.2s;
}

.hr-main-menu a:hover,
.hr-main-menu a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    text-decoration: none;
}

.hr-mobile-menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hr-mobile-menu-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; }
.hr-mobile-menu-overlay { display: none; }

@media (max-width: 768px) {
    .hr-main-menu { display: none; }
    .hr-mobile-menu-toggle { display: block; }
}

/* --- Footer --- */
.hr-footer {
    background: #05668d;
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    margin-top: 40px;
}

/* --- Hero (homepage) --- */
.hero {
    background: linear-gradient(135deg, #05668d 0%, #028090 50%, #69A3BA 100%);
    color: #fff;
    text-align: center;
    padding: 60px 20px 50px;
}

.hero h1 { font-size: 2.8em; margin-bottom: 10px; }
.hero p { font-size: 1.2em; opacity: 0.9; max-width: 600px; margin: 0 auto; }

@media (max-width: 600px) { .hero h1 { font-size: 2em; } .hero { padding: 40px 15px 35px; } }

/* --- Countries grid --- */
.countries-section { max-width: 1100px; margin: 50px auto; padding: 0 20px; }
.countries-section h2 { text-align: center; font-size: 1.8em; color: #05668d; margin-bottom: 35px; }

.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
}

.country-card {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: box-shadow 0.3s, transform 0.3s;
    display: block;
    color: inherit;
}

.country-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.12); transform: translateY(-4px); text-decoration: none; }
.country-emoji { font-size: 2.5em; display: block; margin-bottom: 12px; }
.country-card h3 { font-size: 1.3em; color: #05668d; margin-bottom: 6px; }
.country-count { font-size: 0.95em; color: #666; }

/* --- Stats --- */
.stats-section { background: #f9fafb; padding: 40px 20px; text-align: center; }
.stats-grid { display: flex; justify-content: center; gap: 50px; flex-wrap: wrap; max-width: 800px; margin: 0 auto; }
.stat-number { font-size: 2.2em; font-weight: 700; color: #05668d; display: block; }
.stat-label { font-size: 0.95em; color: #666; }

/* --- Discover section --- */
.discover-section { max-width: 1200px; margin: 40px auto; padding: 0 20px; }
.discover-section h2 { color: #05668d; margin-bottom: 20px; }

/* --- Breadcrumb --- */
.breadcrumb-container { max-width: 1200px; margin: 15px auto; padding: 0 20px; font-size: 0.9em; }
.breadcrumb-link { color: #05668d; }
.breadcrumb-separator { color: #999; margin: 0 6px; }
.breadcrumb-current { color: #666; }

/* --- Fiche Grid (hike page) --- */
.fiche-grid { max-width: 1200px; margin: 0 auto; padding: 0 20px 40px; }

.fiche-grid__colonnes {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .fiche-grid__colonnes { grid-template-columns: 1fr; }
}

.fiche-grid__photo img { width: 100%; border-radius: 8px; }
.fiche-grid__titre h1 { font-size: 1.8em; color: #05668d; margin: 15px 0 10px; }

.fiche-grid__description { margin-bottom: 20px; }
.fiche-grid__description p { margin-bottom: 0.8em; }

.fiche-grid__remarques,
.fiche-grid__difficultes,
.fiche-grid__points-forts { margin-bottom: 20px; }

/* --- Hike parameters --- */
.informations-rando { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 0.95em;
}

.info-item-even { background: #f9f9f9; }
.info-icon { font-size: 1.2em; flex-shrink: 0; width: 24px; text-align: center; }
.param-label { color: #666; }
.param-value { font-weight: 500; }

/* --- Buttons --- */
.fiche-grid__boutons { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    font-size: 0.95em;
    transition: background 0.2s;
    flex: 1;
}

.btn--gpx { background: #05668d; color: #fff; }
.btn--gpx:hover { background: #044f6d; color: #fff; text-decoration: none; }
.btn--nav { background: #4CAF50; color: #fff; }
.btn--nav:hover { background: #388E3C; color: #fff; text-decoration: none; }

/* --- Rating --- */
.rando-rating { padding: 12px; text-align: center; font-size: 1.1em; }
.rando-rating-stars { color: #FF9800; font-size: 1.3em; margin-right: 8px; }

/* --- Map + elevation --- */
.fiche-grid__carte { margin-top: 30px; }
.fiche-grid__carte h2 { color: #05668d; margin-bottom: 15px; }

.hr-carte-rando { width: 100%; height: 450px; border-radius: 8px; border: 1px solid #ddd; }
.hr-elev { width: 100%; height: 200px; margin-top: 10px; }

/* --- Hike cards --- */
.randos-wrapper { display: flex; flex-wrap: wrap; gap: 25px; padding: 0; }

.rando-module {
    display: block;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: box-shadow 0.3s, transform 0.3s;
    flex: 1 1 calc((100% - 75px) / 3);
    min-width: 200px;
    max-width: 380px;
}

.rando-module:hover { box-shadow: 0 8px 16px rgba(0,0,0,0.15); transform: translateY(-3px); text-decoration: none; }

.rando-module-container { display: flex; flex-direction: column; align-items: center; }
.rando-module-image { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; }
.rando-module-image--placeholder { background: linear-gradient(135deg, #e0e0e0, #f5f5f5); }

.rando-module-titre {
    font-size: 1.2em;
    margin: 12px 10px 0;
    color: #05668d;
    text-align: center;
    line-height: 1.3;
}

.rando-module-details {
    list-style: none;
    padding: 8px 14px 14px;
    font-size: 0.9em;
    width: 100%;
}

.rando-module-details li { margin-bottom: 3px; }
.rando-module-details strong { color: #555; }

@media (max-width: 768px) {
    .rando-module { flex-basis: calc(50% - 15px); min-width: 140px; }
    .randos-wrapper { gap: 10px; }
}

/* --- Country page --- */
.country-page { max-width: 1200px; margin: 0 auto; padding: 20px; }
.country-page h1 { color: #05668d; margin-bottom: 5px; }
.country-stats { color: #666; margin-bottom: 20px; }

.sort-controls { margin-bottom: 20px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sort-controls span { color: #666; font-size: 0.9em; }
.sort-controls a {
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 0.85em;
    color: #555;
}
.sort-controls a.active,
.sort-controls a:hover { background: #05668d; color: #fff; border-color: #05668d; text-decoration: none; }

/* --- Hike table --- */
.hike-table { width: 100%; border-collapse: collapse; margin-bottom: 30px; font-size: 0.9em; }
.hike-table th { background: #f5f5f5; padding: 10px; text-align: left; border-bottom: 2px solid #ddd; font-size: 0.85em; color: #555; }
.hike-table td { padding: 8px 10px; border-bottom: 1px solid #eee; }
.hike-table tr:hover { background: #f9f9f9; }
.hike-table a { font-weight: 500; }

.badge-diff {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    color: #fff;
    font-size: 0.85em;
    font-weight: 500;
}

@media (max-width: 768px) {
    .hike-table { font-size: 0.8em; }
    .hike-table th:nth-child(n+5),
    .hike-table td:nth-child(n+5) { display: none; }
}

/* --- Section titles --- */
.titre-rando-h2 { font-size: 1.4em; color: #05668d; margin: 30px 0 15px; }
.titre-rando-h3 { font-size: 1.2em; color: #05668d; margin: 15px 0 10px; }

/* --- Fiche content blocks --- */
.conteneur-remarques_v2,
.conteneur-points-forts,
.div-section-difficultes {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.liste-fiche-rando { padding-left: 1.5em; }
.liste-fiche-rando li { margin-bottom: 0.4em; line-height: 1.5; }

.fiche-section-basse { margin-top: 30px; }
