/* ==========================================================================
   CHRIS HASIBEDER — main.css

   One file, no build tooling. Clean photo site after live-site/content/
   design.md: white, Roboto (300 body / 900 display), text #333, no
   surfaces, no shadows. Images are the content — everything else stays
   quiet. Mobile-first, breakpoints at 35rem / 56rem.

   Sections:
     1. Tokens
     2. Base & typography
     3. Header, off-canvas menu
     4. Footer
     5. Page scaffold
     6. Galleries (heox gallery block: grid / masonry / 1-column strip)
     7. Projects (project page, project grid)
     8. Film grid
     9. Text columns, text blocks
    10. Embeds (two-click) + cookie banner
    11. Legal pages
    12. Accessibility helpers
   ========================================================================== */


/* 1. Tokens ---------------------------------------------------------------- */

:root {
    --color-bg:     #ffffff;
    --color-ink:    #333333;
    --color-black:  #000000;
    --color-muted:  #747474;
    --color-line:   #ebeaea;
    --color-soft:   #f6f6f6;

    /* Roboto: the old site loads it as a local Google-Fonts copy. The
       woff2 files are NOT in the repo yet (see docs/status.md) — until
       they are, the stack falls back to the system sans. */
    --font-sans: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;

    --gutter: clamp(1rem, 4vw, 4.5rem);   /* ~4 % side margin like the old site */
    --gap:    5px;                         /* masonry gap of the old galleries */
    --measure: 46rem;
    --header-height: 5rem;
}


/* 2. Base & typography ----------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 300;
    line-height: 24px;
    color: var(--color-ink);
    background: var(--color-bg);
}

html.has-nav-open {
    overflow: hidden;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 400;
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

h2 {
    font-size: 1.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

h3 {
    font-size: 1.125rem;
    font-weight: 400;
    text-transform: uppercase;
}

@media (min-width: 56rem) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
}

p {
    margin: 0 0 1em;
}

a {
    color: var(--color-ink);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover,
a:focus-visible {
    color: var(--color-black);
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-black);
    outline-offset: 2px;
}

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

button {
    font: inherit;
    color: inherit;
}

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


/* 3. Header, off-canvas menu ----------------------------------------------- */

.hasi-header {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    min-height: var(--header-height);
    padding: 1.25rem var(--gutter);
}

.hasi-header__logo {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

@media (min-width: 56rem) {
    .hasi-header__logo { font-size: 1.5rem; }
}

.hasi-header__toggle {
    padding: 0.25rem 0;
    border: 0;
    background: none;
    font-size: 1.125rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
}

/* Without JS: plain inline nav below the header row. */
.hasi-nav {
    flex-basis: 100%;
}

.hasi-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.hasi-nav__link {
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hasi-nav__link[aria-current="page"] {
    color: var(--color-black);
    text-decoration: underline;
    text-underline-offset: 0.35em;
}

/* With JS: off-canvas panel from the right (white, dark backdrop). */
.hasi-header.has-js .hasi-nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 30;
    width: min(100%, 50rem);
    padding: calc(var(--header-height) + 1rem) var(--gutter) 3rem;
    background: var(--color-bg);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    visibility: hidden;
}

.hasi-header.has-js.is-nav-open .hasi-nav {
    transform: none;
    visibility: visible;
}

.hasi-header.has-js .hasi-nav__list {
    flex-direction: column;
    gap: 1rem;
}

.hasi-header.has-js .hasi-nav__link {
    font-size: 1.25rem;
}

.hasi-header.has-js .hasi-header__toggle {
    position: relative;
    z-index: 40;
}

.hasi-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.6);
}

.hasi-nav-backdrop[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .hasi-header.has-js .hasi-nav { transition: none; }
}


/* 4. Footer ---------------------------------------------------------------- */

.hasi-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-top: 4rem;
    padding: 2rem var(--gutter) 2.5rem;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hasi-footer__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0;
}

.hasi-footer__brand {
    font-weight: 900;
}

.hasi-footer__nav > * + *::before {
    content: "|";
    margin: 0 0.75rem;
    color: var(--color-muted);
}

