/* =========================================================================
   ACC — Inner detail pages (Workshop & ACC Technology)
   -------------------------------------------------------------------------
   THE READING ROOM.

   What this replaced: a "variant layout system" that rendered every service as
   its own full section in one of five rotating layouts, each carrying a giant
   engraved index number, its own eyebrow, and its own WhatsApp button. Six of
   those in a row read as six near-identical zigzag rows with the same call to
   action repeated six times, and one of the variants punched a dark band into
   the middle of an otherwise ivory page.

   What it is now: a catalogue. A sticky index rail on the inline-start names
   every entry and tracks the reading position; the entries themselves stack in
   one consistent rhythm on the inline-end, each with its photograph in an arch
   niche. One rhythm, read top to bottom, closed by a single call to action.
   That is how a showroom presents a range, and it is the same arch / hairline
   / warm-glow vocabulary the home page already speaks.

   Namespace: .acc-pg (page scaffolding), .acc-rail (index), .acc-entry (item).
   Base classes and --c-* contextual tokens come from acc-home.css.
   RTL-safe: logical properties throughout. Mobile: the rail becomes a
   scroll-snap strip pinned under the header.
   ====================================================================== */

/* =====================================================================
   PAGE HERO — the entrance to an inner room
   ===================================================================== */

.acc-pg-hero {
	position: relative;
	isolation: isolate;
	padding-block-start: clamp(44px, 7vw, 92px);
	padding-block-end: clamp(44px, 7vw, 88px);
	background-color: var(--acc-bg-soft);
	border-block-end: 1px solid var(--acc-hairline-bz);
	overflow: clip;
}

.acc-pg-hero::after {
	/* Warm light washing down the plaster from the ceiling. */
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: radial-gradient(90% 80% at 78% 0%, rgba(230, 188, 122, 0.4), transparent 62%);
}

/* The copy takes a little more than half, the print takes the rest. Sized in
   fr rather than a fixed image width so the two columns close on each other:
   a narrow fixed print left a corridor of empty plaster between the headline
   and the frame. */
.acc-pg-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr);
	gap: clamp(32px, 4vw, 64px);
	align-items: center;
}

.acc-pg-hero .acc-section__head {
	max-width: 54ch;
	margin-block-end: 0;
}

.acc-pg-hero .acc-section__title {
	font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem);
	color: var(--acc-ink);
}

.acc-pg-hero .acc-section__intro { color: var(--acc-ink-2); }

/* The hero photograph sits in an arch, like a framed print at the door. The
   library is old-brand, so acc-global.css puts it through the showroom
   treatment; at this size, warm and quiet, it reads as artwork. */
.acc-pg-hero__media {
	position: relative;
	margin: 0;
	aspect-ratio: 4 / 5;
	border-radius: var(--acc-arch);
	overflow: hidden;
	border: 1px solid var(--acc-hairline-bz);
	background: var(--acc-surface);
	box-shadow: var(--acc-shadow);
}

.acc-pg-hero__media img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	display: block;
}

.acc-pg-hero__media::after {
	/* The warm LED wash inside a niche. Never neon. */
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(75% 45% at 50% 0%, rgba(240, 205, 150, 0.34), transparent 68%);
	pointer-events: none;
}

/* Facts, not decoration: where, since when, how many. */
.acc-pg-hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 26px;
	margin-block-start: clamp(22px, 3vw, 34px);
	font-family: var(--acc-font-body);
	font-size: 0.7rem;
	font-weight: 500;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--acc-muted);
}

.acc-pg-hero__meta span {
	display: inline-flex;
	align-items: center;
	gap: 9px;
}

.acc-pg-hero__meta span::before {
	content: "";
	inline-size: 5px;
	block-size: 5px;
	border-radius: 50%;
	background: var(--acc-bronze);
}

/* =====================================================================
   THE INDEX — sticky rail + stacked entries
   ===================================================================== */

.acc-pg-index {
	padding-block: clamp(48px, 7vw, 104px);
}

.acc-pg-index__grid {
	display: grid;
	grid-template-columns: clamp(180px, 20vw, 250px) minmax(0, 1fr);
	gap: clamp(40px, 6vw, 96px);
	align-items: start;
}

/* ---- The rail ------------------------------------------------------- */

.acc-rail {
	position: sticky;
	inset-block-start: calc(var(--acc-header-h) + 28px);
	/* Grid columns floor at their content's min-content width by default. The
	   mobile strip's pills are nowrap, so without this the rail's min-content
	   is the full un-scrolled width of all six and it drags the column past
	   the viewport. */
	min-inline-size: 0;
}

