/* HOME — page-home.php
   ============================================================================
   The first screen is three pieces: the heading (name, title, practice line),
   the first quotation, and the portrait. On a wide screen the heading and the
   quotation sit on the left with the portrait on the right, at its natural
   proportions. On a phone they stack.

   PHONE ORDER — one line to change. WWJ's mockup notes put the portrait
   beneath the quotation on a phone; RHM's note to him is that a phone then
   shows name and quotation with no photograph until the visitor scrolls.
   The order below follows the mockup. To put the portrait directly under the
   heading instead, change the order of .homePortrait in the phone block from
   3 to 2 and .homeQuote from 2 to 3.
   ========================================================================== */

section.homeHero .sectionInner {
	padding-top: clamp(2rem, 1rem + 5vw, 5.5rem);
	padding-bottom: clamp(2.5rem, 1.5rem + 5vw, 6rem);
}

section.homeHero .container {
	display: grid;
	gap: 2.2rem;
}

.homeHeading { order: 1; }
.homeQuote { order: 2; }
.homePortrait { order: 3; }

.homeHeading h1 { line-height: 1.1; }
.homeName { display: block; font-size: var(--text-h1); color: var(--color-blue); }
.homeTitleLine {
	display: block;
	margin-top: 1rem;
	color: var(--color-text-soft);
	color: var(--color-charcoal);
	font-weight: 500;
}
.homePracticeLine {
	margin-top: 0.6rem;
	font-style: italic;
	color: var(--color-text-soft);
}

.homeQuote {
	min-width: min(30rem, 90%);
	font-size: clamp(1.5rem, 1rem + 1vw, 1.75rem);
	line-height: 1.6;
}
.homeQuote p + p { margin-top: 0.8em; }
.homeQuote footer {
	margin-top: 1em;
	font-size: 1rem; /* the same as the source name, so the dash before it matches */
	color: var(--color-text-soft);
}
.homeQuote cite { font-style: normal; font-size: 1rem; text-transform: uppercase;}
.homeQuote cite em { font-style: italic; }
/* Sources set as on the inner pages (style.css § QUOTATIONS): the sans face,
   slightly spaced. The footer takes it too, so the dash before the name matches. */
.homeQuote footer { font-family: var(--font-body); letter-spacing: 0.04em; }

/* LARGE QUOTATION MARKS — an opening mark at the start of the first line and a
   closing mark after the last word, added here (so none are typed in Home Page
   Details). They are set with no line height of their own, so however large
   they are made they never push the lines apart.
   On a wide screen Melville's opening mark hangs out to the left of his first
   line, so his words stay in line with the heading; below 900px there is no
   room for that, and it sits at the start of the line. (The Cage quotation
   on the Contact page has the same marks: css/contact.css.)
   For a drawing instead of a typed mark: set content to "", give the mark a
   display: inline-block, width and height, and a background-image:
   url("../images/icons/....svg"). */
.homeQuote {
	--mark-size: 4.5rem;
	--mark-font: var(--font-serif);
	--mark-color: var(--q-mark-color);
	--mark-gap: 0.1em;            /* space between a mark and the words */
	--mark-open-top: 0.2em;       /* lower (+) or raise (-) the opening mark */
	--mark-close-top: 0.33em;     /* lower (+) or raise (-) the closing mark */
}

.homeQuote > p:first-of-type::before,
.homeQuote > p:last-of-type::after {
	position: relative;
	font-family: var(--mark-font);
	font-size: var(--mark-size);
	font-style: normal;
	line-height: 0;
	color: var(--mark-color);
	pointer-events: none;
}
.homeQuote > p:first-of-type::before {
	content: "“";
	top: var(--mark-open-top);
	margin-right: var(--mark-gap);
}
.homeQuote > p:last-of-type::after {
	content: "”";
	top: var(--mark-close-top);
	margin-left: var(--mark-gap);
}
@media (min-width: 900px) { /* BP-TWO-COL — Melville's opening mark hangs */
	.homeQuote > p:first-of-type { position: relative; }
	.homeQuote > p:first-of-type::before {
		position: absolute;
		right: 100%;
		line-height: 0.5;
		/*line-height:0;*/
	}
}

