/* =========================================
   VARIABLES & THEME
   ========================================= */
:root {
    /* Colors */
    --bg-color: #fcf9f2; /* Warm beige like old paper */
    --text-primary: #111111;
    --text-secondary: #555555;
    --primary-color: #111111;
    --accent-color: #b85b14; /* Orange-brown */
    --border-color: rgba(0, 0, 0, 0.15);
    
    /* Typography */
    --font-heading: 'Merriweather', serif;
    --font-body: 'Inter', sans-serif;
    --font-logo: 'UnifrakturMaguntia', 'Merriweather', serif;

    /* Spacing */
    --container-width: 1280px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
}

/* =========================================
   RESET & BASICS
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.site-wrapper {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* =========================================
   TOP BAR
   ========================================= */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-primary {
    background-color: transparent;
    color: var(--accent-color);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    border: 2px solid var(--accent-color);
    transition: background-color 0.2s ease, transform 0.1s ease, color 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-1px);
}

.btn-login {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.4rem 0.5rem;
    font-weight: 600;
    border: none;
    transition: color 0.2s ease;
}

.btn-login:hover {
    color: var(--accent-color);
}

#auth-nav {
    gap: 0.5rem; /* Make login and register buttons closer */
}

/* =========================================
   MASTHEAD
   ========================================= */
.masthead {
    text-align: center;
    padding: var(--spacing-lg) 0;
    margin-bottom: 0;
}

.logo {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}

.logo-highlight {
    background-color: var(--accent-color);
    color: #ffffff;
    padding: 0 0.15em;
    border-radius: 0.2em;
    margin-right: 0.05em;
    display: inline-block;
    line-height: 1.1;
}

.tagline {
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.1rem;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.tagline::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 10px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 10" width="40" height="10"><path d="M 0 5 L 40 5" fill="none" stroke="%23111111" stroke-width="1.5" opacity="0.4"/></svg>');
    background-repeat: repeat-x;
    background-size: auto 10px;
}

/* =========================================
   NAVIGATION
   ========================================= */
.main-nav {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--spacing-lg);
}

.main-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    display: block;
    padding: 1rem 0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    position: relative;
}

.main-nav a.active {
    color: var(--accent-color);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.main-nav a:hover::after, .main-nav a.active::after {
    width: 100%;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}
.dropdown .arrow {
    font-size: 0.8em;
    margin-left: 4px;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
}
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu li {
    list-style: none;
    width: 100%;
}
.dropdown-menu a {
    padding: 0.5rem 1rem !important;
    display: block;
    font-weight: 500;
    text-transform: none;
    border-bottom: none;
}
.dropdown-menu a::after {
    display: none !important;
}
.dropdown-menu a:hover,
.dropdown-menu a.active {
    background-color: rgba(0,0,0,0.03);
    color: var(--accent-color);
}

/* =========================================
   MAIN CONTENT GRID
   ========================================= */
.content-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

/* =========================================
   ARTICLE CARDS
   ========================================= */
.category {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.category::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    margin-right: 6px;
}

.article-title {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.article-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    font-family: var(--font-heading);
}

.card-image-wrapper {
    overflow: hidden;
    margin-bottom: 1rem;
}

.card-image-wrapper img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    transition: transform 0.5s ease;
}

article:hover .card-image-wrapper img {
    transform: scale(1.05);
}

