/* ===========================================================
   Altera Psykologi — stylesheet
   Palette sampled directly from the practice mark:
   deep forest ink, antique bronze, warm ivory paper.
   =========================================================== */

:root {
  --ink: #1d3128;         /* deep forest — text, headings, buttons */
  --ink-fill: #1c2d25;    /* official solid brand green — matches the on-forest logo & favicon exactly */
  --ink-soft: #33413a;    /* body copy */
  --bronze: #8b7a5f;      /* decorative accents, dividers, large labels */
  --bronze-deep: #6f624c; /* interactive text — links, nav, form focus (AA safe) */
  --bronze-light: #c9bda5;/* accents on dark surfaces */
  --ivory: #f6f2e8;       /* page background — matches the mark exactly */
  --paper: #fbf8f2;       /* card / section surfaces */
  --hairline: #e1d9c9;    /* borders and rules */

  --font-display: 'Marcellus', 'Cormorant Garamond', serif;
  --font-body: 'Cormorant Garamond', Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: var(--ink-soft);
  line-height: 1.75;
  background: var(--ivory);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.01em;
}

a {
  color: var(--bronze-deep);
}

::selection {
  background: var(--bronze);
  color: var(--ivory);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--bronze-deep);
  outline-offset: 3px;
}

main {
  display: block;
  padding-bottom: 2rem;
}

.tracked {
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ---------- Site header ---------- */
.site-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.7rem 2.75rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.1rem 1.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.brand-name {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1rem;
  color: var(--bronze-deep);
}

/* ---------- Main navigation ---------- */
nav.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1.6rem;
}

.main-nav > ul > li {
  position: relative;
  line-height: 1;
}

.has-submenu {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.main-nav > ul > li > a {
  display: inline-block;
  position: relative;
  padding: 0.3rem 0.05rem;
  line-height: 1rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.main-nav > ul > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--bronze-deep);
  transition: right 0.25s ease;
}

.main-nav > ul > li > a:hover::after,
.main-nav > ul > li > a:focus-visible::after,
.main-nav > ul > li > a.active::after {
  right: 0;
}

.main-nav > ul > li > a.active {
  color: var(--bronze-deep);
}

/* Submenu toggle — a separate tap target from the "Tjänster" link
   itself, so the link still goes straight to the Tjänster page while
   this reveals the fold-out on any device, mouse or touch. */
.submenu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--bronze-deep);
  cursor: pointer;
}

.submenu-toggle::after {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-top: -0.25em;
}

.submenu-toggle[aria-expanded="true"]::after {
  transform: rotate(225deg);
  margin-top: 0.2em;
}

/* Submenu (dropdown) */
/* Uses visibility/opacity rather than display:none so the close can be
   delayed — display can't be transitioned, which is why a cursor that
   paused briefly in the gap used to lose the menu instantly. */
.has-submenu .submenu {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.9rem;
  min-width: 260px;
  max-width: calc(100vw - 2rem);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(29, 49, 40, 0.1);
  border: 1px solid var(--hairline);
  padding: 0.4rem 0;
  z-index: 20;

  visibility: hidden;
  opacity: 0;
  /* Closing: wait before hiding, so a slow or wandering cursor keeps it.
     Opening stays instant (no delay on the open rule below). */
  transition: opacity 0.18s ease, visibility 0s linear 0.45s;
}

/* Invisible bridge across the gap between "Tjänster" and the panel.
   Generously oversized (and extended sideways) so the cursor can drift
   diagonally without ever leaving a hoverable surface. */
.has-submenu .submenu::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  right: -1.5rem;
  top: -1.5rem;
  height: 1.5rem;
}

.has-submenu:hover .submenu,
.has-submenu:focus-within .submenu,
.has-submenu.submenu-open .submenu {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.18s ease, visibility 0s linear 0s;
}

.submenu li a {
  display: block;
  padding: 0.7rem 1.6rem;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.98rem;
  white-space: nowrap;
  /* Reserve the weight change up front so text never shifts on hover */
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease;
}

/* Subtle emphasis instead of a filled rectangle: slightly heavier text
   plus a fine underline that stops short of the panel edges. */