.hasi-footer__cookie-settings {
    padding: 0;
    border: 0;
    background: none;
    font-size: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}

.hasi-footer__social {
    display: flex;
    gap: 1rem;
}

.hasi-footer__social-link {
    display: inline-flex;
    padding: 0.25rem;
}

.hasi-footer__icon {
    display: block;
}


/* 5. Page scaffold ----------------------------------------------------------- */

.heox-main {
    padding: 0 var(--gutter);
}

.page__title {
    margin: 1rem 0 2rem;
}

.page--gallery .page__title,
.page--default .page__title,
.page--home .page__title {
    margin-bottom: 1.5rem;
}

.page__body > * + * {
    margin-top: 2.5rem;
}

.page__body h2 {
    margin-top: 3rem;
}

.page__body h2 + * {
    margin-top: 1rem;
}

.page__body > p,
.page__body > ul,
.page__body > ol,
.page__body > blockquote {
    max-width: var(--measure);
}

.page__body > p + p {
    margin-top: 0;
}


/* 6. Galleries --------------------------------------------------------------- */

.heox-block--gallery {
    --cols: 3;
}

.heox-block--gallery[data-columns="1"] { --cols: 1; }
.heox-block--gallery[data-columns="2"] { --cols: 2; }
.heox-block--gallery[data-columns="4"] { --cols: 4; }

.heox-gallery__item {
    margin: 0;
}

.heox-gallery__item .heox-image {
    width: 100%;
}

/* Grid: equal columns, images keep their own height. */
.heox-block--gallery[data-layout="grid"] {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: var(--gap);
}

/* Masonry without JS: CSS multi-column (order runs down the columns). */
.heox-gallery--masonry:not(.is-masonry-js) {
    columns: var(--cols);
    column-gap: var(--gap);
}

.heox-gallery--masonry:not(.is-masonry-js) .heox-gallery__item {
    break-inside: avoid;
    margin-bottom: var(--gap);
}

/* Masonry with JS (main.js): N flex columns filled shortest-first in
   source order — reads row by row like the old Avada masonry. */
.heox-gallery--masonry.is-masonry-js {
    display: flex;
    gap: var(--gap);
    align-items: flex-start;
}

.heox-gallery__column {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: var(--gap);
    min-width: 0;
}

/* Same specificity as the [data-columns] rules above, otherwise the
   narrow-screen overrides lose the cascade. */
@media (max-width: 56rem) {
    .heox-block--gallery[data-columns="3"],
    .heox-block--gallery[data-columns="4"] { --cols: 2; }
}

@media (max-width: 35rem) {
    .heox-block--gallery[data-columns] { --cols: 1; }
}

/* Hover "zoomin" like the old site (multi-column galleries only). */
.heox-block--gallery:not([data-columns="1"]) .heox-gallery__item {
    overflow: hidden;
}

.heox-block--gallery:not([data-columns="1"]) .heox-image {
    transition: transform 0.5s ease;
}

.heox-block--gallery:not([data-columns="1"]) .heox-gallery__item:hover .heox-image {
    transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
    .heox-block--gallery .heox-image,
    .project-grid__cover .heox-image { transition: none; }
    .heox-block--gallery .heox-gallery__item:hover .heox-image,
    .project-grid__link:hover .heox-image { transform: none; }
}

/* 1-column strip (projects): image, caption below, generous spacing. */
.heox-block--gallery[data-columns="1"] {
    display: grid;
    gap: 2.5rem;
}

.heox-block--gallery[data-columns="1"] .heox-gallery__caption {
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 400;
}

.heox-gallery__caption {
    font-size: 12px;
    color: var(--color-muted);
}


/* 7. Projects ---------------------------------------------------------------- */

.project__header {
    margin-bottom: 2.5rem;
}

.project__subtitle {
    margin: 0.5rem 0 0;
    font-size: 1.25rem;
    font-weight: 300;
}

.project__client {
    margin: 0.25rem 0 0;
    color: var(--color-muted);
}

.project__more {
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--color-line);
}

.project__more-title {
    margin-bottom: 1.5rem;
}

