@font-face {
	font-family: 'Inter Local';
	src: url('./fonts/Inter-VariableFont_opsz,wght.ttf') format('truetype');
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Parisienne Local';
	src: url('./fonts/Parisienne-Regular.ttf') format('truetype');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/*
// Original

:root {
	--primary: #fd0890;
	--ivory: #fffdf6;
	--ink: #332626;
	--detail-user-name-color: #fffdf6;
	--overlay-top: rgba(31, 19, 13, 0.22);
	--overlay-bottom: rgba(31, 19, 13, 0.62);
	--background: #000;
	--button-font-color: #ffffff;
	--upload-title-font-color: #fffdf6;
	--guestbook-message-text-color: rgba(46, 41, 36, 0.9);
	--guestbook-title-font-color: #fffdf6;
	--detail-text-color: #332626;
	--detail-subtle-text-color: rgba(51, 38, 38, 0.68);
	--upload-empty-border-color: rgba(253, 8, 144, 0.38);
	--guestbook-input-focus-color: rgba(253, 8, 144, 0.4);
}
*/

:root {
	--primary: #fd0890;
	--ivory: #fffdf6;
	--ink: #332626;
	--detail-user-name-color: #fffdf6;
	--overlay-top: rgba(31, 19, 13, 0.22);
	--overlay-bottom: rgba(31, 19, 13, 0.62);
	--background: #000;
	--button-font-color: #ffffff;
	--upload-title-font-color: #fffdf6;
	--guestbook-message-text-color: #fffdf6;
	--guestbook-title-font-color: #fffdf6;
	--detail-text-color: #332626;
	--detail-subtle-text-color: rgba(51, 38, 38, 0.68);
	--upload-empty-border-color: rgba(253, 8, 144, 0.38);
	--guestbook-input-focus-color: rgba(253, 8, 144, 0.4);
	--comments-sheet-bg: #1b1a1a;
	--comments-sheet-text: #fffdf6;
	--comments-sheet-muted: rgba(255, 253, 246, 0.72);
	--comments-sheet-border: rgba(255, 255, 255, 0.12);
	--comments-sheet-handle: rgba(255, 255, 255, 0.35);
}

body {
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	color: var(--ink);
	background: #f5f6f8;
	-webkit-tap-highlight-color: transparent;
}


/*
Blush Rose Elegant
:root {
  --primary: #D8A7A3;
  --ivory: #FFF9F6;
  --ink: #2F2423;
  --detail-user-name-color: #2F2423;
  --overlay-top: rgba(95, 71, 68, 0.14);
  --overlay-bottom: rgba(95, 71, 68, 0.42);
  --background: #F8F1EE;
  --button-font-color: #ffffff;
  --upload-title-font-color: #2F2423;
  --guestbook-title-font-color: #2F2423;
  --guestbook-message-text-color: rgba(47, 36, 35, 0.9);
  --detail-text-color: #2F2423;
  --detail-subtle-text-color: rgba(47, 36, 35, 0.7);
  --upload-empty-border-color: rgba(216, 167, 163, 0.55);
  --guestbook-input-focus-color: rgba(216, 167, 163, 0.5);
}

Champagne Luxury 
:root {
  --primary: #C9A66B;
  --ivory: #FFFDF8;
  --ink: #2E2924;
  --detail-user-name-color: #2E2924;
  --overlay-top: rgba(58, 46, 34, 0.12);
  --overlay-bottom: rgba(58, 46, 34, 0.42);
  --background: #F8F4EE;
  --button-font-color: #ffffff;
  --upload-title-font-color: #2E2924;
  --guestbook-title-font-color: #2E2924;
  --guestbook-message-text-color: rgba(46, 41, 36, 0.9);
  --detail-text-color: #2E2924;
  --detail-subtle-text-color: rgba(46, 41, 36, 0.68);
  --upload-empty-border-color: rgba(201, 166, 107, 0.6);
  --guestbook-input-focus-color: rgba(201, 166, 107, 0.45);
}

Sage & Neutral
:root {
  --primary: #B7C2B1;
  --ivory: #F8F7F3;
  --ink: #2E2924;
  --detail-user-name-color: #2E2924;
  --overlay-top: rgba(49, 57, 49, 0.12);
  --overlay-bottom: rgba(49, 57, 49, 0.38);
  --background: #F3F5F1;
  --button-font-color: #ffffff;
  --upload-title-font-color: #2E312E;
  --guestbook-title-font-color: #2E312E;
  --guestbook-message-text-color: rgba(46, 49, 46, 0.88);
  --detail-text-color: #2E312E;
  --detail-subtle-text-color: rgba(46, 49, 46, 0.68);
  --upload-empty-border-color: rgba(183, 194, 177, 0.7);
  --guestbook-input-focus-color: rgba(183, 194, 177, 0.55);
}

*/

.app-screen {
	width: 100%;
	min-height: 100dvh;
	display: none;
	background-color: #f5f6f8;
}

#login-screen {
	display: block;
}

