/* Function pages and the overview (/funktioner). Only what public-site.css lacks. Colours come from
   the --ps-* variables defined on .ps there. Shapes follow the two approved drawings. */

/* The base .ps-section has 96px padding; these pages use a tighter rhythm. Each rule sets both
   sides so a section never depends on the one before it. */
.ps-fn .ps-fn-band {
  padding: 64px 0;
}

.ps-fn .ps-fn-stack {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ---- Top of a function page ---- */

.ps-fn .ps-fn-hero {
  padding: 40px 0 72px;
}

/* Without an image the text is one column. 820px keeps the line length readable and, with the
   heading at 48px, makes the column look chosen and not like half of a two-column layout. */
.ps-fn .ps-fn-hero-text {
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.ps-fn .ps-fn-hero-text .ps-eyebrow {
  margin-bottom: 0;
}

.ps-fn .ps-fn-hero-text .ps-btn-row {
  gap: 12px;
}

/* With an image: text left, browser frame right. */
.ps-fn .ps-fn-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  align-items: center;
}

.ps-fn .ps-fn-hero-grid .ps-fn-hero-text {
  max-width: none;
}

/* In a half-width column "bostadsrättsföreningar" does not fit at 48px and breaks inside the word. */
@media (min-width: 768px) {
  .ps-fn .ps-fn-hero-grid h1.ps-h1 {
    font-size: 40px;
  }
}

.ps-fn .ps-fn-hero-shot {
  min-width: 0;
}

.ps-fn .ps-fn-shot {
  display: block;
  width: 100%;
  height: auto;
}

/* ---- Steps ---- */

.ps-fn .ps-fn-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.ps-fn .ps-fn-steps li {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ps-fn .ps-fn-steps p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ps-text);
}

/* ---- Included ---- */

.ps-fn .ps-fn-included {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 64px;
  align-items: start;
}

.ps-fn .ps-fn-included li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ps-fn .ps-fn-included .ps-check {
  flex: none;
  margin-top: 4px;
  color: var(--ps-green);
}

.ps-fn .ps-fn-included li > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ps-fn .ps-fn-included p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ps-text-2);
}

.ps-fn .ps-fn-included strong {
  font-weight: 600;
  color: var(--ps-text);
}

.ps-fn .ps-fn-included .ps-fn-howto {
  font-size: 16px;
  line-height: 1.5;
}

.ps-fn .ps-fn-howto a {
  font-weight: 600;
  color: var(--ps-green);
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* ---- For the residents ---- */

.ps-fn .ps-fn-residents {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 64px;
  align-items: start;
}

.ps-fn .ps-fn-residents p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ps-text);
}

/* ---- FAQ (markup from publicRenderFaq) ---- */

.ps-fn #faq.ps-section {
  padding: 64px 0;
}

.ps-fn .ps-faq-grid {
  align-items: start;
}

/* ---- Price box and text links ---- */

.ps-fn .ps-fn-pricebox {
  padding: 64px 0 32px;
}

.ps-fn .ps-fn-pricebox-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
}

.ps-fn .ps-fn-pricebox .ps-fn-pricebox-inner {
  padding: 32px;
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  background: #ffffff;
}

.ps-fn .ps-fn-price-text {
  max-width: 760px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ps-text);
}

.ps-fn .ps-fn-textlink {
  gap: 6px;
}

/* ---- Pills ---- */

.ps-fn .ps-fn-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ps-fn .ps-fn-pills a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--ps-border);
  border-radius: 999px;
  background: #ffffff;
  font-size: 15px;
  font-weight: 500;
  color: var(--ps-green-dark);
  text-decoration: none;
}

.ps-fn .ps-fn-pills a:hover,
.ps-fn .ps-fn-pills a:focus-visible {
  border-color: var(--ps-green);
}

.ps-fn .ps-fn-pills a:focus-visible {
  outline: 3px solid var(--ps-green-dark);
  outline-offset: 2px;
}

.ps-fn .ps-fn-more {
  padding: 32px 0 80px;
}

.ps-fn .ps-fn-more .ps-fn-stack {
  gap: 24px;
}

.ps-fn h2.ps-fn-h2-small {
  font-size: 28px;
  line-height: 1.25;
}

/* ---- Overview ---- */

.ps-fn .ps-fn-hubhead {
  padding: 40px 0 48px;
}

.ps-fn .ps-fn-hubtop {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ps-fn .ps-fn-hubtop .ps-eyebrow {
  margin-bottom: 0;
}

.ps-fn .ps-fn-hubtop .ps-lead {
  max-width: 760px;
}

.ps-fn .ps-fn-hublist {
  padding: 0 0 64px;
}

/* The header is position: fixed (72px, 64px on small screens), so an anchor jump needs room above. */
.ps-fn .ps-fn-area {
  border-top: 1px solid var(--ps-border);
  padding: 32px 0;
  scroll-margin-top: 88px;
}

.ps-fn .ps-fn-area-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 64px;
  align-items: center;
}

