/* ============================================
	Postcard Base Variables
============================================ */
:root {
	/* Card sizing */
	--card-max-width: 900px;
	--card-aspect-ratio: 8 / 5;

	/* Border */
	--card-border-width: 2px;
	--card-border-color: rgba(0, 0, 0, 0.12);
	--card-border-radius: 18px;

	/* Background (whiter paper look) */
	--card-bg-base: #fefefe;                 /* almost pure white */
	--card-bg-top: rgba(255, 255, 255, 1);   /* brightest top highlight */
	--card-bg-bottom: rgba(250, 245, 235, 0.55); /* a faint warm tone */

	/* Shadow */
	--card-shadow:
		0 8px 20px rgba(0, 0, 0, 0.12),
		0 1px 0 rgba(255, 255, 255, 0.75) inset;

	/* Padding */
	--card-padding: 1.5rem;

	/* Corner radius (mobile override) */
	--card-border-radius-mobile: 14px;
	
	/* Typography */
	--card_text: "Caveat Brush", "Architects Daughter", cursive;
	--address_info_text: "Quicksand", Helvetica, Arial, sans-serif;
}


/* ---------------------------------------------
	card_block basics
--------------------------------------------- */
.card_block {
	box-sizing: border-box;
	margin: 20px auto 0;
	background-color: rgba(251, 251, 251, 0.947);
	width: 95%;
	min-height: 480px;
	border: 3px solid #f4f4f4;
	text-align: center;
	box-shadow: 0 0 4px 2px rgba(201, 196, 183, 0.867);
	padding: 10px;
	border-radius: 10px;
}

/* default: desktop on, mobile off */
.card_back_mobile,
#postage_text_min,
#card_actions_min{
	display:none;
}

@media (max-width: 600px){
	
	/* hide desktop version */
	.card_back_desktop{
		display:none !important;
	}

	/* show mobile version */
	.card_back_mobile,
	#postage_text_min,
	#card_actions_min{
		display:block;
	}

	/* float stamp inside note so text wraps */
	#stamp_cell_min{
		float:right;
		width:88px;              /* tweak */
		margin:0 0 10px 12px;     /* space around stamp */
	}

	#card_stamp_min{
		display:block;
		width:100%;
		height:auto;
	}

	/* contain float */
	#note_cell_min{
		overflow:hidden;
	}
	
	#postage_text_min,
	#card_actions_min {
		height:200px !important;
		min-height:200px !important;
	}
	
}


/* ---------------------------------------------
	card_front
--------------------------------------------- */

#card_front {
	display: flex;
	flex-direction: column;
	justify-content: center; /* vertical centering */
	align-items: center;     /* horizontal centering */
	position: relative;
	overflow: hidden;	/* keeps the effects elements inside the card */
}

#video_play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	-ms-transform: translate(-50%, -50%);
	opacity: .8;
	transition: transform 0.2s ease, filter 0.2s ease;
	border: none;
	box-shadow: none;
}

#video_play:hover {
	cursor: pointer;
	filter: drop-shadow(0 2px 6px rgba(255, 249, 0, 0.815));
}

#play_again {
	display: none;
	font-family: sans-serif;
	font-size: .8em;
	color: #427651;
}
#play_again:hover { 
	cursor: pointer; 
	color: #06088a; 
}
#play_again:before { content: ""; }
#play_again:after { content: " >>"; }


#music_buttons {
	text-align: center;
	display: inline-block;
	width: 200px;
	font-size: 10pt;
}

.music_play:hover, #music_stop:hover {
	cursor: pointer;
}
	

#card_front_heading {
	font-family: var(--font-sans);
	color: var(--text-muted);
	font-size: 1.3em;
	font-weight: 800; /* normalize duplicate bold */
	line-height: 1.5em;

	display: flex;
	flex-direction: column;
	justify-content: flex-end;
}

#card_front_heading {
	height: 40px;
	overflow: hidden;
	margin: .2em auto;
	min-width: 200px;
}

#card_credit, #music_box {
	font-family: Verdana, Helvetica, Arial, sans-serif;
	font-size: .75em;
	font-style: italic;
	text-align: center;
	display: block;
	color: #848484;
	border: 0;
	width: 80%;
	margin: .2em auto 0;
	padding: 0;
	text-align: center;
}

#music_stop {
	display: none;
}



/* ---------------------------------------------
	card_back grid
--------------------------------------------- */

#card_back {
	display: grid;
	grid-template-columns: 3fr 2fr;	/* left note | right address */
	gap: 1rem;
	padding: var(--card-padding);
}

#card_back {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
	   "header  header  stamp"
	   "note    note    address"
	   "note    note    address";
    gap: .2rem;
    padding: 0;
}

#note_cell  {
	grid-area: note;
}

#address_cell {
	grid-area: address;
}

#stamp_cell {
	grid-area: stamp;
}



/* Message area (left column) */
#card_note_area {
	grid-column: 1;
	display: flex;
	flex-direction: column;
}

/* Address block (right column) */
#address_block {
	grid-column: 2;
	position: relative;	/* allows absolute stamp positioning */
	padding: 0.75rem;
	min-height: 150px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: var(--card-border-radius-mobile);
	text-align: center;
}




#send_timing {
    padding: 0 0 0 .5em;
    text-align: left;
    margin: 0;
}

#send_timing input:nth-of-type(2) {
    margin-left: 2em;
}

#card_text {
	height: 32em;
	border: 3px solid #bbb;
	border-radius: 5px;
	max-width: 95%;
	background-color: #f1f1f1;
	text-align: left;
	line-height: 1.5em;
	outline: none;
}

#card_text:focus {
    border-color: rgba(170, 202, 228, 0.883);
    outline: none;
}


