/* ==========================================================================
   larypsed.com — main.css
   Consolidated, responsive stylesheet. Replaces general.css, gallery.css,
   gallery-higher.css, gallery-higher-graphics.css, ie.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom properties (design tokens)
   -------------------------------------------------------------------------- */
:root {
  --color-text:       #000;
  --color-muted:      #707070;
  --color-accent:     #e00000;
  --color-bg:         #fff;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --nav-width:        70px;
  --nav-gap:          80px;
  --container-max:    1060px;
  --container-pad:    90px;

  --gallery-img-h:    520px;

  --transition-fast:  120ms ease;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 0.875rem; /* 14px */
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

a {
  color: var(--color-text);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent);
}

ul {
  list-style: none;
}

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

/* --------------------------------------------------------------------------
   Layout — desktop (≥ 900px)
   -------------------------------------------------------------------------- */
#container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

h1 {
  padding-top: 80px;
  padding-bottom: 24px;
  font-size: 1.0rem;
  font-weight: bold;
  letter-spacing: 0;
}

h1 a {
  color: var(--color-text);
}

h1 a:hover {
  color: var(--color-accent);
}

/* Desktop: two-column layout — nav left, content right */
@media (min-width: 900px) {
  #container {
    display: grid;
    grid-template-columns: var(--nav-width) 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "title  title"
      "nav    content";
    column-gap: var(--nav-gap);
  }

  h1 {
    grid-area: title;
  }

  #sitenav {
    grid-area: nav;
  }

  #main-content {
    grid-area: content;
  }
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
#sitenav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.875rem;
}

#sitenav a,
#sitenav .nav-selected {
  display: block;
  color: var(--color-muted);
  line-height: 1.7;
  white-space: nowrap;
}

#sitenav a:hover {
  color: var(--color-accent);
}

#sitenav .nav-selected {
  font-weight: bold;
  color: var(--color-text);
  cursor: default;
}

#sitenav .nav-selected:hover {
  color: var(--color-text);
}

.menu-contacts {
  display: contents; /* render children inline in the flex column */
}

/* Tablet / mobile: horizontal nav bar */
@media (max-width: 899px) {
  #sitenav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 16px;
    padding-bottom: 20px;
  }

  .menu-contacts {
    display: contents;
  }
}

/* --------------------------------------------------------------------------
   Text pages (index, about, contacts)
   -------------------------------------------------------------------------- */
#text-content {
  padding-bottom: 40px;
}

#text-content p {
  color: var(--color-muted);
  font-size: 0.9em;
  line-height: 1.55;
}

#text-content p a {
  color: var(--color-muted);
  text-decoration: none;
}

#text-content p a:hover {
  color: var(--color-accent);
}

/* Homepage hero image */
#text-content .hero-image {
  margin-bottom: 20px;
  margin-top: -50px;
}

#text-content .hero-image img {
  width: 100%;
  max-width: 571px;
}

@media (max-width: 899px) {
  #text-content .hero-image {
    margin-top: 0;
  }
}

/* Homepage statement paragraph */
#text-content .text-page {
  max-width: 570px;
  text-align: justify;
  line-height: 18px;
  color: var(--color-text);
}

/* About page headings */
#text-content .heading {
  font-weight: bold;
  margin-bottom: 20px;
}

/* About page year-list — table layout matches original exactly */
.yearlist {
  display: table-row;
  line-height: 1.55;
}

.yearlist .year {
  display: table-cell;
  padding-right: 1rem;
  min-width: 3.5em;
  color: var(--color-muted);
}

/* Contacts */
#text-content .contacts-phone {
  margin-bottom: 6px;
}

#text-content .contacts-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

#text-content .contacts-links .sep {
  color: var(--color-muted);
}

/* --------------------------------------------------------------------------
   Gallery — single-image viewer
   -------------------------------------------------------------------------- */

/* Hidden data list — only used by JS */
#gallery-data {
  display: none;
}

#gallery-viewer {
  padding-bottom: 40px;
}

/* Image wrapper — click zones sit inside it */
#gallery-image-wrap {
  position: relative;
  display: inline-block; /* shrink-wraps the image */
  max-width: 100%;
  line-height: 0; /* remove inline gap below img */
}

#main-image {
  display: block;
  max-width: 100%;
  max-height: var(--gallery-img-h);
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity var(--transition-fast);
  user-select: none;
}

#main-image.is-loading {
  opacity: 0;
}

/* Left / right click zones overlaid on the image */
#gallery-prev-zone,
#gallery-next-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 1;
  outline: none;
}

#gallery-prev-zone {
  left: 0;
  cursor: w-resize;
}

#gallery-next-zone {
  right: 0;
  cursor: e-resize;
}

/* Caption */
#gallery-caption {
  margin-top: 14px;
  font-size: 0.8125rem; /* 13px */
  color: var(--color-muted);
  line-height: 1.5;
  min-height: 2.8em; /* prevent layout shift */
}

#caption-title a {
  color: var(--color-muted);
  text-decoration: none;
}

#caption-title a:hover {
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Responsive adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 899px) {
  #container {
    padding: 0 24px;
  }

  h1 {
    padding-top: 32px;
    padding-bottom: 16px;
  }

  :root {
    --gallery-img-h: 70vw;
  }
}

@media (max-width: 599px) {
  #container {
    padding: 0 16px;
  }

  :root {
    --gallery-img-h: 85vw;
  }

  #text-content .text-page {
    text-align: left;
  }
}
