/*
	Dean Dance: hand-written stylesheet. No framework and no template code.
	Fonts: Cormorant Garamond (headings) and Source Serif 4 (text), Google Fonts,
	SIL Open Font Licence.
	Tartan: images/dd-tartan.png, a seamless 768px tile rebuilt from the original
	background (images/DDbg5.jpg): same sett, same colours. Don't recolour it.
	The palette below is taken from the tartan's own red, green, navy, gold and white.
*/

:root {
	/* thread colours, as sampled from the tartan */
	--tartan-red: #6d0009;
	--tartan-navy: #1c1936;
	/* the same colours, tuned for the page */
	--red: #8e1322;
	--red-deep: #6d0009;
	--navy: #1f1c44;
	--green: #1f5a3d;
	--plum: #74488f;
	--gold: #b58a2e;
	--gold-light: #dcbf74;
	--paper: #fbf4e4;
	--paper-deep: #f2e7cd;
	--card: #fffdf6;
	--line: #dfd0a8;
	--ink: #26211c;
	--ink-soft: #5c5346;
	--display: "Cormorant Garamond", "EB Garamond", Garamond, "Times New Roman", serif;
	--body: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
}

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

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--body);
	font-size: 1.0625rem;
	line-height: 1.6;
	overflow-x: hidden;
}

img, svg { max-width: 100%; }

a { color: var(--red); text-underline-offset: 0.15em; }
a:hover { color: var(--red-deep); }
a:focus-visible, input:focus-visible, select:focus-visible {
	outline: 3px solid var(--gold);
	outline-offset: 2px;
}

h1, h2, h3 {
	font-family: var(--display);
	font-weight: 600;
	line-height: 1.15;
	margin: 0;
	text-wrap: balance;
}

p { margin: 0 0 1em; }

/* ---------- Tartan ---------- */

.tartan {
	background-color: var(--tartan-red);
	background-image: url("../../images/dd-tartan.png");
	background-size: 384px 384px; /* the tile is 768px: exactly half size, so it stays crisp */
	background-position: center top;
}

/* ---------- Top bar ---------- */

.topbar {
	background: var(--tartan-navy);
	border-bottom: 1px solid var(--gold);
	position: sticky;
	top: 0;
	z-index: 10;
}

.topbar nav {
	max-width: 68rem;
	margin: 0 auto;
	padding: 0.1rem max(1rem, env(safe-area-inset-right)) 0.1rem max(1rem, env(safe-area-inset-left));
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 1.4rem;
}

.topbar a {
	color: var(--paper);
	font-family: var(--display);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.17em;
	text-decoration: none;
	text-transform: uppercase;
	/* 44px tap target */
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 0.35rem;
	-webkit-tap-highlight-color: rgba(220, 191, 116, 0.3);
}

.topbar a:hover, .topbar a:active { color: var(--gold-light); }

/* ---------- Masthead ---------- */

.masthead {
	position: relative;
	padding: 4.75rem max(1.25rem, env(safe-area-inset-right)) 7.5rem max(1.25rem, env(safe-area-inset-left));
	text-align: center;
	color: #fffaf0;
	border-bottom: 4px double var(--gold);
}

/* a soft dark-red glow behind the lettering, so it reads on the cloth */
.masthead::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 75% 72% at 50% 44%, rgba(34, 0, 5, 0.74) 0%, rgba(34, 0, 5, 0.5) 55%, rgba(34, 0, 5, 0.08) 100%);
}

.masthead > :not(.bunting) { position: relative; }

/* bunting strung under the top bar */
.bunting {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 40px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='40' viewBox='0 0 240 40'%3E%3Cpath d='M0 4h240' stroke='%23fff3d6' stroke-width='2'/%3E%3Cpath d='M6 5h36L24 36z' fill='%23e5a823'/%3E%3Cpath d='M54 5h36L72 36z' fill='%23fff3d6'/%3E%3Cpath d='M102 5h36l-18 31z' fill='%232f8a5b'/%3E%3Cpath d='M150 5h36l-18 31z' fill='%23e5a823'/%3E%3Cpath d='M198 5h36l-18 31z' fill='%234b57b3'/%3E%3C/svg%3E") center top / 240px 40px repeat-x;
	filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
}

.crest {
	width: 11rem;
	height: 11rem;
	margin: 0 auto 1.4rem;
	border-radius: 50%;
	background: var(--tartan-navy);
	box-shadow: 0 0 0 2px var(--gold-light), 0 0 0 7px var(--tartan-navy), 0 0 0 8px var(--gold-light), 0 10px 30px rgba(0, 0, 0, 0.5);
	display: grid;
	place-items: center;
}