.acc-rail__label {
	font-family: var(--acc-font-body);
	font-size: 0.68rem;
	font-weight: 500;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--acc-muted);
	margin-block-end: 20px;
}

.acc-rail__list {
	list-style: none;
	margin: 0;
	padding: 0;
	/* One continuous hairline the whole rail hangs from, like a gallery rod. */
	border-inline-start: 1px solid var(--c-border);
}

.acc-rail__link {
	display: block;
	padding: 11px 0 11px 18px;
	margin-inline-start: -1px;
	border-inline-start: 1px solid transparent;
	font-family: var(--acc-font-body);
	font-size: 0.92rem;
	line-height: 1.35;
	color: var(--acc-muted);
	text-decoration: none;
	transition: color var(--acc-trans), border-color var(--acc-trans),
		padding-inline-start var(--acc-trans);
}

.acc-rail__link:hover { color: var(--acc-ink); }

/* The reading position. Bronze, and the hairline thickens to a marker. */
.acc-rail__link.is-active {
	color: var(--acc-ink);
	border-inline-start-color: var(--acc-bronze);
	padding-inline-start: 24px;
}

.acc-rail__link:focus-visible {
	outline: 2px solid var(--acc-bronze);
	outline-offset: 3px;
	border-radius: var(--acc-radius-sm);
}

/* ---- The entries ---------------------------------------------------- */

/* The rail's counterpart column. min-inline-size:0 keeps long copy from
   forcing the grid wider than the viewport. */
.acc-pg-index__body { min-inline-size: 0; }

.acc-entries {
	display: flex;
	flex-direction: column;
}

.acc-entry {
	display: grid;
	grid-template-columns: minmax(0, 1fr) clamp(190px, 23vw, 310px);
	gap: clamp(24px, 4vw, 56px);
	align-items: center;
	padding-block: clamp(34px, 4.5vw, 58px);
	/* Entries are separated by a hairline, not boxed in cards. A card would
	   claim each service is a product; they are chapters of one range. */
	border-block-start: 1px solid var(--c-border);
}

.acc-entry:first-child { border-block-start: 0; padding-block-start: 0; }
.acc-entry:last-child { padding-block-end: 0; }

/* Anchor landings clear the sticky header. */
.acc-entry {
	scroll-margin-block-start: calc(var(--acc-header-h) + 32px);
}

.acc-entry__media {
	position: relative;
	margin: 0;
	aspect-ratio: 3 / 4;
	border-radius: var(--acc-arch);
	overflow: hidden;
	border: 1px solid var(--acc-hairline-bz);
	background: var(--acc-bg-soft);
}

.acc-entry__media img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.7s var(--acc-ease);
}

.acc-entry:hover .acc-entry__media img { transform: scale(1.04); }

.acc-entry__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(72% 42% at 50% 0%, rgba(240, 205, 150, 0.3), transparent 66%);
	pointer-events: none;
}

/* An entry with no photograph drops the media column rather than reserving an
   empty frame, and recomposes: medallion and name hold the inline-start
   column, the copy takes the inline-end. That fills the same measure a
   photograph would have, so a venture reads as a deliberate composition
   instead of a service whose picture failed to load. */
.acc-entry--noimg {
	grid-template-columns: minmax(0, 1fr);
	align-items: start;
}

.acc-entry--noimg .acc-entry__body {
	display: grid;
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
	/* Row and column gaps are set separately on purpose. A single value put
	   the column's 48px between the medallion and the name too, stranding the
	   medallion in its own band of empty plaster. */
	gap: 14px clamp(18px, 3vw, 48px);
	align-items: start;
}

/* The grid gap owns this spacing now. */
.acc-entry--noimg .acc-entry__mark { margin-block-end: 0; }

/* Two rows: the medallion sits in its own row above, then the name and the
   copy share row two so their first lines start together. The copy must NOT
   span both rows; a spanning item distributes its height across every row it
   covers, which pushed the name down past the end of the paragraph. */
.acc-entry--noimg .acc-entry__mark { grid-area: 1 / 1; }
.acc-entry--noimg .acc-entry__title { grid-area: 2 / 1; margin-block-end: 0; }

.acc-entry--noimg .acc-entry__text {
	grid-area: 2 / 2;
	max-width: none;
}

.acc-entry__mark {
	display: inline-grid;
	place-items: center;
	inline-size: 52px;
	block-size: 52px;
	border-radius: 50%;
	border: 1px solid var(--acc-hairline-bz);
	background: var(--acc-surface);
	color: var(--acc-bronze-text);
	margin-block-end: 18px;
}

