/* Inter is loaded via <link rel="stylesheet"> in each page's <head> (faster than @import). */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.75rem;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 200;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fff;
}

h1,
h2,
h3 {
  font-weight: 700;
}

strong,
b {
  font-weight: 700;
}

/* ——— Fixed header: logo left, menu right ——— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.site-logo img {
  display: block;
  height: 54px;
  width: auto;
  max-width: min(240px, 52vw);
  object-fit: contain;
}

.site-logo:focus-visible {
  outline: 2px solid #1565c0;
  outline-offset: 3px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  justify-content: flex-end;
  align-items: center;
  margin-left: auto;
}

.site-nav a {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 200;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  text-decoration: underline;
}

/* ——— Full-bleed hero ——— */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  margin: 0;
  display: flex;
  /* Headline sits low in the picture, inside the bottom third — not centred. */
  align-items: flex-end;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Hero background. Browsers that understand image-set take the smaller WebP;
   everything else falls back to the first rule's JPEG. */
.hero--luzern {
  background-image: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
    url("../images/Luzern.jpg");
  background-image: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
    image-set(url("../images/Luzern.webp") type("image/webp"),
              url("../images/Luzern.jpg") type("image/jpeg"));
}

.hero__inner {
  position: relative;
  z-index: 1;
  /* The bottom padding is what places the headline in the lower third.
     Change this one value to raise or lower it. */
  padding: 4rem 1.25rem 15vh;
  max-width: 42rem;
  text-align: center;
}

.hero__text {
  margin: 0;
  color: #fff;
  font-weight: 200;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.25;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.hero h1.hero__text {
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
}

/* ——— White content blocks #3–#7 ——— */
.content-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
}

.content-section {
  padding: 2rem 0;
  border-bottom: 1px solid #e8e8e8;
}

.content-section:last-child {
  border-bottom: none;
}

.content-section h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

.content-section h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.15rem;
}

.content-section h3:first-of-type {
  margin-top: 0;
}

.content-section__logo--large {
  display: block;
  width: min(100%, 340px);
  height: auto;
  margin: 0 0 1.5rem;
  object-fit: contain;
}

.content-section p {
  margin: 0 0 1rem;
}

.content-section ul {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.content-section li {
  margin-bottom: 0.35rem;
}

.content-section li:last-child {
  margin-bottom: 0;
}

.content-section p:last-child {
  margin-bottom: 0;
}

.contact-block {
  margin: 0 0 1rem;
  font-style: normal;
}

.contact-links a {
  color: #0d47a1;
  text-decoration: underline;
}

.contact-links a:hover {
  color: #1565c0;
}

.hint {
  font-size: 0.875rem;
  color: #555;
  margin-top: 1rem !important;
}

/* ——— News list ——— */
.news-list {
  margin: 0;
  padding-left: 1.25rem;
}

.news-list a {
  color: #0d47a1;
  text-decoration: underline;
}

.news-list a:hover {
  color: #1565c0;
}

.news-list__item {
  margin-bottom: 0.75rem;
}

.news-list__date {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.875rem;
  color: #555;
}

/* ——— Square cards (#6 towns) ——— */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.town-card {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.town-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 55%);
  pointer-events: none;
  z-index: 1;
}

.town-card__name {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.town-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.town-card:focus-visible {
  outline: 3px solid #1565c0;
  outline-offset: 2px;
}

/* ——— Article subpages ——— */
.article-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 6.25rem 1rem 3rem;
}

.article-page .article-date {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: #555;
}

