/* LeytzaNews - Modern CSS Styles */

/* ===== CSS Custom Properties ===== */
@layer base {
    :root {
        /* Colors */
        --bg-primary: #0D0D0D;
        --bg-secondary: #1A1A1A;
        --bg-tertiary: #252525;
        --text-primary: #F5F5F5;
        --text-secondary: #A0A0A0;
        --accent-primary: #FF6B35;
        --accent-secondary: #FFE66D;
        --accent-highlight: #4ECDC4;
        --error: #FF4757;
        --success: #2ED573;
        
        /* Typography */
        --font-heading: 'Playfair Display', Georgia, serif;
        --font-body: 'Source Serif 4', Georgia, serif;
        --font-ui: 'DM Sans', system-ui, sans-serif;
        
        /* Spacing */
        --space-xs: 0.25rem;
        --space-sm: 0.5rem;
        --space-md: 1rem;
        --space-lg: 1.5rem;
        --space-xl: 2rem;
        --space-2xl: 3rem;
        --space-3xl: 4rem;
        
        /* Border Radius */
        --radius-sm: 4px;
        --radius-md: 8px;
        --radius-lg: 16px;
        --radius-full: 9999px;
        
        /* Transitions */
        --transition-fast: 150ms ease;
        --transition-normal: 250ms ease;
        --transition-slow: 400ms ease;
        
        /* Shadows */
        --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
        --shadow-glow: 0 0 40px rgba(255, 107, 53, 0.3);
    }
}

/* ===== Reset & Base ===== */
@layer base {
    *, *::before, *::after {
        box-sizing: border-box;
    }
    
    * {
        margin: 0;
        padding: 0;
    }
    
    html {
        scroll-behavior: smooth;
    }
    
    body {
        font-family: var(--font-body);
        font-size: 1rem;
        line-height: 1.7;
        color: var(--text-primary);
        background: var(--bg-primary);
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    a {
        color: inherit;
        text-decoration: none;
    }
    
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }
    
    button {
        font-family: inherit;
        cursor: pointer;
    }
    
    /* Custom scrollbar */
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    ::-webkit-scrollbar-track {
        background: var(--bg-secondary);
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--bg-tertiary);
        border-radius: var(--radius-full);
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: var(--accent-primary);
    }
}

/* ===== Typography ===== */
@layer base {
    h1, h2, h3, h4, h5, h6 {
        font-family: var(--font-heading);
        font-weight: 700;
        line-height: 1.2;
    }
}

/* ===== Layout ===== */
@layer utilities {
    .container {
        width: 100%;
        max-width: 1280px;
        margin: 0 auto;
        padding: 0 var(--space-xl);
    }
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 70px;
    background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid color-mix(in srgb, var(--text-secondary) 10%, transparent);
    transition: background var(--transition-normal);
}

.nav__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.nav__logo {
    display: flex;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    transition: transform var(--transition-normal);
}

.nav__logo:hover {
    transform: scale(1.02);
}

.nav__logo-text {
    color: var(--text-primary);
}

.nav__logo-accent {
    color: var(--accent-primary);
}

.nav__links {
    display: flex;
    gap: var(--space-xl);
}

.nav__link {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    position: relative;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width var(--transition-normal);
}

.nav__link:hover,
.nav__link--active {
    color: var(--text-primary);
}

.nav__link:hover::after,
.nav__link--active::after {
    width: 100%;
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav__admin-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-tertiary);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-normal);
}

.nav__admin-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.nav__menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: var(--space-sm);
    background: transparent;
    border: none;
}

.nav__menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-normal);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.mobile-menu--active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    height: 100%;
    padding: var(--space-xl);
}

.mobile-menu__link {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.mobile-menu__link:hover {
    color: var(--accent-primary);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(70px + var(--space-3xl)) var(--space-xl) var(--space-3xl);
    overflow: hidden;
}

.hero__background {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero__mesh {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, color-mix(in srgb, var(--accent-primary) 30%, transparent), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, color-mix(in srgb, var(--accent-highlight) 20%, transparent), transparent),
        radial-gradient(ellipse 50% 30% at 20% 80%, color-mix(in srgb, var(--accent-secondary) 20%, transparent), transparent);
    animation: meshMove 20s ease-in-out infinite;
}

@keyframes meshMove {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(2%, 2%); }
    50% { transform: translate(-1%, 1%); }
    75% { transform: translate(1%, -2%); }
}

.hero__noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
}

.hero__content {
    position: relative;
    max-width: 900px;
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero__tag {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    color: var(--bg-primary);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-lg);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero__title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero__title .highlight {
    color: var(--accent-primary);
    position: relative;
}

.hero__excerpt {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-xl);
    animation: fadeInUp 1s ease-out 0.6s both;
}

.hero__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    color: var(--bg-primary);
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 1rem;
    transition: all var(--transition-normal);
    animation: fadeInUp 1s ease-out 0.8s both;
}