.submenu li a:hover,
.submenu li a:focus-visible {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: var(--bronze);
  background: none;
}

/* Nav stays a single row all the way down to phone widths; only the
   spacing tightens so five words + a toggle still fit on one line. */
@media (max-width: 480px) {
  nav.main-nav ul {
    gap: 1rem;
  }

  .main-nav > ul > li > a {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
  }
}

@media (max-width: 360px) {
  nav.main-nav ul {
    gap: 0.7rem;
  }
}

/* Below this width, centering the dropdown under the trigger can push
   it partly off-screen if "Tjänster" sits near an edge. Anchor it to
   the header itself instead — always centered, always fully on-screen. */
@media (max-width: 640px) {
  .main-nav > ul > li.has-submenu {
    position: static;
  }

  .has-submenu .submenu {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(300px, calc(100vw - 2.5rem));
    max-width: none;
  }
}

/* ---------- Hero ---------- */
.hero {
  max-width: 700px;
  margin: 3rem auto 0;
  padding: 0 1.75rem;
  text-align: center;
}

.hero--compact {
  margin-top: 2.25rem;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--bronze-deep);
  margin-bottom: 0.9rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.25;
}

.lede {
  margin-top: 1.4rem;
  font-size: 1.25rem;
  color: var(--ink-soft);
}

/* Signature divider — echoes the hairline + diamond under the wordmark */
.signature-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 1.4rem auto;
  max-width: 260px;
}

.signature-divider span {
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.signature-divider i {
  width: 7px;
  height: 7px;
  background: var(--bronze);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.hero-actions {
  margin-top: 1.75rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 2.1rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--ink);
  color: var(--ivory);
}

/* ---------- Content image ---------- */
/* aspect-ratio (not a fixed px height) so near-square source photos
   aren't force-cropped into a wide letterbox and lose their subject */
.content-image {
  display: block;
  width: 100%;
  max-width: 780px;
  aspect-ratio: 4 / 3;
  height: auto;
  margin: 2.75rem auto;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 20px 45px rgba(29, 49, 40, 0.1);
}

.image-row {
  display: flex;
  gap: 14px;
  max-width: 780px;
  margin: 2.5rem auto;
}

.image-row .content-image {
  width: 50%;
  aspect-ratio: 4 / 5;
  margin: 0;
}

@media (max-width: 768px) {
  .image-row {
    flex-direction: column;
  }

  .image-row .content-image {
    width: 100%;
  }
}

/* ---------- Prose ---------- */
.prose {
  max-width: 640px;
  margin: 0 auto 3rem;
  padding: 0 1.75rem;
  color: var(--ink-soft);
}

.prose p + p {
  margin-top: 1.15em;
}

/* ---------- Anchor sections (Tjänster) ---------- */
section[id] {
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem 1.75rem;
  scroll-margin-top: 96px;
}

section[id] h2 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

/* Pull-quotes under each Tjänster section heading */
section[id] h4 {
  max-width: 520px;
  margin: 1.5rem auto 0;
  padding: 0 1rem;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--bronze-deep);
}

section[id] h4 i {
  font-style: italic;
}

section[id] .signature-divider {
  margin-top: 0;
}

section[id] + section[id] {
  border-top: 1px solid var(--hairline);
}

/* ---------- Sub-navigation (Tjänster quick links) ---------- */
.sub-nav {
  margin: 0 auto 1rem;
  max-width: 700px;
  padding: 0 1.75rem;
}

.sub-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.6rem;
}

.sub-nav a {
  color: var(--bronze-deep);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid transparent;
}

.sub-nav a:hover,
.sub-nav a:focus-visible {
  border-bottom-color: var(--bronze-deep);
}

/* ---------- Inline links ---------- */
.inline-link {
  color: var(--bronze-deep);
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 3px;
}

.inline-link:hover {
  color: var(--ink);
  text-decoration-color: var(--bronze-deep);
}

/* ---------- Contact section ---------- */
.contact-section {
  max-width: 600px;
}

.contact-section h2 {
  font-size: 1.5rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  margin-top: 2rem;
}

