/* CogniNyheter Hovedstil - Basis for alle templates */

.cogninyheter-container {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background-color: #f9f3e7;
    color: #3b2e1e;
    max-width: 1100px;
    margin: 0 auto;
    padding: 15px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.cogninyheter-main-image {
    border-radius: 50% / 30%;
    box-shadow: 4px 4px 0 #c4b37b;
    filter: sepia(0.2) brightness(0.95);
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.cogninyheter-main-image:hover {
    transform: scale(1.02);
    filter: sepia(0.1) brightness(1.05);
}

.cogninyheter-small-image {
    border-radius: 12px;
    box-shadow: 2px 2px 0 #c4b37b;
    filter: sepia(0.15) brightness(0.95);
    width: 100%;
    height: 140px;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.cogninyheter-small-image:hover {
    transform: scale(1.05);
    filter: sepia(0.05) brightness(1.1);
}

.cogninyheter-headline {
    font-weight: bold;
    text-shadow: 1px 1px 0 #b79853;
    margin: 8px 12px;
    line-height: 1.4;
}

.cogninyheter-text-excerpt {
    font-style: italic;
    color: #5b4c2f;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

/* News Item */
.cogninyheter-news-item {
    position: relative;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    tabindex: 0;
}

.cogninyheter-news-item:hover,
.cogninyheter-news-item:focus {
    background-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    outline: 2px solid #c4b37b;
}

.cogninyheter-news-item a {
    color: inherit;
    text-decoration: none;
    display: block;
}

.cogninyheter-news-item a:hover {
    text-decoration: underline;
}

/* Sosiale knapper */
.cogninyheter-social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}

.cogninyheter-social-buttons a,
.cogninyheter-social-buttons button {
    background-color: #d9cba0;
    color: #3b2e1e;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    box-shadow: 1px 1px 0 #c4b37b;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}

.cogninyheter-social-buttons a:hover,
.cogninyheter-social-buttons button:hover {
    background-color: #b79853;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 2px 2px 0 #c4b37b;
}

.cogninyheter-social-buttons a:focus,
.cogninyheter-social-buttons button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Liker-knapp */
.cogninyheter-like-button {
    background-color: #f0d080;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 1px 1px 0 #c4b37b;
    color: #3b2e1e;
    transition: all 0.3s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    font-size: 0.9rem;
}

.cogninyheter-like-button:hover {
    background-color: #c4b37b;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 2px 2px 0 #b79853;
}

.cogninyheter-like-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.cogninyheter-like-button.liked {
    background-color: #e74c3c;
    color: #fff;
}

.cogninyheter-like-button.liked:hover {
    background-color: #c0392b;
}

.cogninyheter-like-button.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.cogninyheter-like-count {
    margin-left: 8px;
    font-weight: bold;
}

/* Bookmark button */
.cogninyheter-bookmark-button {
    background-color: #3498db;
    color: #fff;
}

.cogninyheter-bookmark-button:hover {
    background-color: #2980b9;
}

.cogninyheter-bookmark-button.bookmarked {
    background-color: #f39c12;
}

.cogninyheter-bookmark-button.bookmarked:hover {
    background-color: #e67e22;
}

/* Share buttons */
.cogninyheter-share-button[data-platform="facebook"] {
    background-color: #3b5998;
    color: #fff;
}

.cogninyheter-share-button[data-platform="twitter"] {
    background-color: #1da1f2;
    color: #fff;
}

.cogninyheter-share-button[data-platform="linkedin"] {
    background-color: #0077b5;
    color: #fff;
}

.cogninyheter-share-button[data-platform="whatsapp"] {
    background-color: #25d366;
    color: #fff;
}

.cogninyheter-share-button[data-platform="email"] {
    background-color: #34495e;
    color: #fff;
}

/* Likers display */
.cogninyheter-show-likers {
    font-size: 0.8rem;
    color: #666;
    background: transparent;
    border: 1px solid #ddd;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: underline;
}

.cogninyheter-show-likers:hover {
    background-color: #f0f0f0;
}

/* Notification system */
.cogninyheter-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.cogninyheter-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cogninyheter-notification-success {
    background-color: #27ae60;
}

.cogninyheter-notification-error {
    background-color: #e74c3c;
}

.cogninyheter-notification-info {
    background-color: #3498db;
}

/* Lazy loading */
.cogninyheter-container img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cogninyheter-container img.lazy.loaded {
    opacity: 1;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible for better keyboard navigation */
.cogninyheter-container *:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cogninyheter-container *,
    .cogninyheter-container *::before,
    .cogninyheter-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .cogninyheter-container {
        background-color: #fff;
        color: #000;
    }
    
    .cogninyheter-like-button,
    .cogninyheter-social-buttons a,
    .cogninyheter-social-buttons button {
        border: 2px solid #000;
    }
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .cogninyheter-container {
        max-width: 95%;
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .cogninyheter-container {
        padding: 10px;
    }
    
    .cogninyheter-social-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cogninyheter-social-buttons a,
    .cogninyheter-social-buttons button {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .cogninyheter-headline {
        font-size: 1.1rem;
        margin: 6px 8px;
    }
    
    .cogninyheter-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .cogninyheter-container {
        padding: 8px;
    }
    
    .cogninyheter-small-image {
        height: 120px;
    }
    
    .cogninyheter-headline {
        font-size: 1rem;
        margin: 4px 6px;
    }
    
    .cogninyheter-text-excerpt {
        font-size: 0.9rem;
    }
    
    .cogninyheter-social-buttons a,
    .cogninyheter-social-buttons button {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

/* Print styles */
@media print {
    .cogninyheter-container {
        background: white;
        color: black;
        box-shadow: none;
    }
    
    .cogninyheter-social-buttons,
    .cogninyheter-like-button,
    .cogninyheter-bookmark-button,
    .cogninyheter-notification {
        display: none !important;
    }
    
    .cogninyheter-main-image,
    .cogninyheter-small-image {
        box-shadow: none;
        filter: none;
    }
}

/* Kjell Aukrust Template Styles */
.cogninyheter-container.kjellaukrust-template {
    background: linear-gradient(135deg, #f4f1e8 0%, #e8dcc0 100%);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(139, 119, 85, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(160, 140, 100, 0.1) 0%, transparent 50%);
    color: #4a3d2a;
    font-family: 'Georgia', 'Times New Roman', serif;
    border: 3px solid #8b7755;
    border-radius: 15px;
    box-shadow: 
        inset 0 0 20px rgba(139, 119, 85, 0.3),
        0 8px 25px rgba(74, 61, 42, 0.25);
    position: relative;
    overflow: visible;
}

.cogninyheter-container.kjellaukrust-template::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #8b7755, #a08c64, #8b7755);
    border-radius: 18px;
    z-index: -1;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-todays-news {
    background: linear-gradient(135deg, #d4c4a0 0%, #c4b088 100%);
    border: 4px double #8b7755;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    position: relative;
    box-shadow: 
        inset 0 0 15px rgba(139, 119, 85, 0.2),
        0 6px 20px rgba(74, 61, 42, 0.2);
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-todays-news::before {
    content: '📰';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #f4f1e8;
    padding: 5px 15px;
    border: 2px solid #8b7755;
    border-radius: 20px;
    font-size: 20px;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-todays-title {
    font-family: 'Georgia', serif;
    font-size: 28px;
    color: #5d4e35;
    text-align: center;
    margin: 0 0 20px 0;
    text-shadow: 2px 2px 4px rgba(139, 119, 85, 0.3);
    font-weight: bold;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-todays-item {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-todays-image {
    flex: 0 0 250px;
    position: relative;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-todays-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border: 6px solid #8b7755;
    border-radius: 50%;
    filter: sepia(0.4) contrast(1.1) brightness(0.95);
    box-shadow: 
        0 0 0 4px #f4f1e8,
        0 0 0 8px #8b7755,
        0 8px 20px rgba(74, 61, 42, 0.3);
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-todays-content {
    flex: 1;
    background: #f8f5f0;
    padding: 20px;
    border: 3px solid #8b7755;
    border-radius: 15px;
    position: relative;
    box-shadow: inset 0 0 10px rgba(139, 119, 85, 0.1);
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-todays-content::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 15px solid #8b7755;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-todays-content::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 23px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid #f8f5f0;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-todays-headline {
    font-family: 'Georgia', serif;
    font-size: 22px;
    color: #5d4e35;
    margin: 0 0 15px 0;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(139, 119, 85, 0.3);
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-regular-news {
    margin-top: 30px;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-section-title {
    font-family: 'Georgia', serif;
    font-size: 24px;
    color: #5d4e35;
    text-align: center;
    margin: 0 0 25px 0;
    padding: 15px;
    background: linear-gradient(135deg, #e8dcc0 0%, #d4c4a0 100%);
    border: 3px double #8b7755;
    border-radius: 15px;
    text-shadow: 1px 1px 2px rgba(139, 119, 85, 0.3);
    font-weight: bold;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-news-item {
    background: #f8f5f0;
    border: 4px solid #8b7755;
    border-radius: 20px;
    padding: 20px;
    position: relative;
    box-shadow: 
        0 6px 15px rgba(74, 61, 42, 0.2),
        inset 0 0 15px rgba(139, 119, 85, 0.1);
    transform: rotate(-1deg);
    transition: all 0.3s ease;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-news-item:nth-child(even) {
    transform: rotate(1deg);
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-news-item:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(74, 61, 42, 0.3),
        inset 0 0 20px rgba(139, 119, 85, 0.15);
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-news-item::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #8b7755, #a08c64, #8b7755);
    border-radius: 23px;
    z-index: -1;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-image-container {
    text-align: center;
    margin-bottom: 15px;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-small-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 4px solid #8b7755;
    border-radius: 15px;
    filter: sepia(0.3) contrast(1.05) brightness(0.95);
    box-shadow: 
        0 0 0 2px #f4f1e8,
        0 0 0 6px #8b7755,
        0 4px 12px rgba(74, 61, 42, 0.25);
    transform: rotate(-2deg);
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-content .cogninyheter-headline {
    font-family: 'Georgia', serif;
    font-size: 16px;
    color: #5d4e35;
    margin: 0 0 10px 0;
    font-weight: bold;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(139, 119, 85, 0.3);
    line-height: 1.3;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-text-excerpt {
    font-family: 'Georgia', serif;
    font-size: 13px;
    color: #6b5a42;
    line-height: 1.5;
    font-style: italic;
    background: rgba(244, 241, 232, 0.7);
    padding: 12px;
    border: 2px solid #c4b088;
    border-radius: 10px;
    margin: 10px 0;
    text-align: justify;
    box-shadow: inset 0 0 8px rgba(139, 119, 85, 0.1);
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-social-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-social-buttons button,
.cogninyheter-container.kjellaukrust-template .cogninyheter-social-buttons a {
    background: linear-gradient(135deg, #d4c4a0 0%, #c4b088 100%);
    color: #5d4e35;
    border: 2px solid #8b7755;
    border-radius: 15px;
    padding: 8px 12px;
    font-family: 'Georgia', serif;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(139, 119, 85, 0.3);
    box-shadow: 0 3px 8px rgba(74, 61, 42, 0.2);
    transition: all 0.2s ease;
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-social-buttons button:hover,
.cogninyheter-container.kjellaukrust-template .cogninyheter-social-buttons a:hover {
    background: linear-gradient(135deg, #c4b088 0%, #b4a078 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(74, 61, 42, 0.3);
}

.cogninyheter-container.kjellaukrust-template .cogninyheter-like-button.liked {
    background: linear-gradient(135deg, #d4a574 0%, #c49564 100%);
    color: #fff;
}

/* Responsive adjustments for Kjell Aukrust template */
@media (max-width: 768px) {
    .cogninyheter-container.kjellaukrust-template .cogninyheter-todays-item {
        flex-direction: column;
        text-align: center;
    }
    
    .cogninyheter-container.kjellaukrust-template .cogninyheter-todays-image {
        flex: none;
        align-self: center;
    }
    
    .cogninyheter-container.kjellaukrust-template .cogninyheter-news-grid {
        grid-template-columns: 1fr;
    }
    
    .cogninyheter-container.kjellaukrust-template .cogninyheter-news-item {
        transform: rotate(0deg);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .cogninyheter-container {
        background-color: #2c3e50;
        color: #ecf0f1;
    }
    
    .cogninyheter-text-excerpt {
        color: #bdc3c7;
    }
    
    .cogninyheter-news-item:hover,
    .cogninyheter-news-item:focus {
        background-color: rgba(52, 73, 94, 0.5);
    }
    
    .cogninyheter-social-buttons a,
    .cogninyheter-social-buttons button {
        background-color: #34495e;
        color: #ecf0f1;
    }
    
    .cogninyheter-social-buttons a:hover,
    .cogninyheter-social-buttons button:hover {
        background-color: #2c3e50;
    }
    
    /* Keep Kjell Aukrust template light even in dark mode */
    .cogninyheter-container.kjellaukrust-template {
        background: linear-gradient(135deg, #f4f1e8 0%, #e8dcc0 100%);
        color: #4a3d2a;
    }
}
