/*
 * Okay, Sounds Great!
 * URI: https://www.okaysoundsgreat.com
 * Author: Dennis de Groot
 * Version: 3.3.0
 */

/* =============================================================================
   COLOR TOKENS
   ============================================================================= */

@media (prefers-color-scheme: light) {
	:root {
		--page-bg:          white;
		--receive-bg:       #E9E9EA;
		--receive-color:    black;
		--send-bg:          #36A9FC;
		--send-color:       white;
		--sendastext-bg:    #53D769;
		--sendastext-color: white;
		--preview-bg:       #E9E9EA;
		--preview-color:    black;
		--preview-title:    black;
		--preview-caption:  #848489;
		--ui-color:         #8a898e;
		--cardsub-color:    #030303;
	}
}

@media (prefers-color-scheme: dark) {
	:root {
		--page-bg:          black;
		--receive-bg:       #272729;
		--receive-color:    white;
		--send-bg:          #2797FE;
		--send-color:       white;
		--sendastext-bg:    #53D769;
		--sendastext-color: white;
		--preview-bg:       #272729;
		--preview-color:    white;
		--preview-title:    white;
		--preview-caption:  #94949b;
		--ui-color:         #8a898e;
		--cardsub-color:    white;
	}
}

/* =============================================================================
   BASE
   ============================================================================= */

html, body {
	overflow-x: hidden;
}

body {
	position: relative;
	max-width: 90%;
	overflow-x: visible;
	margin: 0 auto;
	background-color: var(--page-bg);
	font-family: "Helvetica Neue", Helvetica, sans-serif;
	font-size: 17px;
	font-weight: normal;
}

/* =============================================================================
   LAYOUT
   ============================================================================= */

.box {
	display: flex;
	flex-direction: column;
}

.section {
	margin-bottom: 10px;
}

/* Spacing between sender switches */
.send     + .receive,
.receive  + .send,
#mgmt     + .send,
#touring  + .send,
.send     + #mgmt,
.leftcard + .send,
.preview  + .send {
	margin-top: 10px;
}

/* =============================================================================
   UI CHROME
   ============================================================================= */

.timestamp {
	color: var(--ui-color);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.3px;
	align-self: center;
	margin: 10px 0;
}

.readreceipt {
	color: var(--ui-color);
	align-self: flex-end;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.3px;
	padding: 7px 2px 0 0;
	margin-bottom: 15px;
}

/* =============================================================================
   BUBBLE BASE
   ============================================================================= */

p {
	max-width: 65%;
	word-wrap: break-word;
	margin: 2px 0 0;
	line-height: 22px;
	position: relative;
	padding: 8px 16px;
	border-radius: 18px;
}

/* Inline children should not force full bubble width */
p > span,
p > label {
	display: inline;
}

/* No tail by default */
p:before,
p:after {
	content: none;
}

/* Tail only on last bubble in a group */
p.last-in-group:before,
p.last-in-group:after {
	content: "";
	position: absolute;
	bottom: 0;
	height: 20px;
}

/* =============================================================================
   SENT BUBBLES — BLUE (iMessage)
   ============================================================================= */

.send {
	color: var(--send-color);
	background: var(--send-bg);
	align-self: flex-end;
}

.send.last-in-group:before {
	right: -7px;
	width: 20px;
	background-color: var(--send-bg);
	border-bottom-left-radius: 15px 12px;
	border-top-right-radius: 50% 50%;
}

.send.last-in-group:after {
	right: -24px;
	width: 24px;
	background-color: var(--page-bg);
	border-bottom-left-radius: 10px;
}

.send a,
.send a:hover,
.send a:visited {
	color: var(--send-color);
}

/* =============================================================================
   SENT BUBBLES — GREEN (SMS / sendastext)
   ============================================================================= */

.sendastext {
	color: var(--sendastext-color);
	background: var(--sendastext-bg);
	align-self: flex-end;
}

.sendastext.last-in-group:before {
	right: -7px;
	width: 20px;
	background-color: var(--sendastext-bg);
	border-bottom-left-radius: 15px 12px;
	border-top-right-radius: 50% 50%;
}

.sendastext.last-in-group:after {
	right: -24px;
	width: 24px;
	background-color: var(--page-bg);
	border-bottom-left-radius: 10px;
}

.sendastext a,
.sendastext a:hover,
.sendastext a:visited {
	color: var(--sendastext-color);
}

/* =============================================================================
   RECEIVED BUBBLES — GRAY
   ============================================================================= */

.receive {
	background: var(--receive-bg);
	color: var(--receive-color);
	align-self: flex-start;
}

.receive.last-in-group:before {
	left: -7px;
	width: 20px;
	background-color: var(--receive-bg);
	border-bottom-right-radius: 15px 12px;
	border-top-left-radius: 50% 50%;
}

.receive.last-in-group:after {
	left: -24px;
	width: 24px;
	background-color: var(--page-bg);
	border-bottom-right-radius: 10px;
}

/* =============================================================================
   LINK PREVIEW CARDS — LEFT/GRAY (Spotify + calendar)
   ============================================================================= */

