/* Cleaned / consolidated stylesheet for CM Projects site */

:root {
  --site-header-height: 72px;       /* visible inner bar height (approx) */
  --content-max-width: 920px;       /* matches .info-card max-width */
  --edge-gap: 16px;
  --header-gap: 12px;               /* outer gap above/below inner bar */
}

/* page background and base text */
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background-image: url('/images/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  color: #fff;
  background-color: #111;
  /* make room for the fixed header + visible gap */
  padding-top: calc(var(--site-header-height) + (var(--header-gap) * 2));
  box-sizing: border-box;
}

/* outer fixed container (no visuals) */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  pointer-events: none; /* only inner bar receives events */
}

/* inner visible banner constrained to the content width */
.site-header-inner {
  pointer-events: auto;
  margin: var(--header-gap) auto;
  max-width: var(--content-max-width);
  width: calc(100% - (var(--edge-gap) * 2));
  display: flex;
  flex-wrap: wrap;          /* allow brand and nav to stack if needed */
  align-items: center;
  gap: 12px;
  padding: 12px 16px;       /* reduced padding for better small-screen fit */
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border-radius: 12px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* push nav to the right inside the inner bar */
.site-header-inner .site-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  min-width: 0; /* allow children to shrink */
  margin-left: 0; /* remove forced auto so alignment works when wrapped */
}

/* brand / logo */
.site-header .brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.site-header .logo {
  width: 130px;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.6));
}

.site-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  white-space: nowrap;
}

/* navigation */
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-link {
  flex: 0 0 auto;
  display: inline-block;
  padding: 8px 12px;
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.06);
  transition: background .15s ease, transform .08s ease;
}

/* smaller screens: let nav drop below the brand and become full width */
@media (max-width: 720px) {
  .site-header-inner {
    padding: 10px 12px;
  }
  .site-header-inner .site-nav {
    width: 100%;
    margin-top: 8px;
    justify-content: flex-start; /* align left when wrapped */
  }
  .nav-list {
    gap: 8px;
    padding-bottom: 6px;
  }
  .nav-link {
    padding: 7px 10px;
    font-size: 14px;
  }
}

/* very small screens: compact the brand and ensure nav remains usable (scrollable) */
@media (max-width: 420px) {
  .site-header .logo { width: 86px; }
  .site-title { display: none; }
  .nav-list { gap: 6px; }
  .nav-link { font-size: 13px; padding: 6px 8px; }
}

/* hero area to hold the centered info card */
.hero {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: calc(var(--site-header-height) + 24px) 20px 40px; /* extra top spacing for header */
  min-height: calc(100vh - 120px);
  box-sizing: border-box;
}

/* translucent information card */
.info-card {
  max-width: var(--content-max-width);
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.06);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-sizing: border-box;
  overflow: hidden;       /* clip any accidental overflow (use auto if you prefer scroll) */
}

/* Fix mobile overflow inside .info-card */
.info-card {
  box-sizing: border-box; /* ensure padding doesn't push width */
}

/* ensure images never overflow their container */
.info-card img,
.info-photo-right {
  display: block;
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
}

/* allow long words/emails and other inline content to wrap on small screens */
.info-card,
.info-card .bio,
.info-card .lead,
.info-card .contact-line {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* lead paragraph under the title */
.info-card .lead {
  margin-top: 8px;
  margin-bottom: 18px;
  font-size: 16px;
  color: rgba(255,255,255,0.92);
}

/* row: bio left, photo right */
.info-row 
{
  display: grid;
  grid-template-columns: 1fr auto; /* let image size itself */
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}

.info-row .bio {
  margin: 0;
  font-size: 16px;
  color: rgba(255,255,255,0.95);
}

/* Fix: prevent image from pushing bio column on very wide screens */
.info-row {
  display: grid;
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
  /* allow bio to take remaining space and let image size itself but be clamped */
  grid-template-columns: minmax(0, 1fr) clamp(180px, 32vw, 420px);
}

/* allow text column to shrink/wrap inside grid properly */
.info-row .bio {
  min-width: 0;
}

/* responsive, capped image sizing */
.info-photo-right {
  display: block;
  width: clamp(180px, 32vw, 420px); /* scales between 180px and 420px based on viewport */
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.04);
  justify-self: end;
  align-self: start;
}

/* optional: cap extremely tall images on very large viewports */
@media (min-width: 1400px) {
  .info-photo-right { max-height: 640px; object-fit: contain; }
}

/* responsive (small screens) */
@media (max-width: 720px) {
  .info-row {
    grid-template-columns: 1fr;
  }
  .info-photo-right {
    width: 100%;
    height: auto;
    object-fit: contain;
    justify-self: stretch;
  }
}

/* very small screens: keep nav visible and usable (horizontal scroll) */
@media (max-width: 420px) {
  .site-nav {
    display: block; /* show nav on phones instead of hiding it */
  }

  .nav-list {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 6px 0 0 0;
    overflow-x: auto;                 /* allow horizontal scrolling if too wide */
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    align-items: center;
  }

  /* hide native scrollbar on WebKit, optional */
  .nav-list::-webkit-scrollbar { display: none; }

  .nav-link {
    padding: 7px 10px;
    font-size: 13px;
    white-space: nowrap;              /* keep each button on one line for scroll */
  }

  /* reduce logo and hide title to save space */
  .site-header .logo { width: 86px; }
  .site-title { display: none; }

  /* keep photo visible with a reasonable mobile height */
  .info-photo-right {
    width: 100%;
    height: 200px;
    justify-self: stretch;
  }
}

/* Contact card */
.contact-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 12px;
  box-sizing: border-box;
}

.contact-intro {
  margin: 0 0 10px 0;
  color: rgba(255,255,255,0.9);
  font-size: 15px;
}

.contact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.contact-info {
  margin-bottom: 12px;
  color: rgba(255,255,255,0.95);
  transition: opacity .18s ease, max-height .18s ease;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}

.contact-info.visible {
  max-height: 200px;
  opacity: 1;
}

/* form */
.contact-form {
  display: grid;
  gap: 8px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.25);
  color: #fff;
  box-sizing: border-box;
}

.contact-form textarea { resize: vertical; min-height: 100px; }

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
}

/* make the contact form primary button match the header nav button styling */
.contact-form .btn {
  display: inline-block;
  padding: 8px 12px;
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.06);
  transition: background .15s ease, transform .08s ease;
  cursor: pointer;
}

/* hover / focus / active states match nav behaviour */
.contact-form .btn:hover,
.contact-form .btn:focus {
  background: rgba(255,255,255,0.14);
  transform: translateY(-2px);
  outline: none;
}

.contact-form .btn:active {
  transform: translateY(0);
}

/* small screens: ensure contact card content stays inside the info-card */
@media (max-width:720px) {
  .contact-card { padding: 10px; }
  .contact-actions { gap: 6px; }
  .contact-info.visible { max-height: 400px; }
}

/* visually hidden (accessible) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}