.project__all {
    margin: 2.5rem 0 0;
}

.project__all-link {
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem var(--gap);
}

@media (max-width: 56rem) {
    .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 35rem) {
    .project-grid { grid-template-columns: 1fr; }
}

.project-grid__link {
    display: block;
}

.project-grid__cover {
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    background: var(--color-soft);
}

.project-grid__cover .heox-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-grid__link:hover .heox-image {
    transform: scale(1.04);
}

.project-grid__title {
    display: block;
    margin-top: 0.75rem;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.project-grid__subtitle {
    display: block;
    color: var(--color-muted);
}


/* 8. Film grid ----------------------------------------------------------------- */

.hasi-film-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem var(--gap);
}

@media (max-width: 35rem) {
    .hasi-film-grid { grid-template-columns: 1fr; }
}

.hasi-film-grid__item {
    margin: 0;
}

.hasi-film-grid__title {
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
    font-weight: 500;
    text-transform: uppercase;
}

.hasi-film-grid__video {
    width: 100%;
    background: var(--color-black);
}

.hasi-film-grid .heox-block--embed {
    margin: 0;
}


/* 9. Text columns, text blocks --------------------------------------------- */

.hasi-text-columns {
    display: grid;
    grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
    gap: 2rem 3rem;
}

.hasi-text-columns[data-columns="1"] { --cols: 1; }
.hasi-text-columns[data-columns="3"] { --cols: 3; }
.hasi-text-columns[data-columns="4"] { --cols: 4; }

@media (max-width: 56rem) {
    .hasi-text-columns[data-columns="3"],
    .hasi-text-columns[data-columns="4"] { --cols: 2; }
}

@media (max-width: 35rem) {
    .hasi-text-columns[data-columns] { --cols: 1; }
}

.hasi-text-columns__heading {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.hasi-text-columns__text p:last-child {
    margin-bottom: 0;
}


/* 10. Embeds (two-click) + cookie banner ------------------------------------- */

.heox-block--embed {
    max-width: 100%;
}

.page__body > .heox-block--embed {
    max-width: 60rem;
}

.heox-embed__placeholder {
    display: grid;
    gap: 0.5rem;
    justify-items: start;
    padding: 1.5rem;
    border: 1px solid var(--color-line);
    background: var(--color-soft);
}

.heox-embed__title {
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
}

.heox-embed__notice {
    margin: 0;
    font-size: 12px;
    color: var(--color-muted);
}

.heox-embed__load {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-ink);
    background: var(--color-bg);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.heox-embed__load:hover {
    background: var(--color-ink);
    color: var(--color-bg);
}

.heox-embed__frame {
    aspect-ratio: 16 / 9;
}

/* Route maps are taller than 16:9 on the old site (680 px). */
.page--project .page__body > .heox-block--embed .heox-embed__frame {
    aspect-ratio: 4 / 3;
}

.heox-embed__iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* cookieconsent (heox/kirby-cookiebanner): keep it in the site's voice. */
#cc-main {
    --cc-font-family: var(--font-sans);
    --cc-btn-primary-bg: var(--color-ink);
    --cc-btn-primary-border-color: var(--color-ink);
    --cc-btn-primary-hover-bg: var(--color-black);
    --cc-btn-primary-hover-border-color: var(--color-black);
    --cc-btn-border-radius: 0;
    --cc-modal-border-radius: 0;
    --cc-pm-toggle-border-radius: 1rem;
}


/* 11. Legal pages ------------------------------------------------------------ */

.page--legal .page__body {
    max-width: var(--measure);
}

.page-legal__data {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1.5rem;
    max-width: var(--measure);
    margin: 2.5rem 0 0;
}

.page-legal__data dt {
    font-weight: 500;
}

.page-legal__data dd {
    margin: 0;
}


/* 12. Accessibility helpers --------------------------------------------------- */

.heox-skip-link,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.heox-skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
    white-space: normal;
}

/* Uniform honeypot (plugin ships no CSS) — not display:none, bots check. */
.uniform__potty {
    position: absolute;
    left: -9999px;
}
