/* =========================================================
   Virginia Edwards Design — shared stylesheet
   ---------------------------------------------------------
   To change the typeface site-wide, edit --font-serif below.
   To change the background or text colours, edit the tokens.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300..700;1,8..60,300..600&display=swap');

:root {
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  --bg: #d7d7d5;
  --text: #2a2a28;          /* body + big titles */
  --muted: #5a5a55;         /* nav links (resting) — darkened to meet WCAG AA (was #8b8b87) */
  --muted-active: #45453f;  /* nav active / hover */
  --pill: rgba(248, 248, 245, 0.40);
  --card: #ffffff;
  --line: #a4a49f;

  --maxw: 1500px;
  --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.46;
  letter-spacing: 0.1px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

/* ---------- Navigation ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 24px;
  margin: 14px var(--gutter) 0;
  padding: 20px 34px;
  background: var(--pill);
  border-radius: 44px;
  backdrop-filter: blur(2px);
}

.nav-logo,
.nav-contact { color: var(--muted); white-space: nowrap; }
.nav-contact { justify-self: end; text-align: right; }

.nav-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 26px;
  row-gap: 4px;
  max-width: 760px;
}

.site-nav a { color: var(--muted); transition: color 0.15s ease; }
.site-nav a:hover { color: var(--muted-active); }

.site-nav a.is-active { color: var(--muted-active); }
.site-nav a.is-active::before { content: '\2192\00a0'; } /* arrow + nbsp */

/* ---------- Generic page frame ---------- */

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px var(--gutter) 60px;
}

/* ---------- Project pages ---------- */

.project {
  min-height: calc(100vh - 90px);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px var(--gutter) 48px;
  display: flex;
  flex-direction: column;
}

.project-body {
  display: grid;
  grid-template-columns: minmax(280px, 430px) 1fr;
  gap: clamp(28px, 5vw, 80px);
  align-items: start;
}

.project-text p { margin: 0 0 1.15em; }
.project-text p:first-child { margin-top: 4px; }

.project-media { display: grid; gap: 18px; }

.title-block { margin-top: auto; padding-top: 60px; }
.title-block .year {
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1;
  margin-bottom: 14px;
}
.title-block .big-title {
  margin: 0;
  font-weight: 400;
  line-height: 0.98;
  font-size: clamp(40px, 8.5vw, 124px);
  letter-spacing: -0.5px;
}

/* media helpers */
.media-frame {
  background: var(--card);
  padding: 0;
  border-radius: 2px;
  overflow: hidden;
}
.media-grid-3 { grid-template-columns: repeat(3, 1fr); }
.media-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* a labelled placeholder shown until a real image is dropped in */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px;
  min-height: 200px;
  color: #555550;
  background: repeating-linear-gradient(
    45deg, #cfcfcc, #cfcfcc 12px, #c8c8c5 12px, #c8c8c5 24px);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 14px;
}
.placeholder span { max-width: 220px; }

/* video embed */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 10px;
  overflow: hidden;
}
.video-embed iframe,
.video-embed .placeholder {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

/* ---------- About page ---------- */

.about-heading {
  font-weight: 400;
  font-size: clamp(40px, 7vw, 92px);
  margin: 8px 0 26px;
  line-height: 1;
}
.about-body {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 1.15fr;
  gap: clamp(28px, 5vw, 70px);
  align-items: start;
}
.about-portrait { background: var(--card); }
.about-text p { margin: 0 0 1.2em; }

/* ---------- Home page ---------- */

.home {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px var(--gutter) 80px;
}

/* Align the left hero pattern and the right grid side-by-side */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; 
  gap: 30px;
  align-items: start;
}

/* Force all 8 images into 2 side-by-side columns (2x4) */
.home-cards-flow {
  display: grid;
  grid-template-columns: repeat(2, 1fr) !important; /* 2 columns wide */
  gap: 20px !important;                             /* Balanced spacing */
}

/* Let the containers scale dynamically to their content */
.home-card {
  width: 100% !important;
  height: auto !important;
  overflow: visible;
}

.home-card a {
  display: block;
  width: 100%;
  height: auto;
}

