/* =============================================
   SOPHIA RUGER — GITHUB PAGES SITE
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --teal:       #556989;
  --teal-dark:  #3a4f6b;
  --teal-light: #7a90aa;
  --green:      #6a849f;
  --white:      #ffffff;
  --off-white:  #f7f9f8;
  --text:       #222222;
  --text-muted: #666666;
  --border:     #dde8e5;
  --header-height: 220px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--off-white);
  /* Push content below the sticky header */
  padding-top: var(--header-height);
}

/* Offset anchor links to account for sticky header height */
section[id] {
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

/* --- STICKY HEADER --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.header-bg {
  position: absolute;
  inset: 0;
}

.header-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Dark overlay so white text is always readable */
.header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(55, 75, 105, 0.82) 0%,
    rgba(85, 105, 137, 0.72) 50%,
    rgba(105, 125, 157, 0.68) 100%
  );
}

/* If no image is uploaded yet, fall back to the green/teal gradient */
.header-bg:not(:has(img[src$="header-bg.jpg"])) {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 50%, var(--green) 100%);
}

.header-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--white);
  padding: 0 2rem;
}

.site-title {
  font-family: "avenir-lt-pro", Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.1;
  text-shadow: 0 2px 16px rgba(0,0,0,0.5), 0 1px 4px rgba(0,0,0,0.4);
}

.site-tagline {
  text-shadow: 0 1px 8px rgba(0,0,0,0.45);
}

.site-nav {
  margin-top: 1.1rem;
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 2px;
  transition: background 0.2s, border-color 0.2s;
}

.site-nav a:hover {
  background: rgba(255,255,255,0.18);
  border-color: var(--white);
}

/* --- MAIN CONTENT AREA --- */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

/* --- SECTION TITLES --- */
.section-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: #556989;
  margin-bottom: 1.5rem;
  text-align: center;
  letter-spacing: 0.04em;
}


/* --- ABOUT SECTION: text left, headshot right --- */
.about-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: stretch;
  margin: 2.5rem 0;
}

.about-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.about-block h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #556989;
  margin-bottom: 0.6rem;
  letter-spacing: 0.04em;
}

.about-block p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.about-block + .about-block {
  margin-top: 1.8rem;
}

.about-headshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(42,127,111,0.12);
}

@media (max-width: 768px) {
  .about-row {
    grid-template-columns: 1fr;
  }
  .about-headshot {
    height: 320px;
    margin-top: 1.5rem;
  }
}


/* Hey Sophia I luh you
The below section is commented out in case you want to revert changes */

/* --- THREE HORIZONTAL TEXT BOXES --- */
/*
.card-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2.5rem 0;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--teal);
  padding: 2rem 1.6rem;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(42,127,111,0.07);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--teal-dark);
  margin-bottom: 0.8rem;
  letter-spacing: 0.02em;
}

.card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
}
*/

/* --- SLIDESHOW GALLERY --- */
.slideshow {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto;
  max-width: 820px;
}

.slide-track {
  flex: 1;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(85,105,137,0.15);
}

.slide {
  display: none;
  flex-direction: column;
}

.slide.active {
  display: flex;
}

.slide img {
  width: 100%;
  height: 480px;
  object-fit: contain;    /* was: cover — now shows full image */
  object-position: center;
  display: block;
  background: #f0f4f3;    /* subtle background behind any empty space */
  cursor: zoom-in;        /* hints that it's clickable */
}

.slide-caption {
  background: var(--white);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
  text-align: center;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.slide-btn {
  background: #556989;
  color: white;
  border: none;
  border-radius: 50%;
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-btn:hover {
  background: #3a4f6b;
  transform: scale(1.08);
}

.slide-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.dot.active {
  background: #556989;
}

@media (max-width: 768px) {
  .slide img {
    height: 300px;
  }

  .slide-btn {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 0.9rem;
  }
}

/* --- PROJECT GRID --- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.project-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(42,127,111,0.07);
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(42,127,111,0.15);
}

.project-card img {
  width: 100%;
  height: 260px;       /* increase from 200px */
  object-fit: cover;
  object-position: top; /* anchors crop to top of image instead of center */
  display: block;
}

.project-card-body {
  padding: 1.2rem;
}

.project-card-body h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--teal-dark);
  margin-bottom: 0.4rem;
}

.project-card-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.project-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  border: 1px solid var(--teal-light);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  margin-top: 0.6rem;
}

/* --- MODAL --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--white);
  border-radius: 6px;
  max-width: 640px;
  width: 100%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(0,0,0,0.8);
}

.modal-image {
  width: 100%;
  height: auto;          /* was: 280px — now adapts to image's natural ratio */
  max-height: 420px;     /* prevents very tall images from taking over */
  object-fit: contain;   /* shows full image without cropping */
  background: #f0f4f3;   /* subtle background behind any empty space */
  display: block;
}

.modal-body {
  padding: 1.8rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--teal-dark);
  margin-bottom: 0.8rem;
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1.2rem;
}

.modal-link {
  display: inline-block;
  background: var(--teal);
  color: var(--white);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 0.6rem 1.4rem;
  border-radius: 3px;
  transition: background 0.2s;
}

.modal-link:hover {
  background: var(--teal-dark);
}

/* --- DIVIDER --- */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  :root {
    --header-height: 200px;
  }

  .card-row {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 180px;
  }

  .site-nav a {
    font-size: 0.72rem;
    padding: 0.28rem 0.65rem;
  }
}
