/* sunilsuthar.com — replica of the Squarespace "Avenue" layout.
   Change colours/fonts here; everything else follows. */
:root {
  --font: "proxima-nova", "Figtree", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text: #494646;
  --heading: #333333;
  --muted: #bfbfbf;      /* inactive nav link */
  --link: #ff0000;       /* links inside text */
  --bg: #ffffff;
  --gutter: 20px;        /* outer padding + grid gap + gap between stacked images */
  --block-pad: 17px;     /* Squarespace block padding on layout pages */
  --thumb-height: 50vh;  /* Work grid thumbnails are half the window height */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 0;
  padding: 0 var(--gutter);
  min-height: 24px;
}
.site-title,
.site-nav a {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--heading);
  white-space: nowrap;
}
.site-nav { display: flex; gap: 20px; }
.menu-toggle { display: none; }
.site-nav a { color: var(--muted); transition: color 0.2s ease; }
.site-nav a:hover,
.site-nav a.active { color: var(--heading); }

/* ---------- Work grid (home) ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gutter);
  padding: 0 var(--gutter) var(--gutter);
}
.work-item { position: relative; height: var(--thumb-height); min-height: 200px; overflow: hidden; background: #a09ea1; }
.work-item:has(.work-link:hover), .work-item:has(.work-link:focus-visible) { background: #000 !important; }
.work-link { position: absolute; inset: 0; display: block; }
.work-link img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s cubic-bezier(0.33, 0, 0.2, 1); }
.work-link:hover img, .work-link:focus-visible img { opacity: 0.7; }
.work-title {
  position: absolute;
  left: 4vw;
  right: 4vw;
  bottom: 4vw;
  z-index: 1;
  max-width: 70%;
  color: #fff;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 1.1;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.33, 0, 0.2, 1);
}
.work-link:hover .work-title, .work-link:focus-visible .work-title { opacity: 1; }

/* ---------- Project pages ---------- */
/* "stack": full-width images, 20px apart (Squarespace project galleries) */
.project--stack .blocks > .block { margin: 0 0 var(--gutter); }
.project--stack .block-image img { width: 100%; }
.project--stack .block-text,
.project--stack .block-video,
.project--stack .block-gallery,
.project--stack .block-row { padding: 0 var(--gutter); }

/* "layout": Squarespace layout pages — 20px side margins, 17px block padding */
.project--layout { padding: 0 var(--gutter) var(--gutter); }
.project--layout .blocks { margin: 0 calc(var(--block-pad) * -1); }
.project--layout .block { padding: var(--block-pad); margin: 0; }
.project--layout .block-image img { width: 100%; }
.block-image.is-contained img { width: auto; margin: 0 auto; }
.block-image figcaption { padding-top: 10px; font-size: 14px; font-weight: 400; }

/* Columns (rows of a Squarespace layout, 12-column grid) */
.block-row { display: flex; align-items: flex-start; }
.block-row > .col { flex: 0 0 calc(var(--span) / 12 * 100%); max-width: calc(var(--span) / 12 * 100%); min-width: 0; }
.project--layout .block-row .col > .block { padding: var(--block-pad); }

/* Text */
.block-text { overflow-wrap: break-word; }
.block-text p { margin: 0 0 1.6em; white-space: pre-wrap; }
.block-text > :last-child { margin-bottom: 0; }
.block-text h1 { margin: 0 0 0.67em; font-size: 15px; font-weight: 500; letter-spacing: 0.03em; line-height: 1.4; color: var(--heading); white-space: pre-wrap; }
.block-text h2 { margin: 0.5em 0; font-size: 15px; font-weight: 400; letter-spacing: 0.06em; line-height: 1.4; color: var(--heading); white-space: pre-wrap; }
.block-text h3 { margin: 0.5em 0; font-size: 14px; font-weight: 600; letter-spacing: 0.06em; line-height: 1.4; color: var(--heading); }
.block-text ul, .block-text ol { margin: 0 0 1.6em; padding-left: 40px; }
.block-text li::marker { color: var(--heading); font-size: 12px; }
.block-text li > * { margin: 0.5em 0; }
.block-text a { color: var(--link); }
.block-text a:hover { opacity: 0.75; }
.social-links { display: flex; gap: 14px; margin: 0 0 1.6em; }
.block-text a.social-link { color: var(--heading); }
.social-link svg { width: 18px; height: 18px; }
.block-text strong { font-weight: 700; }
.block-line hr { border: 0; border-top: 1px solid rgba(0, 0, 0, 0.12); margin: 0; }

