/* =========================================================
   AMANTEA ONLINE - WEBCAM LIVE
   ========================================================= */

.ao-webcam-page {
	--ao-dark: #102432;
	--ao-text: #30424d;
	--ao-muted: #73818a;
	--ao-border: #e5eaed;
	--ao-soft: #f6f8f9;
	--ao-live: #e22636;
	--ao-green: #27a269;

	width: 100%;
	background: #fff;
}

.ao-webcam {
	width: min(1400px, calc(100% - 60px));
	margin: 0 auto;
	padding: 55px 0 80px;
	color: var(--ao-text);
}


/* HERO
--------------------------------------------------------- */

.ao-webcam__hero {
	max-width: 760px;
	margin: 0 auto 34px;
	text-align: center;
}

.ao-webcam__eyebrow,
.ao-webcam__section-heading > span {
	display: block;
	margin-bottom: 9px;
	color: #7b8b94;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 2.2px;
	line-height: 1.3;
}

.ao-webcam__hero h1 {
	margin: 0;
	color: var(--ao-dark);
	font-size: clamp(38px, 5vw, 60px);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -1.5px;
}

.ao-webcam__hero p {
	max-width: 650px;
	margin: 16px auto 0;
	color: var(--ao-muted);
	font-size: 17px;
	line-height: 1.65;
}


/* PLAYER
--------------------------------------------------------- */

.ao-webcam__player-card {
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--ao-border);
	border-radius: 18px;
	box-shadow: 0 16px 45px rgba(21, 43, 57, .11);
}

.ao-webcam__player {
	position: relative;
	overflow: hidden;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #0d1921;
}

.ao-webcam__video {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: none;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #000;
}


/* PLACEHOLDER
--------------------------------------------------------- */

.ao-webcam__placeholder {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	text-align: center;

	background:
		radial-gradient(
			circle at 50% 25%,
			#42667c 0%,
			#1b3545 42%,
			#0d1921 100%
		);
}

.ao-webcam__placeholder-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 25px;
}

.ao-webcam__camera-icon {
	display: grid;
	width: 68px;
	height: 68px;
	margin-bottom: 17px;
	place-items: center;
	border: 2px solid rgba(255,255,255,.72);
	border-radius: 50%;
}

.ao-webcam__camera-icon svg {
	width: 30px;
	height: 30px;
}

.ao-webcam__placeholder strong {
	font-size: 23px;
	font-weight: 700;
}

.ao-webcam__placeholder-content > span {
	margin-top: 5px;
	color: rgba(255,255,255,.67);
	font-size: 13px;
}


/* LIVE BADGE
--------------------------------------------------------- */

.ao-webcam__live {
	position: absolute;
	z-index: 10;
	top: 18px;
	left: 18px;

	display: flex;
	align-items: center;
	gap: 7px;

	padding: 8px 12px;

	color: #fff;
	background: rgba(218, 31, 47, .96);
	border-radius: 7px;

	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.3px;
	line-height: 1;
}

.ao-webcam__live-dot {
	width: 7px;
	height: 7px;
	background: #fff;
	border-radius: 50%;
	animation: ao-webcam-live 1.4s infinite;
}

@keyframes ao-webcam-live {
	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: .3;
	}
}


/* OVERLAY
--------------------------------------------------------- */

.ao-webcam__overlay {
	position: absolute;
	z-index: 8;
	right: 0;
	bottom: 0;
	left: 0;

	display: flex;
	align-items: flex-end;
	justify-content: space-between;

	padding: 65px 22px 20px;

	color: #fff;

	background:
		linear-gradient(
			to bottom,
			transparent,
			rgba(0,0,0,.68)
		);

	pointer-events: none;
}

.ao-webcam__location strong,
.ao-webcam__location span {
	display: block;
}

.ao-webcam__location strong {
	font-size: 18px;
	font-weight: 700;
}

.ao-webcam__location span {
	margin-top: 2px;
	font-size: 12px;
	opacity: .78;
}

.ao-webcam__clock {
	font-size: 15px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}


/* STATUS
--------------------------------------------------------- */

.ao-webcam__status {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
}

.ao-webcam__status-item {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;

	min-height: 82px;
	padding: 15px 22px;

	border-right: 1px solid var(--ao-border);
}

.ao-webcam__status-item:last-child {
	border-right: 0;
}