.preview {
	background: var(--preview-bg);
	color: var(--preview-color);
	align-self: flex-start;
	width: 265px;
	max-width: 265px;
	min-width: 150px;
	padding: 0;
}

.preview.last-in-group:before {
	left: -7px;
	width: 20px;
	background-color: var(--preview-bg);
	border-bottom-right-radius: 15px 12px;
	border-top-left-radius: 50% 50%;
}

.preview.last-in-group:after {
	left: -24px;
	width: 24px;
	background-color: var(--page-bg);
	border-bottom-right-radius: 10px;
}

.preview img {
	display: block;
	width: 265px;
	min-width: 150px;
	border-top-left-radius: 10%;
	border-top-right-radius: 10%;
}

/* Calendar / wider link preview */
.preview img.link-img {
	width: 347px;
	min-width: 195px;
}

p.preview:has(.link-img) {
	width: 347px;
	max-width: 347px;
	min-width: 195px;
}

.previewtitle {
	display: block;
	padding: 0 20px;
	margin-bottom: -3px;
	font-size: 15px;
	font-weight: 500;
	color: var(--preview-title);
}

.previewcaption {
	display: block;
	padding: 0 20px 5px;
	font-size: 13px;
	letter-spacing: 0.2px;
	color: var(--preview-caption);
}

.preview a,
.preview a:hover,
.preview a:visited {
	text-decoration: none;
	color: inherit;
}

/* =============================================================================
   CONTACT CARD — RIGHT/BLUE (future use)
   ============================================================================= */

p.card {
	padding: 12px 15px;
	border-radius: 20px;
}

.card {
	color: var(--send-color);
	background: var(--send-bg);
	align-self: flex-end;
}

.card.last-in-group:before {
	right: -7px;
	width: 20px;
	background-color: var(--send-bg);
	border-bottom-left-radius: 15px 12px;
	border-top-right-radius: 50% 50%;
}

.card.last-in-group:after {
	right: -24px;
	width: 24px;
	background-color: var(--page-bg);
	border-bottom-left-radius: 10px;
}

.card a,
.card a:hover,
.card a:visited {
	display: flex;
	align-items: center;
	padding-right: 15px;
	color: inherit;
	text-decoration: none;
}

/* =============================================================================
   CONTACT CARD — LEFT/GRAY
   ============================================================================= */

p.leftcard {
	padding: 12px 15px;
	border-radius: 20px;
}

.leftcard {
	color: var(--receive-color);
	background: var(--receive-bg);
	align-self: flex-start;
}

.leftcard.last-in-group:before {
	left: -7px;
	width: 20px;
	background-color: var(--receive-bg);
	border-bottom-right-radius: 15px 12px;
	border-top-left-radius: 50% 50%;
}

.leftcard.last-in-group:after {
	left: -24px;
	width: 24px;
	background-color: var(--page-bg);
	border-bottom-right-radius: 10px;
}

.leftcard a,
.leftcard a:hover,
.leftcard a:visited {
	display: flex;
	align-items: center;
	color: inherit;
	text-decoration: none;
}

/* Card content: stacked name + subtitle */
.cardcontent {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.cardname {
	font-size: 14px;
	font-weight: 500;
	color: var(--receive-color);
	line-height: 1.3;
	letter-spacing: 0.2px;
}

.cardsub {
	font-size: 11px;
	font-weight: 400;
	color: var(--cardsub-color);
	line-height: 1.7;
	letter-spacing: 0.7px;
}

/* =============================================================================
   CONTACT ICON + CHEVRON
   ============================================================================= */

.icon {
	height: 38px;
	width: 38px;
	background-color: #fefefe;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-left: 9px;
	margin-right: 4px;
}

.initials {
	color: #000;
	font-weight: 400;
	font-size: 16px;
	letter-spacing: 0.5px;
	line-height: 1;
	transform: translate(0px, -1px);
	display: inline-block;
}

.chevron::before {
	border-style: solid;
	border-width: 0.08em 0.08em 0 0;
	border-color: #8e8e93;
	content: '';
	display: inline-block;
	height: 0.40em;
	transform: rotate(-45deg);
	width: 0.40em;
}

.chevron.right:before {
	left: 0;
	transform: rotate(45deg);
}

/* =============================================================================
   MOBILE
   ============================================================================= */

@media (max-width: 500px) {
	body {
		margin: 0;
		padding: 0 15px;
	}

	p {
		max-width: 68vw;
	}

	.preview,
	.preview img {
		width: 52vw;
		min-width: 150px;
	}

	p.preview:has(.link-img),
	.preview img.link-img {
		width: 68vw;
		max-width: 347px;
		min-width: 195px;
	}

	.previewtitle {
		padding: 4px 14px 0;
		margin-bottom: -3px;
		font-size: 15px;
	}

	.previewcaption {
		padding: 0 14px 8px;
		font-size: 13px;
		letter-spacing: 0.2px;
	}

	.cardsub {
	color: var(--cardsub-color);
	}
}
