/* Global Styles & Variables */
:root {
    --primary-green: #2C5F4F;
    --accent-red: #C8553D;
    --bg-cream: #F4E8D0;
    --text-gray: #6B7280;
    --bg-white: #FAF8F3;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    padding: 0;
    margin: 0;
}

body {
    background-color: var(--bg-white);
    background-image: 
        radial-gradient(rgba(44, 95, 79, 0.03) 2px, transparent 0),
        radial-gradient(rgba(200, 85, 61, 0.02) 2px, transparent 0);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
::-webkit-scrollbar-thumb {
    background: #ccc; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green); 
}

/* Typography Overrides */
h1, h2, .section-title {
    font-family: 'Noto Serif SC', serif;
}

.section-title {
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-red);
    opacity: 0.6;
    border-radius: 2px;
}

/* Glassmorphism Utilities */
.glass-bg {
    background: rgba(250, 248, 243, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background-color: var(--primary-green);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(44, 95, 79, 0.2);
}

.btn-primary:hover {
    background-color: #234c3f;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(44, 95, 79, 0.3);
}

.btn-secondary {
    display: inline-block;
    background-color: transparent;
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: rgba(44, 95, 79, 0.05);
}

/* Tabs */
.tab-btn {
    transition: all 0.2s ease;
}

.scrollbar-hide {
    -ms-overflow-style: none; /* IE/Edge */
    scrollbar-width: none; /* Firefox */
}
.scrollbar-hide::-webkit-scrollbar {
    display: none; /* Chromium/Safari */
}

.tab-btn:hover {
    color: var(--primary-green);
}

.tab-btn.active {
    background-color: white;
    color: var(--primary-green);
    border: 1px solid rgba(44, 95, 79, 0.25);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Minimal line clamp utility (Tailwind line-clamp plugin is not enabled). */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tailwind CDN does not reliably generate utilities used only in external JS templates. */
.min-w-0 {
    min-width: 0;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.whitespace-nowrap {
    white-space: nowrap;
}

.overflow-hidden {
    overflow: hidden;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.flex-1 {
    flex: 1 1 0%;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animated-fade-in-up {
    animation-name: fadeInUp;
    animation-duration: 1s;
    animation-fill-mode: both;
}

/* Meridian Card Hover Effects */
.meridian-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.05);
}

.meridian-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-green);
}

/* Seasons Section */
#seasons {
    position: relative;
    overflow: hidden;
}

#seasons::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../img/seasonal_bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.15; /* Make background very subtle */
    mix-blend-mode: multiply;
    z-index: 0;
}

#seasons .container {
    position: relative;
    z-index: 1;
}

/* Slideshow month chip bar */
#seasons-dots {
    scrollbar-width: none; /* Firefox */
}
#seasons-dots::-webkit-scrollbar {
    display: none; /* Chromium/Safari */
}

/* Mobile: show all 12 months as a 2-row grid (6 columns) */
@media (max-width: 767px) {
    #seasons-dots > button {
        width: 100%;
        text-align: center;
    }
}

/* Custom Tooltip */
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
    margin-bottom: 5px;
}

/* About page: mobile-friendly layout tweaks */
@media (max-width: 639px) {
    #about .about-papers > li {
        flex-direction: column;
        align-items: flex-start;
    }

    #about .about-papers > li > .min-w-0 {
        width: 100%;
    }

    #about .about-papers > li > a {
        align-self: flex-start;
    }

    #about .about-papers > li > .flex {
        align-self: flex-start;
        flex-wrap: wrap;
        max-width: 100%;
    }

    /* Replace 1-line truncate with 2-line clamp on small screens. */
    #about .about-papers .truncate {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    #about .about-links li {
        min-width: 0;
    }

    #about .about-links a {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}