/* Honeypot — invisible to real visitors, present for bots that fill
   in every field regardless of visibility via display/opacity.
   !important guards against anything else on the page overriding this. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* Status banner shown after the form submits (success or error) */
.form-status {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1.6;
}

.form-status--success {
  background: #eef3ea;
  border: 1px solid var(--bronze-light);
  color: var(--ink);
}

.form-status--error {
  background: #f7ece7;
  border: 1px solid #cf9a7c;
  color: #7a3b1e;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bronze-deep);
}

.form-group input,
.form-group textarea {
  padding: 0.6rem 0.1rem;
  border: none;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  font-size: 1.05rem;
  font-family: var(--font-body);
  width: 100%;
  background: transparent;
  color: var(--ink-soft);
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.submit-btn {
  align-self: flex-start;
  padding: 0.85rem 2.4rem;
  background: var(--ink);
  color: var(--ivory);
  border: 1px solid var(--ink);
  border-radius: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.submit-btn:hover,
.submit-btn:focus-visible {
  background: transparent;
  color: var(--ink);
}

@media (max-width: 480px) {
  .submit-btn {
    width: 100%;
    text-align: center;
  }
}

/* ---------- Map ---------- */
.map-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  padding-bottom: 50%;
  height: 0;
  overflow: hidden;
  margin: 0 auto 3rem;
  border: 1px solid var(--hairline);
  border-radius: 4px;
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(45%) contrast(1.05);
  transition: filter 0.3s ease;
}

.map-container:hover iframe,
.map-container:focus-within iframe {
  filter: none;
}

/* ---------- Partner logos ---------- */
.partner-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  margin: 1rem auto 3rem;
}

.partner-logos a {
  display: inline-flex;
  cursor: pointer;
}

.partner-logos img {
  height: 38px;
  width: auto;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.partner-logos img:hover {
  opacity: 1;
  filter: grayscale(0%);
}

/* ---------- Site footer ---------- */
.site-footer {
  background: var(--ink-fill); /* exact match to the on-forest logo & favicon asset */
  color: var(--ivory);
  margin-top: 3rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 1.75rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: 340px;
}

.footer-mark {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.footer-brand-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ivory);
  letter-spacing: 0.02em;
}

.footer-brand-role {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--bronze-light);
  margin-top: 0.2rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--ivory);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--bronze-light);
}

.footer-contact {
  font-size: 0.98rem;
  color: var(--ivory);
  line-height: 1.9;
}

.footer-contact a {
  color: var(--bronze-light);
  text-decoration: none;
}

.footer-contact a:hover,
.footer-contact a:focus-visible {
  color: var(--ivory);
}

.footer-bottom {
  border-top: 1px solid rgba(246, 242, 232, 0.14);
  text-align: center;
  padding: 1.1rem 1.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--bronze-light);
}

@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
  }
}
.prose h3 {
  font-size: 1.15rem;
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
}

.prose h3:first-child {
  margin-top: 0;
}

.prose ul {
  list-style: none;
  margin-top: 0.9rem;
}

.prose ul + p,
.prose p + ul {
  margin-top: 1.15em;
}

.prose li {
  position: relative;
  padding-left: 1.3rem;
  color: var(--ink-soft);
}

.prose li + li {
  margin-top: 0.5em;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--bronze);
  transform: rotate(45deg);
}

.prose .meta-note {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.95rem;
  color: var(--bronze-deep);
}

/* ---------- Static hero banner (all pages) ---------- */
/* Full-bleed strip directly under the header. Fixed aspect ratio so the
   composition stays intact at every width; shorter on phones so it never
   pushes the page heading below the fold. */
.hero-banner {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  height: auto;
  object-fit: cover;
  object-position: center 60%;
  margin: 0;
}

@media (max-width: 700px) {
  .hero-banner {
    aspect-ratio: 2 / 1;
  }
}

/* Hero text sits closer to the banner than to a bare header */
.hero-banner + main .hero,
.hero-banner + main .hero--compact {
  margin-top: 2.5rem;
}

img.content-image {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}