.crest img { width: 86%; height: auto; display: block; }

.masthead h1 {
	font-size: clamp(3.3rem, 11.5vw, 6.5rem);
	font-weight: 600;
	letter-spacing: 0.03em;
	line-height: 1;
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
}

.year {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin: 0.8rem auto 1.3rem;
	font-family: var(--display);
	font-size: clamp(1.6rem, 4.8vw, 2.2rem);
	font-weight: 700;
	letter-spacing: 0.3em;
	color: var(--gold-light);
	padding-left: 0.3em; /* balances the trailing letter-space */
}

.year::before, .year::after {
	content: "";
	height: 1px;
	width: min(5.5rem, 16vw);
	background: var(--gold-light);
}

/* date line */
.masthead .when {
	display: inline-block;
	margin: 0 auto 1.3rem;
	padding: 0.4rem 1.5rem;
	font-family: var(--display);
	font-size: clamp(1.5rem, 4.6vw, 2.1rem);
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.25;
	color: var(--tartan-navy);
	background: var(--gold-light);
	border-radius: 2px;
	box-shadow: 0 0 0 1px var(--tartan-navy), 0 0 0 3px var(--gold-light), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.masthead .when span { color: var(--red); padding: 0 0.2em; }
.masthead .when b { font-weight: inherit; white-space: nowrap; }

.masthead .schools {
	max-width: 36rem;
	margin: 0 auto;
	font-family: var(--display);
	font-style: italic;
	font-weight: 600;
	font-size: clamp(1.35rem, 3.9vw, 1.75rem);
	line-height: 1.35;
	text-wrap: balance;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

/* ---------- Page ---------- */

main {
	max-width: 52rem;
	margin: 0 auto;
	padding: 0 max(1.25rem, env(safe-area-inset-right)) 2rem max(1.25rem, env(safe-area-inset-left));
}

section { scroll-margin-top: 4rem; }

.eyebrow {
	font-family: var(--display);
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--gold);
	margin: 0 0 0.5rem;
}

.section-title {
	text-align: center;
	font-size: clamp(2.2rem, 6.5vw, 3rem);
	font-weight: 700;
	color: var(--navy);
}

/* plain ampersand in headings */
.amp { font-style: italic; font-weight: 600; }

/* thistle divider */
.rule {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin: 3.1rem auto;
}

.rule::before, .rule::after {
	content: "";
	flex: 0 1 9rem;
	height: 1px;
	background: var(--gold);
}

.rule svg { width: 2.9rem; height: 2.9rem; flex: none; }
.rule .t-stem { stroke: var(--green); }
.rule .t-bulb { stroke: var(--green); fill: #dfeadb; }
.rule .t-tuft { stroke: var(--plum); stroke-width: 2.2; }

/* ---------- Invitation card ---------- */

.invitation {
	position: relative;
	margin: -5rem auto 0;
	max-width: 40rem;
	padding: 2.75rem 2rem 2.5rem;
	text-align: center;
	background: var(--card);
	border: 1px solid var(--gold);
	outline: 1px solid var(--gold);
	outline-offset: -9px;
	border-radius: 3px;
	box-shadow: 0 14px 40px rgba(60, 10, 18, 0.26);
}

.invitation .date {
	font-size: clamp(2.3rem, 7.8vw, 3.6rem);
	font-weight: 700;
	color: var(--red);
}

.invitation .time {
	font-family: var(--display);
	font-size: clamp(1.7rem, 5.2vw, 2.2rem);
	font-style: italic;
	font-weight: 600;
	color: var(--navy);
	margin: 0.2rem 0 1.2rem;
}

.invitation .venue {
	font-size: 1.125rem;
	line-height: 1.5;
	margin: 0 auto 1.3rem;
	max-width: 24rem;
	font-style: normal;
}

.invitation .venue strong { font-weight: 600; display: block; font-size: 1.2rem; color: var(--navy); }

/* price: a plain line between gold rules */
.invitation .price {
	display: inline-block;
	font-family: var(--display);
	font-size: 1.7rem;
	font-weight: 700;
	color: var(--navy);
	padding: 0.2rem 1.4rem;
	border-top: 1px solid var(--gold);
	border-bottom: 1px solid var(--gold);
	margin: 0 0 1.3rem;
}

.invitation .notice {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--red);
	text-wrap: balance;
}

.invitation .notice span { display: block; }

/* ---------- The evening ---------- */

.evening {
	list-style: none;
	margin: 2rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.25rem;
}

.evening li {
	--c: var(--red);
	background: var(--card);
	border: 1px solid var(--line);
	border-top: 4px solid var(--c);
	border-radius: 3px;
	padding: 1.5rem 1.25rem 1.3rem;
	text-align: center;
}

.evening li:nth-child(2) { --c: var(--gold); }
.evening li:nth-child(3) { --c: var(--green); }
.evening li:nth-child(4) { --c: var(--navy); }

.evening .ico { display: block; color: var(--c); line-height: 0; margin-bottom: 0.6rem; }
.evening svg { width: 3.4rem; height: 3.4rem; }

.evening h3 { font-size: 1.7rem; font-weight: 700; color: var(--navy); margin-bottom: 0.3rem; }
.evening p { margin: 0; color: var(--ink-soft); line-height: 1.45; }

/* ---------- Tickets ---------- */

.tickets { text-align: center; }

.panel {
	margin: 1.75rem auto 0;
	max-width: 40rem;
	padding: 2.25rem 1.75rem;
	color: #fffaf0;
	background: var(--red);
	border: 1px solid var(--gold);
	outline: 1px solid var(--gold-light);
	outline-offset: -8px;
	border-radius: 3px;
}

.panel h3 { font-size: clamp(1.9rem, 6vw, 2.6rem); font-weight: 700; }
.panel p { margin: 0.6rem auto 0; text-wrap: balance; }
.panel p.release { font-size: 1.2rem; font-style: italic; margin-top: 0.9rem; }

.tickets .lead { max-width: 32rem; margin: 0.25rem auto 0; }

/* ---------- Mailchimp ticket application form ---------- */

#mc_embed_signup {
	margin: 1.5rem auto 0;
	max-width: 34rem;
	padding: 2rem 1.5rem;
	text-align: left;
	background: var(--card);
	border: 1px solid var(--gold);
	border-radius: 3px;
	font-family: var(--body);
}

