/* =============================================================
   AASEN BIL 2.0 — news.css
   Nyhetskort (forside-teaser + nyhetsliste) og artikkelvisning.
   Lastes av index.html (teaser), nyheter.html og nyhet.html.
   ============================================================= */

/* ---------- Nyhetskort ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post {
  position: relative;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.post:hover { transform: translateY(-5px); box-shadow: var(--sh-2); }
/* Hele kortet klikkbart (stretched link) — overskrift-lenka dekker kortet via ::after */
.post__link { color: inherit; }
.post__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.post:hover .post__link { color: var(--red-700); }
.post:hover .link-arrow svg { transform: translateX(4px); }
.post__media { aspect-ratio: 16/9; overflow: hidden; }
.post__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.post:hover .post__media img { transform: scale(1.05); }
.post__body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post__date { font-size: .82rem; color: var(--red-600); font-weight: 600; font-family: var(--font-head); }
.post__body h3 { font-size: 1.18rem; line-height: 1.25; }
.post__body p { font-size: .94rem; color: var(--ink-500); }
.post__body .link-arrow { margin-top: auto; font-size: .9rem; }

/* ---------- Artikkelvisning (enkeltnyhet) ---------- */
.article { width: 100%; } /* full innholdsbredde */
/* Artikkel starter rett under brødsmulen — strammere topp enn vanlige undersider */
.section--article { padding-top: clamp(16px, 2vw, 24px); }
.article__media { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16/9; margin: 30px 0 28px; background: var(--surface); }
.article__media img { width: 100%; height: 100%; object-fit: cover; }
.article__meta { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font-size: .9rem; color: var(--ink-500); margin-bottom: 14px; }
.article__cat { color: var(--red-600); font-weight: 700; font-family: var(--font-head); }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.1; }
.article__lead { font-size: 1.2rem; color: var(--ink-700); margin-top: 18px; font-weight: 500; }

.article__body { font-size: 1.06rem; margin-top: 26px; }
.article__body > * + * { margin-top: 1.1em; }
.article__body h2 { font-size: 1.45rem; margin-top: 1.5em; }
.article__body h3 { font-size: 1.18rem; margin-top: 1.3em; }
.article__body ul, .article__body ol { padding-left: 1.4em; display: flex; flex-direction: column; gap: .4em; }
.article__body ul { list-style: disc; }
.article__body ol { list-style: decimal; }
.article__body a { color: var(--red-700); text-decoration: underline; }
.article__body img { border-radius: var(--r); margin-block: 1.4em; }
.article__body blockquote { border-left: 4px solid var(--red-600); padding: 4px 0 4px 18px; color: var(--ink-700); font-style: italic; font-size: 1.12rem; }

.article__share { display: flex; align-items: center; gap: 10px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.article__share span { font-family: var(--font-head); font-weight: 700; font-size: .9rem; }
.article__share a { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); transition: background .15s, transform .15s, color .15s; }
.article__share a:hover { background: var(--red-600); color: #fff; transform: translateY(-2px); }
.article__share svg { width: 18px; height: 18px; }

.article__back { display: inline-flex; align-items: center; gap: .4em; font-family: var(--font-head); font-weight: 700; color: var(--ink-500); margin-bottom: 18px; }
.article__back:hover { color: var(--red-700); }
.article__back svg { width: 1em; height: 1em; }

/* ---------- Paginering (nyheter.html — backend leverer ekte lenker senere) ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 44px; }
.pagination a {
  min-width: 44px; height: 44px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: 1.5px solid var(--line);
  font-family: var(--font-head); font-weight: 700;
  transition: border-color .15s, background .15s, color .15s;
}
.pagination a:hover { border-color: var(--ink-900); }
.pagination a.is-current { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }

/* ---------- Responsiv ---------- */
@media (max-width: 1000px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .news-grid { grid-template-columns: 1fr; } }
