/* Base styles */
body {
    font-family: 'Inter', sans-serif;
}

/* Typography */
.prose {
    font-family: 'Merriweather', Georgia, serif;
}

.prose h1,
.prose h2,
.prose h3 {
    font-family: 'Inter', sans-serif;
}

.prose p {
    line-height: 1.9;
}

/* Images */
.prose img {
    border-radius: 0.5rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease;
}

.prose img:hover {
    transform: scale(1.01);
}

/* Line clamp for card titles */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f5f4;
}

::-webkit-scrollbar-thumb {
    background: #a8a29e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #78716c;
}

/* Article content styles */
.article-content h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1c1917;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1c1917;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1c1917;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
    line-height: 1.9;
}

.article-content a {
    color: #059669;
    text-decoration: underline;
    text-decoration-color: #6ee7b7;
}

.article-content a:hover {
    color: #047857;
}

.article-content img {
    border-radius: 0.5rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.article-content figure {
    margin: 2rem 0;
}

.article-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #a8a29e;
    margin-top: 0.75rem;
    font-style: italic;
}

/* Hero section overlay */
.hero-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.2), transparent);
}

/* Hero: image cropped by CSS (object-cover) to fill banner; object-center keeps focus on middle for portrait */
.hero-banner .hero-img {
    display: block;
}

/* Trail Summary Box - Styled like the original */
.trail-summary {
    margin-top: 3rem;
    padding: 1.75rem;
    background: linear-gradient(135deg, #fafaf9 0%, #f5f5f4 100%);
    border-radius: 1rem;
    border: 1px solid #e7e5e4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Visual connector line before trail summary */
.trail-summary::before {
    content: "";
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(to right, transparent, #d6d3d1, transparent);
}

.trail-summary-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1c1917;
    margin: 0 0 1.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #d6d3d1;
    font-family: 'Inter', sans-serif;
}

/* Style for h3 inside trail-summary */
.trail-summary h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1c1917;
    margin: 0 0 1.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #d6d3d1;
    font-family: 'Inter', sans-serif;
}

.trail-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.trail-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px dashed #d6d3d1;
    transition: background-color 0.2s ease;
    border-radius: 0.375rem;
}

.trail-summary-item:hover {
    background-color: rgba(255, 255, 255, 0.6);
}

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

@media (min-width: 640px) {
    .trail-summary-item {
        flex-direction: row;
        align-items: flex-start;
        gap: 1rem;
    }
}

.trail-summary-label {
    font-weight: 600;
    color: #44403c;
    min-width: 160px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Icon utilities for trail summary labels */
.trail-summary-icon::before {
    font-size: 1rem;
    display: inline-block;
    width: 1.25rem;
    text-align: center;
}

.icon-distance::before { content: "📏"; }
.icon-ascent::before { content: "📈"; }
.icon-time::before { content: "⏱️"; }
.icon-difficulty::before { content: "⚡"; }
.icon-tip::before { content: "💡"; }
.icon-gear::before { content: "🎒"; }
.icon-route::before { content: "🗺️"; }
.icon-elevation::before { content: "⛰️"; }

.trail-summary-value {
    color: #57534e;
    flex: 1;
    line-height: 1.6;
}

.trail-summary-value a {
    color: #059669;
    text-decoration: underline;
    text-decoration-color: #6ee7b7;
    font-weight: 500;
    transition: color 0.2s ease;
}

.trail-summary-value a:hover {
    color: #047857;
    text-decoration-color: #059669;
}

/* Enhanced stats display for trail summary */
.trail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #d6d3d1;
}

.trail-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: #44403c;
}

.trail-stat-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #059669;
}

/* Leaflet finish marker - remove default icon styling */
.leaflet-div-icon.finish-marker {
    background: transparent !important;
    border: none !important;
}

/* Hike history graph (GitHub-like) */
.hike-history-year {
    background: #fafaf9;
    border: 1px solid #e7e5e4;
    border-radius: 0.75rem;
    padding: 1rem;
}

.hike-history-grid-wrap {
    width: fit-content;
    max-width: 100%;
}

.hike-history-year-picker {
    display: inline-flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #57534e;
    font-weight: 600;
}

.hike-history-select {
    border: 1px solid #d6d3d1;
    border-radius: 0.5rem;
    background: #ffffff;
    color: #1c1917;
    font-size: 0.875rem;
    padding: 0.5rem 0.65rem;
    min-width: 6.5rem;
}

.hike-history-select:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.hike-history-year-panel {
    background: #fafaf9;
    border: 1px solid #e7e5e4;
    border-radius: 0.75rem;
    padding: 1rem;
}

.hike-history-months-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.9rem;
}

.hike-history-month {
    background: #ffffff;
    border: 1px solid #e7e5e4;
    border-radius: 0.6rem;
    padding: 0.65rem;
}

.hike-history-month-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.hike-history-month-head h4 {
    margin: 0;
    font-size: 0.8rem;
    color: #1c1917;
    font-weight: 700;
}

.hike-history-month-head span {
    font-size: 0.7rem;
    color: #78716c;
}

.hike-history-weekdays-head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin-bottom: 0.3rem;
    font-size: 0.625rem;
    color: #78716c;
    line-height: 1;
    text-align: center;
}

.hike-history-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.15rem;
}

.hike-history-cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.48rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.hike-history-cell-link {
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.hike-history-cell-link:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.2);
}

.hike-history-cell-empty {
    background: #d6d3d1;
}

.hike-history-cell-active {
    background: #059669;
    color: #ffffff;
}

.hike-history-cell-outside {
    background: #f5f5f4;
}

@media (min-width: 768px) {
    .hike-history-months-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
