/*
Theme Name: Homus Atelier
Theme URI: https://homus.sg/atelier
Author: Homus
Description: Canonical block theme for the Homus Designer Empowerment Program. Identical on every designer site. Per-designer identity is expressed as a generated child theme (style.css + theme.json), never as a selected style variation — variation selection is database state and is silently overridden the moment a designer touches the Styles panel.
Version: 0.2.0
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: homus-atelier
Tags: block-theme, portfolio, full-site-editing
*/

/* Layout feel driven by --wp--custom--* so a child theme changes structure
   without shipping a template file. */

.homus-project-grid {
  display: grid;
  grid-template-columns: repeat(var(--wp--custom--grid-columns, 3), minmax(0, 1fr));
  gap: var(--wp--preset--spacing--50);
}

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

@media (max-width: 600px) {
  .homus-project-grid { grid-template-columns: 1fr; }
}

.homus-project-grid figure { margin: 0; }

.homus-project-grid img,
.homus-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: var(--wp--custom--image-ratio, 4/5);
  border-radius: var(--wp--custom--radius, 0);
  display: block;
}

.homus-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: var(--wp--preset--spacing--40);
}

/* Proof separation is structural, not decorative. The two blocks must never
   read as one section — different ground, its own rule, its own heading. */

.homus-proof-company {
  background: var(--wp--preset--color--surface);
  border-top: var(--wp--custom--hairline, 1px) solid var(--wp--preset--color--line);
  padding-block: var(--wp--preset--spacing--60);
}

.homus-proof-company__attribution {
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.homus-proof-designer {
  background: transparent;
  padding-block: var(--wp--preset--spacing--60);
}

.homus-proof-designer__source {
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--sm);
}

.site-credit {
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--sm);
  border-top: var(--wp--custom--hairline, 1px) solid var(--wp--preset--color--line);
  padding-block-start: var(--wp--preset--spacing--30);
}

