/* Michele Camicia — layout and sequence styles. Tokens live in theme.json. */

:root {
	--mc-gap-photo: var(--wp--preset--spacing--60);
	--mc-sans: var(--wp--preset--font-family--sans);
	--mc-muted: var(--wp--preset--color--muted);
	--mc-line: var(--wp--preset--color--line);
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { height: auto; }
::selection { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper); }

/* ---------- Header / footer ---------- */
.mc-header { row-gap: .75rem; }
.mc-header .wp-block-site-title a { text-decoration: none; }
.mc-header .wp-block-navigation a { color: var(--mc-muted); }
.mc-header .wp-block-navigation a:hover,
.mc-header .wp-block-navigation .current-menu-item a { color: inherit; text-decoration: none; }

.mc-footer { border-top: 1px solid var(--mc-line); font-family: var(--mc-sans); font-size: var(--wp--preset--font-size--xs); color: var(--mc-muted); }
.mc-footer p { margin: 0; }

/* ---------- Home: index of projects ---------- */
.mc-home { padding-top: var(--wp--preset--spacing--40); }
.mc-index__grid {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: 1fr;
	gap: var(--wp--preset--spacing--50) clamp(1.25rem, 3vw, 2.5rem);
	align-items: end;
}
@media (min-width: 640px) { .mc-index__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .mc-index__grid { grid-template-columns: repeat(3, 1fr); } }
.mc-index__grid > li { margin: 0; }
.mc-card .wp-block-post-featured-image { margin: 0; overflow: hidden; background: #e9e7e1; }
.mc-card .wp-block-post-featured-image img { display: block; width: 100%; height: auto; transition: transform 1.2s cubic-bezier(.2,.7,.2,1), opacity .4s; }
.mc-card:hover .wp-block-post-featured-image img { transform: scale(1.015); }
.mc-card__text { margin-top: .7rem; gap: 1rem; border-top: 1px solid var(--mc-line); padding-top: .55rem; }
.mc-card__text .wp-block-post-title { margin: 0; font-weight: 500; letter-spacing: 0; line-height: 1.3; }
.mc-card__text .wp-block-post-title a:hover { text-decoration: none; }
.mc-card__text .wp-block-post-excerpt { margin: 0; text-align: right; white-space: nowrap; }
.mc-card__text .wp-block-post-excerpt__excerpt { margin: 0; }

/* ---------- Project page ---------- */
.mc-project__head { padding-top: var(--wp--preset--spacing--50); }
.mc-project__head .wp-block-post-title { margin: 0; font-weight: 500; letter-spacing: -0.035em; }
.mc-project__meta { margin-top: .9rem !important; text-transform: uppercase; letter-spacing: .12em !important; }
.mc-project__meta p { margin: 0; }

.mc-sequence { margin-top: var(--wp--preset--spacing--40); }
.mc-sequence > p { max-width: var(--wp--style--global--content-size); }

/* Subtitle under the title */
.is-style-dek {
	font-size: var(--wp--preset--font-size--l); font-style: italic; line-height: 1.25;
	color: var(--mc-muted); margin-bottom: var(--wp--preset--spacing--50) !important;
}

/* Photographs: generous, even rhythm */
.mc-sequence > .wp-block-image,
.mc-sequence > .is-style-diptych { margin-top: var(--mc-gap-photo) !important; margin-bottom: 0; }
.mc-sequence > .wp-block-image:first-of-type { margin-top: 0 !important; }
.mc-sequence > .wp-block-image + p,
.mc-sequence > .is-style-diptych + p { margin-top: var(--mc-gap-photo) !important; }

.wp-block-image img { display: block; }
.mc-sequence .wp-block-image:not(.alignfull) img { max-height: 88vh; width: auto; max-width: 100%; margin-inline: auto; }
.mc-sequence .wp-block-image.alignfull img { width: 100%; }
.mc-sequence > .wp-block-image.alignwide[style*="--ar"] { max-width: min(var(--wp--style--global--wide-size), calc(88vh * var(--ar))); }
.mc-sequence > .wp-block-image:not(.alignwide):not(.alignfull)[style*="--ar"] { max-width: min(var(--wp--style--global--content-size), calc(88vh * var(--ar))); }

/* Captions: quiet, set in the sans, location on its own line */
.mc-sequence figcaption.wp-element-caption {
	max-width: 36rem; margin: .8rem 0 0; text-align: left;
}
.mc-sequence figcaption em { display: block; font-style: normal; color: var(--mc-muted); margin-top: .2rem; }
.mc-sequence .alignfull figcaption { padding-inline: var(--wp--style--root--padding-left); }
@media (min-width: 1320px) {
	.mc-sequence .alignfull figcaption { padding-inline: calc((100vw - var(--wp--style--global--wide-size)) / 2); }
}

/* Diptych */
.is-style-diptych { display: grid; grid-template-columns: 1fr; gap: var(--wp--preset--spacing--50) clamp(1rem, 2vw, 1.75rem); align-items: start; }
.is-style-diptych > .wp-block-image { margin: 0 !important; }
.is-style-diptych .wp-block-image img { width: 100% !important; max-height: none !important; }
@media (min-width: 782px) { .is-style-diptych { grid-template-columns: 1fr 1fr; } }

/* Text pause: a line that stops the eye between photographs */
.mc-sequence > .is-style-pause,
.is-style-pause {
	max-width: 24ch !important; margin: var(--mc-gap-photo) auto 0 !important;
	font-size: var(--wp--preset--font-size--l); line-height: 1.2; text-align: center; text-wrap: balance;
}
.mc-sequence > .is-style-pause + * { margin-top: var(--mc-gap-photo) !important; }

/* Long text at the end of the sequence */
.mc-sequence h2 {
	font-size: var(--wp--preset--font-size--xs); text-transform: uppercase; letter-spacing: .14em;
	font-weight: 600; margin-top: var(--mc-gap-photo); padding-top: 1rem; border-top: 1px solid var(--mc-line);
}
.mc-sequence p { text-wrap: pretty; hanging-punctuation: first; }

/* Next / all projects */
.mc-next { margin-top: var(--mc-gap-photo) !important; padding-top: 1rem; border-top: 1px solid var(--mc-line); font-family: var(--mc-sans); font-size: var(--wp--preset--font-size--s); }
.mc-next p, .mc-next .post-navigation-link-previous { margin: 0; }

/* ---------- Reveal on scroll (only below the fold, only if motion is welcome) ---------- */
@media (prefers-reduced-motion: no-preference) {
	.mc-will-reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s ease, transform 1.2s cubic-bezier(.2,.7,.2,1); }
	.mc-will-reveal.is-in { opacity: 1; transform: none; }
}

