/* ============================================================
 * custom.css — Portfolio-specific styles on top of Poole + Hyde
 * ============================================================ */

/* Skip link (accessibility) */
.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: #fff;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e5e5;
  z-index: 1000;
}

/* Sidebar footer */
.sidebar-footer {
  font-size: 0.75rem;
  margin-top: 1rem;
}

/* Override Hyde's decorative Abril Fatface — match Soren's PT Sans */
.sidebar-about h1 {
  font-family: "PT Sans", Helvetica, Arial, sans-serif;
  font-size: 1.4rem;
  font-weight: bold;
  letter-spacing: -0.025rem;
}

/* Sidebar lead/subtitle — subtle */
.sidebar-about .lead {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 300;
}

/* Nav links — match Soren's subtle style */
.sidebar-nav-item {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
}

.sidebar-nav-item.active {
  color: #fff;
}

/* ---------- About page ---------- */
.about-intro {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.portrait {
  border-radius: 5px;
  width: 180px;
  height: auto;
  object-fit: cover;
  flex-shrink: 0;
  float: right;
  margin: 0 0 1rem 1.5rem;
}

.about-heading h1 {
  margin-bottom: 0.25rem;
}

.phonetic {
  font-style: italic;
  color: #999;
  margin: 0.15rem 0;
}

.pronouns,
.subtitle {
  font-size: 0.9rem;
  color: #999;
  margin: 0.15rem 0;
}

.about-links {
  margin-top: 2rem;
  font-size: 0.95rem;
  color: #999;
}

.updated {
  font-size: 0.85rem;
  color: #9a9a9a;
}

/* ---------- Page lead ---------- */
.page-lead {
  color: #999;
  margin-top: 0;
}

/* ---------- Prose ---------- */
.prose > :first-child {
  margin-top: 0;
}

/* ---------- Section labels ---------- */
.section-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: #999;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 0.35rem;
}

/* ---------- Projects ---------- */
.project-list,
.link-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.project {
  margin-bottom: 2rem;
}

.project-title {
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}

.project-title a {
  color: #303030;
}

.project-title a:hover {
  color: #000;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
}

.tags li {
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  color: #999;
}

.link-list li {
  margin: 0.4rem 0;
}

/* ---------- Responsive about ---------- */
@media (max-width: 480px) {
  .about-intro {
    flex-direction: column;
    text-align: center;
  }

  .portrait {
    float: none;
    margin: 0 auto 1rem;
    display: block;
  }
}

.lang-switch { margin-top: 1rem; display: flex; gap: .75rem; }
.lang-switch a { opacity: .7; text-decoration: none; }
.lang-switch a.active { opacity: 1; font-weight: 600; text-decoration: underline; }

/* Certifieringar: lista med små ikoner (som LinkedIn) */
.cert-list { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.cert-item { display: flex; align-items: center; gap: 1rem; padding: .75rem 0; }
.cert-item + .cert-item { border-top: 1px solid rgba(128, 128, 128, .25); }
.cert-icon-box {
  flex: none;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.cert-icon {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}
/* Små rasterikoner visas i halv storlek i stället för att sträckas och bli suddiga. */
.cert-icon-small { width: 2rem; height: 2rem; }
.cert-icon-fallback {
  font-weight: 600;
  background: rgba(128, 128, 128, .2);
}
.cert-title { margin: 0; font-size: 1.05rem; }
.cert-title a { color: #202020; }
.cert-meta { margin: .1rem 0 0; font-size: .9rem; opacity: .75; }

/* ============================================================
 * Mobil/tablet-navigering (< 48em). Desktop (>= 48em) är oförändrad.
 * ============================================================ */

/* Nya element finns bara på mobil/tablet och bara när JS är på. */
.topbar,
.page-pager {
  display: none;
}

@media (max-width: 47.99em) {
  /* Toppbar med hamburger */
  .js .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
    padding: 0 .5rem 0 1rem;
    background-color: #202020;
  }
  .topbar-name {
    color: #fff;
    font-weight: bold;
    letter-spacing: -0.025rem;
    text-decoration: none;
  }

  .menu-toggle {
    position: relative;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
  }
  .menu-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
  }
  .menu-toggle-bar {
    position: absolute;
    left: .625rem;
    right: .625rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
  }
  .menu-toggle-bar:nth-child(1) { top: calc(50% - 7px); }
  .menu-toggle-bar:nth-child(2) { top: calc(50% - 1px); }
  .menu-toggle-bar:nth-child(3) { top: calc(50% + 5px); }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  /* Sidopanelen blir en fullskärmsmeny som glider ner uppifrån */
  .js .sidebar {
    position: fixed;
    inset: 0;
    z-index: 20;
    overflow-y: auto;
    padding: 5rem 1.5rem 2rem;
    text-align: left;
    transform: translateY(-100%);
    visibility: hidden;
  }
  .js.menu-open .sidebar {
    transform: translateY(0);
    visibility: visible;
  }

  /* Animation körs bara medan menu.js har satt .menu-anim, dvs. efter att
     användaren klickat på hamburgaren/krysset eller tryckt Escape. Vid resize
     över brytpunkten finns ingen transition, så menyn byter läge direkt. */
  .js.menu-anim .sidebar {
    transition: transform .35s ease, visibility 0s linear .35s;
  }
  .js.menu-anim.menu-open .sidebar {
    transition: transform .35s ease, visibility 0s;
  }
  .js.menu-anim .menu-toggle-bar {
    transition: transform .3s ease, opacity .2s ease;
  }
  .js.menu-open {
    overflow: hidden;
  }
  /* Namnet visas redan i toppbaren */
  .js .sidebar-about {
    display: none;
  }
  .js .sidebar-nav-item {
    font-size: 1.75rem;
    line-height: 1.4;
    padding: .4rem 0;
  }
  .js .lang-switch {
    margin-top: 2rem;
    font-size: 1.1rem;
  }

  /* Sticky footer: innehållet fyller ut så att Föregående/Nästa alltid hamnar
     längst ner – efter innehållet på långa sidor, i vyns nederkant på korta. */
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .content {
    flex: 1 0 auto;
    /* .container har margin: 0 auto, som annars krymper den som flexbarn */
    width: 100%;
    display: flex;
    flex-direction: column;
    padding-bottom: 2rem;
  }

  /* Föregående / Nästa */
  .page-pager {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
  }
  .page-pager-link {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .75rem 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    color: #202020;
    text-decoration: none;
  }
  .page-pager-link:hover,
  .page-pager-link:focus-visible {
    background-color: #f5f5f5;
    text-decoration: none;
  }
  .page-pager-next {
    margin-left: auto;
    text-align: right;
  }
  .page-pager-dir {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
  }
  .page-pager-title {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 47.99em) and (prefers-reduced-motion: reduce) {
  .js.menu-anim .sidebar,
  .js.menu-anim.menu-open .sidebar,
  .js.menu-anim .menu-toggle-bar {
    transition: none;
  }
}