.homus-meta {
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------------------------------------------------------------------------
   Services and process — for a partner who sells a process rather than a
   portfolio. Everything below is hairlines and space: there is no card, no
   shadow, no filled circle. A site with no photographs has nothing to hide
   behind, so the rules have to do the dividing.
   --------------------------------------------------------------------------- */

.homus-services .homus-service,
.homus-process .homus-process__stage {
  border-top: var(--wp--custom--hairline, 1px) solid var(--wp--preset--color--line);
  padding-block-start: var(--wp--preset--spacing--40);
  margin-block-start: var(--wp--preset--spacing--40);
}

.homus-service__index,
.homus-service__kicker {
  color: var(--wp--preset--color--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}

/* The outcome line is content, not a caption. It gets its own rule and its own
   colour so it survives an editor moving it, and so it never reads as a
   photo credit. */
.homus-outcome {
  border-inline-start: 2px solid var(--wp--preset--color--accent);
  padding-inline-start: var(--wp--preset--spacing--30);
  margin-block-start: var(--wp--preset--spacing--30);
  color: var(--wp--preset--color--contrast);
}

.homus-process__number {
  font-family: var(--wp--preset--font-family--display);
  font-size: var(--wp--preset--font-size--xl);
  line-height: 1;
  color: var(--wp--preset--color--accent);
  font-variant-numeric: tabular-nums;
  margin: 0 0 var(--wp--preset--spacing--20) 0;
}

.homus-process__summary {
  color: var(--wp--preset--color--contrast);
  margin-block-start: 0;
}

.homus-process__label {
  color: var(--wp--preset--color--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-block-end: 0;
}

.homus-process__label + p {
  margin-block-start: 0.35em;
}

/* The commercial-model band. One section on a different ground, because on a
   site that sells transparency the terms are the product. Used once per page. */
.homus-band {
  border-block: var(--wp--custom--hairline, 1px) solid var(--wp--preset--color--line);
}

.homus-figure {
  font-family: var(--wp--preset--font-family--display);
  font-size: var(--wp--preset--font-size--display);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--wp--preset--color--accent);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.homus-figure__unit,
.homus-figure__label {
  color: var(--wp--preset--color--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-block-start: var(--wp--preset--spacing--20);
}

.homus-contact-line {
  font-family: var(--wp--preset--font-family--display);
  margin-block-start: var(--wp--preset--spacing--40);
}

/* ===========================================================================
   PORTFOLIO — the standard's structural floor, added 2026-09-02.

   Everything below serves id-website-standard.md. The rule it exists for:
   the photography is the product, so the chrome does not compete with it.
   Hairlines, one accent, no card shadow, no rounded corner, no gradient.
   =========================================================================== */

/* --- Masonry -------------------------------------------------------------
   Not CSS multi-column: that reflows document order down each column and
   puts project 4 above project 2. This is the ordinary grid with a column
   offset and a taller every-third card, which gives the same broken baseline
   while a screen reader and the tab order still read 1, 2, 3.
   ------------------------------------------------------------------------- */

.homus-project-grid--masonry {
  align-items: start;
  --homus-stagger: var(--wp--preset--spacing--60);
}

.homus-project-grid--masonry .homus-card:nth-child(3n + 2) {
  margin-block-start: var(--homus-stagger);
}

.homus-project-grid--masonry .homus-card:nth-child(3n + 3) .homus-card__image img {
  aspect-ratio: 4 / 5;
}

@media (max-width: 900px) {
  .homus-project-grid--masonry { --homus-stagger: var(--wp--preset--spacing--40); }
  .homus-project-grid--masonry .homus-card:nth-child(3n + 2) { margin-block-start: 0; }
  .homus-project-grid--masonry .homus-card:nth-child(2n + 2) {
    margin-block-start: var(--homus-stagger);
  }
}

@media (max-width: 600px) {
  .homus-project-grid--masonry .homus-card { margin-block-start: 0 !important; }
}

/* The card is a photograph with two lines under it. No border, no panel.
   The only hover is on the image and it is a tone shift, not a lift. */
.homus-card__image { margin: 0; overflow: hidden; }

.homus-card__image img {
  aspect-ratio: var(--wp--custom--image-ratio, 3/2);
  transition: opacity 220ms ease, transform 320ms ease;
}

@media (hover: hover) {
  .homus-card:hover .homus-card__image img { opacity: 0.86; transform: scale(1.012); }
}

@media (prefers-reduced-motion: reduce) {
  .homus-card__image img { transition: none; }
  .homus-card:hover .homus-card__image img { transform: none; }
}

.homus-card__title { margin-block: var(--wp--preset--spacing--30) 0; }
.homus-card__title a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.homus-card:hover .homus-card__title a { color: var(--wp--preset--color--accent); }
.homus-card__meta { margin-block-start: 0.35em; gap: 0 0.75em; }

/* --- Filter --------------------------------------------------------------
   Term links, so every filtered view has its own URL and works without
   JavaScript. Property type first, because that is how a homeowner
   self-identifies (standard §3).
   ------------------------------------------------------------------------- */

.homus-filter { margin-block-start: var(--wp--preset--spacing--40); }

.homus-filter__axis {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5em 1.25em;
  padding-block: var(--wp--preset--spacing--30);
  border-block-start: var(--wp--custom--hairline, 1px) solid var(--wp--preset--color--line);
}

.homus-filter__label {
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  min-width: 6ch;
}

.homus-filter__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 1.1em;
}

.homus-filter__term {
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--sm);
  text-decoration: none;
  padding-block: 0.35em;          /* keeps the tap target above 24px */
  border-block-end: 1px solid transparent;
}

.homus-filter__term:hover { color: var(--wp--preset--color--contrast); }

.homus-filter__term[aria-current] {
  color: var(--wp--preset--color--contrast);
  border-block-end-color: var(--wp--preset--color--accent);
}

.homus-filter__term--sub::before { content: "└ "; color: var(--wp--preset--color--line); }

/* --- Style categories ---------------------------------------------------- */

.homus-styles__list {
  list-style: none;
  margin: var(--wp--preset--spacing--50) 0 0;
  padding: 0;
  border-block-start: var(--wp--custom--hairline, 1px) solid var(--wp--preset--color--line);
}

.homus-styles__link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5em 2em;
  padding-block: var(--wp--preset--spacing--40);
  border-block-end: var(--wp--custom--hairline, 1px) solid var(--wp--preset--color--line);
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
}

.homus-styles__name {
  font-family: var(--wp--preset--font-family--display);
  font-size: var(--wp--preset--font-size--lg);
  flex: 0 0 auto;
  min-width: 9ch;
}

.homus-styles__note { color: var(--wp--preset--color--muted); flex: 1 1 24ch; }
.homus-styles__link:hover .homus-styles__name { color: var(--wp--preset--color--accent); }

/* --- The empty state -----------------------------------------------------
   A slot, not a placeholder image. It has to read unmistakably as
   "photograph goes here" — never as a grey box someone thought was a design,
   and never as stock photography, which on a site whose argument is honesty
   would defeat the argument.
   ------------------------------------------------------------------------- */

.homus-empty__slots {
  display: grid;
  grid-template-columns: repeat(var(--wp--custom--grid-columns, 3), minmax(0, 1fr));
  gap: var(--wp--preset--spacing--50);
  align-items: start;
}

.homus-slot {
  position: relative;
  aspect-ratio: var(--wp--custom--image-ratio, 3/2);
  background: var(--wp--preset--color--surface);
  border: var(--wp--custom--hairline, 1px) dashed var(--wp--preset--color--line);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.2em;
  padding: var(--wp--preset--spacing--30);
}

.homus-slot--tall { aspect-ratio: 4 / 5; }

.homus-slot__tag,
.homus-slot__spec {
  font-size: var(--wp--preset--font-size--sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--muted);
}

.homus-slot__tag { color: var(--wp--preset--color--accent); }

.homus-empty__note { margin-block-start: var(--wp--preset--spacing--50); }

.homus-empty__convention code {
  font-size: 0.92em;
  color: var(--wp--preset--color--contrast);
  background: var(--wp--preset--color--surface);
  padding: 0.15em 0.45em;
}

@media (max-width: 900px) { .homus-empty__slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .homus-empty__slots { grid-template-columns: 1fr; } }

/* --- Designed-empty proof and team blocks ---------------------------------
   Added 2026-09-02 for homus_render_designer_reviews()'s honest empty state
   and for any page-level "nobody named yet" block (e.g. About's people
   section). Same voice as the project empty state above: a dashed hairline,
   never a grey box mistaken for a design, never filled with a stand-in.
   ------------------------------------------------------------------------- */

.homus-empty-block .empty,
.empty {
  border: var(--wp--custom--hairline, 1px) dashed var(--wp--preset--color--line);
  padding: var(--wp--preset--spacing--50);
  margin-block-start: var(--wp--preset--spacing--40);
}

.empty h3 { margin: 0 0 var(--wp--preset--spacing--30); font-size: var(--wp--preset--font-size--lg); }
.empty p { color: var(--wp--preset--color--muted); max-width: 60ch; }
.empty ul { list-style: none; margin: var(--wp--preset--spacing--40) 0 0; padding: 0; display: grid; gap: var(--wp--preset--spacing--20); }
.empty li { color: var(--wp--preset--color--muted); }
.empty li strong { color: var(--wp--preset--color--contrast); font-weight: 500; }

/* --- Project case study --------------------------------------------------
   Standard §5. The facts ledger is the comparison the visitor is making;
   the hardest-problem block is the paragraph that does the persuading.
   ------------------------------------------------------------------------- */

.homus-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--wp--preset--spacing--40);
  border-block: var(--wp--custom--hairline, 1px) solid var(--wp--preset--color--line);
  padding-block: var(--wp--preset--spacing--40);
}