.acc-entry__mark .acc-icon {
	inline-size: 24px;
	block-size: 24px;
}

.acc-entry__title {
	font-family: var(--acc-font-head);
	/* Marcellus has one weight. Hierarchy is size and space, never bold. */
	font-weight: 400;
	line-height: 1.12;
	letter-spacing: 0.005em;
	font-size: clamp(1.5rem, 2.8vw, 2.1rem);
	color: var(--c-text);
	margin-block-end: clamp(12px, 1.4vw, 18px);
}

.acc-entry__text {
	color: var(--c-muted);
	font-size: var(--acc-text-base);
	line-height: 1.72;
	max-width: 62ch;
}

/* =====================================================================
   GROUPS — the Technology page splits present-day from forward-looking
   ===================================================================== */

.acc-pg-group + .acc-pg-group {
	margin-block-start: clamp(48px, 7vw, 96px);
	padding-block-start: clamp(40px, 6vw, 76px);
	border-block-start: 1px solid var(--c-border-metal);
}

.acc-pg-group__head {
	margin-block-end: clamp(26px, 3.5vw, 44px);
	max-width: 58ch;
}

.acc-pg-group__title {
	font-family: var(--acc-font-head);
	font-weight: 400;
	font-size: clamp(1.35rem, 2.2vw, 1.75rem);
	line-height: 1.2;
	color: var(--c-text);
}

.acc-pg-group__note {
	margin-block-start: 10px;
	color: var(--c-muted);
	font-size: var(--acc-text-sm);
	line-height: 1.65;
}

/* =====================================================================
   CONTINUE — a quiet strip of onward links, not a row of cards
   ===================================================================== */

.acc-pg-continue {
	padding-block: clamp(34px, 4.5vw, 56px);
	background: var(--acc-bg-soft);
	border-block-start: 1px solid var(--acc-hairline-bz);
}

.acc-pg-continue__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 14px clamp(24px, 4vw, 52px);
}

.acc-pg-continue__label {
	font-family: var(--acc-font-body);
	font-size: 0.68rem;
	font-weight: 500;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--acc-muted);
}

.acc-pg-continue__link {
	display: inline-flex;
	align-items: center;
	gap: 0.55em;
	font-family: var(--acc-font-head);
	font-size: clamp(1.05rem, 1.6vw, 1.25rem);
	color: var(--acc-ink);
	text-decoration: none;
	border-block-end: 1px solid transparent;
	transition: border-color var(--acc-trans), color var(--acc-trans);
}

.acc-pg-continue__link:hover {
	color: var(--acc-bronze-text);
	border-block-end-color: var(--acc-bronze);
}

.acc-pg-continue__link .acc-icon {
	inline-size: 15px;
	block-size: 15px;
	color: var(--acc-bronze);
	transition: transform var(--acc-trans);
}

.acc-pg-continue__link:hover .acc-icon { transform: translateX(4px); }
[dir="rtl"] .acc-pg-continue__link:hover .acc-icon { transform: translateX(-4px); }

/* =====================================================================
   CLOSING BAND — walnut, once, at the very bottom
   Contextual tokens are flipped by the walnut block in acc-home.css.
   ===================================================================== */

.acc-pg-close {
	position: relative;
	overflow: clip;
	background: var(--acc-walnut-deep);
	color: var(--c-text);
	text-align: center;
	padding-block: clamp(56px, 8vw, 104px);
}

.acc-pg-close__glow {
	position: absolute;
	inset-block-start: -40%;
	/* True horizontal centring must stay physical: a logical inset flips in
	   RTL and drags the glow off the opposite edge. */
	left: 50%;
	transform: translateX(-50%);
	inline-size: min(900px, 120%);
	block-size: 600px;
	background: radial-gradient(closest-side, rgba(201, 180, 140, 0.18), transparent 70%);
	pointer-events: none;
}

.acc-pg-close__inner {
	position: relative;
	max-width: 700px;
}

.acc-pg-close__title {
	font-family: var(--acc-font-head);
	font-weight: 400;
	font-size: clamp(1.85rem, 4vw, 2.8rem);
	line-height: 1.16;
	color: var(--c-text);
}

.acc-pg-close__text {
	margin-block-start: 16px;
	margin-inline: auto;
	max-width: 52ch;
	font-size: clamp(1rem, 1.5vw, 1.1rem);
	line-height: 1.65;
	color: var(--c-muted);
}

