/* === Book Designer — Barb Aronica — Base Styles === */

:root {
  --color-1: #f3f2f2;
  --color-2: #e8e8e8;
  --color-3: #c6c5c3;
  --color-4: #cbcfb4;
  --color-6: #716f6f;
  --color-7: #212326;
  --color-8: #141617;
  --white: #ffffff;
  --font-body: "Trebuchet MS", Helvetica, sans-serif;
  --font-nav: Verdana, Geneva, sans-serif;
  --max-width: 1248px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 22px;
  color: var(--color-6);
  line-height: 1.3;
  letter-spacing: 0.015em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background: var(--color-1);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-8); text-decoration: none; }
a:hover { color: #198fd9; }

/* === Header === */

.site-header {
  background: var(--color-2);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--font-body);
  font-size: 1em;
  font-weight: 400;
  color: var(--color-6);
}

.main-nav ul {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.main-nav li {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  margin: 0 10px;
  line-height: 1;
}

.main-nav li:first-child { margin-left: 0; }
.main-nav li:last-child  { margin-right: 0; }

.main-nav a {
  font-family: var(--font-nav);
  font-size: 0.68em;
  font-weight: 400;
  text-transform: lowercase;
  color: var(--color-6);
  line-height: 1;
  transition: color 0.3s cubic-bezier(.42, .01, .58, 1);
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav a.active {
  color: var(--color-4);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: var(--color-6);
  color: var(--color-2);
  border: none;
  padding: 8px 14px;
  font-family: var(--font-nav);
  font-size: 0.8em;
  cursor: pointer;
}

/* === Main Content === */

.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
}

h1 {
  font-family: var(--font-body);
  font-size: 2em;
  font-weight: 400;
  color: var(--color-6);
  margin-bottom: 20px;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h2 {
  font-family: var(--font-body);
  font-size: 2em;
  font-weight: 400;
  color: var(--color-8);
  line-height: 1.0;
  letter-spacing: -0.015em;
}

/* === Home Page === */

.home-layout {
  display: flex;
  gap: 40px;
  align-items: center;
}

.home-text {
  flex: 2;
}

.home-text p {
  margin-bottom: 1em;
}

.home-text .attribution {
  text-align: right;
  color: var(--color-8);
}

.home-photo {
  flex: 1;
  text-align: center;
}

.home-photo img {
  max-width: 100%;
}

.home-photo .photo-credit {
  font-size: 0.6em;
  text-align: center;
  margin-top: 8px;
  color: var(--color-8);
}

/* === Justified Image Grid === */

.jig-gallery {
  opacity: 0;
  transition: opacity 0.3s;
  line-height: 0;
}

.jig-gallery::after {
  content: '';
  display: table;
  clear: both;
}

.jig-item {
  position: relative;
  float: left;
  overflow: hidden;
  cursor: pointer;
}

.jig-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.jig-item a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.jig-item a::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity 0.3s;
}

.jig-item:hover a::after {
  opacity: 0.2;
}

.jig-item.jig-hidden {
  display: none !important;
}

/* === Lightbox === */

.jig-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.jig-lightbox.active {
  display: flex;
}

.jig-lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.jig-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.jig-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.jig-lightbox-close {
  position: fixed;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
}

.jig-lightbox-prev,
.jig-lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  z-index: 10;
  padding: 10px;
}

.jig-lightbox-prev { left: 15px; }
.jig-lightbox-next { right: 15px; }

.jig-lightbox-counter {
  color: #fff;
  font-family: var(--font-nav);
  font-size: 14px;
  margin-top: 10px;
  text-align: center;
}

/* === Branding Grid === */

.branding-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.brand-card {
  border: 1px solid var(--color-6);
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-card img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}

/* === Resume === */

.resume-content h2 {
  font-family: var(--font-body);
  font-size: 1em;
  font-weight: 400;
  color: var(--color-8);
  margin-top: 1em;
  margin-bottom: 5px;
  line-height: 1.0;
}

.resume-content p {
  margin-bottom: 1em;
}

#resume-column p {
  font-size: 0.75em !important;
}

/* === Contact === */

.contact-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.contact-intro,
.contact-form {
  flex: 1;
}

.contact-intro a {
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.form-group {
  margin-bottom: 16px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--color-3);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--color-1);
  color: var(--color-8);
  height: 50px;
}

.form-group textarea {
  min-height: 220px;
  height: auto;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-4);
}

.form-submit-row {
  text-align: right;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 1em;
  padding: 10px 24px;
  background: var(--color-7);
  color: var(--white);
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-submit:hover {
  background: var(--color-6);
}

.form-status {
  margin-top: 12px;
  font-size: 0.9em;
}

.form-status.success { color: #2e7d32; }
.form-status.error { color: #c62828; }

/* === Footer === */

.site-footer {
  background: var(--color-2);
  padding: 15px 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-inner p {
  font-family: var(--font-nav);
  font-size: 0.8em;
  line-height: 1;
  color: var(--color-7);
}

/* === Responsive === */

@media (max-width: 1024px) {
  .branding-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .home-layout {
    flex-direction: column;
  }

  .home-photo {
    order: -1;
    max-width: 300px;
    margin: 0 auto;
  }

  .contact-layout {
    flex-direction: column;
  }

  .branding-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  /* Justified grid — stack on mobile (overrides JS inline styles) */
  .jig-item {
    width: 100% !important;
    height: auto !important;
    margin-right: 0 !important;
    margin-bottom: 4px !important;
    float: none !important;
  }

  .jig-item img {
    height: auto;
  }

  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-6);
    z-index: 999;
  }

  .main-nav.open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .main-nav a {
    display: block;
    padding: 12px 24px;
    color: var(--color-3);
    font-size: 1.01em;
  }

  .main-nav a:hover,
  .main-nav a.active {
    background: var(--color-3);
    color: var(--color-6);
  }

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

  h1 {
    font-size: 1.5em;
  }
}
