/* ==========================================================================
   Nicholas Davila — Portfolio
   Clean hand-written stylesheet, rebuilt from the Adobe Portfolio "basic"
   theme. Design tokens (colors, type scale, spacing, grid) were extracted
   from the live theme CSS; the two Typekit fonts referenced by the original
   site are licensed through Adobe Fonts and are not rehosted here — see
   README.md for details on the font substitution.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Inter:wght@400;700&display=swap');

:root {
  --color-text: #222222;
  --color-text-muted: #999999;
  --color-text-hover: #666666;
  --color-bg: #ffffff;
  --color-bg-subtle: #eeeeee;
  --color-overlay: rgba(0, 0, 0, 0.3);

  --font-heading: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  --max-width: 1400px;
  --sidebar-width: 19%;
}

/* ---- Reset ---- */
* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
}

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

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---- Layout shell ---- */
.site-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-content {
  display: flex;
  align-items: flex-start;
  gap: 1%;
  margin: 0 5%;
  padding: 0 0 60px;
}

/* ---- Sidebar / nav ---- */
.sidebar-content {
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  position: sticky;
  top: 0;
}

.site-header {
  position: relative;
  padding-top: 60px;
  padding-bottom: 20px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text);
}

.logo a:hover {
  color: var(--color-text);
}

.logo-tagline {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text);
  padding-top: 20px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  position: absolute;
  top: 30px;
  right: 5%;
}

.hamburger i {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
}

nav {
  padding-top: 40px;
}

nav .nav-group {
  padding-bottom: 30px;
}

nav .gallery-title {
  padding-bottom: 20px;
}

nav .gallery-title a {
  color: #282727;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

nav .gallery-title a:hover,
nav .gallery-title a.active {
  color: var(--color-text);
}

nav .project-title {
  padding-bottom: 12px;
}

nav .project-title a,
nav .page-title a {
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
}

nav .project-title a:hover,
nav .project-title a.active,
nav .page-title a:hover,
nav .page-title a.active {
  color: var(--color-text);
}

nav .page-title {
  padding-top: 6px;
  padding-bottom: 30px;
}

.nav-social ul {
  display: flex;
  gap: 16px;
}

.nav-social .icon {
  width: 20px;
  height: 16px;
  fill: var(--color-text-muted);
  transition: fill 0.2s ease;
}

.nav-social a:hover .icon {
  fill: var(--color-text);
}

/* ---- Main content ---- */
main {
  flex: 1;
  min-width: 0;
}

/* ---- Homepage / work grid ---- */
.project-covers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5% 1.5%;
  padding-top: 60px;
}

.project-cover {
  display: block;
  position: relative;
}

.cover-image-wrap {
  overflow: hidden;
  position: relative;
  aspect-ratio: 508 / 397;
  background: var(--color-bg-subtle);
}

.cover-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cover-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-cover:hover .cover-image-wrap::after {
  opacity: 1;
}

.details-wrap {
  padding-top: 12px;
}

.project-cover .title {
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.3;
  padding-bottom: 4px;
}

.project-cover .date {
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
}

/* ---- Page header (project pages, contact) ---- */
.page-header {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 0 40px;
  text-align: center;
}

.page-header .title {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding-bottom: 15px;
}

.page-header .description {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text-muted);
}

/* ---- Project content modules ---- */
.page-content {
  padding-bottom: 60px;
}

.project-module {
  margin-bottom: 40px;
}

/* Text stays in a narrow readable column; images/galleries/embeds use
   the full main-content width (matches the original theme). */
.module-text {
  max-width: 800px;
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
}

.module-text p {
  margin: 0 0 1em;
}

.module-image {
  max-width: 100%;
}

.module-image img {
  width: 100%;
}

.module-caption {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  padding-top: 10px;
}

/* Justified image gallery: rows are pre-packed at build time (see
   scratch_justified_pack.py at repo history) so every image keeps its
   native aspect ratio — no cropping. Each row gets its own height,
   scaled so the row's images exactly fill the container width. */
.module-gallery {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gallery-row {
  display: flex;
  gap: 4px;
}

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

/* Two-up / side-by-side rows */
.module-row {
  display: flex;
  gap: 20px;
  align-items: center;
}

.module-row > * {
  flex: 1;
  min-width: 0;
}

/* Video / embed */
.module-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.module-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Page content wide images that break out of the 800px column */
.page-content.wide {
  max-width: 100%;
}

/* Back to top */
.back-to-top {
  text-align: center;
  padding: 40px 0;
}

.back-to-top a {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text-muted);
}

.back-to-top a:hover {
  color: var(--color-text);
}

/* ---- Contact form ---- */
.contact-form {
  max-width: 500px;
  margin: 0 auto;
}

.form-input {
  margin-bottom: 24px;
}

.form-input label {
  display: block;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.form-input input,
.form-input textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--color-bg-subtle);
  padding: 8px 0;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text);
  background: transparent;
}

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

.form-input textarea {
  min-height: 120px;
  resize: vertical;
}

.submit-button {
  display: inline-block;
  padding: 12px 32px;
  border: 1px solid var(--color-text);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  background: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.submit-button:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ---- Footer ---- */
.site-footer {
  padding: 60px 0;
  text-align: center;
}

.footer-social ul {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.footer-social .icon {
  width: 20px;
  height: 16px;
  fill: var(--color-text-muted);
  transition: fill 0.2s ease;
}

.footer-social a:hover .icon {
  fill: var(--color-text);
}

/* ---- Responsive ---- */
@media (max-width: 932px) {
  .site-content {
    flex-direction: column;
  }

  .sidebar-content {
    width: 100%;
    flex: 1 1 auto;
    position: static;
  }

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

  .page-header {
    padding: 34px 0 20px;
  }

  .page-header .title {
    font-size: 22px;
  }

  .module-row {
    flex-direction: column;
  }

  .hamburger {
    display: flex;
  }

  nav {
    display: none;
  }

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

@media (max-width: 540px) {
  .project-covers {
    grid-template-columns: 1fr;
  }

  .site-content {
    margin: 0 6%;
  }

  .gallery-row {
    flex-wrap: wrap;
  }

  .gallery-row img {
    width: auto !important;
    height: auto !important;
    max-width: 100%;
  }
}