/* Write Card: Stamp */
#stamp_cell {
	margin: 0;
	padding: 0;
	text-align: right;
}

#card_stamp {
	z-index: 1;
}



/* ============================================
	Shared “card shell” for both
============================================ */
#recipients_block {
	position: relative;
	box-sizing: border-box;
	width: min(var(--card-max-width), 100% - 2rem);
	margin: 1.5rem auto;

	background:
		radial-gradient(circle at 10% 0%, var(--card-bg-top), transparent 55%),
		radial-gradient(circle at 100% 100%, var(--card-bg-bottom), transparent 55%),
		var(--card-bg-base);

	border-radius: var(--card-border-radius);
	border: var(--card-border-width) solid var(--card-border-color);

	box-shadow: var(--card-shadow);
	padding: var(--card-padding);

	display: flex;
	flex-direction: column;
}


/* Recipients block: auto height (just shrink-wrap content) */
#recipients_block {
	/* default height: auto; */
	/* min-height: 4rem; */
}

.card_block > #card_image {
	max-width: 85%;
	max-height: 85%;
}


/* ============================================
	Responsive Refinements
============================================ */
@media (max-width: 480px) {
	.card_block,
	#recipients_block {
		border-radius: var(--card-border-radius-mobile);
		padding: calc(var(--card-padding) * 0.75);
	}
}

@media (min-width: 900px) {
	.card_block,
	#recipients_block {
		margin-top: 2rem;
		margin-bottom: 2rem;
	}
}

/* ============================================
	Recipients inner content
============================================ */

#recipient_list {
	/* background-color: rgba(255, 250, 232, 0.9); */
	/* padding: 0; */
}

#music_selection {
}

#music_selected {
	display: none;
}

#card_effect_div {
	display: none;
}

/* ============================================
	Postcard Back Layout (Grid)
============================================ */


/* ============================================
	Card Note – Left-aligned + Underlined
============================================ */
#card_note, #card_note_min {
	font-size: 1.2rem;
	font-family: var(--card_text);
	text-align: left;

	/* Taller lines */
	line-height: 1.55;

	/* Push first baseline so it sits right on the first rule */
	padding: 1.9rem 0.75rem 0.75rem 0.5rem;

	/* Lines spaced to match baseline distance */
	background-image: repeating-linear-gradient(
		to bottom,
		transparent 0 1.4rem,
		rgba(0, 0, 0, 0.05) 1.5rem 0.91rem
	);

	border-radius: 8px;
}

/* Timestamp above the note, right-aligned inside note area */
#time_stamp {
	text-align: right;
	font-family: var(--card_text); /* handwritten to match note; swap to address_info_text if you prefer */
	font-size: 0.9rem;
	opacity: 0.8;
	margin-bottom: 0.75rem;
	margin-right: 0.5rem;
}

/* ============================================
	Stamp in top-right of address_block
============================================ */
#stamp_block {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
}

#stamp_wrap {
	display: inline-block;
	padding: 4px;
	border: 1px dashed rgba(0, 0, 0, 0.3);
	border-radius: 6px;
	background-color: #fff;
	position: relative;	/* anchor for cancel_waves if enabled */
}


/* Wavy Cancellation Marks (off for now) */
#cancel_waves {
	display: none;
}

/* ============================================
	Postage text + actions
============================================ */
#postage_text {
	text-align: left;
	padding: 0;
	margin: 1.3em 0 0 0;

	font-size: 0.9rem;
	line-height: 1.3;
	font-family: var(--address_info_text);

	opacity: 0.7;
	letter-spacing: 0.3px;

	border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
}

/* Main action buttons (e.g., Edit / Send) */
#card_actions {
	display: flex;
	flex-direction: column;	/* stack children vertically */
	align-items: center;	/* center everything */
	gap: 0.75rem;
	margin-top: 0.75rem;
	font-family: var(--address_info_text);
	text-align: center;
}

/* Forms inside buttons row */
.card_action_form {
	margin: 0;
}

/* Base card button style */
.card_button {
	padding: 0;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, 0.25);
	background-color: rgba(255, 255, 255, 0.85);
	cursor: pointer;
	font-size: 0.9rem;
	font-family: var(--address_info_text);
	transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
	width: 190px;
}

/* Primary action (Send my Card) */
.card_button_primary {
	background-color: #1a7a4f;
	color: #ffffff;
	border-color: #1a7a4f;
}

/* Hover / active states */
.card_button:hover {
	background-color: rgba(255, 255, 255, 1);
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}

.card_button_primary:hover {
	background-color: #145a3a;
	border-color: #145a3a;
}

/* Recycle info small + soft */
#recycle_info {
	font-size: 0.8rem;
	opacity: 0.75;
	margin: 0.4rem 0 0.5rem;
	text-align: center;
}

/* Terms link under recycle info / link stack */
.terms_link {
	display: block;
	font-size: 0.8rem;
	text-align: center;
	margin: 0.75rem auto 0;
	color: #1e4a35;
	text-decoration: underline;
	opacity: 0.8;
}

/* ============================================
	Reply / Homepage link buttons (stacked)
============================================ */
#card_links {
	display: flex;
	flex-direction: column;		/* stack buttons vertically */
	align-items: center;		/* center horizontally */
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.card_link_btn {
	display: inline-block;
	padding: 0.4rem 1.0rem;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, 0.25);
	background-color: rgba(255, 255, 255, 0.85);
	font-family: var(--address_info_text);
	font-size: 0.9rem;
	color: #1e4a35;
	text-decoration: none;
	width: 150px;			/* keeps the button shape consistent */
	text-align: center;
	transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.card_link_btn:hover {
	background-color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}