/* Header and footer keep the page side margins */
.mc-header, .mc-footer { padding-left: var(--wp--style--root--padding-left); padding-right: var(--wp--style--root--padding-right); }


/* Title block: subtitle sits under the title, opener photo comes up into the first screen */
.mc-project__head { padding-top: var(--wp--preset--spacing--40); }
.mc-sequence { margin-top: 0 !important; }
.mc-sequence > .is-style-dek {
	max-width: var(--wp--style--global--wide-size) !important;
	margin-top: .6rem !important; margin-bottom: var(--wp--preset--spacing--40) !important;
}

/* Tagline under the name */
.mc-brand .wp-block-site-tagline { margin: 0; font-family: var(--mc-sans); font-size: var(--wp--preset--font-size--xs); color: var(--mc-muted); letter-spacing: .02em; }

/* Home: rows of equal height; each cover keeps its own proportions (set by index.js via --ar) */
.mc-card__text { flex-wrap: wrap !important; row-gap: .1rem; }
.mc-card__text .wp-block-post-excerpt { white-space: normal; }
@media (min-width: 640px) {
	.mc-index__grid.is-justified {
		--row-h: clamp(200px, 26vw, 380px);
		display: flex; flex-wrap: wrap; align-items: flex-start;
		gap: var(--wp--preset--spacing--50) clamp(1rem, 2.2vw, 2rem);
	}
	.mc-index__grid.is-justified > li { flex: calc(var(--ar) * 100) 1 calc(var(--ar) * var(--row-h)); min-width: 0; }
	.mc-index__grid.is-justified::after { content: ""; flex: 999999 1 0; }
}