/* Specific Card Layouts */
.card-featured {
    grid-column: span 2;
    padding-right: var(--spacing-lg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.card-featured .article-title {
    font-size: 2.2rem;
}

.card-standard {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
}

.card-standard .article-title {
    font-size: 1.4rem;
}

/* Ensure card contents don't shrink */
.card-featured .card-image-wrapper,
.card-featured .card-content,
.card-standard .card-image-wrapper,
.card-standard .card-content {
    flex: 0 0 auto;
}

/* Smile/Wavy filler for empty spaces */
.card-featured::after,
.card-standard::after,
.article-list::after {
    content: '';
    display: block;
    flex: 1 1 0px;
    min-height: 0;
    /* Wavy line, color of bold text (#111111), slightly transparent */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 10" width="40" height="10"><path d="M 0 5 L 40 5" fill="none" stroke="%23111111" stroke-width="1.5" opacity="0.4"/></svg>');
    background-position: center;
    background-repeat: repeat-x;
    background-size: auto 12px;
}

/* List Articles (Sidebar style) */
.article-list {
    grid-column: span 1;
    padding-left: var(--spacing-lg);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Pinned sidebar — stays in right col across all grid rows */
.article-list-pinned {
    grid-column: 4;
    grid-row: 1 / 4;
}

.card-text {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.card-text:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.card-text .article-title {
    font-size: 1.1rem;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card-featured {
        grid-column: span 2;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: var(--spacing-lg);
    }
    
    .article-list {
        grid-column: span 2;
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border-color);
        padding-top: var(--spacing-lg);
    }

    /* On tablet, unpin the list so it flows normally */
    .article-list-pinned {
        grid-column: span 2;
        grid-row: auto;
    }

    .statti-container {
        grid-column: span 2;
    }

    .statti-inner-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Hide fast-news sidebar completely on mobile */
    .fast-news {
        display: none !important;
    }

    /* Full-width main layout */
    .main-layout {
        flex-direction: column;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .card-featured,
    .card-standard,
    .article-list,
    .article-list-pinned,
    .statti-container {
        grid-column: span 1 !important;
        grid-row: auto !important;
    }

    .statti-inner-grid {
        grid-template-columns: 1fr;
    }

    .logo {
        font-size: 3rem;
    }

    .main-nav ul {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* =========================================
   SIDEBAR & BURGER
   ========================================= */
.burger-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    margin-right: 15px;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.masthead {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.sidebar-nav {
    list-style: none;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-category-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    margin-bottom: -5px;
}

.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 5px 0;
}

.highlight-item {
    color: var(--accent-color) !important;
    font-weight: 700 !important;
    display: flex;
    align-items: center;
}

.highlight-item::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23b85b14"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>');
    background-size: cover;
}

.sidebar-nav a {
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-primary);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* =========================================
   VIDEO SECTION
   ========================================= */
.video-section {
    margin-top: 40px;
    margin-bottom: 40px;
    border-top: 2px solid var(--text-primary);
    padding-top: 20px;
}

.section-title {
    font-family: var(--font-heading);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

.video-card {
    position: relative;
    cursor: pointer;
}

.video-thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    margin-bottom: 10px;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.video-card:hover .video-thumb img {
    transform: scale(1.05);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid #fff;
    margin-left: 5px;
}

/* =========================================
   NEWS TICKER (MARQUEE)
   ========================================= */
.news-ticker {
    background: #111;
    color: #fff;
    padding: 5px 0;
    overflow: hidden;
    margin-bottom: var(--spacing-md);
    border-radius: 0;
    max-width: 100%;
}

.ticker-wrapper {
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
}

.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: ticker 30s linear infinite;
    font-size: 1.1rem;
    font-weight: 500;
}

.ticker-content a {
    color: #fff;
    text-decoration: underline;
}

.ticker-content a:hover {
    color: var(--accent-color);
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* =========================================
   MAIN LAYOUT & FAST NEWS
   ========================================= */
.main-layout {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.fast-news {
    flex: 0 0 300px;
}

.fast-news-title {
    font-family: var(--font-heading);
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.fast-news-list {
    display: flex;
    flex-direction: column;
}

.fast-news-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.fast-news-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.fast-news-title-link {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
}

.fast-news-title-link:hover {
    color: var(--accent-color);
}

/* =========================================
   LONG READS (STATTI)
   ========================================= */
.statti-container {
    background: #1e1e1e;
    color: #fff;
    padding: var(--spacing-md);
    border-radius: 8px;
    grid-column: 1 / 4;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.statti-container-title {
    font-family: var(--font-heading);
    color: #fff;
    font-size: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.statti-inner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.statti-card {
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

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

.statti-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.statti-content {
    padding: 1rem;
}

.statti-content h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.statti-content a {
    color: #fff;
    text-decoration: none;
}

.statti-content a:hover {
    color: var(--accent-color);
}

#current-date {
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background-color: var(--bg-alt);
}

/* =========================================
   ADVERTISEMENTS (SIDEBARS)
   ========================================= */
.global-page-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 100vw;
    overflow-x: hidden;
}

.ad-sidebar {
    display: none;
    width: 160px;
    min-height: 600px;
    background: transparent;
    border: none;
    margin-top: 150px;
    padding: 10px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.ad-placeholder {
    display: none;
}

@media (min-width: 1650px) { /* 1280 (container) + 320 (ads) + margins */
    .ad-sidebar {
        display: block;
    }
    .global-page-layout .site-wrapper {
        margin: 0 30px;
    }
}