#mc_embed_signup h2 {
	text-align: center;
	font-size: 2.1rem;
	font-weight: 700;
	color: var(--navy);
	margin-bottom: 0.25rem;
}

#mc_embed_signup .indicates-required {
	text-align: center;
	font-size: 0.95rem;
	color: var(--ink-soft);
	margin-bottom: 1.25rem;
}

#mc_embed_signup .asterisk { color: var(--red); font-weight: 700; }

#mc_embed_signup .mc-field-group { margin: 0 0 1rem; }

#mc_embed_signup label,
#mc_embed_signup .input-group strong {
	display: block;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

#mc_embed_signup input[type="text"],
#mc_embed_signup input[type="email"],
#mc_embed_signup select {
	display: block;
	width: 100%;
	min-height: 3rem;
	padding: 0.5rem 0.75rem;
	font: inherit; /* 17px: above the 16px below which iOS zooms on focus */
	color: var(--ink);
	background-color: #fff;
	border: 1px solid #b9a877;
	border-radius: 3px;
	-webkit-appearance: none;
	appearance: none;
}

#mc_embed_signup input[type="text"]:focus,
#mc_embed_signup input[type="email"]:focus,
#mc_embed_signup select:focus { border-color: var(--navy); }

#mc_embed_signup select {
	padding-right: 2.2rem;
	background-image: linear-gradient(45deg, transparent 50%, #1f1c44 50%), linear-gradient(135deg, #1f1c44 50%, transparent 50%);
	background-position: calc(100% - 1.05rem) 55%, calc(100% - 0.7rem) 55%;
	background-size: 0.35rem 0.35rem;
	background-repeat: no-repeat;
}

#mc_embed_signup .helper_text {
	display: block;
	font-size: 0.95rem;
	font-style: italic;
	color: var(--ink-soft);
	margin-top: 0.25rem;
}

#mc_embed_signup .input-group ul {
	list-style: none;
	margin: 0.25rem 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 2rem;
}

#mc_embed_signup .input-group li { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; }
#mc_embed_signup .input-group li label { margin: 0; font-weight: 400; padding: 0.6rem 0.5rem 0.6rem 0; }
#mc_embed_signup .input-group strong a { display: inline-block; padding: 0.65rem 0; }
#mc_embed_signup input[type="radio"] { width: 1.25rem; height: 1.25rem; accent-color: var(--red); }