/* Triptych: three photographs in a row, for serial portraits; stacked on phones */
.mc-sequence > .is-style-triptych { margin-top: var(--mc-gap-photo) !important; }
.is-style-triptych { display: grid; grid-template-columns: 1fr; gap: var(--wp--preset--spacing--50) clamp(1rem, 2vw, 1.75rem); align-items: start; }
.is-style-triptych > .wp-block-image { margin: 0 !important; }
.is-style-triptych .wp-block-image img { width: 100% !important; max-height: none !important; }
@media (min-width: 782px) { .is-style-triptych { grid-template-columns: repeat(3, 1fr); } }
.is-style-triptych + p, .mc-sequence > .is-style-triptych + .is-style-pause { margin-top: var(--mc-gap-photo) !important; }

/* Centered captions (block style "Centered caption"), used for square, serial work */
.mc-sequence .is-style-caption-center figcaption.wp-element-caption { text-align: center; margin-inline: auto; max-width: 30rem; }

/* Vertical pairs never taller than the screen */
.is-style-diptych .wp-block-image img { max-height: 88vh !important; object-fit: contain; }

/* ---------- About and other pages ---------- */
.mc-page .mc-sequence { margin-top: var(--wp--preset--spacing--50) !important; }
.mc-about { gap: clamp(2rem, 6vw, 6rem) !important; }
.mc-about > .wp-block-column:first-child .wp-block-image { margin: 0 !important; }
.mc-about > .wp-block-column:first-child img { width: 100% !important; max-height: none !important; }
@media (min-width: 782px) { .mc-about > .wp-block-column:first-child { position: sticky; top: 2rem; align-self: flex-start; } }
.mc-about p:first-child { font-size: var(--wp--preset--font-size--l); line-height: 1.3; }
.mc-about h2 { margin-top: var(--wp--preset--spacing--60) !important; margin-bottom: var(--wp--preset--spacing--40) !important; }
.mc-list { margin: 0; }
.mc-list table { width: 100%; border-collapse: collapse; font-family: var(--mc-sans); font-size: var(--wp--preset--font-size--s); line-height: 1.5; }
.mc-list td { border: 0; border-top: 1px solid var(--mc-line); padding: 1.15rem 1.5rem 1.2rem 0; vertical-align: top; }
.mc-list tr:last-child td { border-bottom: 1px solid var(--mc-line); }
.mc-list td:first-child { width: 5.5rem; color: var(--mc-muted); font-variant-numeric: tabular-nums; }
.mc-list td em { font-style: normal; color: var(--mc-muted); display: inline-block; margin-top: .3rem; }
.mc-about .mc-links { margin-top: var(--wp--preset--spacing--50) !important; }
.mc-links { font-family: var(--mc-sans); font-size: var(--wp--preset--font-size--s); }

/* Tearsheets: linked screenshots */
.mc-page .is-style-diptych a img { transition: opacity .3s; }
.mc-page .is-style-diptych a:hover img { opacity: .85; }
.mc-page .is-style-diptych figcaption { font-size: var(--wp--preset--font-size--s); }
.mc-page .is-style-diptych figcaption a { text-decoration: underline; text-underline-offset: .2em; }

/* Contact */
.mc-contact-lead { color: var(--mc-muted); }
.mc-contact-mail { font-family: var(--mc-sans); font-size: var(--wp--preset--font-size--l); letter-spacing: -0.01em; margin-top: .4rem !important; }
.mc-contact-mail a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.mc-contact-list { margin-top: var(--wp--preset--spacing--50) !important; }
.mc-contact-list td:first-child { width: 7rem; }