.login-hero {
	position: relative;
	min-height: 100dvh;
	background-image:
		linear-gradient(180deg, var(--overlay-top), var(--overlay-bottom)),
		url('../img/copertina.jpg');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.login-overlay {
	min-height: 100dvh;
	position: relative;
	padding: 24px;
	padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.login-heading {
	position: absolute;
	top: 40dvh;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(600px, calc(100% - 48px));
	text-align: left;
}

.login-title {
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-weight: 600;
	font-size: clamp(1rem, 4.2vw, 1.55rem);
	line-height: 1.03;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	text-align: left;
	color: #ffffff;
}

.login-title + .login-subtitle {
	margin-top: 8px;
}

.login-subtitle {
	font-family: 'Parisienne Local', cursive;
	font-size: clamp(2.2rem, 11vw, 4rem);
	line-height: 0.95;
	letter-spacing: 0.2px;
	opacity: 0.95;
	margin-bottom: 12px;
	text-align: left;
	color: #ffffff;
}

.login-form {
	position: absolute;
	top: 65dvh;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(600px, calc(100% - 48px));
	margin-top: 0;
	padding: 14px;
	display: grid;
	gap: 15px;
}

.login-label {
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.9rem;
	font-weight: bold;
	letter-spacing: 0.2px;
	opacity: 0.95;
	color: #ffffff;
}

.login-label::after {
    content: " ❤";
    color: #ff0000;
    margin-left: 4px;
}

.login-input {
	width: 100%;
	border: 0;
	border-radius: 12px;
	padding: 15px;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 1rem;
	font-weight: 600;
	color: var(--ink);
	background: var(--ivory);
	outline: 2px solid transparent;
	outline-offset: 2px;
	transition: outline-color 0.2s ease;
}

.login-input:focus {
	outline-color: rgba(17, 17, 17, 0.22);
}

.login-input.is-error {
	outline-color: #ff8475;
}

.login-button {
	border: 0;
	border-radius: 12px;
	padding: 15px;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: var(--button-font-color);
	background: var(--primary);
	cursor: pointer;
}

.login-button:active {
	opacity: 0.92;
}

.login-loading {
	min-height: 34px;
	display: none;
	justify-content: center;
	align-items: center;
}

.login-loading.is-visible {
	display: flex;
}

@media (min-width: 768px) {
	.login-overlay {
		padding-left: 32px;
		padding-right: 32px;
	}

	.login-heading,
	.login-form {
		width: min(600px, calc(100% - 64px));
	}
}

#grid-screen {
	height: 100dvh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #f5f6f8;
}

.grid-layout {
	min-height: 100dvh;
	background: #f5f6f8;
}

#slideshow  {
	position: relative;
	height: 52dvh;
	min-height: 52dvh;
	overflow: hidden;
	background: #141414;
	box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}

#slideshow::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: linear-gradient(180deg, var(--overlay-top), var(--overlay-bottom));
	pointer-events: none;
	z-index: 2;
}

#slideshow-image {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	opacity: 1;
	transition: opacity 0.35s ease;
}

#slideshow-image.is-fading {
	opacity: 0.2;
}

