/*
	Dean Dance: hand-written stylesheet. No framework and no template code.
	Fonts: Fraunces (headings) and Nunito (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;
	--tartan-gold: #804809;
	/* brighter relatives of the same colours, for the page */
	--red: #a81224;
	--red-deep: #7d0a17;
	--navy: #23204f;
	--green: #1f6a45;
	--gold: #e5a823;
	--gold-soft: #f6d680;
	--plum: #7c4a9e;
	--paper: #fff8ea;
	--paper-deep: #f8ecd2;
	--card: #fffdf7;
	--ink: #2a2433;
	--ink-soft: #5d5566;
	--display: "Fraunces", "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--body: "Nunito", "Avenir Next", "Segoe UI", Helvetica, Arial, sans-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: 700;
	line-height: 1.12;
	margin: 0;
	text-wrap: balance;
}

p { margin: 0 0 1em; }

/* Fraunces has a very ornate ampersand: use the plain one in headings */
.amp { font-family: var(--body); font-weight: 800; font-size: 0.92em; }

/* ---------- 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: 3px 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.2rem;
}

.topbar a {
	color: var(--paper);
	font-size: 0.9rem;
	font-weight: 800;
	letter-spacing: 0.09em;
	text-decoration: none;
	text-transform: uppercase;
	/* 44px tap target */
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 0.4rem;
	-webkit-tap-highlight-color: rgba(229, 168, 35, 0.3);
}

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

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

.masthead {
	position: relative;
	padding: 4rem max(1.25rem, env(safe-area-inset-right)) 8rem max(1.25rem, env(safe-area-inset-left));
	text-align: center;
	color: #fffaf0;
	overflow: hidden;
}

/* 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% 70% at 50% 46%, rgba(38, 0, 6, 0.66) 0%, rgba(38, 0, 6, 0.42) 55%, rgba(38, 0, 6, 0) 100%);
}

/* scalloped lower edge */
.masthead::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 22px;
	background: radial-gradient(circle at 22px 24px, var(--paper) 21px, transparent 22px) center bottom / 44px 22px repeat-x;
}

.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: 11.5rem;
	height: 11.5rem;
	margin: 0 auto 1.25rem;
	border-radius: 50%;
	background: var(--tartan-navy);
	box-shadow: 0 0 0 4px var(--gold), 0 0 0 10px rgba(28, 25, 54, 0.85), 0 0 0 12px var(--gold-soft), 0 12px 30px rgba(0, 0, 0, 0.5);
	display: grid;
	place-items: center;
}

/* the ring of dancers turns slowly, like a reel */
.crest img { width: 86%; height: auto; display: block; animation: reel 90s linear infinite; }

@keyframes reel { to { transform: rotate(360deg); } }

.masthead h1 {
	font-size: clamp(3.1rem, 12vw, 6.25rem);
	font-weight: 700;
	letter-spacing: 0.005em;
	line-height: 1;
	text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.5);
}

.year {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.8rem;
	margin: 0.7rem auto 1.3rem;
	font-family: var(--display);
	font-size: clamp(1.6rem, 5vw, 2.2rem);
	font-weight: 700;
	letter-spacing: 0.2em;
	color: var(--gold);
	padding-left: 0.2em;
}

/* a little wave either side of the year */
.year::before, .year::after {
	content: "";
	height: 10px;
	width: min(5rem, 16vw);
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='10' viewBox='0 0 20 10'%3E%3Cpath d='M0 5q5-7 10 0t10 0' fill='none' stroke='%23e5a823' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 20px 10px repeat-x;
}

.masthead .when {
	display: inline-block;
	margin: 0 auto 1.4rem;
	padding: 0.5rem 1.5rem;
	font-family: var(--display);
	font-size: clamp(1.4rem, 4.6vw, 2.05rem);
	font-weight: 700;
	line-height: 1.25;
	color: var(--tartan-navy);
	background: var(--gold);
	border-radius: 0.8rem;
	box-shadow: 0 4px 0 var(--tartan-gold), 0 10px 20px rgba(0, 0, 0, 0.35);
	transform: rotate(-1.5deg);
}

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