.homus-fact__label {
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 0.35em;
}

.homus-fact__value {
  font-family: var(--wp--preset--font-family--display);
  font-size: var(--wp--preset--font-size--lg);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

@media (max-width: 700px) { .homus-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.homus-case--problem {
  border-inline-start: 2px solid var(--wp--preset--color--accent);
  padding-inline-start: var(--wp--preset--spacing--40);
}

.homus-beforeafter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--wp--preset--spacing--40);
}

.homus-beforeafter__item { margin: 0; }
.homus-beforeafter__item img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; }

@media (max-width: 600px) { .homus-beforeafter { grid-template-columns: 1fr; } }

/* A project without a before/after pair, a floor plan or a hardest-problem
   note must not print an empty heading. These sections collapse when the
   bound meta resolves to nothing. */
.homus-beforeafter:not(:has(img[src])),
.homus-floorplan:not(:has(img[src])),
.homus-case--problem:has(p:empty) { display: none; }

/* --- Enquiry -------------------------------------------------------------
   Standard §8. Visible labels, errors near the field, a real submit button.
   Nothing here promises a response time.
   ------------------------------------------------------------------------- */

.homus-enquiry {
  background: var(--wp--preset--color--surface);
  border-block: var(--wp--custom--hairline, 1px) solid var(--wp--preset--color--line);
}

.homus-form { margin-block-start: var(--wp--preset--spacing--50); }

.homus-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--wp--preset--spacing--40);
}

@media (max-width: 700px) { .homus-form__row { grid-template-columns: 1fr; } }

.homus-form__field { display: block; margin-block-end: var(--wp--preset--spacing--40); }

.homus-form__label {
  display: block;
  color: var(--wp--preset--color--muted);
  font-size: var(--wp--preset--font-size--sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-block-end: 0.5em;
}

.homus-form__optional { text-transform: none; letter-spacing: 0; opacity: 0.8; }

.homus-form input,
.homus-form select,
.homus-form textarea {
  width: 100%;
  min-height: 44px;                       /* touch target */
  background: var(--wp--preset--color--base);
  color: var(--wp--preset--color--contrast);
  border: var(--wp--custom--hairline, 1px) solid var(--wp--preset--color--line);
  border-radius: var(--wp--custom--radius, 0);
  font-family: inherit;
  font-size: var(--wp--preset--font-size--base);
  padding: 0.7em 0.85em;
}

.homus-form input:focus-visible,
.homus-form select:focus-visible,
.homus-form textarea:focus-visible,
.homus-form__submit:focus-visible,
.homus-filter__term:focus-visible,
.homus-styles__link:focus-visible,
.homus-card a:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
}

.homus-form__submit {
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--base);
  border: 0;
  border-radius: var(--wp--custom--radius, 0);
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.95rem 1.75rem;
  min-height: 44px;
  cursor: pointer;
}

.homus-form__submit:hover { background: var(--wp--preset--color--contrast); }