#slideshow .slideshow-heading {
	top: auto;
	left: 16px;
	bottom: 20px;
	transform: none;
	width: calc(100% - 32px);
	z-index: 10;
}

#slideshow .slideshow-heading .login-title,
#slideshow .slideshow-heading .login-subtitle {
	color: #ffffff;
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

#slideshow-uploadBtn {
	position: fixed;
	bottom: calc(84px + env(safe-area-inset-bottom));
	right: 16px;
	left: auto;
	transform: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 1.15rem;
	font-weight: 700;
	background: var(--primary);
	color: #ffffff;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 14px 28px rgba(253, 8, 144, 0.28), 0 8px 18px rgba(0, 0, 0, 0.22);
	z-index: 1100;
}

#slideshow-uploadBtn i {
	font-size: 1.35rem;
	line-height: 1;
}

#slideshow-uploadBtn:active {
	transform: scale(0.96);
}

#detail-screen {
  position: relative;
  display: none;
  width: 100%;
  min-height: 100vh;
  height: 100vh;
	background: #f5f6f8;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.detail-media-wrapper {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
	min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
	background: #f5f6f8;
	margin: 0;
	padding: calc(max(72px, env(safe-area-inset-top)) + 24px) 12px 96px;
	box-sizing: border-box;
  overflow: hidden;
	max-height: none;
}

.detail-media-wrapper img,
.detail-media-wrapper video {
  width: 100%;
	max-height: calc(100vh - 192px);
  height: auto;
  object-fit: contain;
  display: block;
  background: var(--background);
  opacity: 1;
  transform: translateY(0);
	transition: opacity 0.26s ease, transform 0.26s ease;
}

.detail-media-wrapper.is-transitioning img,
.detail-media-wrapper.is-transitioning video {
  opacity: 0;
  transform: translateY(14px);
}

.detail-actions {
  position: fixed;
	right: 14px;
	top: 68%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 12;
  pointer-events: auto;
  padding: 10px 8px;
  margin-top: 0;
  width: auto;
  flex-shrink: 0;
	background: rgba(255, 255, 255, 0.72);
	border: 1px solid rgba(17, 17, 17, 0.06);
	border-radius: 24px;
	box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
	backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);
	color: var(--ink);
}

.detail-navigation-hint {
	position: fixed;
	left: 50%;
	right: auto;
	bottom: 22px;
	transform: translateX(-50%);
	z-index: 11;
	text-align: center;
	max-width: calc(100% - 120px);
	color: rgba(51, 38, 38, 0.72);
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.01em;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.detail-action-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: auto;
	color: var(--ink);
  background: transparent;
  border-radius: 999px;
  padding: 2px 0;
}

.detail-action {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
	color: var(--ink);
  font-size: 1.35rem;
  cursor: pointer;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: transform 0.18s ease, opacity 0.18s ease;
  padding: 0;
}

.detail-action:active {
  transform: scale(0.96);
  opacity: 0.85;
}



.detail-action-count {
	color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
} 

.detail-comment-composer {
  position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
	width: 100%;
	max-width: none;
  margin: 0;
	padding: 10px 12px;
	border: 1px solid var(--comments-sheet-border);
	border-radius: 0;
	background: rgba(27, 26, 26, 0.94);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
  z-index: 10;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.detail-comment-input {
  width: 100%;
  flex: 1;
  min-width: 0;
	border: 1px solid var(--comments-sheet-border);
	background: var(--comments-sheet-bg);
	border-radius: 14px;
	padding: 11px 12px;
  color: var(--comments-sheet-text);
  font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
  font-size: 0.92rem;
  line-height: 1.4;
  resize: none;
  outline: none;
  max-height: 120px;
  overflow: auto;
}

.detail-comment-input::placeholder {
	color: var(--comments-sheet-muted);
}

.detail-comment-input:focus {
	outline: 2px solid rgba(255, 255, 255, 0.14);
	outline-offset: 2px;
	background: #222020;
}

.detail-comment-submit {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--button-font-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.detail-comment-submit:active {
  transform: scale(0.97);
}

.detail-comments-backdrop {
  position: fixed;
  inset: 0;
	background: rgba(0, 0, 0, 0.32);
  opacity: 0;
  transition: opacity 0.22s ease;
	z-index: 1050;
}

.detail-comments-backdrop.is-visible {
  opacity: 1;
}

.detail-comments-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
	background: #171717;
  color: var(--comments-sheet-text);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 38px rgba(0, 0, 0, 0.18);
  min-height: 35vh;
  max-height: 62vh;
  transform: translateY(110%);
  transition: transform 0.28s ease;
	z-index: 1051;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-comments-sheet.is-open {
  transform: translateY(0);
}

.detail-comments-sheet__handle {
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: var(--comments-sheet-handle);
  margin: 10px auto 6px;
}

.detail-comments-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--comments-sheet-border);
}