.article-page h1 {
  margin-top: 0;
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.article-page p {
  margin: 0 0 1rem;
}

.article-figure {
  margin: 0 0 1.5rem;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.article-page .back {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: #0d47a1;
}

.article-page .back:hover {
  color: #1565c0;
}

.article-page .placeholder {
  color: #555;
  font-style: italic;
}

/* ——— Skip link (keyboard users; hidden until focused) ——— */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: #fff;
  color: #0d47a1;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ——— Site footer ——— */
.site-footer {
  border-top: 1px solid #e8e8e8;
  background: #fafafa;
  padding: 2.5rem 1rem;
}

.site-footer__inner {
  max-width: 720px;
  margin: 0 auto;
  font-size: 0.9rem;
  color: #555;
}

.site-footer p {
  margin: 0 0 0.35rem;
}

.site-footer__name {
  font-weight: 700;
  color: #1a1a1a;
}

.site-footer a {
  color: #0d47a1;
}

.site-footer__legal {
  margin-top: 1rem;
  font-size: 0.825rem;
  color: #777;
}

/* ——— Small screens: keep the header compact so it doesn't eat the hero ——— */
@media (max-width: 640px) {
  /* The nav wraps onto a second row here, making the fixed header taller.
     These three values keep anchor jumps and article tops clear of it. */
  html {
    scroll-padding-top: 7.5rem;
  }

  .article-page {
    padding-top: 8rem;
  }

  .site-logo img {
    height: 42px;
  }

  .site-nav {
    gap: 0.25rem 0.75rem;
  }

  .site-nav a {
    font-size: 0.8rem;
  }
}

/* ——— Contact: vCard QR codes ——— */
.vcard-heading {
  margin-top: 2rem;
}

.vcard-intro {
  color: #555;
  font-size: 0.925rem;
}

/* These are dense QR codes (81 and 85 modules, because the logo in the middle
   forces high error correction), so they need to be rendered LARGE enough for a
   camera to resolve each module. Do not shrink these below ~280px. */
.vcard-grid {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
  max-width: 40rem;
}

.vcard {
  margin: 0;
  text-align: center;
}

.vcard__name {
  margin: 0 0 0.6rem;
  font-weight: 700;
  font-size: 1rem;
}

.vcard__qr {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto 0.6rem;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 0.35rem;
  background: #fff;
  /* Keep the QR modules sharp rather than blurred when scaled down */
  image-rendering: -webkit-optimize-contrast;
}

.vcard__download {
  display: inline-block;
  padding: 0.5rem 0.25rem;   /* generous tap target on touch screens */
  font-size: 0.875rem;
  color: #0d47a1;
}

.vcard__download:hover,
.vcard__download:focus-visible {
  color: #1565c0;
}

/* ——— Mobile: lighter hero image ——— */
/* A phone never needs the 2400px desktop hero. 1200px covers a 390pt screen
   at 3x pixel density and costs ~44 KB instead of ~116 KB. */
@media (max-width: 768px) {
  .hero--luzern {
    background-image: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
      url("../images/Luzern-mobile.jpg");
    background-image: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)),
      image-set(url("../images/Luzern-mobile.webp") type("image/webp"),
                url("../images/Luzern-mobile.jpg") type("image/jpeg"));
  }
}

/* ——— Touch targets ——— */
/* Applied at every width, not just narrow ones: touchscreen laptops and
   tablets report desktop widths. The negative margin keeps the header the
   same visual height as before, so this costs nothing on screen. */
.site-nav a {
  display: inline-block;
  padding: 0.45rem 0;
  margin: -0.45rem 0;
}

.contact-links a,
.news-list a {
  display: inline-block;
  padding: 0.2rem 0;
}

/* ——— Very narrow phones (320–360px) ——— */
@media (max-width: 380px) {
  .site-nav a {
    font-size: 0.75rem;
  }

  .content-main {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
}

/* ——— Large desktops: let the hero headline scale up a little ——— */
@media (min-width: 1600px) {
  .hero h1.hero__text {
    font-size: 2.5rem;
  }

  .hero__inner {
    max-width: 48rem;
  }
}

/* ——— Respect a reduced-motion preference ——— */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ——— Print: drop the fixed header and the huge hero ——— */
@media print {
  .site-header,
  .hero,
  .skip-link {
    display: none !important;
  }

  body {
    color: #000;
  }

  .content-main,
  .article-page {
    padding-top: 0;
    max-width: none;
  }
}

/* ——— Language switcher ——— */
.site-lang {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.site-lang a {
  display: inline-block;
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: #555;
  text-decoration: none;
  border-radius: 4px;
}

.site-lang a:hover,
.site-lang a:focus-visible {
  color: #0d47a1;
  background: rgba(13, 71, 161, 0.07);
}

/* The language you are currently reading */
.site-lang a[aria-current] {
  color: #1a1a1a;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
}

.error-rule {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 2rem 0;
}

.article-page h2 {
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
}

/* The header now carries logo + nav + language switcher. Below this width the
   nav and switcher share the second row rather than stacking into three. */
@media (max-width: 900px) {
  .site-header__inner {
    gap: 0.5rem 1rem;
  }

  .site-nav {
    order: 3;
  }

  .site-lang {
    order: 2;
  }
}

/* ——— Real Estate Data section ——— */
.data-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.data-item {
  padding: 1.1rem 1.2rem;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #fafafa;
}

.data-item h3 {
  margin: 0 0 .4rem;
  font-size: 1.05rem;
}

.data-item h3 a {
  color: #1a1a1a;
  text-decoration: none;
}

.data-item h3 a:hover,
.data-item h3 a:focus-visible {
  color: #0d47a1;
  text-decoration: underline;
}

.data-item p {
  margin: 0 0 .5rem;
  font-size: .925rem;
}

.data-item__cta {
  margin: 0 !important;
}

.data-item__cta a {
  display: inline-block;
  padding: .2rem 0;
  color: #0d47a1;
  font-size: .9rem;
}

/* ——— data cards: map thumbnail beside the text ——— */
.data-item {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}

.data-item__thumb {
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  line-height: 0;
}

.data-item__thumb img {
  display: block;
  width: 100%;
  height: auto;
}

.data-item__body > :first-child {
  margin-top: 0;
}

@media (max-width: 640px) {
  .data-item {
    grid-template-columns: 1fr;
    gap: .9rem;
  }
}