.ao-webcam__status-item small,
.ao-webcam__status-item strong {
	display: block;
}

.ao-webcam__status-item small {
	margin-bottom: 3px;
	color: #8a969d;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 1.2px;
	line-height: 1.3;
}

.ao-webcam__status-item strong {
	color: var(--ao-dark);
	font-size: 13px;
	font-weight: 600;
}

.ao-webcam__status-icon,
.ao-webcam__status-clock {
	color: #788b96;
	font-size: 18px;
}

.ao-webcam__online-dot {
	width: 10px;
	height: 10px;
	flex: 0 0 10px;
	border-radius: 50%;
}

.ao-webcam__online-dot--waiting {
	background: #e5a92f;
}

.ao-webcam__online-dot--online {
	background: var(--ao-green);
}

.ao-webcam__online-dot--offline {
	background: var(--ao-live);
}


/* GENERIC SECTIONS
--------------------------------------------------------- */

.ao-webcam__section {
	margin-top: 70px;
}

.ao-webcam__section-heading {
	margin-bottom: 25px;
	text-align: center;
}

.ao-webcam__section-heading h2 {
	margin: 0;
	color: var(--ao-dark);
	font-size: clamp(27px, 4vw, 37px);
	font-weight: 700;
	line-height: 1.15;
}


/* WEATHER
--------------------------------------------------------- */

.ao-webcam__weather-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	overflow: hidden;

	background: var(--ao-soft);
	border: 1px solid var(--ao-border);
	border-radius: 14px;
}

.ao-webcam__weather-item {
	padding: 27px 15px;
	text-align: center;
	border-right: 1px solid var(--ao-border);
}

.ao-webcam__weather-item:last-child {
	border-right: 0;
}

.ao-webcam__weather-icon {
	display: block;
	min-height: 30px;
	margin-bottom: 8px;
	color: #526c7b;
	font-size: 26px;
	line-height: 30px;
}

.ao-webcam__weather-item small,
.ao-webcam__weather-item strong {
	display: block;
}

.ao-webcam__weather-item small {
	color: #87959d;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 1.1px;
}

.ao-webcam__weather-item strong {
	margin-top: 6px;
	color: var(--ao-dark);
	font-size: 17px;
	font-weight: 600;
}


/* ABOUT
--------------------------------------------------------- */

.ao-webcam__about {
	max-width: 800px;
	margin-right: auto;
	margin-left: auto;
	text-align: center;
}

.ao-webcam__about p {
	margin: 0 0 14px;
	color: var(--ao-muted);
	font-size: 16px;
	line-height: 1.8;
}


/* DISCOVER
--------------------------------------------------------- */

.ao-webcam__discover-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px;
}

.ao-webcam__discover-grid a {
	display: block;
	padding: 27px;

	color: inherit;
	text-decoration: none;

	background: #fff;
	border: 1px solid var(--ao-border);
	border-radius: 14px;

	transition:
		transform .2s ease,
		box-shadow .2s ease,
		border-color .2s ease;
}

.ao-webcam__discover-grid a:hover {
	transform: translateY(-3px);
	border-color: #d7dfe3;
	box-shadow: 0 12px 30px rgba(21,43,57,.09);
}

.ao-webcam__discover-grid strong,
.ao-webcam__discover-grid span,
.ao-webcam__discover-grid b {
	display: block;
}

.ao-webcam__discover-grid strong {
	margin-bottom: 7px;
	color: var(--ao-dark);
	font-size: 18px;
	font-weight: 700;
}

.ao-webcam__discover-grid span {
	min-height: 42px;
	color: var(--ao-muted);
	font-size: 13px;
	line-height: 1.55;
}

.ao-webcam__discover-grid b {
	margin-top: 15px;
	color: #456a80;
	font-size: 12px;
	font-weight: 700;
}


/* TABLET
--------------------------------------------------------- */

@media (max-width: 900px) {

	.ao-webcam {
		width: min(100% - 30px, 1200px);
		padding-top: 40px;
	}

	.ao-webcam__section {
		margin-top: 55px;
	}

}


/* MOBILE
--------------------------------------------------------- */

