/*
Theme Name: Happy Blocks
Theme URI: https://henrik.net/happy-blocks/
Author: Henrik Ismarker
Author URI: https://henrik.net/
Description: Minimalistiskt tema med färgblock, mobil-accordion och sidvisa bakgrundsfärger.
Version: 0.6.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: happy-blocks
Tags: custom-colors, custom-menu, translation-ready
*/

:root {
  --hb-bg: #ffffff;
  --hb-fg: #111111;

  /* Layout */
  --hb-max: 1200px;
  /* Content max width on pages (requested: 1100px) */
  --hb-content: 1100px;

  /* Colors */
  --hb-yellow: #f6d85c;
}

html, body { margin:0; padding:0; }
/* Outside the centered "surface" is always white */
html { background: #ffffff; }
body {
  background: #ffffff;
  color: #111111;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
}
a { color: inherit; }

/* =====================
   SURFACE WRAPPER (PAGES)
   ===================== */

.hb-surface {
  max-width: var(--hb-max);
  margin: 40px auto;
  padding: 0 24px;
}

.hb-surface--page {
  background: var(--hb-bg);
  color: var(--hb-fg);
}


/* =====================
   FRONT PAGE
   ===================== */

.hb-front {
  max-width: var(--hb-max);
  margin: 40px auto;
  padding: 0 24px;
}

.hb-layout {
  display: grid;
  grid-template-columns: 42% 58%;
  gap: 0;
}

.hb-left {
  background: var(--hb-yellow);
  padding: 56px 48px;
}

.hb-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 10px 0;
  font-size: clamp(44px, 5vw, 84px);
  line-height: 0.95;
}

.hb-tagline {
  margin: 0 0 30px 0;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 800;
}

.hb-left .hb-content p {
  margin: 0 0 18px 0;
  font-size: 14px;
}

.hb-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
}

.hb-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 900;
  font-size: clamp(20px, 2.8vw, 44px);
  padding: 18px;
  min-height: 190px;
}

.hb-tile:focus {
  outline: 3px solid rgba(0,0,0,0.55);
  outline-offset: -3px;
}

.hb-tile-label { text-align: center; }

/* =====================
   PAGE + TOP TABS
   ===================== */

.hb-topbar {
  width: 100%;
  background: transparent;
  padding: 0;
}

.hb-topbar-inner {
  width: 100%;
  display: flex;
  align-items: stretch;
}

.hb-home {
  width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: var(--hb-yellow);
  flex: 0 0 auto;
}

.hb-home svg { width: 26px; height: 26px; display:block; }

.hb-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  flex: 1 1 auto;
}

.hb-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 18px 20px;
  font-weight: 900;
  min-width: 140px;
  position: relative;
}

.hb-tab.is-current {
  box-shadow: inset 0 -6px 0 rgba(0,0,0,0.35);
}

.hb-tab:focus {
  outline: 3px solid rgba(0,0,0,0.55);
  outline-offset: -3px;
}

.hb-page {
  min-height: calc(100vh - 64px);
  padding: 70px 0 140px;
}

.hb-page-inner {
  max-width: var(--hb-content);
  margin: 0 auto;
}

.hb-page h1 {
  margin: 0 0 26px 0;
  font-size: clamp(68px, 8vw, 128px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.9;
  text-align: center;
}

.hb-page .hb-page-content {
  max-width: 72ch;
  margin: 0 auto;
}

.hb-page .hb-page-content p {
  margin: 0 0 22px 0;
  font-size: 18px;
}

/* Between mode: hide labels, keep blocks */
@media (max-width: 980px) {
  .hb-tab span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
  .hb-tab { min-width: 78px; }
}

/* =====================
   MOBILE
   ===================== */

@media (max-width: 780px) {
  .hb-front {
    margin: 16px auto;
    padding: 0 16px;
  }
  .hb-surface {
    margin: 16px auto;
    padding: 0 16px;
  }
  .hb-layout { grid-template-columns: 1fr; }
  .hb-left { padding: 34px 22px; }
  .hb-right { grid-template-columns: 1fr; }
  .hb-tile { min-height: 64px; font-size: 26px; }

  /* Tabs hidden, mobile bars used instead */
  .hb-topbar { display: none; }

  .hb-page { padding: 42px 0 160px; }
  .hb-page h1 { font-size: clamp(52px, 11vw, 84px); }
}

/* Mobile bars */
.hb-mobile-bars { display: none; }

@media (max-width: 780px) {
  .hb-mobile-bars {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9999;
  }
  .hb-mobile-bars-inner {
    max-width: var(--hb-max);
    margin: 0 auto;
    overflow: hidden;
  }
  .hb-bar {
    display: block;
    width: 100%;
    border: 0;
    margin: 0;
    padding: 18px 16px;
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    cursor: pointer;
  }
  .hb-bar.is-active { padding: 26px 16px; }
  .hb-bar:focus { outline: 3px solid rgba(0,0,0,0.55); outline-offset: -3px; }
}