/* messages written by Mailchimp's validation script */
#mc_embed_signup div.mce_inline_error {
	margin-top: 0.3rem;
	padding: 0.3rem 0.6rem;
	background: var(--red);
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
}

#mc_embed_signup input.mce_inline_error,
#mc_embed_signup select.mce_inline_error { border-color: var(--red); border-width: 2px; }

#mc_embed_signup #mce-responses .response {
	margin: 0 0 1rem;
	padding: 0.6rem 0.8rem;
	font-weight: 600;
	border-left: 4px solid var(--red);
	background: var(--paper-deep);
}

#mc_embed_signup #mce-success-response { border-left-color: var(--green); color: var(--green); }

#mc_embed_signup .clear.foot { text-align: center; }

#mc_embed_signup .button {
	display: inline-block;
	min-width: 12rem;
	min-height: 50px;
	margin: 0.5rem 0 1rem;
	padding: 0.7rem 2rem;
	-webkit-appearance: none;
	appearance: none;
	font-family: var(--display);
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #fffaf0;
	background: var(--red);
	border: 1px solid var(--gold);
	border-radius: 3px;
	cursor: pointer;
}

#mc_embed_signup .button:hover { background: var(--red-deep); }
#mc_embed_signup .refferal_badge { margin: 0 auto; }
#mc_embed_signup .optionalParent a { display: inline-block; padding: 4px 0; }

/* ---------- Terms ---------- */

.terms .intro { text-align: center; max-width: 36rem; margin: 1rem auto 1.5rem; color: var(--ink-soft); font-style: italic; }

.terms ol {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: term;
	font-size: 1rem;
}

.terms li {
	counter-increment: term;
	position: relative;
	padding: 0.9rem 0 0.9rem 3.25rem;
	border-top: 1px solid var(--line);
}

.terms li:last-child { border-bottom: 1px solid var(--line); }

.terms li::before {
	content: counter(term);
	position: absolute;
	left: 0;
	top: 0.5rem;
	width: 2.4rem;
	text-align: center;
	font-family: var(--display);
	font-size: 1.9rem;
	font-weight: 700;
	color: var(--red);
}

/* ---------- Footer ---------- */

.site-footer { margin-top: 3.5rem; }

.site-footer .ribbon { height: 3rem; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); background-size: 192px 192px; }

.site-footer .inner {
	background: var(--tartan-navy);
	color: #d8d1dc;
	text-align: center;
	padding: 2rem max(1.25rem, env(safe-area-inset-right)) calc(2.5rem + env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
	font-size: 0.95rem;
}

.site-footer .name {
	font-family: var(--display);
	font-size: 1.6rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--gold-light);
}

.site-footer p { margin: 0 auto 0.4rem; max-width: 36rem; }
.site-footer p.name { margin-bottom: 0.5rem; }
.site-footer a { color: var(--gold-light); display: inline-block; padding: 0.75rem 0.5rem; margin: -0.25rem 0; }

/* ---------- Phone ---------- */

@media (max-width: 600px) {
	.bunting { height: 32px; background-size: 192px 32px; }
	.tartan { background-size: 256px 256px; }
	.site-footer .ribbon { background-size: 128px 128px; }
	.topbar nav { gap: 0 0.5rem; }
	.topbar a { font-size: 0.86rem; letter-spacing: 0.11em; padding: 0 0.3rem; }
	.masthead { padding: 3.75rem max(1rem, env(safe-area-inset-right)) 6.75rem max(1rem, env(safe-area-inset-left)); }
	.crest { width: 8.5rem; height: 8.5rem; }
	.masthead .when { font-size: 1.4rem; padding: 0.45rem 1.2rem; }
	.masthead .when b { display: block; }
	.masthead .when span { display: none; }
	.invitation { padding: 2.25rem 1.25rem 2rem; }
	.invitation .price { font-size: 1.45rem; padding: 0.2rem 0.9rem; }
	.evening { grid-template-columns: 1fr; }
	.rule { margin: 2.5rem auto; }
	.terms li { padding-left: 2.7rem; }
	.terms li::before { width: 2rem; }
	#mc_embed_signup { padding: 1.5rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

@media print {
	.bunting { display: none; }
	.topbar { display: none; }
	.masthead { color: #000; padding-bottom: 2rem; }
	.masthead::before { display: none; }
	.tartan { background: none; }
	.invitation { margin-top: 1rem; box-shadow: none; }
}
