/* Main styles for Narrative.ovh */
:root {
    --primary-color: #1a365d;
    --secondary-color: #2b77ad;
    --accent-color: #ff6b35;
    --dark-text: #1a202c;
    --light-text: #f7fafc;
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-background: #ffffff;
    --border-color: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.15);
    --hover-shadow: rgba(0, 0, 0, 0.25);
    --gradient-overlay: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

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

body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.7;
    color: var(--dark-text);
    background: var(--background);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-overlay);
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', serif;
    font-weight: 600;
    margin-bottom: 1.2rem;
    line-height: 1.3;
    color: var(--primary-color);
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

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

a:not(.btn-back):not(.logo a):not(nav a):not(.read-more):not(.story-card h2 a)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

a:not(.btn-back):not(.logo a):not(nav a):not(.read-more):not(.story-card h2 a):hover::after {
    width: 100%;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a5298 100%);
    color: var(--light-text);
    padding: 1.2rem 0;
    box-shadow: 0 4px 20px var(--shadow);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 100; /* Ensure header is above other content */
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    z-index: -1;
}

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

.logo a {
    color: var(--light-text);
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    font-family: 'Lora', serif;
    background: linear-gradient(45deg, #fff, #e0e6ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.logo a:hover {
    text-decoration: none;
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

nav ul {
    display: flex;
    list-style: none;
    align-items: center;
}

nav li {
    margin-left: 2rem;
    position: relative;
}

nav a {
    color: var(--light-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    position: relative;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transform: translateY(-2px);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropbtn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 101; /* Must be higher than dropdown-content */
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 0.5rem;
}

.dropdown-content a {
    color: var(--dark-text);
    padding: 1rem 1.5rem;
    text-decoration: none;
    display: block;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 0;
}

.dropdown-content a:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    transform: translateX(5px);
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */
main {
    padding: 3rem 0;
    min-height: 70vh;
    position: relative;
    z-index: 10; /* Lower than header but higher than background elements */
}

.stories-container {
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.stories-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.stories-container h1 {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.stories-container h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

.stories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
}

.story-card {
    background-color: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 2rem;
    border: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    flex-direction: column;
    position: relative;
}

.story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.story-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow);
}

.story-card:hover::before {
    transform: scaleX(1);
}

.story-card h2 {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease;
}

.story-card h2 a {
    color: var(--primary-color);
    text-decoration: none;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.story-meta {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.story-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.story-excerpt {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.7;
    color: #4a5568;
}

.story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.7rem;
}

.tag {
    background: rgba(231, 242, 255, 0.8);
    color: var(--secondary-color);
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid rgba(49, 130, 206, 0.2);
    cursor: pointer;
}

.tag:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(49, 130, 206, 0.3);
}

.read-more {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary-color), #2c5282);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    align-self: flex-start;
    box-shadow: 0 4px 10px rgba(49, 130, 206, 0.2);
    border: none;
    position: relative;
    overflow: hidden;
}

.read-more::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    transition: all 0.5s ease;
}

.read-more:hover {
    background: linear-gradient(135deg, #2c5282, var(--primary-color));
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(49, 130, 206, 0.3);
    text-decoration: none;
    color: white;
}

.read-more:hover::before {
    left: 100%;
}

/* Story Page */
.story {
    background-color: var(--card-background);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    backdrop-filter: blur(10px);
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.story::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.story-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.story-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.story-header .story-meta {
    display: flex;
    gap: 2rem;
    font-size: 1rem;
    color: #718096;
}

.story-header .story-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.story-content {
    font-size: 1.1rem;
    line-height: 1.9;
    margin-bottom: 2rem;
    font-family: 'Lora', serif;
    color: #2d3748;
}

.story-content p {
    margin-bottom: 1.8rem;
}

.story-navigation {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.btn-back {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(49, 130, 206, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    transition: all 0.5s ease;
}

.btn-back:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(49, 130, 206, 0.3);
    text-decoration: none;
    color: white;
}

.btn-back:hover::before {
    left: 100%;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a5298 100%);
    color: var(--light-text);
    padding: 2.5rem 0;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

footer .container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

footer p {
    margin-bottom: 0;
    font-size: 1rem;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 992px) {
    .stories-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .story {
        padding: 2rem;
    }
    
    .story-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .stories-list {
        grid-template-columns: 1fr;
    }
    
    .story-header h1 {
        font-size: 1.8rem;
    }
    
    .story-content {
        font-size: 1rem;
    }
    
    .container {
        padding: 0 1.2rem;
    }
    
    .stories-container {
        padding: 1.5rem;
    }
    
    .story-card {
        padding: 1.5rem;
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .stories-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .story {
        padding: 2rem;
    }
    
    .story-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .stories-list {
        grid-template-columns: 1fr;
    }
    
    .story-header h1 {
        font-size: 1.8rem;
    }
    
    .story-content {
        font-size: 1rem;
    }
    
    .container {
        padding: 0 1.2rem;
    }
    
    .stories-container {
        padding: 1.5rem;
    }
    
    .story-card {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    nav ul {
        margin-top: 1rem;
        justify-content: center;
    }
    
    nav li {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    
    .story {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .story-header h1 {
        font-size: 1.5rem;
    }
    
    .story-content {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .dropdown-content {
        right: -50px;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gradient background animation */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    pointer-events: none;
    opacity: 0.8;
    transition: background 0.5s ease;
}

/* Add Font imports */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Add some custom animations */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(49, 130, 206, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(49, 130, 206, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(49, 130, 206, 0);
    }
}

.story-card:hover .read-more {
    animation: pulseGlow 1.5s infinite;
}

/* Category pages */
.categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

.category-card {
    background-color: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 2rem;
    border: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    flex-direction: column;
    position: relative;
    text-align: center;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.category-card h2 a {
    color: var(--primary-color);
    text-decoration: none;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.category-count {
    font-size: 1.1rem;
    color: #718096;
    margin-bottom: 1.5rem;
}