/*
Theme Name: Discgolfkörkortet
Theme URI: https://www.svenskdiscgolf.se/
Author: Svenska Discgolfförbundet
Author URI: https://www.svenskdiscgolf.se/
Description: Ett modernt, mörkt och mobilanpassat tema för Discgolfkörkortet. Byggt för skolor, barn och vuxna med tydlig typografi, Gutenberg-stöd och responsiva videoklipp.
Version: 1.2.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: discgolfkorkortet
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: education, block-styles, custom-logo, custom-menu, featured-images, wide-blocks, accessibility-ready
*/

:root {
  --dg-black: #090909;
  --dg-panel: #151515;
  --dg-panel-soft: #1d1d1d;
  --dg-yellow: #ffca05;
  --dg-blue: #337ab7;
  --dg-blue-bright: #008acb;
  --dg-orange: #ed6a1c;
  --dg-green: #55a947;
  --dg-white: #fff;
  --dg-muted: #c8c8c8;
  --dg-line: #353535;
  --dg-radius: 20px;
  --dg-content: 760px;
  --dg-wide: 1180px;
  --dg-logo-height: 62px;
  --dg-font-heading: "Arial Narrow", "Aptos Narrow", "Roboto Condensed", Arial, sans-serif;
  --dg-font-body: Inter, Arial, Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--dg-white);
  background: var(--dg-black);
  font-family: var(--dg-font-body);
  font-size: 18px;
  line-height: 1.7;
  overflow-wrap: normal;
}
a { color: var(--dg-yellow); text-underline-offset: .18em; }
a:hover { color: var(--dg-white); }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { position: fixed; z-index: 100000; top: 12px; left: 12px; width: auto; height: auto; padding: 12px 18px; clip: auto; color: #000; background: var(--dg-yellow); font-weight: 800; }

.site-header { position: relative; z-index: 50; background: rgba(9,9,9,.96); border-bottom: 4px solid var(--dg-yellow); }
.site-header::after { content: ""; position: absolute; right: 0; bottom: -4px; width: 22%; height: 4px; background: var(--dg-blue); }
.header-inner { width: min(calc(100% - 40px), var(--dg-wide)); min-height: 0; margin: auto; padding: 15px 0; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.site-branding { display: flex; align-items: center; min-width: 0; }
.custom-logo-link { display: block; line-height: 0; }
.custom-logo { display: block; width: auto; max-height: var(--dg-logo-height); }
.site-title { margin: 0; font-family: var(--dg-font-heading); font-size: clamp(1.6rem, 4vw, 2.55rem); font-stretch: condensed; font-weight: 700; line-height: .92; letter-spacing: -.015em; text-transform: uppercase; }
.site-title a { color: var(--dg-yellow); text-decoration: none; }
.site-description { margin: 5px 0 0; color: var(--dg-muted); font-size: .78rem; line-height: 1.2; }

.menu-toggle { display: none; width: 50px; height: 46px; padding: 11px; color: #000; background: var(--dg-yellow); border: 0; border-radius: 8px; cursor: pointer; }
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after { display: block; width: 28px; height: 3px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-toggle-bars { position: relative; }
.menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -9px; }
.menu-toggle-bars::after { top: 9px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { top: 0; transform: rotate(-45deg); }
.primary-menu { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.primary-menu a { display: block; padding: 12px 14px; color: #fff; font-size: .92rem; font-weight: 800; text-decoration: none; border-radius: 7px; }
.primary-menu a:hover, .primary-menu a:focus-visible, .primary-menu .current-menu-item > a, .primary-menu .current_page_item > a { color: #000; background: var(--dg-yellow); }

.site-main { min-height: 60vh; }
.page-hero { position: relative; min-height: clamp(240px, 38vw, 480px); display: grid; align-items: end; overflow: hidden; background: var(--dg-panel); isolation: isolate; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0,0,0,.95) 0%, rgba(0,0,0,.66) 52%, rgba(0,0,0,.25) 100%); }
.page-hero::after { content: ""; position: absolute; right: -70px; bottom: -130px; z-index: -1; width: 320px; aspect-ratio: 1; background: var(--dg-yellow); transform: rotate(45deg); opacity: .92; }
.page-hero.has-image { background-size: cover; background-position: center; }
.hero-inner { width: min(calc(100% - 40px), var(--dg-wide)); margin: 0 auto; padding: clamp(48px, 8vw, 92px) 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 12px; color: var(--dg-yellow); font-size: .78rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 32px; height: 4px; background: var(--dg-blue-bright); }
.entry-title { max-width: 100%; margin: 0; font-family: var(--dg-font-heading); font-size: clamp(2.4rem, 6.3vw, 5.6rem); font-weight: 700; line-height: .84; letter-spacing: -.025em; text-transform: uppercase; text-wrap: balance; overflow-wrap: normal; word-break: normal; hyphens: none; }

.content-wrap { width: min(calc(100% - 40px), var(--dg-content)); margin: 0 auto; padding: clamp(52px, 8vw, 90px) 0; }
.entry-content > * { margin-top: 0; margin-bottom: 1.45em; }
.entry-content :where(h2,h3,h4,h5,h6) { margin-top: 1.8em; margin-bottom: .55em; font-family: var(--dg-font-heading); font-weight: 700; line-height: .92; letter-spacing: -.015em; text-transform: uppercase; text-wrap: balance; overflow-wrap: normal; word-break: normal; hyphens: none; }
.entry-content .wp-block-heading,
.entry-content .wp-block-media-text :where(h2,h3,h4,h5,h6),
.entry-content .wp-block-column :where(h2,h3,h4,h5,h6),
.entry-content .wp-block-group :where(h2,h3,h4,h5,h6) { line-height: .92; }
.entry-content :where(p,li,td,th,figcaption) { overflow-wrap: anywhere; }
.entry-content h2 { font-size: clamp(2rem, 5vw, 3.4rem); color: var(--dg-yellow); }
.entry-content h3 { font-size: clamp(1.55rem, 3.5vw, 2.35rem); }
.entry-content h4 { color: var(--dg-blue-bright); font-size: 1.4rem; }
.entry-content > .alignwide { width: min(var(--dg-wide), calc(100vw - 40px)); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.entry-content > .alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }
.entry-content blockquote { margin-inline: 0; padding: 22px 26px; color: #fff; background: var(--dg-panel); border-left: 7px solid var(--dg-yellow); border-radius: 0 14px 14px 0; }
.entry-content ul li::marker { color: var(--dg-yellow); }
.entry-content ol li::marker { color: var(--dg-blue-bright); font-weight: 900; }
.entry-content .wp-block-button__link, .button, input[type="submit"] { color: #000; background: var(--dg-yellow); border: 0; border-radius: 8px; padding: .78em 1.25em; font-weight: 900; text-decoration: none; box-shadow: 5px 5px 0 var(--dg-blue); transition: transform .18s, box-shadow .18s; }
.entry-content .wp-block-button__link:hover, .button:hover, input[type="submit"]:hover { color: #000; transform: translate(2px,2px); box-shadow: 3px 3px 0 var(--dg-blue); }
.wp-block-image img, .wp-block-cover, .wp-block-media-text, .wp-block-video video { border-radius: var(--dg-radius); }
.wp-block-embed { margin-block: 2rem; }
.wp-block-embed__wrapper { position: relative; width: 100%; overflow: hidden; border-radius: var(--dg-radius); background: #000; }
.wp-block-embed.is-type-video .wp-block-embed__wrapper { aspect-ratio: 16 / 9; }
.wp-block-embed.is-type-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.wp-block-table { overflow-x: auto; }
.wp-block-table table { border-collapse: collapse; }
.wp-block-table th { color: #000; background: var(--dg-yellow); }
.wp-block-table td, .wp-block-table th { padding: 10px 14px; border: 1px solid var(--dg-line); }
input, textarea, select { max-width: 100%; padding: 12px; color: #fff; background: var(--dg-panel); border: 2px solid var(--dg-line); border-radius: 7px; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--dg-yellow); outline-offset: 2px; }

.posts-grid { width: min(calc(100% - 40px), var(--dg-wide)); margin: 0 auto; padding: 60px 0 90px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.post-card { position: relative; overflow: hidden; background: var(--dg-panel); border: 1px solid var(--dg-line); border-radius: var(--dg-radius); }
.post-card:nth-child(3n+2) { border-top: 5px solid var(--dg-blue); }
.post-card:nth-child(3n+3) { border-top: 5px solid var(--dg-green); }
.post-card:first-child { border-top: 5px solid var(--dg-yellow); }
.post-card-image { display: block; aspect-ratio: 16/10; overflow: hidden; background: var(--dg-panel-soft); }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.post-card:hover .post-card-image img { transform: scale(1.04); }
.post-card-content { padding: 24px; }
.post-card h2 { margin: 0 0 10px; font-family: var(--dg-font-heading); font-size: 1.9rem; font-weight: 700; line-height: .92; letter-spacing: -.01em; text-transform: uppercase; }
.post-card h2 a { color: #fff; text-decoration: none; }
.post-card h2 a:hover { color: var(--dg-yellow); }
.post-meta { color: var(--dg-muted); font-size: .78rem; }
.pagination { grid-column: 1/-1; }

.site-footer { position: relative; background: var(--dg-panel); border-top: 1px solid var(--dg-line); overflow: hidden; }
.site-footer::before { content: ""; position: absolute; left: -90px; top: -115px; width: 230px; aspect-ratio: 1; background: var(--dg-blue); transform: rotate(45deg); opacity: .35; }
.footer-inner { position: relative; width: min(calc(100% - 40px), var(--dg-wide)); margin: auto; padding: 54px 0; display: flex; justify-content: space-between; align-items: center; gap: 28px; }
.footer-name { margin: 0; color: var(--dg-yellow); font-family: var(--dg-font-heading); font-size: 1.65rem; font-weight: 700; line-height: .95; text-transform: uppercase; }
.footer-credit { margin: 5px 0 0; color: var(--dg-muted); font-size: .82rem; }
.footer-menu { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; margin: 0; padding: 0; list-style: none; }
.footer-menu a { color: #fff; font-size: .85rem; font-weight: 700; text-decoration: none; }
.footer-menu a:hover { color: var(--dg-yellow); }

@media (max-width: 860px) {
  body { font-size: 17px; }
  .header-inner { min-height: 0; padding-top: 10px; padding-bottom: 10px; }
  .menu-toggle { display: grid; place-items: center; flex: 0 0 auto; }
  .main-navigation { position: absolute; top: 100%; left: 0; right: 0; display: none; padding: 10px 20px 22px; background: var(--dg-black); border-bottom: 4px solid var(--dg-blue); box-shadow: 0 16px 35px rgba(0,0,0,.4); }
  .main-navigation.is-open { display: block; }
  .primary-menu { display: block; }
  .primary-menu li + li { border-top: 1px solid var(--dg-line); }
  .primary-menu a { padding: 15px 10px; border-radius: 0; }
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .page-hero::after { right: -140px; }
}

@media (max-width: 560px) {
  .header-inner, .hero-inner, .content-wrap, .posts-grid, .footer-inner { width: min(calc(100% - 28px), var(--dg-wide)); }
  .site-description { display: none; }
  .page-hero { min-height: 230px; }
  .entry-title { font-size: clamp(2.2rem, 10vw, 4rem); line-height: .86; }
  .posts-grid { grid-template-columns: 1fr; padding-top: 36px; }
  .footer-inner { display: block; }
  .footer-menu { justify-content: flex-start; margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  body { color: #000; background: #fff; }
  .site-header, .site-footer { display: none; }
  .page-hero { min-height: 0; color: #000; background: none !important; }
  .page-hero::before, .page-hero::after { display: none; }
  .hero-inner, .content-wrap { width: 100%; padding: 20px 0; }
}
