.project {
  display: flex;
  align-items: center;
  gap: 36px; /* mindre horisontellt gap mellan bild och info */
  margin: 60px 0; /* minskat vertikalt mellanrum mellan sektioner */
}

/* --- Navbar --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,0.6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.brand {
  font-weight: 700;
  color: #111;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 18px;
}

.nav-links a {
  color: #111;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 6px;
  border-radius: 6px;
}

.nav-links a:hover {
  background: rgba(0,0,0,0.04);
}

/* Mobile toggle */
.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  width: 36px;
  height: 24px;
  cursor: pointer;
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block;
  background: #111;
  height: 2px;
  border-radius: 2px;
  position: relative;
}
.nav-toggle-label span { top: 10px; }
.nav-toggle-label span::before { content: ''; position: absolute; top: -8px; left: 0; right: 0; }
.nav-toggle-label span::after { content: ''; position: absolute; top: 8px; left: 0; right: 0; }

@media (max-width: 700px) {
  .nav-toggle-label { display: block; }
  .nav-links { position: absolute; right: 20px; top: 60px; flex-direction: column; background: rgba(255,255,255,0.95); padding: 10px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.08); display: none; }
  .nav-links a { padding: 10px 14px; }
  .nav-toggle:checked + .nav-toggle-label + .nav-links { display: flex; }
}

.project-image {
  /* make a fixed-size image box so all images have the same visible size
     use a 16:9 aspect ratio by default; change padding-bottom to alter ratio */
  width: 100%;
  max-width: 700px;
  border-radius: 8px;
  overflow: hidden; /* crop anything outside the box */
  /* aspect-ratio gives modern browsers a simple way to keep consistent size */
  aspect-ratio: 16 / 9;
  background: #eee; /* fallback background while image loads */
}

.project-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover; /* cover will crop/zoom images to always fill the box */
  transition: transform 300ms ease, filter 300ms ease;
}

/* Subtle hover/focus effect */
.project-image:hover img,
.project-image:focus-within img {
  transform: scale(1.03);
  filter: brightness(1.03);
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .project-image img {
    transition: none;
  }
  .project-image:hover img,
  .project-image:focus-within img {
    transform: none;
    filter: none;
  }
}

.project-info {
  max-width: 400px;
}

.project-period {
  color: #888;
  font-size: 13px;
  margin: 6px 0 8px 0;
  letter-spacing: 0.4px;
}

.project-category {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
  color: #666;
}

.project-title {
  font-size: 32px;
  margin: 10px 0;
}

.project-desc {
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
}

.project-link {
  text-decoration: none;
  font-weight: 600;
  padding-bottom: 2px;
  border-bottom: 1px solid black;
  transition: opacity 0.2s ease;
}

.project-link:hover {
  opacity: 0.6;
}

/* --- Responsiv layout --- */
@media (max-width: 900px) {
  .project {
    flex-direction: column;
    text-align: center;
  }

  /* On smaller screens make the image box taller so it remains visible */
  .project-image {
    max-width: 100%;
    aspect-ratio: 4 / 3; /* slightly taller on mobile */
  }
}

/* Medium phones / small tablets */
@media (max-width: 600px) {
  .project {
    gap: 20px;
    margin: 40px 0; /* mindre vertikalt mellanrum */
  }

  .project-info {
    max-width: 100%;
    padding: 0 18px; /* ge lite luft på kanterna */
  }

  .project-title {
    font-size: 24px;
  }

  .project-desc {
    font-size: 15px;
  }

  .project-image {
    aspect-ratio: 1 / 1; /* kvadratisk bild på mindre skärmar */
    max-width: 480px;
  }
}

/* Små telefoner */
@media (max-width: 400px) {
  .project {
    gap: 16px;
    margin: 24px 0;
  }

  .project-title {
    font-size: 20px;
  }

  .project-desc {
    font-size: 14px;
    line-height: 1.5;
  }

  .project-image {
    aspect-ratio: 4 / 3; /* lite högre så bild syns bättre på små skärmar */
    border-radius: 6px;
  }
}

/* ===========================
   KONTAKT-BUBBLA
=========================== */
/* Contact bubble (fixed bottom-right) */
.contact-bubble {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  display: inline-block;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  z-index: 60;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.contact-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.contact-bubble:hover,
.contact-bubble:focus {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.16);
}

@media (max-width: 420px) {
  .contact-bubble { width: 48px; height: 48px; right: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-bubble { transition: none; }
}

/* Tooltip bubble */
.contact-tooltip {
    position: fixed;
    right: 90px;               /* Justering från kontakt-knappen */
    bottom: 30px;
    background: white;
    padding: 10px 15px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    border: 1px solid #e5e5e5;
}

/* Small triangle */
.contact-tooltip::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: 12px;
    width: 0;
    height: 0;
    border-left: 8px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}

/* Show tooltip when hovering over the bubble (OR JS toggle) */
.contact-bubble + #contact-tooltip {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Contact modal overlay */
.contact-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.contact-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}
.contact-modal-panel {
  width: 360px;
  max-width: calc(100% - 40px);
  background: #fff;
  border-radius: 10px;
  padding: 20px 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  position: relative;
}
.contact-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
}
.contact-content h3 { margin-top: 0; }
.contact-content p { margin: 8px 0; }
.contact-content .small { color: #666; font-size: 13px; margin-top: 12px; }

@media (max-width: 480px) {
  .contact-modal-panel { width: 320px; padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-modal { transition: none; }
}