.detail-comments-sheet__header h3 {
  margin: 0;
  color: var(--comments-sheet-text);
  font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.detail-comments-sheet__close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--comments-sheet-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.detail-comments-sheet__list {
  padding: 12px 16px 92px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.detail-comments-sheet__composer {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--comments-sheet-border);
	background: #171717;
}

.detail-comments-sheet__input {
	width: 100%;
	flex: 1;
	min-width: 0;
	min-height: 46px;
	max-height: 120px;
	resize: none;
	overflow: auto;
	border: 1px solid var(--comments-sheet-border);
	border-radius: 14px;
	background: #222020;
	color: var(--comments-sheet-text);
	padding: 11px 12px;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.92rem;
	line-height: 1.4;
	outline: none;
}

.detail-comments-sheet__input::placeholder {
	color: var(--comments-sheet-muted);
}

.detail-comments-sheet__input:focus {
	outline: 2px solid rgba(255, 255, 255, 0.14);
	outline-offset: 2px;
}

.detail-comments-sheet__submit {
	width: 42px;
	height: 42px;
	flex-shrink: 0;
	border: 0;
	border-radius: 50%;
	background: var(--primary);
	color: var(--button-font-color);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 1rem;
	cursor: pointer;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.detail-comments-sheet__submit:active {
	transform: scale(0.97);
}

.detail-comments-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--comments-sheet-border);
}

.detail-comments-item:last-child {
  border-bottom: 0;
}

.detail-comments-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.detail-comments-item__identity {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.detail-comments-item__avatar {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: #fff;
	flex-shrink: 0;
}

.detail-comments-item__user {
  color: var(--comments-sheet-text);
  font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.detail-comments-item__date {
  color: var(--comments-sheet-muted);
  font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
  font-size: 0.72rem;
}

.detail-comments-item__text {
  margin: 0;
  color: var(--comments-sheet-text);
  font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-comments-empty {
  color: var(--comments-sheet-muted);
  font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
  font-size: 0.92rem;
  text-align: center;
  padding: 18px 0 10px;
}

.detail-header {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}

.detail-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 70px);
  padding: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.detail-user-meta {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	min-width: 0;
}

.detail-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: #fff;
}

.detail-user-name {
	color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-user-datetime {
	color: rgba(51, 38, 38, 0.68);
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.74rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.detail-close {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--button-font-color);
  font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
  font-size: 1.2rem;
  z-index: 3;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

#signout,
.upload-back {
	width: 45px;
	height: 45px;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 1.5rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid var(--primary);
	background: var(--primary);
	color: #ffffff;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
	z-index: 20;
}

#signout {
	position: absolute;
	top: 12px;
	left: 12px;
}


/* --- GRIGLIA E IMMAGINI (Invariato) --- */
.instagram-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 24px;
}

.gallery-item {
  position: relative; /* Necessario per posizionare l'overlay interno */
  width: 100%;
  aspect-ratio: 1 / 1; 
  overflow: hidden;
  background-color: #f0f0f0;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
	object-fit: cover;
  display: block;
}

.gallery-item--video img {
  filter: saturate(0.9) contrast(1.05);
}

.gallery-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.gallery-video-play {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  position: relative;
  display: block;
}

.gallery-video-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid #ffffff;
}