.hero__cta:hover {
    background: var(--accent-highlight);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.hero__cta svg {
    transition: transform var(--transition-fast);
}

.hero__cta:hover svg {
    transform: translateX(4px);
}

/* ===== Sections ===== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: var(--space-md);
}

.section-line {
    width: 60px;
    height: 4px;
    background: var(--accent-primary);
    margin: 0 auto;
    border-radius: var(--radius-full);
}

/* ===== Grid ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-xl);
}

.grid__loader {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: var(--space-2xl);
}

/* ===== Cards ===== */
.card {
    display: block;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.6s ease-out both;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card__image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.card:hover .card__image img {
    transform: scale(1.05);
}

.card__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-secondary) 0%, transparent 50%);
}

.card__category {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    padding: var(--space-xs) var(--space-md);
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    color: var(--bg-primary);
    font-family: var(--font-ui);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 1;
}

.card__content {
    padding: var(--space-xl);
}

.card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    transition: color var(--transition-fast);
}

.card:hover .card__title {
    color: var(--accent-primary);
}

.card__excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Featured Section ===== */
.featured {
    padding: var(--space-3xl) 0;
    background: var(--bg-primary);
}

/* ===== Latest / Timeline ===== */
.latest {
    padding: var(--space-3xl) 0;
    background: var(--bg-secondary);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.timeline__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-xl);
    align-items: center;
    padding: var(--space-xl);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    animation: fadeInUp 0.6s ease-out both;
}

.timeline__item:nth-child(1) { animation-delay: 0.1s; }
.timeline__item:nth-child(2) { animation-delay: 0.2s; }
.timeline__item:nth-child(3) { animation-delay: 0.3s; }
.timeline__item:nth-child(4) { animation-delay: 0.4s; }
.timeline__item:nth-child(5) { animation-delay: 0.5s; }

.timeline__item:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.timeline__date {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.timeline__content {
    min-width: 0;
}

.timeline__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
    transition: color var(--transition-fast);
}

.timeline__item:hover .timeline__title {
    color: var(--accent-primary);
}

.timeline__excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.timeline__arrow {
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.timeline__item:hover .timeline__arrow {
    color: var(--accent-primary);
    transform: translateX(4px);
}

/* ===== Related Section ===== */
.related {
    padding: var(--space-3xl) 0;
    background: var(--bg-primary);
}

.related__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-xl);
}

/* ===== Article Page ===== */
.article-page {
    padding-top: 70px;
    min-height: 100vh;
}

.article-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.article-error {
    text-align: center;
    padding: var(--space-3xl);
}

.article-error h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.article-error p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.article-header {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: flex-end;
    padding-bottom: var(--space-3xl);
}

.article-header__background {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.article-header__image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.article-header__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-primary) 0%, color-mix(in srgb, var(--bg-primary) 80%, transparent) 50%, transparent 100%);
}

.article-header__content {
    position: relative;
    padding-bottom: var(--space-xl);
    animation: fadeInUp 0.8s ease-out;
}

.article-header .article-category {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    color: var(--bg-primary);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
}

.article-header .article-title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 900;
    margin-bottom: var(--space-md);
    max-width: 800px;
}

.article-meta {
    display: flex;
    gap: var(--space-lg);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.article-body {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-xl) var(--space-3xl);
}

.article-excerpt {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    padding-left: var(--space-lg);
    border-left: 4px solid var(--accent-primary);
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.9;
}

.article-content p {
    margin-bottom: var(--space-lg);
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-secondary);
    padding: var(--space-3xl) 0 var(--space-xl);
    border-top: 1px solid var(--bg-tertiary);
}

.footer__content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-2xl);
}

.footer__brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer__logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-primary);
}

.footer__tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer__links {
    display: flex;
    gap: var(--space-xl);
}

.footer__link {
    font-family: var(--font-ui);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer__link:hover {
    color: var(--accent-primary);
}

.footer__social {
    display: flex;
    gap: var(--space-md);
}

.footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.footer__social-link:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.footer__bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--bg-tertiary);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== Loader ===== */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@container (max-width: 768px) {
    .nav__links {
        display: none;
    }
    
    .nav__menu-btn {
        display: flex;
    }
    
    .footer__content {
        flex-direction: column;
        gap: var(--space-xl);
        text-align: center;
    }
    
    .footer__links {
        justify-content: center;
    }
    
    .footer__social {
        justify-content: center;
    }
    
    .timeline__item {
        grid-template-columns: 1fr auto;
    }
    
    .timeline__date {
        grid-column: 1 / -1;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .hero__excerpt {
        font-size: 1rem;
    }
    
    .article-header {
        min-height: 50vh;
    }
}

/* ===== Animations ===== */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== Focus States ===== */
@layer base {
    a:focus-visible,
    button:focus-visible {
        outline: 2px solid var(--accent-primary);
        outline-offset: 2px;
    }
}

/* ===== Selection ===== */
@layer base {
    ::selection {
        background: var(--accent-primary);
        color: var(--bg-primary);
    }
}