/* Video */
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-caption { margin: 10px 0 0; font-size: 14px; font-weight: 400; }

/* Galleries */
.block-gallery { position: relative; }
.gallery-slider .gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-slider .gallery-track::-webkit-scrollbar { display: none; }
.gallery-slider .gallery-item { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; }
.gallery-slider .gallery-item img { width: 100%; }
.gallery-prev, .gallery-next {
  position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px;
  border: 0; background: rgba(0, 0, 0, 0.35); cursor: pointer; opacity: 0; transition: opacity 0.2s;
}
.block-gallery:hover .gallery-prev, .block-gallery:hover .gallery-next,
.gallery-prev:focus-visible, .gallery-next:focus-visible { opacity: 1; }
.gallery-prev { left: calc(var(--block-pad) + 10px); }
.gallery-next { right: calc(var(--block-pad) + 10px); }
.gallery-prev::before, .gallery-next::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; margin: -6px 0 0 -3px;
  border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(45deg);
}
.gallery-next::before { margin-left: -9px; transform: rotate(-135deg); }
.gallery-grid .gallery-track { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--gutter); }
.gallery-grid .gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery-stack .gallery-item + .gallery-item { margin-top: var(--gutter); }
.gallery-stack .gallery-item img { width: 100%; }

/* Password page + 404 */
.lock, .not-found { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: var(--gutter); }
.lock-form { width: 100%; max-width: 360px; text-align: center; }
.lock-title { margin: 0 0 20px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--heading); }
.lock-form input, .lock-form button { display: block; width: 100%; padding: 12px 14px; font: inherit; border: 1px solid #ccc; border-radius: 0; }
.lock-form button { margin-top: 10px; background: var(--heading); color: #fff; border-color: var(--heading); cursor: pointer; text-transform: uppercase; letter-spacing: 0.1em; }
.lock-error { margin-top: 14px; color: var(--link); font-weight: 400; }
.not-found a { color: var(--link); }

/* ---------- Mobile (Squarespace stacks everything under 640px) ---------- */
@media (max-width: 640px) {
  body { padding-top: 69px; }
  .site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; margin: 0; height: 69px; background: #fff; }
  .menu-toggle { display: block; width: 24px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; z-index: 102; }
  .menu-toggle span, .menu-toggle::before, .menu-toggle::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--heading); transition: transform 0.2s, opacity 0.2s; }
  .menu-toggle::before { top: 0; } .menu-toggle span { top: 8px; } .menu-toggle::after { bottom: 0; }
  .menu-open .menu-toggle::before { transform: translateY(8px) rotate(45deg); }
  .menu-open .menu-toggle span { opacity: 0; }
  .menu-open .menu-toggle::after { transform: translateY(-8px) rotate(-45deg); }
  .site-nav { position: fixed; inset: 0; z-index: 101; background: #fff; flex-direction: column; align-items: center; justify-content: center; gap: 20px; opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s; }
  .menu-open .site-nav { opacity: 1; visibility: visible; }
  .site-nav a, .site-nav a.active { color: var(--heading); }
  .work-grid { grid-template-columns: 1fr; }
  .block-row { display: block; }
  .block-row > .col { max-width: none; }
  .block-row > .col:empty { display: none; }
}