/* --- EFFETTO HOVER INSTAGRAM --- */

/* L'overlay nero è nascosto di base (opacity: 0) */
.gallery-item .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3); /* Velo scuro semitrasparente */
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s ease; /* Transizione fluida per l'effetto */
}

/* Mostra l'overlay solo quando si passa il mouse sopra l'elemento */
.gallery-item:hover .overlay {
  opacity: 1;
}

/* Stile per i contatori e le icone */
.gallery-item .stats {
  color: #ffffff;
  font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  gap: 30px; /* Spazio tra l'icona dei Like e dei Commenti */
}

.gallery-item .likes, 
.gallery-item .comments {
  display: flex;
  align-items: center;
  gap: 7px; /* Spazio tra l'icona SVG e il testo numerico */
}

.grid-loading {
	grid-column: 1 / -1;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 120px;
}

#feed-screen {
	height: 100dvh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #f5f6f8;
}

.feed-layout {
	width: 100%;
	min-height: 100dvh;
	box-sizing: border-box;
	padding: 10px 12px 108px;
	background:
		radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 34%),
		linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 246, 248, 1));
}

.feed-header {
	width: 100%;
	max-width: 560px;
	margin: 0 auto 14px;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
}

.feed-kicker {
	margin: 0 0 4px;
	color: rgba(46, 49, 46, 0.56);
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.feed-title {
	margin: 0;
	color: var(--detail-text-color);
	font-size: clamp(1.6rem, 4vw, 2.2rem);
	line-height: 1;
}

.feed-list {
	width: 100%;
	max-width: 560px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.feed-card {
	position: relative;
	border-radius: 22px;
	background: #ffffff;
	box-shadow: 0 12px 28px rgba(18, 24, 16, 0.09);
	cursor: pointer;
	transform: translateY(0);
	transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.feed-card:active {
	transform: translateY(1px) scale(0.995);
}

.feed-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 14px 10px;
	gap: 10px;
}

.feed-card__user {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	max-width: 100%;
}

.feed-card__user-meta {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	min-width: 0;
}

.feed-card__avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	border: 2px solid rgba(255, 255, 255, 0.9);
	background: #fff;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.feed-card__media {
	position: relative;
	width: 100%;
	height: 420px;
	background: #111;
	overflow: hidden;
}

.feed-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.feed-video-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.2);
	pointer-events: none;
}

.feed-video-play {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	border: 2px solid rgba(255, 255, 255, 0.88);
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.24);
	position: relative;
	display: block;
}

.feed-video-play::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 55%;
	transform: translate(-50%, -50%);
	width: 0;
	height: 0;
	border-top: 13px solid transparent;
	border-bottom: 13px solid transparent;
	border-left: 20px solid #ffffff;
}

.feed-card__uploader {
	color: var(--ink);
	font-size: 0.92rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
}

.feed-card__datetime {
	color: rgba(51, 38, 38, 0.68);
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.74rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.feed-card__footer {
	padding: 10px 14px 14px;
}

.feed-card__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.feed-action-group {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 9px;
	border-radius: 999px;
	background: transparent;
	color: var(--ink);
}

.feed-action {
	width: 46px;
	height: 46px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ink);
	font-size: 1.35rem;
	cursor: pointer;
	transition: transform 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.feed-action:active {
	transform: scale(0.96);
	opacity: 0.85;
}

.feed-action--delete {
	background: transparent;
	color: var(--ink);
}

.feed-action-count {
	color: var(--ink);
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1;
	min-width: 1.5rem;
	text-align: left;
}

.feed-list .grid-loading {
	min-height: 160px;
}

.loading-spinner {
	width: 34px;
	height: 34px;
	border: 3px solid rgba(0, 0, 0, 0.15);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 0.85s linear infinite;
}

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



.ptr-indicator {
    height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    transition: height 0.2s ease;
    font-size: 1rem;
    color: var(--primary);
  }

.message-modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.42);
	z-index: 1200;
}

.message-modal.is-visible {
	display: flex;
}

