/* Donor Yearbook - structural styles only. Override freely in your theme. */

/* ---------- Grid ---------- */
.yb-grid-wrap { scroll-margin-top: 90px; }

.yb-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2.25rem 1.5rem; /* row gap (between entries) | column gap */
}

/* 4 columns on smaller desktop and large tablets */
@media (max-width: 1200px) {
    .yb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 3 columns on tablets */
@media (max-width: 1000px) {
    .yb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 2 columns on mobile */
@media (max-width: 600px) {
    .yb-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.75rem 1rem;
    }
}

/* Each entry is one tight unit: message, signature, "Class of", then a faint line that ends it off.
   The space between entries is bigger than the space inside one, so it's clear what belongs together. */
.yb-card {
	display: flex;
	flex-direction: column;
	text-align: center;
	background: transparent !important;
	border: 0;
	border-bottom: 1.5px solid #b6c9d1;
	padding: 0 3px 25px;
}
.yb-card *, .yb-card *::before, .yb-card *::after { box-sizing: border-box; }

/* Masonry: JS spreads the cards over these columns (the grid above sets how many),
   always adding the next card to the shortest column, so no gaps are left. */
.yb-col { display: flex; flex-direction: column; gap: inherit; min-width: 0; align-self: start; }

/* Optional written message. It sits above the signature, like a note signed off underneath.
   To put it below instead, add:  .yb-msg { order: 3; margin: 14px 0 0; } */
.yb-msg {
	margin: 0 0 2px;
	padding: 0 4px;
	font-size: .85rem;
	line-height: 1.4;
	text-align: center;
	white-space: pre-line;
	overflow-wrap: anywhere;
	color: var(--yb-msg-color, #ffffff);
}
.yb-sig {
    flex: 0 0 auto;
    min-height: 52px;
    padding: 0 2px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.yb-sig-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 70px;
    object-fit: contain;
    filter: var(--yb-img-filter, none);
    margin-top: 15px;
}
.yb-typed { color: var(--yb-ink, #ffffff); line-height: 1.15; word-break: break-word; }

.yb-class {
	padding: 2px 0 0;
	color: var(--yb-class-color, #c7d9e1);
	text-transform: uppercase;
	letter-spacing: .025em;
	font-size: .85rem;
	font-weight: 600;
}
.yb-class-label, .yb-class-year { font-weight: 600; }

/* No colour blocks behind signatures */
.yb-sig, .yb-sig-img, .yb-typed { background: transparent !important; box-shadow: none !important; }
.yb-sig-img, .yb-typed { border: 0 !important; }
.yb-empty { grid-column: 1 / -1; text-align: center; }
/* Load more button. Style it yourself with .yb-more (or .yb-grid-wrap .yb-more for extra weight). */
.yb-more[hidden] { display: none !important; }
.yb-more { display: block; margin: 1.5rem auto 0; cursor: pointer; }
.yb-more:disabled { opacity: .6; cursor: wait; }
.yb-more:not(.yb-more-theme) {
	height: 44px;
	padding: 0 28px;
	font-family: Montserrat, sans-serif;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #ffffff;
	background: transparent;
	border: 1px solid #ffffff;
	border-radius: 0;
	transition: background-color .15s ease;
	margin-top: 50px;
	margin-bottom: 50px;
}
.yb-more:not(.yb-more-theme):hover:not(:disabled) { background: rgba(255, 255, 255, .12); }

/* ---------- Typed signatures: six fonts, one shared size ----------
   Every font uses the SAME fluid size (--yb-name-size), so they all resize at the same rate.
   font-size-adjust then equalises the lowercase (x-)height of each font, so they LOOK the same size
   instead of just having the same number. Tune by eye with:
     --yb-xh   (below)  the shared x-height target: raise it to make ALL fonts bigger
     --yb-fit  (per font) a nudge for one font, 1 = no change, 1.1 = 10% bigger */
.yb-typed, .yb-font-preview {
	--yb-name-size: clamp(1.1rem, 2.5vw, 1.8rem);
	--yb-xh: 0.4;
	--yb-fit: 1;
	font-size: calc(var(--yb-name-size) * var(--yb-fit));
	font-size-adjust: var(--yb-xh);
	line-height: 1.1 !important;
}
.yb-typed { max-width: 90%; font-size: calc(var(--yb-name-size) * var(--yb-fit) * var(--yb-user, 1)); }

/* Per-font size: each font reads its own multiplier, set in WordPress under Yearbook > Settings > Signature sizes
   (as --yb-size-dancing etc.). You can also set one here instead, e.g. --yb-user: 1.1; for 10% bigger. */
.yb-font-dancing { font-family: 'Dancing Script', cursive; font-weight: 500; --yb-user: var(--yb-size-dancing, 1); }
.yb-font-dafoe   { font-family: 'Mr Dafoe', cursive;                         --yb-user: var(--yb-size-dafoe, 1); }
.yb-font-caveat  { font-family: 'Caveat', cursive; font-weight: 600;         --yb-user: var(--yb-size-caveat, 1); }
.yb-font-apple   { font-family: 'Homemade Apple', cursive;                   --yb-user: var(--yb-size-apple, 1); }

/* Older browsers without font-size-adjust: approximate the same effect with fixed nudges. */
@supports not (font-size-adjust: 0.4) {
	.yb-font-dafoe      { --yb-fit: 1.2; }
	.yb-font-caveat     { --yb-fit: 1.05; }
	.yb-font-apple      { --yb-fit: 1.4; }
	.yb-font-dancing    { --yb-fit: 1.2; }
}


/* ---------- Form (values taken from the SureForms theme settings) ---------- */
.yb-form-wrap {
	--yb-text: #3e4c52;
	--yb-accent: #33464f;
	--yb-field-bg: #fbfbfc;
	--yb-field-bg-hover: rgba(62, 76, 82, .05);
	--yb-field-border: rgba(62, 76, 82, .25);
	--yb-field-border-hover: rgba(63, 113, 136, .65);
	--yb-focus-glow: rgba(63, 113, 136, .15);
	--yb-selected-bg: rgba(63, 113, 136, .1);
	--yb-placeholder: #7c8a95;
	--yb-ring: rgba(62, 76, 82, .7);
	--yb-error: #dc2626;
	--yb-radius: 2px;
	--yb-h: 45px; /* one height for every box in the form */
	display: block;
	width: 100%;
	max-width: none;
	flex: 1 1 100%;
	font-family: Montserrat, sans-serif;
	font-size: 14px;
	line-height: 20px;
	font-weight: 400;
	color: #7c8a95;
	-webkit-font-smoothing: antialiased;
}
.yb-form-wrap *, .yb-form-wrap *::before, .yb-form-wrap *::after { box-sizing: border-box; }

.yb-field { margin: 0 0 16px; }
.yb-form-wrap .yb-label {
	display: block;
	margin: 0 0 8px 0;
	font-family: Montserrat, sans-serif !important;
	font-size: 16px !important;
	line-height: 20px !important;
	font-weight: 400 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	color: var(--yb-text);
}
.yb-req { color: var(--yb-error); }

/* Text fields */
.yb-input {
	display: block;
	width: 100%;
	height: var(--yb-h);
	padding: 0 12px;
	font: inherit;
	color: var(--yb-text);
	background: var(--yb-field-bg);
	border: 1px solid var(--yb-field-border);
	border-radius: var(--yb-radius);
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
/* Message box */
.yb-form-wrap .yb-input.yb-textarea {
	display: block;
	width: 100%;
	height: var(--yb-msg-h, 104px); /* fixed size; the text scrolls inside if it ever runs longer */
	min-height: 0;
	max-height: none;
	padding: 10px 12px;
	font: inherit;
	font-family: Montserrat, sans-serif;
	font-size: 14px;
	line-height: 20px;
	color: var(--yb-text);
	background: var(--yb-field-bg);
	border: 1px solid var(--yb-field-border);
	border-radius: var(--yb-radius);
	box-shadow: none;
	overflow-y: auto;
	resize: none !important;
}
.yb-form-wrap .yb-input.yb-textarea:hover { background: var(--yb-field-bg-hover); border-color: var(--yb-field-border-hover); }
.yb-form-wrap .yb-input.yb-textarea:focus { outline: none; border-color: var(--yb-accent); box-shadow: 0 0 0 3px var(--yb-focus-glow); }
.yb-count { margin-top: 4px; font-size: 12px; line-height: 16px; text-align: right; color: var(--yb-placeholder); }
.yb-form-wrap .yb-label .yb-opt { font-weight: 400 !important; color: var(--yb-placeholder); }
.yb-input::placeholder { color: var(--yb-placeholder); opacity: 1; }
.yb-input:hover { background: var(--yb-field-bg-hover); border-color: var(--yb-field-border-hover); }
.yb-input:focus { outline: none; border-color: var(--yb-accent); box-shadow: 0 0 0 3px var(--yb-focus-glow); }

/* Option boxes with a radio ring on the right (tabs + handwriting styles) */
.yb-tab, .yb-font-opt {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	height: var(--yb-h);
	padding: 0 12px;
	overflow: hidden;
	font: inherit;
	text-align: left;
	color: var(--yb-text);
	background: var(--yb-field-bg);
	border: 1px solid var(--yb-field-border);
	border-radius: var(--yb-radius);
	cursor: pointer;
	opacity: 1;
	transition: border-color .15s ease, background-color .15s ease;
}
.yb-tab:hover, .yb-font-opt:hover { background: var(--yb-field-bg-hover); border-color: var(--yb-field-border-hover); }
.yb-tab::after, .yb-font-opt::after {
	content: '';
	flex: none;
	width: 16px;
	height: 16px;
	border: 2px solid var(--yb-ring);
	border-radius: 50%;
	background: transparent;
}
.yb-tab.is-active, .yb-font-opt:has(input:checked) { background: var(--yb-selected-bg); border-color: var(--yb-accent); }
.yb-tab.is-active::after, .yb-font-opt:has(input:checked)::after {
	border-color: var(--yb-accent);
	background: radial-gradient(circle, var(--yb-accent) 0 38%, transparent 42%);
}
.yb-tab:focus-visible, .yb-font-opt:has(input:focus-visible) { outline: none; box-shadow: 0 0 0 3px var(--yb-focus-glow); border-color: var(--yb-accent); }

.yb-tab { text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.yb-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
@media (max-width: 480px) { .yb-tabs { grid-template-columns: minmax(0, 1fr); } }

.yb-panel[hidden] { display: none; }

/* Handwriting styles (4): 4 across on desktop, 2 across on tablets, stacked on mobile */

.yb-fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.yb-form-wrap .yb-fonts .yb-font-opt { margin: 0 !important; }
@media (max-width: 600px) { .yb-fonts { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .yb-fonts { grid-template-columns: minmax(0, 1fr); } }
.yb-font-opt input { position: absolute; opacity: 0; pointer-events: none; }
.yb-font-preview {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	line-height: 1.3;
	color: var(--yb-text);
}
.yb-font-opt .yb-font-preview { --yb-name-size: 1.25rem; line-height: 1.5 !important; padding: .15em 0; }
.yb-font-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Drawing */
.yb-hint { margin: 0 0 4px; }
.yb-canvas {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 1;
	background: #fff;
	border: 1px dashed var(--yb-ring);
	border-radius: var(--yb-radius);
	touch-action: none;
	cursor: crosshair;
}
.yb-clear {
	margin: 8px 0 16px;
	height: 32px;
	padding: 0 12px;
	font: inherit;
	font-size: 12px;
	color: var(--yb-text);
	background: var(--yb-field-bg);
	border: 1px solid var(--yb-field-border);
	border-radius: var(--yb-radius);
	cursor: pointer;
}
.yb-clear:hover { background: var(--yb-field-bg-hover); border-color: var(--yb-field-border-hover); }

/* Slide to verify */
.yb-slide { margin: 0 0 16px; }
.yb-slide-track {
	--yb-p: 0%;
	position: relative;
	height: var(--yb-h);
	background: var(--yb-field-bg);
	border: 1px solid var(--yb-field-border);
	border-radius: var(--yb-radius);
	overflow: hidden;
}
.yb-slide-fill { position: absolute; top: 0; bottom: 0; left: 0; width: var(--yb-p); background: var(--yb-accent); opacity: .18; }
.yb-slide-text {
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	padding: 0 56px;
	font-size: 14px; text-align: center;
	color: var(--yb-text);
	pointer-events: none;
}
.yb-slide-input {
	position: absolute; inset: 0;
	width: 100%; height: 100%; margin: 0;
	background: transparent;
	-webkit-appearance: none; appearance: none;
	cursor: grab; touch-action: pan-y;
}
.yb-slide-input:disabled { cursor: default; }
.yb-slide-input::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.yb-slide-input::-moz-range-track { height: 100%; background: transparent; }
.yb-slide-input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 48px; height: 38px; border: 0; border-radius: 5px; background: var(--yb-accent); }
.yb-slide-input::-moz-range-thumb { width: 48px; height: 38px; border: 0; border-radius: 5px; background: var(--yb-accent); }
.yb-slide-input:focus-visible { outline: 2px solid var(--yb-accent); outline-offset: 3px; }
.yb-slide-track.is-done .yb-slide-fill { opacity: .3; }

/* Google reCAPTCHA */
.yb-recaptcha-wrap { margin: 0 0 16px; padding: 4px 6px 10px 0; min-height: 92px; overflow: visible; }
.yb-recaptcha { display: block; width: 304px; height: 78px; }
@media (max-width: 360px) {
	.yb-recaptcha-wrap { min-height: 82px; }
	.yb-recaptcha { transform: scale(.88); transform-origin: 0 0; }
}

/* Submit button (matches the SureForms button) */
.yb-form-wrap .yb-form .yb-submit {
	display: block !important;
	float: none !important;
	width: 100% !important;
	max-width: none !important;
	height: 55px;
	margin: 4px 0 !important;
	padding: 8px 14px;
	font-family: Montserrat, sans-serif;
	font-size: 14px;
	line-height: normal;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: uppercase;
	color: #fff;
	background: #3f7188;
	border: 1px solid #3f7188;
	border-radius: 0 !important;
	box-shadow: none;
	cursor: pointer;
	opacity: 1;
	transition: background-color .15s ease, border-color .15s ease;
}
.yb-form-wrap .yb-form .yb-submit:hover:not([disabled]) { background: rgba(63, 113, 136, .9); border-color: rgba(63, 113, 136, .9); }
/* Not yet available: the same blue, just dimmed and slightly greyed. Never changes on hover. */
.yb-form-wrap .yb-form .yb-submit[disabled],
.yb-form-wrap .yb-form .yb-submit[disabled]:hover {
	color: #fff;
	background: #3f7188;
	border-color: #3f7188;
	opacity: .6;
	filter: grayscale(.35);
	cursor: not-allowed;
}
.yb-status { min-height: 16px; margin: 8px 0 0; font-size: 12px; line-height: 16px; font-weight: 500; }
.yb-status.is-error { color: var(--yb-error); }
.yb-thanks { text-align: center; padding: 24px 16px; color: var(--yb-text); }
.yb-thanks p { margin: 0 0 12px; }
.yb-thanks-title { font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--yb-accent); }
.yb-thanks-text { font-size: 16px; line-height: 24px; font-weight: 500; }
.yb-thanks-note { font-size: 16px; line-height: 24px; }
.yb-thanks-redirect { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px !important; font-size: 14px; line-height: 20px; }
.yb-spinner {
	flex: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(63, 113, 136, .25);
	border-top-color: var(--yb-accent);
	border-radius: 50%;
	animation: yb-spin .8s linear infinite;
}
@keyframes yb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .yb-spinner { animation-duration: 2.4s; } }
.yb-thanks-redirect a { color: var(--yb-accent); text-decoration: underline; }
.yb-thanks[hidden] { display: none; }

/* Honeypot: hidden from people, visible to naive bots */
.yb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.yb-form-wrap .yb-input,
.yb-form-wrap .yb-input.yb-textarea { color: #7c8a95; }

.yb-form-wrap .yb-input:not(:placeholder-shown) {
	background: #fbfbfc;
	border-color: var(--yb-accent);
}