.homePortrait {margin: 0;}
.homePortrait img { width: min(100%, 530px); height: auto; } /* natural proportions — never cropped */
@media (max-width: 899px) { /* below BP-TWO-COL: the capped portrait centered */
	.homePortrait img { display: block; margin: 0 auto; }
}

@media (min-width: 900px) { /* BP-TWO-COL */
	section.homeHero .container {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
		grid-template-areas:
			"heading portrait"
			"quote   portrait";
		grid-template-rows: auto 1fr;
		column-gap: clamp(3rem, 6vw, 7rem);
		row-gap: 2.6rem;
		align-items: start;
	}
	.homeHeading { grid-area: heading; }
	.homeQuote { grid-area: quote; }
	.homePortrait { grid-area: portrait; align-self: center; }
	/* When there is no portrait the text takes the full width. */
	section.homeHero .container:not(:has(.homePortrait)) { grid-template-columns: 1fr; grid-template-areas: "heading" "quote"; }
}

/* The three cards: secondary to the first screen. No boxes, no buttons —
   a line with a small drawing at its center above each (the icon divider,
   style.css), a heading, a sentence and a text link. The link is pushed to
   the foot of the card so the three links line up across the row. */
section.homeCards .sectionInner { padding: 6rem 0 6rem; }

/* THE CREASE — a faint shadow along the top of the cards section, darkest at
   the top edge and fading quickly downwards, like one half of the inner crease
   of an open book. Three settings:
     --crease-color     the shade it is mixed from
     --crease-strength  how dark it is at the very top (0% = gone)
     --crease-depth     how far down it fades out
   The steps between are set as fractions of the strength, so the fade keeps
   its shape whatever the strength. */
section.homeCards {
	--crease-color: var(--color-wood);
	--crease-strength: 9%;
	--crease-depth: clamp(4rem, 3rem + 5vw, 8rem);
	background-image: linear-gradient(to bottom,
		color-mix(in srgb, var(--crease-color) var(--crease-strength), transparent) 0%,
		color-mix(in srgb, var(--crease-color) calc(var(--crease-strength) * 0.55), transparent) 12%,
		color-mix(in srgb, var(--crease-color) calc(var(--crease-strength) * 0.25), transparent) 35%,
		color-mix(in srgb, var(--crease-color) calc(var(--crease-strength) * 0.08), transparent) 65%,
		transparent 100%);
	background-size: 100% var(--crease-depth);
	background-repeat: no-repeat;
}
section.homeCards .container {
	display: grid;
	gap: 2.5rem;
}
.homeCard {
	display: flex;
	flex-direction: column;
}
.homeCard .iconDivider { margin-top: 0; margin-bottom: 1.4rem; }
.homeCard h2 { font-size: var(--text-h3); margin-bottom: 0.6rem; }
.homeCard p { font-size: 0.95em; line-height: 1.6; color: var(--color-text-soft); }
.homeCardLink { margin-top: auto; padding-top: 1rem; }
.homeCardLink a { padding-bottom: 0.15rem; }
.homeCardLink a::after { content: "\2192"; margin-left: 0.5em; }
.homeCardLink a:hover { text-shadow: .2px .2px .3px currentColor;}

/* The space between the cards. Also used below to size the "where next" links. */
:root { --home-cards-gap: clamp(3rem, 6vw, 5rem); }

@media (min-width: 900px) { /* BP-TWO-COL */
	section.homeCards .container {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--home-cards-gap);
	}
	/* The "where next" links (style.css § ONWARD LINKS), home page only: one
	   card wide, so they sit directly beneath the middle card. Below 900px the
	   cards stack and the links take their usual width. */
	section.onwardLinks nav {
		max-width: calc((100% - 2 * var(--home-cards-gap)) / 3);
	}
}