.message-modal__content {
	width: min(460px, calc(100% - 48px));
	background: var(--ivory);
	color: var(--ink);
	border-radius: 16px;
	padding: 20px;
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.26);
	border: 1px solid rgba(253, 8, 144, 0.2);
	text-align: center;
}

.message-modal__title {
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 1.05rem;
	font-weight: 600;
	letter-spacing: 0.4px;
	margin: 0;
	text-transform: uppercase;
}

.message-modal__text {
	margin: 14px 0 18px;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.35;
	word-break: break-word;
}

.message-modal__button {
	border: 0;
	border-radius: 12px;
	padding: 12px 24px;
	font-size: 0.98rem;
	font-weight: 700;
	color: #fff;
	background: var(--primary);
	cursor: pointer;
	min-width: 120px;
}

.message-modal__button:active {
	opacity: 0.92;
}

.profile-crop-modal__content {
	width: min(520px, calc(100% - 32px));
	text-align: left;
	display: grid;
	gap: 16px;
}

.profile-crop-modal__content .message-modal__title,
.profile-crop-modal__content .message-modal__text {
	text-align: center;
}

.profile-crop-stage-wrap {
	display: flex;
	justify-content: center;
}

.profile-crop-stage {
	position: relative;
	width: min(100%, 320px);
	aspect-ratio: 1 / 1;
	margin: 0 auto;
	overflow: hidden;
	border-radius: 22px;
	background:
		linear-gradient(45deg, rgba(255, 255, 255, 0.65) 25%, transparent 25%),
		linear-gradient(-45deg, rgba(255, 255, 255, 0.65) 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.65) 75%),
		linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.65) 75%);
	background-size: 24px 24px;
	background-position: 0 0, 0 12px, 12px -12px, -12px 0px;
	box-shadow: inset 0 0 0 1px rgba(253, 8, 144, 0.12), 0 10px 24px rgba(0, 0, 0, 0.12);
	touch-action: none;
	cursor: grab;
}

.profile-crop-stage:active {
	cursor: grabbing;
}

.profile-crop-stage__image {
	position: absolute;
	top: 50%;
	left: 50%;
	max-width: none;
	user-select: none;
	-webkit-user-drag: none;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.profile-crop-zoom {
	display: grid;
	gap: 10px;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--ink);
}

.profile-crop-zoom span {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(51, 38, 38, 0.62);
}

.profile-crop-zoom input[type='range'] {
	width: 100%;
	accent-color: var(--primary);
}

.profile-crop-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}

.profile-crop-actions__button {
	min-width: 140px;
}

.profile-crop-actions__button--secondary {
	background: #7f7f7f;
}

.yesno-modal__content {
	max-width: 460px;
}

.yesno-modal__actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}

.yesno-modal__button {
	min-width: 104px;
}

.yesno-modal__button--secondary {
	background: #7f7f7f;
}

.yesno-modal__button--destructive {
	background: #d9534f;
}

#guestbook-screen {
	height: 100dvh;
	min-height: 100dvh;
	background: #f5f6f8;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

#profile-screen {
	height: 100dvh;
	min-height: 100dvh;
	background:
		linear-gradient(180deg, rgba(253, 8, 144, 0.08), rgba(245, 246, 248, 0.98) 38%),
		linear-gradient(180deg, #f8f9fb, #eef1f5);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overflow-x: hidden;
}

.profile-layout {
	width: min(100%, calc(100% - 20px));
	min-height: 100%;
	margin: 0 auto;
	padding: 14px 0 96px;
	display: flex;
	justify-content: center;
	align-items: flex-start;
}