.masthead .schools {
	max-width: 34rem;
	margin: 0 auto;
	font-size: clamp(1.1rem, 3.4vw, 1.35rem);
	font-weight: 700;
	line-height: 1.4;
	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 {
	display: inline-block;
	font-size: 0.85rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #fff;
	background: var(--green);
	border-radius: 99px;
	padding: 0.25rem 1rem;
	margin: 0 0 0.9rem;
}

.section-title {
	text-align: center;
	font-size: clamp(2.1rem, 6.5vw, 2.9rem);
	color: var(--navy);
	padding-bottom: 1.1rem;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='12' viewBox='0 0 120 12'%3E%3Cpath d='M3 6q9.500-9 19 0t19 0 19 0 19 0 19 0 19 0' fill='none' stroke='%23e5a823' stroke-width='3.500' stroke-linecap='round'/%3E%3C/svg%3E") center bottom / 120px 12px no-repeat;
}

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

.rule::before, .rule::after {
	content: "";
	flex: 0 1 8rem;
	height: 0;
	border-top: 4px dotted var(--gold);
}

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

/* ---------- Next event card ---------- */

.invitation {
	position: relative;
	margin: -6rem auto 0;
	max-width: 38rem;
	padding: 2.25rem 1.75rem 2.25rem;
	text-align: center;
	background: var(--card);
	border: 3px solid var(--gold);
	border-radius: 1.4rem;
	box-shadow: 0 8px 0 rgba(125, 10, 23, 0.16), 0 18px 40px rgba(60, 10, 20, 0.25);
}

.invitation .date {
	font-size: clamp(2.2rem, 8vw, 3.5rem);
	color: var(--red);
}

.invitation .time {
	font-family: var(--display);
	font-size: clamp(1.7rem, 5.5vw, 2.3rem);
	font-weight: 600;
	color: var(--navy);
	margin: 0.25rem 0 1.1rem;
}

.invitation .venue {
	font-size: 1.15rem;
	line-height: 1.45;
	margin: 0 auto 1.25rem;
	max-width: 24rem;
	font-style: normal;
}

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

/* price: a plain line between gold rules */
.invitation .price {
	display: inline-block;
	margin: 0 auto 1.25rem;
	padding: 0.55rem 0.25rem;
	border-top: 1px solid var(--gold-soft);
	border-bottom: 1px solid var(--gold-soft);
	font-family: var(--display);
	font-size: 1.3rem;
	font-weight: 600;
	color: var(--navy);
}

.invitation .notice {
	margin: 0 auto;
	max-width: 26rem;
	padding: 0.7rem 1rem;
	font-size: 0.98rem;
	font-weight: 800;
	color: var(--red-deep);
	background: var(--paper-deep);
	border-radius: 0.8rem;
	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-radius: 1.2rem;
	border: 2px solid var(--paper-deep);
	border-bottom: 6px solid var(--c);
	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: grid;
	place-items: center;
	width: 4.6rem;
	height: 4.6rem;
	margin: 0 auto 0.7rem;
	border-radius: 50%;
	background: var(--c);
	color: #fff;
}

.evening li:nth-child(odd) .ico { transform: rotate(-6deg); }
.evening li:nth-child(even) .ico { transform: rotate(6deg); }
.evening li:nth-child(2) .ico { color: var(--tartan-navy); }

.evening svg { width: 2.7rem; height: 2.7rem; stroke-width: 2; }

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

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

.tickets { text-align: center; }

/* shaped like a ticket stub */
.panel {
	margin: 2rem auto 0;
	max-width: 36rem;
	padding: 2rem 2.25rem;
	color: #fff;
	border-radius: 1rem;
	background:
		radial-gradient(circle at 0 50%, var(--paper) 15px, transparent 16px),
		radial-gradient(circle at 100% 50%, var(--paper) 15px, transparent 16px),
		var(--red);
	outline: 2px dashed rgba(255, 255, 255, 0.55);
	outline-offset: -9px;
}

.panel h3 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
.panel p { margin: 0.6rem auto 0; font-weight: 600; text-wrap: balance; }

.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: 3px solid var(--gold);
	border-radius: 1.2rem;
	font-family: var(--body);
}