.ps-fn .ps-fn-area-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

/* One real link per row keeps the link text short for screen readers and AI search. The heading link is
   stretched over the whole row (text column and picture) with ::after, so the whole row is clickable
   without a second, hidden link around the picture (a picture with a real alt text must not sit inside
   an aria-hidden link). The "Läs mer" link is lifted above the stretched area so it keeps its own hover
   and focus. */
.ps-fn .ps-fn-area-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ps-fn .ps-fn-area-titlerow {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ps-fn .ps-fn-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ps-green-light);
  color: var(--ps-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ps-fn h2.ps-fn-area-title {
  font-family: var(--ps-serif);
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--ps-green-dark);
}

.ps-fn .ps-fn-area-title a {
  color: inherit;
  text-decoration: none;
  /* The focus ring is drawn on the stretched ::after below, so the link must not draw a second one. */
  outline: none;
}

.ps-fn .ps-fn-area-title a::after {
  content: "";
  position: absolute;
  /* Reaches a little outside the row so the focus ring does not touch the text; the row padding (32px)
     is larger than this, so the click areas of neighbouring rows never overlap. */
  inset: -12px;
  border-radius: 12px;
}

.ps-fn .ps-fn-area .ps-fn-textlink {
  position: relative;
  z-index: 1;
}

.ps-fn .ps-fn-area-title a:hover,
.ps-fn .ps-fn-area-title a:focus-visible {
  color: var(--ps-green);
  text-decoration: underline;
}

.ps-fn .ps-fn-area-title a:focus-visible::after {
  outline: 3px solid var(--ps-green-dark);
  outline-offset: 2px;
}

.ps-fn .ps-fn-area-shot {
  display: block;
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
}

.ps-fn .ps-fn-area-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

.ps-fn .ps-fn-points {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ps-fn .ps-fn-points li {
  display: flex;
  gap: 10px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ps-text);
}

.ps-fn .ps-fn-points .ps-check {
  flex: none;
  margin-top: 3px;
  color: var(--ps-green);
}

.ps-fn .ps-fn-hubprice {
  padding: 48px 0;
}

.ps-fn .ps-fn-hubprice .ps-fn-price-text {
  color: var(--ps-green-dark);
}

/* ---- Small screens: one column, full-width buttons, nothing wider than the screen ---- */

@media (max-width: 767px) {
  .ps-fn .ps-fn-band {
    padding: 40px 0;
  }

  .ps-fn .ps-fn-hero {
    padding: 24px 0 48px;
  }

  .ps-fn .ps-fn-stack {
    gap: 28px;
  }

  .ps-fn .ps-fn-hero-grid,
  .ps-fn .ps-fn-steps,
  .ps-fn .ps-fn-included,
  .ps-fn .ps-fn-residents,
  .ps-fn .ps-fn-area-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ps-fn .ps-fn-hero-grid {
    gap: 32px;
  }

  .ps-fn .ps-fn-included {
    gap: 24px;
  }

  .ps-fn .ps-fn-pricebox {
    padding: 40px 0 24px;
  }

  .ps-fn .ps-fn-pricebox .ps-fn-pricebox-inner {
    padding: 24px 20px;
  }

  .ps-fn .ps-fn-more {
    padding: 24px 0 56px;
  }

  .ps-fn .ps-fn-hubhead {
    padding: 24px 0 32px;
  }

  .ps-fn .ps-fn-area {
    scroll-margin-top: 80px;
  }

  .ps-fn h2.ps-fn-area-title {
    font-size: 24px;
  }

  .ps-fn .ps-fn-hubprice {
    padding: 36px 0;
  }

  .ps-fn #faq.ps-section {
    padding: 40px 0;
  }

  .ps-fn .ps-faq-grid {
    gap: 24px;
  }
}

/* The page background behind the header shows through the 72px top padding of main.ps; the text pages
   are white from the breadcrumb down, as drawn. Scoped to .ps-fn so the start page is not touched. */
main.ps-fn {
  background: #ffffff;
}

/* Swedish compounds are long, but automatic hyphenation is off on purpose: with it the browser splits
   words to fill the line ("säker-het", "bostadsrättsför-eningens") although they fit on the next one.
   overflow-wrap only breaks a word that cannot fit on a line of its own. */
.ps-fn h1.ps-h1 {
  hyphens: manual;
  overflow-wrap: break-word;
}

@media (max-width: 767px) {
  /* Small enough that "bostadsrättsföreningar" fits on one line at 360px. */
  .ps-fn h1.ps-h1 {
    font-size: 24px;
  }
}
