/*
Theme Name: Tidligpå Portal
Theme URI: https://tidligpa.local
Author: Zpirit
Description: Portal theme that lists network sites in a simple grid.
Version: 1.0.0
Text Domain: tidligpa-portal
*/

@font-face {
  font-family: 'Good Sans';
  src: url('../../mu-plugins/tidligpa/tidligpa-platform/assets/fonts/good-sans/GoodSans-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Good Sans';
  src: url('../../mu-plugins/tidligpa/tidligpa-platform/assets/fonts/good-sans/GoodSans-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Good Sans';
  src: url('../../mu-plugins/tidligpa/tidligpa-platform/assets/fonts/good-sans/GoodSans-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --portal-bg: #c2d6ee;
  --portal-surface: rgba(255, 255, 255, 0.94);
  --portal-surface-strong: #ffffff;
  --portal-text: #0a3f51;
  --portal-muted: rgba(10, 63, 81, 0.8);
  --portal-border: rgba(10, 63, 81, 0.18);
  --portal-accent: #fedd38;
  --portal-accent-strong: #0a3f51;
  --portal-shadow: 0 18px 40px rgba(10, 63, 81, 0.1);
  --portal-radius: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: 'Good Sans', system-ui, -apple-system, sans-serif;
  color: var(--portal-text);
  background: var(--portal-bg);
}

a {
  color: inherit;
}

.portal-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4rem 0 5rem;
}

.portal-hero {
  padding: 2rem 0 3rem;
}

.portal-kicker {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(10, 63, 81, 0.08);
  color: var(--portal-accent-strong);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-title {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.6rem, 8vw, 5.4rem);
  line-height: 0.94;
  font-weight: 500;
}

.portal-intro {
  max-width: 42rem;
  margin: 1.5rem 0 0;
  color: var(--portal-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.portal-search {
  position: relative;
  max-width: 36rem;
  margin-top: 2rem;
}

.portal-search__icon {
  position: absolute;
  top: 50%;
  left: 1.1rem;
  width: 1.2rem;
  height: 1.2rem;
  transform: translateY(-50%);
  color: rgba(10, 63, 81, 0.65);
}

.portal-search__input {
  width: 100%;
  min-height: 3.6rem;
  padding: 0.85rem 1rem 0.85rem 3rem;
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(10, 63, 81, 0.08);
  color: var(--portal-text);
  font: inherit;
  font-size: 1rem;
}

.portal-search__input:focus {
  outline: none;
  border-color: var(--portal-text);
}

.portal-meta {
  margin: 2rem 0 0;
  color: var(--portal-accent-strong);
  font-weight: 500;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.portal-card,
.portal-empty {
  padding: 1.35rem;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  background: var(--portal-surface-strong);
  box-shadow: var(--portal-shadow);
}

.portal-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.portal-card__eyebrow {
  margin: 0 0 0.35rem;
  color: rgba(10, 63, 81, 0.64);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-card__title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  font-weight: 500;
}

.portal-card__description,
.portal-empty p {
  margin: 0;
  color: var(--portal-muted);
  line-height: 1.6;
}

.portal-card__description--muted {
  color: rgba(10, 63, 81, 0.58);
}

.portal-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.8rem 1.05rem;
  border-radius: 999px;
  background: var(--portal-accent);
  color: var(--portal-text);
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.portal-card__link:hover,
.portal-card__link:focus-visible {
  transform: translateY(-1px);
  background: #f7e172;
}

.portal-empty--search {
  grid-column: 1 / -1;
}

@media (max-width: 700px) {
  .portal-shell {
    width: min(100% - 1.25rem, 1120px);
    padding-top: 3rem;
  }

  .portal-hero {
    padding-bottom: 2rem;
  }

  .portal-grid {
    grid-template-columns: 1fr;
  }

  .portal-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ==========================================================================
   Decorative scene — balloons & clouds (portal)
   ========================================================================== */

#tidligpa-portal-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

#tidligpa-portal-deco img {
  position: absolute;
}

/* Clouds */
#tidligpa-portal-deco .deco-cloud-big {
  top: 4%;
  right: 2%;
  width: clamp(130px, 17vw, 210px);
  animation: fp-cloud-right-in .8s cubic-bezier(.2,.6,.2,1) both,
             fp-cloud-float 6s ease-in-out infinite;
  animation-delay: .08s, .88s;
}

#tidligpa-portal-deco .deco-cloud-medium {
  top: 10%;
  left: 3%;
  width: clamp(85px, 11vw, 155px);
  animation: fp-cloud-left-in .8s cubic-bezier(.2,.6,.2,1) both,
             fp-cloud-float 7s ease-in-out infinite;
  animation-delay: .02s, .82s;
}

#tidligpa-portal-deco .deco-cloud-small {
  top: 38%;
  right: 5%;
  width: clamp(58px, 7vw, 108px);
  opacity: .9;
  animation: fp-cloud-right-in .8s cubic-bezier(.2,.6,.2,1) both,
             fp-cloud-float 5s ease-in-out infinite;
  animation-delay: .14s, .94s;
}

/* Balloons */
#tidligpa-portal-deco .deco-balloon-yellow {
  bottom: 5%;
  right: 4%;
  width: clamp(75px, 9vw, 125px);
  animation: fp-balloon-in .9s cubic-bezier(.2,.6,.2,1) both,
             fp-balloon-bob-lg 4.8s ease-in-out infinite;
  animation-delay: .04s, .94s;
}

#tidligpa-portal-deco .deco-balloon-pink {
  bottom: 9%;
  left: 4%;
  width: clamp(52px, 7vw, 92px);
  animation: fp-balloon-in .85s cubic-bezier(.2,.6,.2,1) both,
             fp-balloon-bob-sm 3.8s ease-in-out infinite;
  animation-delay: .18s, 1.03s;
}

/* Keyframes */
@keyframes fp-cloud-left-in {
  0%   { transform: translateX(-18px) translateY(6px); opacity: 0; }
  60%  { opacity: .9; }
  100% { transform: translateX(0) translateY(0); opacity: 1; }
}

@keyframes fp-cloud-right-in {
  0%   { transform: translateX(18px) translateY(6px); opacity: 0; }
  60%  { opacity: .95; }
  100% { transform: translateX(0) translateY(0); opacity: 1; }
}

@keyframes fp-cloud-float {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@keyframes fp-balloon-in {
  0%   { transform: translateY(28px) scale(.995); opacity: 0; }
  70%  { opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes fp-balloon-bob-lg {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}

@keyframes fp-balloon-bob-sm {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  #tidligpa-portal-deco img { animation: none !important; }
}