.profile-card {
	width: min(100%, 540px);
	margin-top: 8px;
	padding: 22px;
	border-radius: 28px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 16px 38px rgba(15, 16, 22, 0.12);
	display: grid;
	gap: 20px;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.profile-card__identity {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px;
	border-radius: 22px;
	background: linear-gradient(135deg, rgba(253, 8, 144, 0.06), rgba(253, 8, 144, 0.015));
	border: 1px solid rgba(253, 8, 144, 0.08);
}

.profile-card__avatar {
	width: 88px;
	height: 88px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
	border: 4px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 8px 20px rgba(15, 16, 22, 0.12);
	background: #fff;
}

.profile-card__identity-text {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.profile-card__label {
	display: inline-flex;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(51, 38, 38, 0.56);
}

.profile-card__name {
	font-size: 1.2rem;
	font-weight: 800;
	color: #21191d;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.profile-card__meta {
	font-size: 0.88rem;
	line-height: 1.45;
	color: rgba(31, 26, 29, 0.68);
	word-break: break-word;
}

.profile-card__meta span {
	font-weight: 700;
	color: #1f1a1d;
}

.profile-card__upload {
	display: grid;
	gap: 14px;
	padding: 18px;
	border-radius: 22px;
	border: 1px dashed rgba(253, 8, 144, 0.2);
	background: rgba(255, 255, 255, 0.72);
}

.profile-card__upload-copy {
	display: grid;
	gap: 8px;
}

.profile-card__hint {
	font-size: 0.92rem;
	line-height: 1.5;
	color: rgba(31, 26, 29, 0.7);
}

.profile-card__button {
	border: 0;
	border-radius: 14px;
	padding: 14px 16px;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.98rem;
	font-weight: 700;
	color: #fff;
	background: var(--primary);
	box-shadow: 0 10px 22px rgba(253, 8, 144, 0.2);
	opacity: 0.72;
	cursor: not-allowed;
}

.profile-card__button:disabled {
	opacity: 0.72;
}

@media (max-width: 480px) {
	.profile-layout {
		width: min(100%, calc(100% - 16px));
		padding: 10px 0 96px;
	}

	.profile-card {
		padding: 18px;
		border-radius: 24px;
	}

	.profile-card__identity {
		padding: 14px;
		gap: 14px;
	}

	.profile-card__avatar {
		width: 78px;
		height: 78px;
	}

	.profile-card__upload {
		padding: 16px;
	}
}

.guestbook-layout {
	width: min(100%, calc(100% - 20px));
	min-height: 100%;
	margin: 0 auto;
	padding: 14px 0 96px;
}

.guestbook-composer {
	display: grid;
	gap: 10px;
	margin-bottom: 16px;
	padding: 16px;
	border-radius: 24px;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid rgba(17, 17, 17, 0.06);
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
}

.guestbook-composer__header {
	display: flex;
	align-items: center;
	gap: 12px;
}

.guestbook-composer__avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	background: #fff;
	border: 1px solid rgba(17, 17, 17, 0.08);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.guestbook-composer__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.guestbook-composer__title {
	color: var(--ink);
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.95rem;
	font-weight: 700;
}

.guestbook-composer__subtitle {
	color: rgba(51, 38, 38, 0.64);
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.78rem;
	line-height: 1.3;
}

.guestbook-input {
	width: 100%;
	display: block;
	resize: vertical;
	min-height: 110px;
	max-height: 220px;
	border: 0;
	border-radius: 18px;
	padding: 16px 18px;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.96rem;
	line-height: 1.5;
	color: var(--ink);
	background: #ffffff;
	box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.05);
}

.guestbook-input:focus {
	outline: 2px solid rgba(17, 17, 17, 0.14);
}

.guestbook-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 0;
	border-radius: 999px;
	padding: 13px 18px;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.96rem;
	font-weight: 700;
	color: var(--button-font-color);
	background: var(--primary);
	cursor: pointer;
	justify-self: flex-start;
	box-shadow: 0 10px 18px rgba(253, 8, 144, 0.18);
}

.guestbook-submit.is-loading {
	opacity: 0.8;
	cursor: progress;
}

.guestbook-list {
	display: grid;
	gap: 14px;
}

.guestbook-message {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	background: #ffffff;
	border: 1px solid rgba(17, 17, 17, 0.06);
	border-radius: 22px;
	padding: 16px 16px 14px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
}

.guestbook-message__avatar-wrap {
	flex-shrink: 0;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	overflow: hidden;
	background: rgba(17, 17, 17, 0.04);
	border: 1px solid rgba(17, 17, 17, 0.08);
}

