/* SUNDE IBK – felles nyhetskort og modal. Sideoppsett for nyheter.php. */
.news-section {
    position: relative;
    overflow: hidden;
    padding: 88px 0 96px;
    background: var(--sunde-bg) !important;
    border: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}
.news-section::before {
    content: ''; position: absolute; top: 80px; right: -160px;
    width: clamp(520px, 65vw, 1050px); height: 1100px;
    background: url('../../assets/images/sundebukk.webp') center top / contain no-repeat;
    opacity: .045; filter: grayscale(1); pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 70%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 70%, transparent);
}
.news-section > .container { position: relative; }
.news-section .section-title {
    color: var(--sunde-text); font-family: 'Outfit', sans-serif;
    font-size: clamp(32px, 4vw, 48px); line-height: 1.08;
    font-weight: 700; letter-spacing: -.035em; margin: 14px 0 36px;
}
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.news-card {
    display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    border: 1px solid var(--sunde-border) !important; border-radius: 7px;
    background: var(--sunde-panel) !important; color: var(--sunde-text);
    backdrop-filter: none; -webkit-backdrop-filter: none;
    transition: border-color .2s, transform .2s;
}
.news-card:hover { border-color: rgba(230,191,63,.4) !important; transform: translateY(-3px); }
.news-card__image { aspect-ratio: 16 / 10; overflow: hidden; background: var(--sunde-bg-2); }
.news-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .45s; }
.news-card:hover .news-card__image img { transform: scale(1.025); }
.news-card__body { display: flex; flex-direction: column; flex: 1; padding: 24px; }
.news-card__meta { color: var(--sunde-muted); font-size: 11px; font-weight: 500; line-height: 1.6; margin-bottom: 12px; overflow-wrap: anywhere; }
.news-card h3 {
    color: var(--sunde-text) !important; font-family: 'Outfit', sans-serif !important;
    font-size: 23px !important; font-weight: 700 !important;
    line-height: 1.18 !important; letter-spacing: -.02em;
    margin: 0 0 13px !important; overflow-wrap: anywhere;
}
.news-card p { color: var(--sunde-muted) !important; font-size: 14px; line-height: 1.7; margin: 0 0 22px !important; }
.news-card__link {
    display: inline-flex; align-items: center; align-self: flex-start; gap: 12px;
    min-height: 44px; margin-top: auto; padding: 8px 0;
    border: 0; background: transparent; color: var(--sunde-accent) !important;
    font-family: inherit; font-size: 13px; font-weight: 700; text-decoration: none !important;
}
.news-card__link i { font-size: 11px; transition: transform .2s; }
.news-card__link:hover i { transform: translateX(4px); }
.news-card__link:focus-visible { outline: 2px solid var(--sunde-accent); outline-offset: 4px; }
.news-archive { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--sunde-border); }
.news-empty { grid-column: 1 / -1; color: var(--sunde-muted); padding: 24px 0; }

/* Hele modalen scroller i Bootstrap-overlayen, uten eget scrollfelt i teksten. */
.news-modal { overflow-x: hidden; overflow-y: auto; }
.news-modal .modal-dialog { width: auto; max-width: 900px; margin: 28px auto; height: auto !important; max-height: none !important; padding: 0 16px; }
.news-modal .modal-content {
    position: relative; overflow: hidden; height: auto !important; max-height: none !important;
    background: #1c1c1c !important; color: var(--sunde-text);
    border: 1px solid rgba(255,255,255,.12) !important; border-radius: 8px !important;
    box-shadow: 0 28px 80px rgba(0,0,0,.5);
}
.news-modal .modal-header { position: absolute; top: 0; right: 0; z-index: 4; border: 0 !important; padding: 14px; }
.news-modal .btn-close {
    position: relative; display: grid; place-items: center;
    width: 40px !important; height: 40px !important; padding: 0 !important;
    background: #131313 !important; background-image: none !important;
    border: 1px solid rgba(255,255,255,.2) !important;
    border-radius: 50%; opacity: 1 !important;
}
.news-modal .btn-close::before, .news-modal .btn-close::after { content: ''; position: absolute; width: 16px; height: 2px; background: #fff; }
.news-modal .btn-close::before { transform: rotate(45deg); }
.news-modal .btn-close::after { transform: rotate(-45deg); }
.news-modal .btn-close:hover { border-color: var(--sunde-accent) !important; }
.news-modal .btn-close:focus-visible { outline: 2px solid var(--sunde-accent); outline-offset: 3px; }
.news-modal__image { display: block; width: 100%; height: auto; max-width: 100%; max-height: none; object-fit: contain; background: #131313; }
.news-modal .modal-body { padding: 32px; overflow: visible !important; max-height: none !important; }
.news-modal .modal-header + .modal-body { padding-top: 70px; }
.news-modal__meta { margin-bottom: 12px; color: var(--sunde-accent); font-size: 12px; line-height: 1.6; }
.news-modal h2 {
    margin: 0 0 22px !important; color: var(--sunde-text) !important;
    font-family: 'Outfit', sans-serif !important; font-weight: 700 !important;
    font-size: clamp(26px, 3vw, 38px); line-height: 1.12 !important;
    letter-spacing: -.025em; overflow-wrap: anywhere;
}
.news-modal__text, .news-modal__text p { color: #d3d3d3 !important; font-size: 16px; line-height: 1.8; overflow-wrap: anywhere; }
.news-modal__text img { max-width: 100%; height: auto; }
.news-modal__text a { color: var(--sunde-accent); }
.news-modal__actions { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--sunde-border); }
.news-modal__button {
    display: inline-flex; align-items: center; gap: 12px;
    min-height: 48px; padding: 12px 22px; border-radius: var(--sunde-radius, 6px);
    background: var(--sunde-accent); color: #131313 !important;
    font-size: 14px; font-weight: 700; text-decoration: none !important;
}
.news-modal__button:hover { background: #f0cc58; }
.news-modal__button:focus-visible { outline: 2px solid var(--sunde-text); outline-offset: 4px; }
.modal-backdrop { background: #030303 !important; backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.modal-backdrop.show { opacity: .86 !important; }
@media (max-width: 991.98px) { .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
    .news-section { padding: 48px 0 60px; }
    .news-section .section-title { margin-bottom: 24px; font-size: 34px; }
    .news-section::before { top: 200px; right: -160px; width: 500px; height: 750px; opacity: .025; }
    .news-card__body { padding: 22px; }
    .news-modal .modal-dialog { margin: 12px auto; padding: 0 12px; }
    .news-modal .modal-body { padding: 24px 20px; }
    .news-modal .modal-header { padding: 10px; }
    .news-modal__text, .news-modal__text p { font-size: 15px; }
}
@media (max-width: 650px) { .news-grid { grid-template-columns: 1fr; gap: 20px; } }
@media (prefers-reduced-motion: reduce) {
    .news-card, .news-card__image img, .news-card__link i { transition: none; }
    .news-card:hover, .news-card:hover .news-card__image img, .news-card__link:hover i { transform: none; }
}