@media (max-width: 700px) {

	.ao-webcam {
		width: calc(100% - 24px);
		padding: 28px 0 55px;
	}

	.ao-webcam__hero {
		margin-bottom: 23px;
	}

	.ao-webcam__hero h1 {
		font-size: 38px;
		letter-spacing: -1px;
	}

	.ao-webcam__hero p {
		margin-top: 12px;
		font-size: 15px;
		line-height: 1.55;
	}

	.ao-webcam__player-card {
		border-radius: 12px;
	}

	.ao-webcam__live {
		top: 10px;
		left: 10px;
		padding: 7px 10px;
	}

	.ao-webcam__placeholder strong {
		font-size: 18px;
	}

	.ao-webcam__camera-icon {
		width: 54px;
		height: 54px;
		margin-bottom: 12px;
	}

	.ao-webcam__camera-icon svg {
		width: 24px;
	}

	.ao-webcam__overlay {
		padding: 38px 12px 11px;
	}

	.ao-webcam__location strong {
		font-size: 14px;
	}

	.ao-webcam__clock {
		font-size: 12px;
	}

	.ao-webcam__status {
		grid-template-columns: 1fr;
	}

	.ao-webcam__status-item {
		justify-content: flex-start;
		min-height: 62px;
		padding: 12px 18px;
		border-right: 0;
		border-bottom: 1px solid var(--ao-border);
	}

	.ao-webcam__status-item:last-child {
		border-bottom: 0;
	}

	.ao-webcam__section {
		margin-top: 47px;
	}

	.ao-webcam__weather-grid {
		grid-template-columns: 1fr 1fr;
	}

	.ao-webcam__weather-item {
		border-bottom: 1px solid var(--ao-border);
	}

	.ao-webcam__weather-item:nth-child(2) {
		border-right: 0;
	}

	.ao-webcam__weather-item:nth-child(3),
	.ao-webcam__weather-item:nth-child(4) {
		border-bottom: 0;
	}

	.ao-webcam__discover-grid {
		grid-template-columns: 1fr;
	}

	.ao-webcam__discover-grid span {
		min-height: auto;
	}

}
/* =========================================================
   YOUTUBE LIVE PLAYER
   ========================================================= */
.ao-webcam__youtube {
	position: absolute;
	inset: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
	opacity: 0;
	background: #000;
	transition: opacity .25s ease;
}

.ao-webcam__youtube.is-ready { opacity: 1; }

.ao-webcam__youtube iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Lascia cliccabili i controlli YouTube. L'overlay informativo non intercetta i click. */
.ao-webcam__youtube { pointer-events: auto; }
.ao-webcam__overlay,
.ao-webcam__live { pointer-events: none; }

/* =========================================================
   MOBILE LANDSCAPE - VIDEO A SCHERMO DISPONIBILE
   Solo telefoni in orizzontale; non altera desktop/tablet.
   Non usa la Fullscreen API (non automatizzabile su iOS).
   ========================================================= */
@media (orientation: landscape) and (max-height: 600px) and (pointer: coarse) {
    html:has(.ao-webcam__player),
    body:has(.ao-webcam__player) {
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    .ao-webcam__player-card {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        width: 100dvw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 2147483000 !important;
        overflow: hidden !important;
        background: #000 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .ao-webcam__player {
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: auto !important;
        border-radius: 0 !important;
    }

    .ao-webcam__youtube,
    .ao-webcam__youtube iframe {
        width: 100% !important;
        height: 100% !important;
    }

    .ao-webcam__status,
    .ao-webcam__overlay,
    .ao-webcam__live {
        display: none !important;
    }
}

/* Banner homepage condiviso: prima del titolo della webcam */
.ao-webcam__banner {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 34px;
    overflow: hidden;
}
.ao-webcam__banner img,
.ao-webcam__banner video {
    max-width: 100%;
    height: auto;
}
@media (max-width: 700px) {
    .ao-webcam__banner { margin-bottom: 24px; }
}

/* Spaziatura banner webcam */
.ao-webcam {
    padding-top: 35px;
}

.ao-webcam__banner {
    margin-bottom: 35px;
}

@media (max-width: 700px) {
    .ao-webcam {
        padding-top: 18px;
    }

    .ao-webcam__banner {
        margin-bottom: 25px;
    }
}

/* Webcam Amantea - elimina lo spazio superiore di WoodMart */
body:has(.ao-webcam) main#main-content {
    padding-top: 20px !important;
    margin-top: 0 !important;
}

/* Mobile */
@media (max-width: 767px) {
    body:has(.ao-webcam) main#main-content {
        padding-top: 12px !important;
    }
}
