/* Professional Newspaper Design - dagnytt */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

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

.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Wider container for homepage news layout */
main.container:has(.news-layout) {
    max-width: 1270px;
}

/* Wider containers for header and navigation */
.site-header .container,
.category-nav .container {
    max-width: 1270px;
}

/* Header */
.site-header {
    background: #f8f9fa;
    background: linear-gradient(180deg, #ffffff 0%, #f4f5f7 100%);
    color: #1a1a1a;
    padding: 10px 0;
    border-bottom: 3px solid #c41e3a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
}

.header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.site-title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 2.5em;
    font-weight: 900;
    letter-spacing: 6px;
    margin: 0;
    line-height: 1;
    text-transform: lowercase;
    color: #1a1a1a;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.site-title::before,
.site-title::after {
    content: '◆';
    color: #c41e3a;
    font-size: 0.35em;
    vertical-align: middle;
    margin: 0 12px;
    opacity: 0.7;
}

.site-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-title a:hover {
    color: #c41e3a;
}

.site-tagline {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-size: 0.9em;
    font-style: italic;
    color: #666;
    letter-spacing: 1px;
    font-weight: 400;
    text-transform: lowercase;
    margin: 0;
    line-height: 1.2;
    text-align: right;
}

/* Category Navigation */
.category-nav {
    background: #34495e;
    background: linear-gradient(180deg, #3d566e 0%, #2c3e50 100%);
    border-bottom: 1px solid #5d6d7e;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.category-toggle {
    display: none;
    width: 100%;
    background: #34495e;
    color: #ecf0f1;
    border: none;
    padding: 12px 20px;
    font-family: 'Arial', sans-serif;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.category-toggle:hover {
    background: #3d566e;
}

.category-toggle .toggle-icon {
    transition: transform 0.3s;
    display: inline-block;
}

.category-toggle.open .toggle-icon {
    transform: rotate(180deg);
}

.category-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
    flex: 1;
}

.category-list li {
    margin: 0;
}

.category-list a {
    display: block;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    font-family: 'Arial', sans-serif;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.category-list a:hover,
.category-list a.active {
    background: #c41e3a;
    color: #fff;
}

/* Main Layout */
main {
    padding: 30px 0;
}

.news-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
    background: #fff;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Featured Article */
.featured-article {
    border-bottom: 3px solid #1a1a1a;
    padding-bottom: 30px;
    margin-bottom: 30px;
}

.featured-article .article-image {
    width: 100%;
    max-width: 100%;
    height: 450px;
    object-fit: cover;
    margin-bottom: 20px;
}

.featured-article .article-title {
    font-size: 2em;
    line-height: 1.2;
    margin-bottom: 15px;
    font-weight: bold;
}

.featured-article .article-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.featured-article .article-title a:hover {
    color: #c41e3a;
}

.featured-article .article-summary {
    font-size: 1.2em;
    line-height: 1.7;
    margin-bottom: 15px;
    color: #555;
}

/* Article Meta */
.article-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.category-badge {
    background: #c41e3a;
    color: #fff;
    padding: 5px 12px;
    font-size: 0.75em;
    font-family: 'Arial', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.category-badge.small {
    font-size: 0.7em;
    padding: 3px 8px;
}

.article-date {
    font-size: 0.85em;
    color: #666;
    font-family: 'Arial', sans-serif;
}

.article-author {
    font-size: 0.85em;
    color: #666;
    font-family: 'Arial', sans-serif;
}

.read-more {
    display: inline-block;
    color: #c41e3a;
    font-weight: bold;
    text-decoration: none;
    font-family: 'Arial', sans-serif;
    font-size: 0.9em;
}

.read-more:hover {
    text-decoration: underline;
}

/* Recent Articles Grid */
.recent-articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.article-card {
    border: 1px solid #ddd;
    transition: box-shadow 0.3s;
}

.article-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.article-card .card-image {
    width: 100%;
    max-width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-card .card-content {
    padding: 20px;
}

.article-card .card-title {
    font-size: 1.3em;
    line-height: 1.3;
    margin-bottom: 10px;
}

.article-card .card-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.article-card .card-title a:hover {
    color: #c41e3a;
}

.article-card .card-summary {
    font-size: 0.95em;
    color: #666;
    line-height: 1.5;
}

/* Sidebar */
.sidebar {
    border-left: 1px solid #ddd;
    padding-left: 30px;
}

.sidebar-section {
    margin-bottom: 40px;
}

.sidebar-title {
    font-size: 1.05em;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Arial', sans-serif;
}

.sidebar-article {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.sidebar-article:last-child {
    border-bottom: none;
}

.sidebar-article h4 {
    font-size: 1em;
    line-height: 1.4;
    margin-bottom: 8px;
}

.sidebar-article h4 a {
    color: #1a1a1a;
    text-decoration: none;
}

.sidebar-article h4 a:hover {
    color: #c41e3a;
}

.sidebar-categories {
    list-style: none;
}

.sidebar-categories li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.sidebar-categories li:last-child {
    border-bottom: none;
}

.sidebar-categories a {
    color: #333;
    text-decoration: none;
    font-family: 'Arial', sans-serif;
    display: block;
}

.sidebar-categories a:hover {
    color: #c41e3a;
    padding-left: 5px;
    transition: padding 0.2s;
}

/* Full Article Page */
.full-article {
    background: #fff;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.article-header {
    margin-bottom: 30px;
}

.article-header h1 {
    font-size: 1.8em;
    line-height: 1.3;
    margin-bottom: 15px;
}

.article-lead {
    font-size: 1.3em;
    line-height: 1.7;
    color: #555;
    font-style: italic;
    margin-bottom: 20px;
    padding-left: 20px;
    border-left: 4px solid #c41e3a;
}

.article-image-container {
    margin: 0 0 30px 0;
}

.article-main-image {
    width: 100%;
    max-width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.article-image-caption {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    padding: 12px 20px;
    background: #f9f9f9;
    border-left: 3px solid #c41e3a;
    margin-top: 0;
    font-family: 'Arial', sans-serif;
    line-height: 1.5;
}

.article-body {
    font-size: 1.1em;
    line-height: 1.8;
    color: #333;
    max-width: 800px;
}

.article-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #ddd;
}

/* Category Page */
.category-header {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.category-header h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.category-header p {
    color: #666;
    font-family: 'Arial', sans-serif;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.no-articles {
    background: #fff;
    padding: 40px;
    text-align: center;
    font-size: 1.2em;
    color: #666;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: 'Arial', sans-serif;
    transition: background 0.3s;
}

.btn:hover {
    background: #c41e3a;
}

/* Footer */
.site-footer {
    background: #1a1a1a;
    color: #fff;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
    font-family: 'Arial', sans-serif;
}

.site-footer a {
    color: #c41e3a;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.footer-disclaimer {
    font-size: 0.75em;
    color: #888;
    margin-top: 15px;
    line-height: 1.6;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Terms Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.modal-content {
    background-color: #fefefe;
    margin: 3% auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    position: relative;
}

.modal-close {
    color: #666;
    position: sticky;
    top: 0;
    right: 0;
    float: right;
    font-size: 32px;
    font-weight: bold;
    padding: 10px 20px;
    background: #fff;
    z-index: 10;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover,
.modal-close:focus {
    color: #c41e3a;
}

.legal-document {
    padding: 40px 50px;
    font-family: 'Georgia', serif;
    line-height: 1.8;
    color: #1a1a1a;
}

.legal-document h1 {
    font-size: 1.8em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legal-document .document-date {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-bottom: 30px;
    font-size: 0.95em;
}

.legal-document h2 {
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legal-document p {
    margin-bottom: 15px;
    text-align: justify;
}

.legal-document a {
    color: #c41e3a;
    text-decoration: none;
}

.legal-document a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .legal-document {
        padding: 30px 20px;
    }

    .legal-document h1 {
        font-size: 1.4em;
    }

    .legal-document h2 {
        font-size: 1.1em;
    }
}

/* Share Button */
.article-share {
    text-align: right;
    margin-top: 20px;
    margin-bottom: 20px;
    position: relative;
}

.share-button {
    background: #c41e3a;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-family: 'Arial', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s, transform 0.1s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.share-button:hover {
    background: #a01730;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.share-button:active {
    transform: translateY(0);
}

.share-button i {
    font-size: 1.1em;
}

.share-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.share-dropdown.show {
    display: block;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-family: 'Arial', sans-serif;
    font-size: 0.95em;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.share-option:last-child {
    border-bottom: none;
}

.share-option:hover {
    background: #f5f5f5;
}

.share-option:first-child {
    border-radius: 8px 8px 0 0;
}

.share-option:last-child {
    border-radius: 0 0 8px 8px;
}

.share-option i {
    width: 20px;
    text-align: center;
    font-size: 1.1em;
}

.share-option[data-platform="facebook"] i {
    color: #1877f2;
}

.share-option[data-platform="twitter"] i {
    color: #000;
}

.share-option[data-platform="linkedin"] i {
    color: #0a66c2;
}

.share-option[data-platform="whatsapp"] i {
    color: #25d366;
}

.share-option[data-platform="email"] i {
    color: #666;
}

.share-option[data-platform="copy"] i {
    color: #666;
}

/* Search Box */
.search-container {
    position: relative;
    flex-shrink: 0;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 250px;
    padding: 8px 35px 8px 15px;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Arial', sans-serif;
    background: rgba(255, 255, 255, 0.95);
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.5);
    background: #fff;
}

.search-box .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
    font-size: 0.9em;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 400px;
    max-width: 500px;
    max-height: 500px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-dropdown.show {
    display: block;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: block;
    color: inherit;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-title {
    font-weight: bold;
    font-size: 0.95em;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.3;
}

.search-result-meta {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 4px;
}

.search-result-snippet {
    font-size: 0.85em;
    color: #555;
    line-height: 1.4;
}

.search-result-snippet mark {
    background: #fff59d;
    padding: 2px 0;
    font-weight: bold;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

.search-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

.search-view-all {
    padding: 12px 16px;
    text-align: center;
    background: #f9f9f9;
    border-top: 2px solid #ddd;
    font-weight: bold;
    color: #c41e3a;
    cursor: pointer;
    border-radius: 0 0 6px 6px;
}

.search-view-all:hover {
    background: #f0f0f0;
}

/* Responsive Design */
@media (max-width: 968px) {
    .news-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-left: none;
        border-top: 2px solid #ddd;
        padding-left: 0;
        padding-top: 30px;
    }

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

    /* Mobile category navigation */
    .category-nav .container {
        flex-direction: column;
        gap: 10px;
    }

    .category-toggle {
        display: flex;
        width: 100%;
    }

    .category-list {
        display: none;
        flex-direction: column;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }

    .category-list.open {
        display: flex;
        max-height: 500px;
        transition: max-height 0.3s ease-in;
    }

    .category-list li {
        width: 100%;
        border-top: 1px solid #444;
    }

    .category-list a {
        width: 100%;
        text-align: left;
    }

    .search-container {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    .search-dropdown {
        left: 0;
        right: 0;
        min-width: auto;
    }
}

@media (max-width: 640px) {
    .container {
        max-width: 100%;
        padding: 0 10px;
    }

    .header-content {
        flex-direction: column;
        gap: 3px;
    }

    .site-title {
        font-size: 1.8em;
        letter-spacing: 4px;
    }

    .site-title::before,
    .site-title::after {
        margin: 0 8px;
        font-size: 0.3em;
    }

    .site-tagline {
        font-size: 0.65em;
        letter-spacing: 1px;
        text-align: center;
    }

    .site-header {
        padding: 6px 0 3px 0;
    }

    .news-layout {
        padding: 15px;
    }

    .recent-articles-grid,
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .featured-article .article-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 300px;
    }

    .featured-article .article-title {
        font-size: 1.3em;
        line-height: 1.3;
    }

    .article-card .card-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 250px;
    }

    .category-list {
        flex-direction: column;
    }

    .full-article {
        padding: 20px 15px;
    }

    .article-header h1 {
        font-size: 1.5em;
    }

    .article-main-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: none;
    }

    .article-share {
        text-align: center;
    }

    .share-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}
