/*
Theme Name: Stavtrupportalen
Description: Tema til Stavtrupportalen, baseret på designet i demo/. Nyheder, opslag, arkiv, historie, annoncer og sidebjælke-bokse.
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: stavtrupportalen
*/

:root {
  --green: rgb(33, 62, 133);
  --green-dark: #162b5e;
  --green-tint: #e4e6f3;
  --line: #d6d9ee;
  --bg: rgb(244, 245, 249); /* 5% of the brand blue on white */
  --text: #1a1d33;
  --muted: #444a70;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }

h1, h2, h3 { margin: 0; line-height: 1.2; }
h1, h2, .logo { font-family: "Source Serif 4", Georgia, serif; }

.wrap { max-width: 1056px; margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: var(--green); color: #fff; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.logo { color: #fff; font-weight: 700; font-size: 28px; }
.logo:hover { text-decoration: none; }
.site-search { display: flex; gap: 8px; flex: 1 1 220px; max-width: 320px; }
.site-search input { flex: 1; min-width: 0; height: 44px; border: 0; border-radius: 6px; padding: 0 12px; font: inherit; }
.site-search button { height: 44px; padding: 0 16px; border: 2px solid #fff; border-radius: 6px; background: transparent; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.site-search button:hover { background: var(--green-dark); }

/* Top banner and nav */
.top { background: #fff; border-bottom: 1px solid var(--line); }
.banner { padding-top: 16px; padding-bottom: 12px; }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px 8px; padding-bottom: 12px; }
.main-nav a { padding: 10px 14px; border-radius: 6px; font-weight: 600; }
.main-nav a[aria-current="page"] { background: var(--green); color: #fff; }

/* Layout */
.layout { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; padding-top: 24px; padding-bottom: 24px; }
.content { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.sidebar { flex: 0 0 212px; display: flex; flex-direction: column; gap: 20px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.meta { margin: 0 0 4px; font-size: 14px; color: var(--muted); }

.hero-body { padding: 20px 24px 24px; }
.hero h1 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 10px; }
.hero h1 a { color: var(--text); }
.hero p.lead { margin: 0 0 14px; font-size: 18px; }
.more { font-weight: 700; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 3px solid var(--green); margin-bottom: 16px; }
.section-head h2 { font-size: 26px; }
.section-head a { font-weight: 700; padding: 8px 0; }

.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.news-card { display: block; color: var(--text); }
.news-card:hover { text-decoration: none; border-color: var(--green); }
.news-card .body { padding: 12px 14px 16px; }
.news-card h3 { font-size: 18px; line-height: 1.3; }

.post-list { display: flex; flex-direction: column; gap: 16px; }
.post { display: flex; flex-wrap: wrap; gap: 16px; padding: 14px; color: var(--text); }
.post:hover { text-decoration: none; border-color: var(--green); }
.post .txt { flex: 1 1 240px; }
.post h3 { font-size: 19px; margin-bottom: 6px; }
.post p { margin: 0; }

/* Sidebar */
.box { width: 212px; padding: 16px; border-radius: 8px; }
.box h2 { font-size: 20px; margin-bottom: 8px; }
.box p { margin: 0 0 8px; font-size: 15px; }
.box-green { background: var(--green); color: #fff; }
.box-green .btn { display: block; text-align: center; background: #fff; color: var(--green); font-weight: 700; padding: 12px; border-radius: 6px; }
.box-white { background: #fff; border: 1px solid var(--line); }

/* Footer */
.site-footer { background: var(--green); color: #fff; margin-top: 16px; }
.site-footer .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 20px; }
.sponsors { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: #fff; text-decoration: underline; }

/* Real images and ads */
/* Images contain text, so they are never cropped: full image at its natural ratio */
.cover { display: block; width: 100%; height: auto; }
.hero { display: flex; flex-wrap: wrap; }
.hero .cover { flex: 0 1 360px; width: 360px; max-width: 100%; margin: 0 auto; }
.hero-body { flex: 1 1 280px; align-self: center; }
.post img { flex: 0 0 220px; width: 220px; max-width: 100%; height: auto; border-radius: 4px; }
.ad-rotator a { display: block; line-height: 0; }
.ad-rotator a[hidden] { display: none; }
.ad-rotator img { display: block; max-width: 100%; height: auto; }
.top-ad { width: 100%; border-radius: 4px; overflow: hidden; }
.top-ad img { width: 100%; }
.ad-note { margin: 4px 0 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: right; }
.ad-side { width: 212px; }
.ad-side img { width: 212px; }
.sponsors li { width: 88px; height: 88px; background: #fff; border-radius: 6px; overflow: hidden; }
.sponsors li[hidden] { display: none; }
.sponsors a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.sponsors img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Below this width the sidebar wraps under the content */
@media (max-width: 836px) {
  .sidebar { flex-basis: 100%; align-items: center; }
}

@media (max-width: 600px) {
  .logo { font-size: 24px; }
  .site-search { max-width: none; }
  .hero-body { padding: 16px; }
  .post img { flex-basis: 100%; width: 100%; }
  .ad-side + .ad-side { display: none; }
}

/* Adresser */
.page-title { font-size: clamp(28px, 4vw, 36px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -16px; }
.chips a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; }
.chips a:hover { border-color: var(--green); text-decoration: none; }
.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.entry { padding: 14px 16px 16px; }
.entry h3 { font-size: 18px; line-height: 1.3; margin-bottom: 6px; }
.entry address { display: flex; flex-direction: column; font-style: normal; font-size: 15px; overflow-wrap: anywhere; }

/* Kontakt */
.contact { padding: 20px 24px 24px; }
.contact h2 { font-size: 24px; margin-bottom: 10px; }
.contact p, .contact ul { margin: 0 0 12px; }
.contact ul { padding-left: 20px; }
.btn-link { display: inline-block; background: var(--green); color: #fff; font-weight: 700; padding: 12px 18px; border-radius: 6px; }
.btn-link:hover { background: var(--green-dark); text-decoration: none; }

/* Ugentligt */
.ugentligt h2 { padding-bottom: 8px; border-bottom: 3px solid var(--green); }
.ugentligt .entry-box { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ugentligt .entry-box:last-child { border-bottom: 0; padding-bottom: 0; }
.ugentligt h3 { font-size: 16px; line-height: 1.3; margin-bottom: 4px; }
.ugentligt p { overflow-wrap: anywhere; }
.ugentligt p:last-child { margin-bottom: 0; }

/* Stavtrups historie */
.history-list { display: flex; flex-direction: column; gap: 16px; }
.history-item { display: block; padding: 16px 20px; color: var(--text); }
.history-item:hover { text-decoration: none; border-color: var(--green); }
.history-item h2 { font-size: 22px; margin-bottom: 4px; }
.history-item .meta { margin: 0; }
.back { margin: 0; font-weight: 700; }
.article { padding: 24px; }
.article h1 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 6px; }
.article-body { max-width: 68ch; font-size: 18px; line-height: 1.6; }
.article-body p { margin: 0 0 1em; }
.article-body .c { text-align: center; white-space: pre-wrap; }
.article-body > a { display: block; margin: 0 0 1em; }
.article-body img { display: block; max-width: 100%; height: auto; border-radius: 4px; }

/* WordPress */
.screen-reader-text { position: absolute; left: -9999px; }
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
.main-nav a[aria-current="page"] { background: var(--green); color: #fff; }

.pagination { margin-top: 24px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-weight: 600; }
.pagination .page-numbers.current { background: var(--green); border-color: var(--green); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--green); text-decoration: none; }

.archive-tools { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.archive-search { display: flex; gap: 8px; flex: 1 1 240px; max-width: 360px; }
.archive-search input { flex: 1; min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 6px; padding: 0 12px; font: inherit; }
.archive-search button { height: 44px; padding: 0 16px; border: 0; border-radius: 6px; background: var(--green); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.archive-search button:hover { background: var(--green-dark); }
.chips a[aria-current="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.no-image { padding-top: 14px; }
.news-card .body .meta { margin-bottom: 4px; }
.article-body .alignleft { float: left; margin: 0 1em 1em 0; }
.article-body .alignright { float: right; margin: 0 0 1em 1em; }
.article-body .aligncenter { margin-left: auto; margin-right: auto; }
.article-body figure { margin: 0 0 1em; }
.article-body figcaption, .article-body .wp-caption-text { font-size: 14px; color: var(--muted); }
.article-body::after { content: ""; display: block; clear: both; }
.page-content { display: flex; flex-direction: column; gap: 32px; }
.page-content > p, .page-content > ul { margin: 0; }
