/*
Theme Name: Svensk Hockey
Theme URI: https://example.com/
Author: Adelbert Otto
Description: Ett lätt, responsivt WordPress-tema byggt för SHL & Allsvenskan Hockey-pluginet.
Version: 0.1.18
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: svensk-hockey-theme
*/

:root {
  --sh-header-height: 74px;
  --sh-bg: #0b1016;
  --sh-surface: #111923;
  --sh-surface-2: #182431;
  --sh-text: #f5f7fa;
  --sh-muted: #aeb8c4;
  --sh-accent: #f2c94c;
  --sh-border: rgba(255,255,255,.10);
  --sh-content: 1480px;
  --sh-radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(30,71,105,.22), transparent 36rem),
    linear-gradient(180deg, #0b1016 0%, #0e141c 100%);
  color: var(--sh-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
img { max-width: 100%; height: auto; }

.sh-site-shell { min-height: 100vh; display: flex; flex-direction: column; padding-top: var(--sh-header-height); }
.sh-container { width: min(calc(100% - 32px), var(--sh-content)); margin-inline: auto; }
.sh-site-main { flex: 1; padding: 24px 0 56px; }

.sh-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(8,13,19,.96);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--sh-border);
  transform: translateZ(0);
  backface-visibility: hidden;
}
.sh-header-inner { min-height: 74px; display: flex; align-items: center; gap: 20px; }
.sh-brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.sh-brand img, .custom-logo { display: block; max-height: 48px; width: auto; object-fit: contain; }
.sh-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sh-brand-title { font-weight: 900; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-brand-tagline { color: var(--sh-muted); font-size: .84rem; }
.sh-nav { margin-left: auto; }
/* Top-level navigation only. Nested WordPress menus are real dropdowns. */
.sh-nav > ul { display: flex; align-items: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.sh-nav li { position: relative; list-style: none; }
.sh-nav a { display: block; padding: 10px 13px; border-radius: 10px; text-decoration: none; font-weight: 700; color: #eaf0f6; }
.sh-nav a:hover,
.sh-nav .current-menu-item > a,
.sh-nav .current-menu-ancestor > a { background: var(--sh-surface-2); }

.sh-nav .menu-item-has-children > a { padding-right: 31px; position: relative; }
.sh-nav .menu-item-has-children > a::after {
  content: "▾";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-52%);
  font-size: .72rem;
  color: var(--sh-muted);
  transition: transform .16s ease;
}
.sh-nav .sub-menu {
  position: absolute;
  z-index: 1100;
  top: calc(100% + 7px);
  left: 0;
  min-width: 250px;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #0e1721;
  border: 1px solid var(--sh-border);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(0,0,0,.40);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}
.sh-nav .sub-menu::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -8px; height: 8px;
}
.sh-nav .sub-menu a {
  white-space: nowrap;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: .94rem;
}
.sh-nav li:hover > .sub-menu,
.sh-nav li:focus-within > .sub-menu,
.sh-nav li.sh-submenu-open > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.sh-nav li.sh-submenu-open > a::after { transform: translateY(-52%) rotate(180deg); }
.sh-menu-toggle { display: none; margin-left: auto; width: 52px; height: 52px; align-items: center; justify-content: center; border: 1px solid var(--sh-border); background: var(--sh-surface); color: var(--sh-text); border-radius: 12px; padding: 0; cursor: pointer; line-height: 1; }
.sh-menu-toggle:hover, .sh-menu-toggle:focus-visible, .sh-menu-toggle[aria-expanded="true"] { background: var(--sh-surface-2); }
.sh-menu-toggle:focus-visible { outline: 2px solid var(--sh-accent); outline-offset: 2px; }
.sh-menu-icon { display: inline-flex; width: 24px; height: 18px; flex-direction: column; justify-content: space-between; align-items: stretch; }
.sh-menu-icon > span { display: block; width: 100%; height: 3px; border-radius: 999px; background: currentColor; transition: transform .18s ease, opacity .18s ease; }
.sh-menu-toggle[aria-expanded="true"] .sh-menu-icon > span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.sh-menu-toggle[aria-expanded="true"] .sh-menu-icon > span:nth-child(2) { opacity: 0; }
.sh-menu-toggle[aria-expanded="true"] .sh-menu-icon > span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
.sh-screen-reader-text { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.sh-hero { margin-bottom: 24px; }
.sh-hero-frame { overflow: hidden; border-radius: var(--sh-radius); border: 1px solid var(--sh-border); background: #0c1117; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.sh-hero-frame img { display: block; width: 100%; max-height: 680px; object-fit: cover; }
.sh-hero-copy { padding: 24px clamp(18px, 3vw, 38px); }
.sh-hero-title { margin: 0; font-size: clamp(2rem, 4.2vw, 4.5rem); line-height: .98; text-transform: uppercase; letter-spacing: -.03em; }
.sh-hero-subtitle { margin: 12px 0 0; color: var(--sh-muted); max-width: 70ch; }

.sh-content-card { background: rgba(17,25,35,.78); border: 1px solid var(--sh-border); border-radius: var(--sh-radius); padding: clamp(18px, 2.4vw, 34px); box-shadow: 0 16px 40px rgba(0,0,0,.22); }
.sh-content-card + .sh-content-card { margin-top: 22px; }
.entry-title { margin-top: 0; line-height: 1.1; }
.entry-content > :first-child { margin-top: 0; }
.entry-content > :last-child { margin-bottom: 0; }

/* Let the hockey plugin use exactly the theme content width. */
.entry-content .sah-wrap,
.sh-hockey-full .sah-wrap { width: 100% !important; max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }

.sh-site-footer { border-top: 1px solid var(--sh-border); background: #090e14; color: var(--sh-muted); }
.sh-footer-inner { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 0; }
.sh-footer-main { display: flex; flex-direction: column; gap: 4px; }
.sh-footer-copy { color: #dce6ef; }
.sh-footer-note { color: var(--sh-muted); }
.sh-footer-credit { text-align: right; }
.sh-footer-inner a { color: #dce6ef; }
.sh-footer-credit-label { color: var(--sh-muted); }

.wp-block-image img, .alignwide img, .alignfull img { border-radius: 12px; }
.alignwide { margin-left: max(-4vw, -60px); margin-right: max(-4vw, -60px); }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

body.admin-bar .sh-site-header { top: 32px; }

@media (max-width: 782px) {
  body.admin-bar .sh-site-header { top: 46px; }
}

@media (max-width: 900px) {
  .sh-container { width: min(calc(100% - 22px), var(--sh-content)); }
  .sh-menu-toggle { display: inline-flex; }
  .sh-nav { display: none; position: absolute; top: calc(100% + 1px); left: 0; right: 0; background: #0b1118; border-bottom: 1px solid var(--sh-border); padding: 10px 11px 16px; }
  .sh-nav.is-open { display: block; }
  .sh-nav > ul { display: grid; gap: 6px; }
  .sh-nav a { padding: 12px 14px; }
  .sh-nav .menu-item-has-children > a { padding-right: 40px; }
  .sh-nav .sub-menu {
    position: static;
    min-width: 0;
    display: grid;
    gap: 4px;
    margin: 2px 0 5px 14px;
    padding: 4px 0 4px 10px;
    border: 0;
    border-left: 2px solid rgba(242,201,76,.5);
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
  .sh-nav .sub-menu a { padding: 10px 12px; white-space: normal; color: #d6e0ea; font-size: .92rem; }
  .sh-nav .sub-menu a::before { content: "↳ "; color: var(--sh-accent); }
  .sh-nav .menu-item-has-children > a::after { transform: translateY(-52%); }
  .sh-brand-tagline { display: none; }
  .sh-footer-inner { align-items: flex-start; flex-direction: column; }
  .sh-footer-credit { text-align: left; }
}

@media (max-width: 520px) {
  .sh-brand { gap: 10px; }
  .sh-brand img, .custom-logo { max-height: 42px; max-width: 88px; }
  .sh-brand-title { font-size: 1rem; }
}


/* Share bar */
.sh-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 22px;
  padding: 11px 13px;
  border: 1px solid var(--sh-border);
  border-radius: 13px;
  background: rgba(17,25,35,.82);
}
.sh-share-label { color: var(--sh-muted); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-right: 2px; }
.sh-share-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--sh-border);
  border-radius: 10px;
  background: #15202c;
  color: #f5f7fa;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.sh-share-btn:hover, .sh-share-btn:focus-visible { background: #1d2c3b; border-color: rgba(255,255,255,.2); transform: translateY(-1px); }
.sh-share-btn:focus-visible { outline: 2px solid var(--sh-accent); outline-offset: 2px; }
.sh-share-btn svg { width: 18px; height: 18px; fill: currentColor; flex: 0 0 auto; }
.sh-share-facebook { color: #dbe9ff; }
.sh-share-whatsapp { color: #dfffe9; }
.sh-share-copy.is-copied { color: #fff2b0; border-color: rgba(242,201,76,.5); }

@media (max-width: 560px) {
  .sh-share { align-items: stretch; }
  .sh-share-label { flex: 0 0 100%; margin: 0 0 1px; }
  .sh-share-btn { flex: 1 1 calc(50% - 5px); }
  .sh-share-copy { flex-basis: 100%; }
}


/* Back to top */
.sh-back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 980;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(17,25,35,.96);
  color: #f5f7fa;
  box-shadow: 0 10px 30px rgba(0,0,0,.32);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, background .18s ease, visibility .18s ease;
}
.sh-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.sh-back-to-top:hover,
.sh-back-to-top:focus-visible {
  background: #1d2c3b;
}
.sh-back-to-top:focus-visible {
  outline: 2px solid var(--sh-accent);
  outline-offset: 2px;
}
.sh-back-to-top-arrow {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sh-accent);
  color: #0b1016;
  font-size: 1rem;
  line-height: 1;
}
.sh-back-to-top-text { white-space: nowrap; }

@media (max-width: 560px) {
  .sh-back-to-top {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    min-height: 42px;
    padding: 9px 12px;
    font-size: .9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sh-back-to-top { transition: none; }
}


/* Cookie consent / preferences — v0.1.17 top-layer rebuild */
.sh-cookie-manage {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-top: 8px;
  padding: 8px 13px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(17,25,35,.96);
  color: #f5f7fa;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.sh-cookie-manage:hover,
.sh-cookie-manage:focus-visible {
  background: #1d2c3b;
  border-color: rgba(255,255,255,.24);
}
.sh-cookie-manage:focus-visible {
  outline: 2px solid var(--sh-accent);
  outline-offset: 2px;
}
.sh-cookie-manage:active { transform: translateY(1px); }
.sh-cookie-manage-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  background: var(--sh-accent);
  color: #0b1016;
}
.sh-cookie-manage-icon svg { display: block; }
.sh-cookie-manage-text { white-space: nowrap; }

@media (max-width: 560px) {
  .sh-cookie-manage {
    min-height: 40px;
    padding: 8px 11px;
    font-size: .9rem;
  }
}

/* The whole cookie component is a direct body child and owns its own viewport
   layer. It never participates in footer/theme layout. */
.sh-cookie-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  place-items: end center;
  padding: 18px;
  pointer-events: none;
  isolation: isolate;
}
.sh-cookie-layer.is-open {
  display: grid;
  pointer-events: auto;
}
.sh-cookie-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(2, 7, 12, .68);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.sh-cookie-sheet {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 36px));
  max-height: min(78vh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: #0a1017;
  color: #f5f7fa;
  box-shadow: 0 24px 80px rgba(0,0,0,.68);
}
.sh-cookie-sheet-head {
  position: sticky;
  top: -20px;
  z-index: 2;
  margin: -20px -20px 14px;
  padding: 18px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #0a1017;
}
.sh-cookie-sheet-head h2 { margin: 0; font-size: 1.25rem; }
.sh-cookie-close {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: inline-grid; place-items: center;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.14);
  background: #182431; color: #fff; font-size: 1.6rem; line-height: 1;
  cursor: pointer;
}
.sh-cookie-copy p { margin: 0; color: #bac5d0; font-size: .96rem; }
.sh-cookie-policy { display: inline-block; margin-top: 10px; color: #fff; }
.sh-cookie-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.sh-cookie-btn {
  appearance: none; border: 1px solid rgba(255,255,255,.16); border-radius: 10px;
  padding: 10px 14px; font-weight: 800; cursor: pointer;
}
.sh-cookie-btn-primary { background: #f2c94c; color: #081019; border-color: #f2c94c; }
.sh-cookie-btn-primary:hover { filter: brightness(1.05); }
.sh-cookie-btn-secondary { background: #182431; color: #f5f7fa; }
.sh-cookie-btn-secondary:hover { background: #223244; }
.sh-cookie-preferences[hidden] { display: none !important; }
.sh-cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid rgba(255,255,255,.09); }
.sh-cookie-category:first-child { border-top: 0; }
.sh-cookie-category p { margin: 4px 0 0; color: #aeb8c4; font-size: .9rem; }
.sh-cookie-required { white-space: nowrap; color: #8fd9ae; font-weight: 800; font-size: .86rem; }
.sh-cookie-toggle-row { cursor: pointer; }
.sh-cookie-toggle-row input { width: 22px; height: 22px; accent-color: #f2c94c; flex: 0 0 auto; }
.sh-cookie-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 16px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.09); }

@media (max-width: 760px) {
  .sh-cookie-layer {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
  .sh-cookie-sheet {
    width: 100%;
    max-height: min(74vh, 650px);
    padding: 16px;
    border-radius: 18px;
  }
  .sh-cookie-sheet-head { top: -16px; margin: -16px -16px 12px; padding: 14px 16px 10px; }
  .sh-cookie-actions, .sh-cookie-modal-actions { flex-direction: column; }
  .sh-cookie-actions .sh-cookie-btn, .sh-cookie-modal-actions .sh-cookie-btn { width: 100%; }
  .sh-cookie-category { align-items: flex-start; }
}

@media (prefers-reduced-motion: no-preference) {
  .sh-cookie-layer.is-open .sh-cookie-sheet { animation: sht-cookie-in .18s ease-out both; }
  @keyframes sht-cookie-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
}