.acc-pg-close__actions {
	margin-block-start: clamp(26px, 4vw, 38px);
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	justify-content: center;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

/* Tablet — the hero print moves ABOVE the copy before the columns get too
   narrow, matching the home hero: the photograph is the arrival, the headline
   follows it. The figure stays after the header in the DOM so the h1 is still
   the first thing read; only the visual order changes. */
@media (max-width: 900px) {
	.acc-pg-hero__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: clamp(26px, 5vw, 40px);
	}

	.acc-pg-hero__media {
		order: -1;
		aspect-ratio: 16 / 10;
		max-inline-size: 460px;
		/* An arch this wide would read as a dome, so soften to the vitrine
		   edge and let the hero copy carry the arch motif on its own. */
		border-radius: var(--acc-radius);
	}
}

/* Below 860px the rail cannot hold a column; it becomes a scroll-snap strip
   pinned under the header, which keeps the index reachable while reading. */
@media (max-width: 860px) {
	.acc-pg-index__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: clamp(24px, 5vw, 34px);
	}

	.acc-rail {
		position: sticky;
		inset-block-start: var(--acc-header-h);
		z-index: 5;
		margin-inline: calc(var(--acc-gutter) * -1);
		padding-inline: var(--acc-gutter);
		padding-block: 12px;
		background: color-mix(in srgb, var(--acc-bg) 92%, transparent);
		backdrop-filter: blur(10px);
		-webkit-backdrop-filter: blur(10px);
		border-block-end: 1px solid var(--c-border);
	}

	.acc-rail__label { display: none; }

	.acc-rail__list {
		display: flex;
		gap: 8px;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		border-inline-start: 0;
		scrollbar-width: none;
	}

	.acc-rail__list::-webkit-scrollbar { display: none; }

	.acc-rail__link {
		flex: none;
		scroll-snap-align: start;
		padding: 9px 16px;
		margin-inline-start: 0;
		border: 1px solid var(--c-border);
		border-radius: var(--acc-radius-pill);
		font-size: 0.84rem;
		white-space: nowrap;
	}

	.acc-rail__link.is-active {
		padding-inline-start: 16px;
		border-color: var(--acc-bronze);
		color: var(--acc-ink);
		background: var(--acc-surface);
	}
}

/* Phone — entries go single column, the arch returns at full width. */
@media (max-width: 700px) {
	.acc-entry {
		grid-template-columns: minmax(0, 1fr);
		gap: clamp(18px, 4vw, 26px);
		padding-block: clamp(28px, 6vw, 40px);
	}

	/* Photograph above its text, so the eye meets the subject first. */
	.acc-entry__media {
		order: -1;
		aspect-ratio: 4 / 3;
		border-radius: var(--acc-radius);
	}

	.acc-entry__text { max-width: none; }

	/* No room for the two-column venture composition on a phone. */
	.acc-entry--noimg .acc-entry__body {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	.acc-entry--noimg .acc-entry__mark,
	.acc-entry--noimg .acc-entry__title,
	.acc-entry--noimg .acc-entry__text { grid-area: auto; }

	.acc-entry--noimg .acc-entry__title {
		margin-block-end: clamp(12px, 1.4vw, 18px);
	}

	.acc-pg-continue__inner { gap: 12px 26px; }
}

/* =====================================================================
   TOUCH — keyed off the pointer, not the viewport, so a touch laptop gets
   the same treatment as a phone.
   ===================================================================== */

@media (pointer: coarse) {
	/* The rail pills and the onward links are the two controls on these pages
	   that sit below a comfortable thumb target on their own. */
	.acc-rail__link {
		display: flex;
		align-items: center;
		min-block-size: 44px;
	}

	.acc-pg-continue__link { padding-block: 11px; }
}

/* =====================================================================
   MOTION — entries fade up as they are reached, staggered by the rail
   order. Everything here is opacity + transform only, and collapses to
   nothing under reduced motion (the .acc-anim gate is set before paint).
   ===================================================================== */

.acc-anim .acc-entry,
.acc-anim .acc-pg-hero__media,
.acc-anim .acc-pg-group__head {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity 0.7s var(--acc-ease), transform 0.7s var(--acc-ease);
}

.acc-anim .acc-entry.is-in,
.acc-anim .acc-pg-hero__media.is-in,
.acc-anim .acc-pg-group__head.is-in {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.acc-anim .acc-entry,
	.acc-anim .acc-pg-hero__media,
	.acc-anim .acc-pg-group__head {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.acc-entry__media img,
	.acc-entry:hover .acc-entry__media img { transition: none; transform: none; }

	/* The rail stays sticky. It is orientation, not decoration, and the
	   active-state marker is feedback rather than animation. */
}