#mc_embed_signup h2 {
	text-align: center;
	font-size: 2rem;
	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: 800; }

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

#mc_embed_signup label,
#mc_embed_signup .input-group strong {
	display: block;
	font-weight: 700;
	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.8rem;
	font: inherit; /* 17px: above the 16px below which iOS zooms on focus */
	color: var(--ink);
	background-color: #fff;
	border: 2px solid #d9c9a3;
	border-radius: 0.6rem;
	-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%, #23204f 50%), linear-gradient(135deg, #23204f 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;
	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.3rem; height: 1.3rem; 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.7rem;
	background: var(--red);
	color: #fff;
	font-size: 0.95rem;
	font-weight: 700;
	border-radius: 0.4rem;
}

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

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

#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.75rem 2rem;
	-webkit-appearance: none;
	appearance: none;
	font-family: var(--body);
	font-size: 1.1rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff;
	background: var(--red);
	border: 0;
	border-radius: 99px;
	box-shadow: 0 4px 0 var(--red-deep);
	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: 1.25rem auto 1.5rem; color: var(--ink-soft); }

.terms ol {
	margin: 0;
	padding: 0.5rem 1.5rem;
	list-style: none;
	counter-reset: term;
	font-size: 1rem;
	background: var(--card);
	border: 2px solid var(--paper-deep);
	border-radius: 1.2rem;
}

.terms li {
	counter-increment: term;
	position: relative;
	padding: 0.9rem 0 0.9rem 3.2rem;
	border-top: 2px dotted #e6d6ae;
}

.terms li:first-child { border-top: 0; }

.terms li::before {
	content: counter(term);
	position: absolute;
	left: 0;
	top: 0.8rem;
	width: 2.1rem;
	height: 2.1rem;
	display: grid;
	place-items: center;
	font-family: var(--display);
	font-size: 1.15rem;
	font-weight: 700;
	color: #fff;
	background: var(--navy);
	border-radius: 50%;
}

.terms li:nth-child(4n+1)::before { background: var(--red); }
.terms li:nth-child(4n+2)::before { background: var(--green); }
.terms li:nth-child(4n+3)::before { background: var(--gold); color: var(--tartan-navy); }

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

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

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

.site-footer .inner {
	background: var(--tartan-navy);
	color: #ddd6e6;
	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.98rem;
}

.site-footer .name {
	font-family: var(--display);
	font-size: 1.7rem;
	font-weight: 700;
	color: var(--gold);
}

.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-soft); display: inline-block; padding: 0.75rem 0.5rem; margin: -0.25rem 0; }

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

@media (max-width: 600px) {
	.tartan { background-size: 256px 256px; }
	.site-footer .ribbon { background-size: 128px 128px; }
	.topbar nav { gap: 0 0.3rem; }
	.topbar a { font-size: 0.78rem; letter-spacing: 0.06em; padding: 0 0.35rem; }
	.masthead { padding: 3.2rem max(1rem, env(safe-area-inset-right)) 7.5rem max(1rem, env(safe-area-inset-left)); }
	.bunting { height: 32px; background-size: 192px 32px; }
	.crest { width: 8.75rem; height: 8.75rem; }
	.masthead .when { font-size: 1.3rem; padding: 0.5rem 1.2rem; }
	.masthead .when b { display: block; }
	.masthead .when span { display: none; }
	.invitation { padding: 2.25rem 1.1rem 1.75rem; }
	.invitation .price { font-size: 1.15rem; }
	.evening { grid-template-columns: 1fr; }
	.rule { margin: 2.5rem auto 2.25rem; }
	.panel { padding: 1.75rem 1.75rem; }
	.terms ol { padding: 0.25rem 1rem; }
	.terms li { padding-left: 2.8rem; }
	#mc_embed_signup { padding: 1.5rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.crest img { animation: none; }
}

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