/*
Theme Name: Harbor
Description: A portfolio theme with a masonry wall of projects and the site title, tagline and menu fixed in a bar at the bottom of the screen. A single-image project opens that one high-resolution image in a lightbox; a multi-image series opens a lightbox gallery with left/right arrows to cycle through the whole series.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: harbor
*/

:root {
  --bg: #f4f3f0;
  --ink: #151515;
  --muted: #6b6b6b;
  --line: #dcdad5;
  --fs: 15px;
  --cols: 4;
  --gap: 14px;
  --radius: 10px;
  --dock-h: 96px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lb-open { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs)/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 300; }
.skip:focus { top: 12px; }

main { padding: 16px 16px calc(var(--dock-h) + 24px); }

/* ---------- Bottom bar: title, tagline, menu ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--bg); border-top: 1px solid var(--line);
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); }
.dock__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 32px; align-items: end; max-width: 2400px; margin: 0 auto; }
.dock__name { margin: 0; font-size: 1.07em; font-weight: 700; line-height: 1.2; }
.dock__tag { margin: .15em 0 0; color: var(--muted); }
.dock__nav ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 20px; list-style: none; margin: 0; padding: 0; }
.dock__nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.dock__nav .current-menu-item > a, .dock__nav .current_page_item > a { font-weight: 700; }

/* ---------- Masonry wall ---------- */
.wall { column-count: var(--cols); column-gap: var(--gap); }                                  /* no-JS fallback */
.wall > .card { break-inside: avoid; margin-bottom: var(--gap); }
.wall.is-masonry { display: grid; column-count: auto; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: 1px; column-gap: var(--gap); row-gap: 0; align-items: start; }               /* JS sets each card's row span */
.wall.is-masonry > .card { margin-bottom: 0; }
.card { margin: 0; min-width: 0; }
.card__link { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: #e6e4df; cursor: zoom-in; }
.card__img { display: block; width: 100%; height: auto; transition: transform .35s ease; }
.card__link:hover .card__img, .card__link:focus-visible .card__img { transform: scale(1.03); }
.card__title { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 10px; color: #fff; font-weight: 600; font-size: .92em; line-height: 1.25;
  background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); opacity: 0; transition: opacity .2s; }
.card__link:hover .card__title, .card__link:focus-visible .card__title { opacity: 1; }
@media (hover: none) { .card__title { display: none; } }
.card__badge { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px 5px 7px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 600; line-height: 1; }
.card__badge svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.empty { padding: 80px 0; text-align: center; color: var(--muted); }

/* ---------- Project and text pages ---------- */
.entry { max-width: 1100px; margin: 0 auto; padding: 24px 0 0; }
.entry h1 { margin: 0 0 1em; font-size: 1.5em; line-height: 1.2; }
.entry--text { max-width: 720px; }
.entry-content > * { margin-top: 0; margin-bottom: 1em; }
.entry-content img { display: block; height: auto; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content .wp-block-image img { width: 100%; }
figcaption { margin-top: 6px; color: var(--muted); font-size: .9em; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(10, 10, 10, .96); color: #fff; }
.lb[hidden] { display: none; }
.lb__stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 56px 88px 64px; }
.lb__img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; opacity: 1; transition: opacity .2s; }
.lb.is-loading .lb__img { opacity: .25; }
.lb__btn { position: absolute; z-index: 2; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb__btn:hover { background: rgba(255, 255, 255, .3); }
.lb__btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb__x { top: 14px; right: 14px; }
.lb__prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb__next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb__cap { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 2; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .8); padding: 0 80px; }
.lb__count { margin-left: .7em; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .6); }
.lb--single .lb__prev, .lb--single .lb__next, .lb--single .lb__count { display: none; }

@media (max-width: 700px) {
  main { padding: 10px 10px calc(var(--dock-h) + 20px); }
  .dock { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .dock__inner { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .dock__nav ul { justify-content: flex-start; }
  .lb__stage { padding: 56px 8px 60px; }
  .lb__prev { left: 8px; }
  .lb__next { right: 8px; }
  .lb__prev, .lb__next { background: rgba(0, 0, 0, .45); }
}
@media (prefers-reduced-motion: reduce) { .card__img, .card__title, .lb__img { transition: none; } }