/* ---------- Titles: light serif, left-aligned; small roman subtitle ---------- */
.mc-project__head .wp-block-post-title {
	font-family: var(--wp--preset--font-family--serif); font-weight: 300;
	font-size: clamp(2.9rem, 6vw, 5.5rem) !important;
	letter-spacing: -0.025em; line-height: 1; text-wrap: balance; max-width: 22ch;
}
.mc-sequence > .is-style-dek {
	font-size: 1rem; font-style: normal; line-height: 1.4; color: var(--mc-muted);
	margin-top: .9rem !important; max-width: var(--wp--style--global--wide-size) !important;
}

/* ---------- Captions one point larger: they carry the story ---------- */
.mc-sequence figcaption.wp-element-caption { font-size: .8125rem; line-height: 1.5; }
.mc-sequence figcaption em { margin-top: .25rem; }

/* Subtitle: a real second level — above body size, darker, text-like */
.mc-sequence > .is-style-dek {
	font-size: clamp(1.125rem, 1.4vw, 1.25rem); line-height: 1.35; font-weight: 400;
	color: #45443f; max-width: 40ch !important; margin-top: .65rem !important;
}
.mc-sequence > .is-style-dek {
	margin-left: max(0px, calc((100% - var(--wp--style--global--wide-size)) / 2)) !important;
	margin-right: auto !important;
}

/* Name a step above the menu (+9%), header height unchanged */
.mc-header .wp-block-site-title { font-size: .95rem !important; }

/* Phones: less empty space between menu and first cover */
@media (max-width: 639px) { .mc-home { padding-top: 0; } .mc-home .mc-index { margin-top: .5rem; } }

/* "Next project" arrow points forward, after the title */
.mc-next .post-navigation-link-previous a::after { content: "\00a0→"; }

/* Pages: subtitle then content, same rhythm as projects */
.mc-page .mc-sequence { margin-top: 0 !important; }
.mc-page .mc-sequence > .is-style-dek { margin-bottom: var(--wp--preset--spacing--50) !important; }
.mc-page .mc-contact-mail { margin-top: 0 !important; }
.mc-sequence > .is-style-dek { max-width: 48ch !important; text-wrap: balance; }

/* ---------- Editor: show captions as on the site ---------- */
.editor-styles-wrapper figcaption.wp-element-caption { font-size: .8125rem; line-height: 1.5; text-align: left; max-width: 36rem; margin-left: 0; }
.editor-styles-wrapper figcaption em { display: block; font-style: normal; color: var(--mc-muted); margin-top: .25rem; }
.editor-styles-wrapper .is-style-caption-center figcaption.wp-element-caption { text-align: center; margin-inline: auto; max-width: 30rem; }
.editor-styles-wrapper .is-style-dek { font-style: normal; font-size: 1.25rem; color: #45443f; }
.editor-styles-wrapper .is-style-pause { max-width: 24ch; margin-inline: auto; font-size: var(--wp--preset--font-size--l); line-height: 1.2; text-align: center; }

/* ---------- Consent banner: small, bottom-left, in the site's voice ---------- */
.mc-consent {
	position: fixed; left: clamp(1rem, 4vw, 3rem); bottom: 1rem; z-index: 50; max-width: 26rem;
	background: var(--wp--preset--color--paper); color: var(--wp--preset--color--ink);
	border: 1px solid var(--mc-line); padding: 1rem 1.1rem; font-family: var(--mc-sans); font-size: .8125rem; line-height: 1.45;
	box-shadow: 0 6px 24px rgba(0,0,0,.06);
}
.mc-consent[hidden] { display: none; }
.mc-consent p { margin: 0 0 .8rem; }
.mc-consent a { text-decoration: underline; text-underline-offset: .2em; }
.mc-consent__actions { display: flex; gap: .5rem; justify-content: flex-end; }
.mc-consent button {
	font: inherit; cursor: pointer; padding: .45rem .9rem; border: 1px solid var(--wp--preset--color--ink);
	background: transparent; color: inherit;
}
.mc-consent button[data-consent="granted"] { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--paper); }
@media (max-width: 639px) { .mc-consent { left: 1rem; right: 1rem; max-width: none; } }

/* Keyboard focus: clear but quiet */
:where(a, button, input, textarea, summary):focus-visible { outline: 2px solid var(--wp--preset--color--ink); outline-offset: 3px; }