.guestbook-message__avatar {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.guestbook-message__body {
	flex: 1;
	min-width: 0;
}

.guestbook-message__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 10px;
}

.guestbook-message__user {
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--ink);
	letter-spacing: 0.2px;
}

.guestbook-message__date {
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.74rem;
	color: rgba(51, 38, 38, 0.68);
	white-space: nowrap;
}

.guestbook-message__text {
	margin: 0;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.98rem;
	line-height: 1.5;
	color: var(--ink);
	white-space: pre-wrap;
	word-break: break-word;
}

.guestbook-empty {
	padding: 26px 20px;
	border-radius: 22px;
	background: rgba(255, 255, 255, 0.92);
	border: 1px dashed rgba(17, 17, 17, 0.16);
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 0.96rem;
	line-height: 1.5;
	text-align: center;
	color: rgba(51, 38, 38, 0.72);
}

#upload-screen {
	min-height: 100dvh;
	background: #f5f6f8;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.upload-layout {
	width: min(100%, calc(100% - 24px));
	margin: 0 auto;
	padding: 18px 0 26px;
}

.upload-header {
	display: grid;
	grid-template-columns: 45px 1fr auto;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}

.upload-add {
	border: 0;
	border-radius: 12px;
	height: 44px;
	padding: 0 14px;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-weight: 600;
	cursor: pointer;
}

.upload-back {
	padding: 0;
}

.upload-add {
	background: var(--primary);
	color: var(--button-font-color);
	font-size: 0.95rem;
}

.upload-title {
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 1rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	margin: 0;
	text-align: center;
	color: var(--ink);
}

.upload-counter {
	margin: 0 0 12px;
	font-size: 0.92rem;
	color: rgba(51, 38, 38, 0.72);
	text-align: center;
}

.upload-preview-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.upload-card {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 18px;
	background: #ffffff;
	box-shadow: 0 8px 20px rgba(51, 38, 38, 0.08);
}

.upload-card img,
.upload-card video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.upload-remove {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 50%;
	background: var(--primary);
	color: #ffffff;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.upload-empty {
	grid-column: 1 / -1;
	min-height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 16px;
	border-radius: 14px;
	border: 1px dashed var(--upload-empty-border-color);
	color: #6a5454;
	background: #fff;
}

.upload-submit {
	position: sticky;
	bottom: 16px;
	width: 100%;
	margin-top: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 0;
	border-radius: 12px;
	height: 48px;
	font-family: 'Inter Local', 'Segoe UI', Arial, sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: var(--button-font-color);
	background: var(--primary);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
	cursor: pointer;
}

.upload-submit-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border-width: 2px;
	border-color: rgba(255, 255, 255, 0.45);
	border-top-color: #ffffff;
}

.upload-submit.is-loading .upload-submit-spinner {
	display: inline-block;
}

.upload-submit.is-loading .upload-submit-icon {
	display: none;
}

.upload-submit.is-loading:disabled {
	opacity: 1;
	cursor: progress;
}

.upload-submit:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}


.tabbar {
  position: fixed;
	bottom: max(10px, env(safe-area-inset-bottom));
	left: 50%;
	right: auto;
	width: min(100%, calc(100% - 20px));
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 0;
	background-color: rgba(255, 255, 255, 0.9);
	padding: 7px 6px;
	box-shadow: 0 10px 26px rgba(0,0,0,0.14);
  z-index: 1000;
  color: #333;
	border-radius: 22px;
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	transform: translateX(-50%);
} 

.tabButton {
  background-color: transparent;
	border-radius: 16px;
  border: none;
	padding: 6px 8px;
	min-height: 46px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
	gap: 3px;
	font-size: 10px;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease;
}

.tabButton i {
	font-size: 22px;
}

.tabButton span {
	font-size: 10px;
  font-weight: 500;
}

button.active {
	color: var(--primary);
	background-color: rgba(253, 8, 144, 0.08);
	opacity: 1;
	border: 1px solid rgba(253, 8, 144, 0.12);
	box-shadow: none;
}

.tabButton:active {
	transform: scale(0.96);
}
