/* basic reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --page-x: 3rem;
  --gap-lg: 5rem;
  --gap-md: 3rem;
  --gap-sm: 1.5rem;
}

@media (max-width: 768px) {
  :root {
    --page-x: 1.25rem;
    --gap-lg: 2.5rem;
    --gap-md: 1.75rem;
    --gap-sm: 1rem;
  }
}

@media (max-width: 480px) {
  :root {
    --page-x: 1rem;
    --gap-lg: 1.5rem;
    --gap-md: 1.25rem;
    --gap-sm: 0.75rem;
  }
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #111;
  background: #fafafa;
}

/* site title uses Questrial, rest stays Arial */
header h1 a {
  font-family: 'Questrial', sans-serif;
  text-decoration: none;
  color: inherit;
}

/* header */
header {
  padding: 3rem var(--page-x) 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--gap-sm);
  flex-wrap: wrap; /* allows nav to wrap under title on small screens */
}

header h1 {
  font-size: clamp(1.5rem, 2vw + 1rem, 2.5rem);
  font-weight: normal;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap; /* prevent overflow on narrow screens */
}

nav a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

nav a:hover,
nav a.active { border-bottom-color: currentColor; }

/* stack nav below title on small screens with nicer spacing */
@media (max-width: 640px) {
  header {
    align-items: flex-start;
  }
  nav {
    width: 100%;
    margin-top: 0.5rem;
  }
  nav ul {
    gap: 0.875rem 1rem;
  }
}

/* banner */
.banner {
  display: block;
  width: calc(100% - 2 * var(--page-x));
  margin: 3rem var(--page-x);
  max-height: 60vh;
  object-fit: cover;
}

/* intro text on index */
.intro {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 var(--page-x);
  font-size: 1rem;
}
.intro p { margin-bottom: 1rem; }

/* Works gallery grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-lg) 4rem;
  padding: 3rem var(--page-x);
}

/* 2 columns for tablets */
@media (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-md) var(--gap-md);
    padding: 2rem var(--page-x);
  }
}

/* 1 column for phones */
@media (max-width: 640px) {
  .gallery {
    grid-template-columns: 1fr;
    gap: var(--gap-md);
    padding: 1.5rem var(--page-x);
  }
}

.gallery-item { overflow: hidden; }
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease;
}

/* disable hover zoom where hover is not supported */
@media (hover: hover) and (pointer: fine) {
  .gallery-item img:hover { transform: scale(1.03); }
}

/* inline meta under each thumbnail */
.gallery-meta {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #555;
}
.gallery-meta .title { color: #111; font-weight: 600; }
.gallery-meta .line2 { font-style: italic; }

/* Lightbox overlay */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: block;
  z-index: 1000;
  overflow: hidden;
  touch-action: none;
}

.lightbox figure {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 0;
}

/* centered image, panned and scaled via transforms */
.lightbox-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) scale(1);
  transform-origin: center center;
  will-change: transform;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  z-index: 1;
}

/* never show the caption in the lightbox */
.lightbox-caption { display: none; }

/* hidden state */
.lightbox.hidden { display: none; }

/* controls always on top */
.lightbox-nav,
.lightbox-close {
  position: absolute;
  background: none;
  border: none;
  color: #111;
  font-size: clamp(1.5rem, 1rem + 1.2vw, 2rem);
  cursor: pointer;
  padding: 0.5rem;
  z-index: 5;
  pointer-events: auto;
}

.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-nav.prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-nav:disabled { opacity: 0.3; cursor: default; }

/* add a larger hit area on touch devices */
@media (pointer: coarse) {
  .lightbox-nav,
  .lightbox-close {
    padding: 0.75rem 1rem;
  }
}

/******* ABOUT ********/
.about-section {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  padding: 3rem var(--page-x);
}

.about-section .about-image,
.about-section .about-text { flex: 1; }

