/* Alexis Piquer — alexispiquer.com
   Static site, no build-time framework in the browser: plain HTML/CSS,
   generated from data/*.json by build.js. See README.md to update content.

   System: permanent sidebar index (title + year) + a single content column.
   Photography first — minimal metadata, optional author text after the
   images, never before. Every photograph is shown at 100% of the column
   width regardless of orientation (only height varies) — the photograph is
   never resized to "fit" a layout. */

:root {
  --ink: #111111;
  --text: #2b2b2b;      /* reading text: author notes, statement */
  --muted: #6b6b6b;     /* metadata: dates, places, labels, nav */
  --line: #d9d9d9;
  --bg: #fafaf8;
  --accent: #b5482f;    /* single accent, minimal use */

  --sidebar-w: 300px;
  --maxw: 720px;         /* max width of the photograph column — kept close
                            to feliperomerobeltran.com's own column width
                            (~690-756px), per Alexis: smaller photographs,
                            not full-bleed-large */
  --text-maxw: 480px;    /* max width of reading-text blocks */

  --rhythm: clamp(48px, 7vw, 104px);  /* vertical space between photographs */
}

* { box-sizing: border-box; }

/* Reset a few elements that ship with a non-zero browser default margin —
   <figure> in particular caused real horizontal overflow on narrow
   viewports (100% width + the UA default 40px side margins). */
figure, blockquote, h1, h2, h3, p, ul { margin: 0; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Open Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Skip link: invisible until keyboard-focused, jumps past the sidebar. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
  font-size: 13px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

.layout {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 48px 32px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .name {
  font-size: 13px;
  letter-spacing: 0.07em;
  font-weight: 600;
  margin-bottom: 48px;
  display: block;
}

.sidebar nav .group-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 28px 0 10px;
  text-transform: uppercase;
}

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

.sidebar nav li { margin-bottom: 14px; }

.sidebar nav a {
  display: block;
  font-size: 15px;
  color: var(--ink);
}

.sidebar nav a .year {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.sidebar nav a .year.ongoing::after {
  content: " — ongoing";
}

.sidebar nav a[aria-current="page"] {
  color: var(--accent);
}

.sidebar .info-link {
  margin-top: 40px;
  display: block;
  padding-top: 20px;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.sidebar .info-link[aria-current="page"] {
  color: var(--accent);
}

.sidebar .social-link {
  margin-top: 16px;
  display: inline-flex;
  color: var(--muted);
}

.sidebar .social-link:hover {
  color: var(--accent);
}

/* ---------- Main content ---------- */
.main {
  flex: 1;
  min-width: 0;
  padding: clamp(40px, 6vw, 72px) clamp(24px, 6vw, 64px) 120px;
}

.main-inner {
  max-width: var(--maxw);
  /* Sits right after .main's own padding, close to the sidebar — centering
     it within the full remaining width left too much empty space between
     the project list and the photos on wide screens. */
}

/* ---------- Image system ----------
   One self-contained block per photograph:

     <figure class="img-item h">
       <img src="images/<slug>/01.jpg" alt="…" loading="lazy">
     </figure>

   Add, remove or reorder photographs by editing data/<slug>.json — see
   README.md. The h/v/sq class is informational only (used for alt text
   defaults); it does not change the display width. Every photograph is
   100% of the column width — only its height changes, per its own aspect
   ratio. This matches feliperomerobeltran.com's mechanism: a vertical and
   a horizontal photograph share the same width, never the same height. */
.img-item {
  width: 100%;
}

.img-item img {
  width: 100%;
}

/* Placeholder box, used only until a real photograph replaces it (see
   data/<slug>.json — placeholder: true/false). Never shipped as final
   content. */
.ph {
  width: 100%;
  aspect-ratio: var(--ar, 3 / 2);
  background: repeating-linear-gradient(135deg, #e5e3de, #e5e3de 2px, #ecebe7 2px, #ecebe7 14px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  border: 1px solid var(--line);
}

.ph span {
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--bg);
  padding: 3px 9px;
  margin: 10px;
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

/* ---------- Home / project index ---------- */
.index-list {
  display: flex;
  flex-direction: column;
  gap: var(--rhythm);
}

.index-item {
  display: block;
}

.index-caption {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  max-width: 100%;
}

.index-caption .title {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.index-caption .place-date {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Project page ----------
   Minimal head (title + place/date) → photographs → optional text, with
   less visual weight than the images. */
.project-head {
  margin-bottom: clamp(36px, 5vw, 56px);
  max-width: var(--text-maxw);
}

.project-title {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin: 0 0 8px;
}

.project-subline {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.project-subline .sep { margin: 0 7px; }

.project-images {
  display: flex;
  flex-direction: column;
  gap: var(--rhythm);
  margin-bottom: clamp(56px, 8vw, 96px);
}

/* Optional text, AFTER the photographs, lighter than them. Omitted
   entirely on projects where it doesn't add anything yet. */
.project-note {
  max-width: var(--text-maxw);
  margin-bottom: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.project-note p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
}

/* Discreet note that the site shows a selection, not the full project
   (which lives in the portfolio). No box, no border — one metadata line,
   same weight as the rest of the secondary text. */
.project-sample {
  max-width: var(--text-maxw);
  margin-bottom: 40px;
}

.project-sample p {
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 0;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.project-nav span.label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

/* ---------- Info page ---------- */
.info-block { margin-bottom: 48px; max-width: var(--text-maxw); }
.info-block p.info-location {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin: 0;
}

.info-block p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}
.info-block a.mail { font-size: 15px; }

footer.page-footer {
  margin-top: 80px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 404 ---------- */
.not-found {
  max-width: var(--text-maxw);
}
.not-found h1 {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 400;
  margin: 0 0 16px;
}
.not-found p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 24px;
}

/* ---------- Tablet ----------
   The sidebar is kept (still enough width for the permanent index) but
   narrows, with reduced type and margins; the content column loses
   desktop's more generous side margin. */
@media (max-width: 1024px) {
  :root {
    --sidebar-w: 290px;
  }

  .sidebar { padding: 36px 24px; }
  .sidebar .name { margin-bottom: 36px; }
  .main { padding: clamp(32px, 5vw, 48px) clamp(20px, 4vw, 40px) 96px; }
}

/* ---------- Mobile ----------
   The sidebar becomes a horizontal header; the project index switches to
   a single wrapping line instead of a fixed side column. */
@media (max-width: 640px) {
  .layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 22px 20px;
  }

  .sidebar .name { margin-bottom: 18px; }

  .sidebar nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
  }

  .sidebar nav .group-label { margin: 14px 0 8px; }

  .main { padding: 32px 20px 72px; }

  .project-title { font-size: 22px; }
  .index-caption { flex-direction: column; gap: 2px; }
}