/* Images keep their original, natural dimensions and scaling */
.home-card img {
  width: 100% !important;
  height: auto !important; /* No cropping, no forced 1:1 ratios */
  display: block;
}

/* recreated "VIRGINIA EDWARDS" hero pattern */
.hero-pattern {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #e9e7e0;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-content: center;
  justify-content: center;
  padding: 26px;
  transform: rotate(-0.4deg);
}
.hero-tag {
  border: 2px solid #1c1c1c;
  padding: 7px 14px;
  font-size: clamp(13px, 1.7vw, 22px);
  letter-spacing: 1px;
  color: #1c1c1c;
  white-space: nowrap;
  transform: rotate(var(--r, 0deg)) scaleX(var(--sx, 1));
  font-weight: 500;
}
.home-date {
  position: absolute;
  left: 18px;
  bottom: 14px;
  font-size: clamp(28px, 4vw, 52px);
  color: #3a3a36;
  font-variant-numeric: tabular-nums;
  mix-blend-mode: multiply;
}

/* ---------- Contact page ---------- */

.contact {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px var(--gutter) 60px;
  min-height: calc(100vh - 90px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}
.contact-clock {
  font-size: clamp(22px, 3vw, 34px);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.contact-list { justify-self: end; text-align: right; display: grid; gap: 5px; }
.contact-row {
  display: flex;
  justify-content: flex-end;
  gap: 60px;
  white-space: nowrap;
}
.contact-row a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}
.contact-row a:hover { color: #000; }
.contact-row svg { width: 16px; height: 16px; flex: none; }

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .site-nav {
    grid-template-columns: 1fr;
    gap: 8px;
    border-radius: 26px;
    padding: 16px 22px;
    text-align: center;
  }
  .nav-contact { justify-self: center; text-align: center; }
  .nav-center { justify-content: center; max-width: none; }

  .project-body,
  .about-body,
  .home-grid { grid-template-columns: 1fr; }

  .contact {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .contact-list { justify-self: start; text-align: left; }
  .contact-row { justify-content: flex-start; gap: 26px; white-space: normal; }

  .title-block { padding-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

:focus-visible { outline: 2px solid #555; outline-offset: 3px; }

/* ---------- Accessibility utilities ---------- */

/* visually hidden but available to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* skip-to-content link: hidden until focused via keyboard */
.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 100;
  background: #1c1c1c;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: 6px;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; }

.site-img { display: block; width: 100%; height: auto; border-radius: 2px; }

/* ---------- Image Slideshow Styles ---------- */

.slideshow-container {
  max-width: 100%;
  position: relative;
  margin: auto;
  background: var(--card);
  border-radius: 2px;
  overflow: hidden;
}

/* Hide images by default */
.mySlides {
  display: none;
}

/* Ensure the images match up nicely */
.mySlides img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Next & previous navigational buttons */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 16px;
  color: var(--text);
  font-weight: bold;
  font-size: 18px;
  transition: 0.3s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  background-color: rgba(248, 248, 245, 0.5); /* Matching your layout pill background style */
}

.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.prev:hover, .next:hover {
  background-color: rgba(69, 69, 63, 0.8);
  color: #fff;
}

/* Navigation Dots */
.slideshow-dots {
  margin-top: 10px;
}

.dot {
  cursor: pointer;
  height: 10px;
  width: 10px;
  margin: 0 4px;
  background-color: var(--line);
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
}

.dot.active, .dot:hover {
  background-color: var(--text);
}

/* Smooth fade transition between slides */
.fade {
  animation-name: fade;
  animation-duration: 0.5s;
}

@keyframes fade {
  from { opacity: .4 }
  to { opacity: 1 }
}
/* --- Slideshow Alignment Fixes --- */

/* Ensures the text and slideshow sit beautifully next to each other */
.project-body {
  display: grid !important;
  grid-template-columns: 1.1fr 1fr !important; /* Splitting the horizontal screen room cleanly */
  gap: clamp(28px, 5vw, 80px) !important;       /* Adapts space dynamically */
  align-items: start !important;
  width: 100%;
}

/* Constrains slideshow to keep it aligned with text height bounds */
.project-media {
  width: 100% !important;
  display: block !important;
}

.slideshow-container {
  width: 100% !important;
}