.about-section .about-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.about-section .about-text h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.25rem, 0.8rem + 1vw, 1.5rem);
  font-weight: 500;
}
.about-section .about-text p {
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .about-section {
    flex-direction: column;
    gap: var(--gap-sm);
    padding: 2rem var(--page-x);
  }
}

/* CV page */
.cv { max-width: 800px; margin: 3rem auto; padding: 0 var(--page-x); }
.cv h2 { font-size: clamp(1.5rem, 1rem + 1.2vw, 2rem); font-weight: normal; margin-bottom: 0.25rem; }
.cv-subtitle { color: #555; margin-bottom: 1.5rem; font-style: italic; font-size: 1rem; }
.cv h3 {
  font-size: clamp(1.1rem, 0.9rem + 0.6vw, 1.25rem);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: normal;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}
.cv-list { list-style: none; padding-left: 0; }
.cv-list li { margin-bottom: 0.75rem; line-height: 1.5; }
.cv-list li .year { font-weight: bold; margin-right: 0.5rem; color: #111; }

/* Contact page */
.contact-section {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 4rem var(--page-x);
  background: url('../images/contact-bg.jpg') no-repeat center center;
  background-size: cover;
  color: #111;
}

@media (max-width: 768px) {
  .contact-section {
    flex-direction: column;
    gap: var(--gap-sm);
    padding: 2rem var(--page-x);
  }
}

.contact-info { flex: 1; }
.contact-info h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.25rem, 0.9rem + 1vw, 1.5rem);
  font-weight: 500;
}
.contact-info p { margin-bottom: 1.5rem; line-height: 1.6; }
.contact-info .email { margin-bottom: 2rem; }
.contact-info a { color: inherit; text-decoration: none; }

.social-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.social-icons a { color: #111; font-size: 1.25rem; }

.social-icons a.text-link { font-size: 1rem; }
.social-icons a.icon-link {
  font-size: 1.5rem;
  line-height: 1;
}

/* form pane */
.contact-form {
  flex: 1;
  max-width: 600px;   /* limit width */
  margin: 0 auto;     /* equal space left and right */
}

.contact-form form {
  background: rgba(255,255,255,0.9);
  padding: 2rem;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; }
.name-fields { display: flex; gap: 1rem; }
.name-fields input { flex: 1; }

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ccc;
  border-radius: 2px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: #888; }

/* stack the two name inputs on phones */
@media (max-width: 480px) {
  .name-fields { flex-direction: column; gap: 0.75rem; }
}

.contact-form button[type="submit"] {
  background: #3a5a40;
  color: #fff;
  text-transform: uppercase;
  border: none;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 2px;
  transition: opacity 0.2s ease;
}
.contact-form button[type="submit"]:hover { opacity: 0.8; }

/* Shop page */
.shop-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem var(--page-x);
  background: url('../images/contact-bg.jpg') no-repeat center center;
  background-size: cover;
  min-height: calc(100vh - 6rem);
  color: #111;
}
.shop-section .shop-info {
  max-width: 600px;
  text-align: center;
  background: rgba(255,255,255,0.9);
  padding: 2rem;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.shop-section h2 { /* fixed missing dot */
  font-size: clamp(1.25rem, 0.9rem + 1vw, 1.5rem);
  font-weight: 500;
  margin-bottom: 1rem;
}
.shop-section p { margin-bottom: 1.5rem; line-height: 1.6; }
.shop-section a { color: inherit; text-decoration: underline; }
.shop-section .social-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.shop-section .social-icons a { color: #111; font-size: 1.5rem; }

/* motion preference */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 768px) {
  .contact-section {
    flex-direction: column;
    gap: 3rem;  /* bigger space between info (with Instagram) and form */
  }
}

@media (max-width: 768px) {
  .about-section {
    flex-direction: column;
    gap: 3rem;   /* more vertical space between photo and text */
    padding: 2rem var(--page-x);
  }
}
