/* sesei.it modules (frontend.md §4.2), concatenated in one file. */

/* ---------- home layout ---------- */
.home-intro p { margin-bottom: var(--space); }

/* ---------- stadium-map ---------- */
.stadium-map { max-width: 926px; margin: 0 auto var(--space); }
.stadium-map-image { display: block; width: 100%; height: auto; border-radius: 10px; }

/* ---------- tips-box ---------- */
.tips-box {
	background: var(--c-panel);
	border-radius: 10px;
	padding: 20px;
	margin-bottom: var(--space);
}
.tips-box p { font-size: 14px; }
.tips-box ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.45; }
.tips-box li + li { margin-top: 8px; }

/* ---------- photo-grid (match pages, recent photos) ---------- */
.photo-grid { margin: 0 0 var(--space); }
.photo-grid-label {
	display: inline-block;
	border: 1px solid var(--c-burgundy);
	color: var(--c-burgundy);
	border-radius: 5px;
	padding: 2px 10px;
	margin-bottom: 10px;
	font-size: 14px;
}
.photo-grid ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}
@media (min-width: 600px) { .photo-grid ul { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .photo-grid ul { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.photo-grid figure { margin: 0; }
.photo-thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--c-panel);
	border-radius: 8px;
	overflow: hidden;
	aspect-ratio: 4 / 3;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid figcaption { font-size: 14px; line-height: 1.45; margin-top: 5px; color: var(--c-burgundy); }
.photo-grid figcaption a { color: var(--c-green-active); font-weight: 700; text-decoration: underline; }
.photo-grid figcaption a:hover { color: var(--c-green-900); }
.photo-meta { color: var(--c-text); }

/* ---------- recent-photos ---------- */
.recent-photos { margin-bottom: var(--space); }
.photo-grid-recent ul {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: 5px;
}
.photo-grid-recent li { flex: 0 0 150px; scroll-snap-align: start; }
@media (min-width: 1024px) {
	.photo-grid-recent ul { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; }
}

/* ---------- entrance-map ---------- */
.entrance-map { background: var(--c-panel); border-radius: 10px; padding: var(--panel-pad); margin-bottom: var(--space); }
.entrance-map-inner { display: grid; gap: 20px; }
@media (min-width: 768px) {
	.entrance-map-inner { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }
}
.gate-list { list-style: none; margin: 0; padding: 0; }
.gate-list li { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.gate-img { height: 40px; width: auto; flex: 0 0 auto; }
.entrance-map-image { border-radius: 8px; display: block; }

/* ---------- sector-header / sector-locator ---------- */
.sector-header { margin-bottom: var(--space); }
.sector-locator { margin-top: var(--space); }
@media (min-width: 768px) {
	.sector-page {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 250px;
		grid-template-areas: "crumb crumb" "header locator" "seats seats" "comments comments";
		column-gap: var(--space);
		align-items: start;
	}
	.sector-page > .breadcrumb { grid-area: crumb; }
	.sector-header { grid-area: header; }
	.sector-locator { grid-area: locator; margin: 0 0 var(--space); }
	.sector-seats { grid-area: seats; min-width: 0; }
	.sector-comments { grid-area: comments; }
}
.sector-header h1 { margin-bottom: 5px; }
.sector-subtitle { font-size: 18px; font-style: italic; font-weight: 700; margin-bottom: 10px; }
@media (min-width: 1024px) { .sector-subtitle { font-size: 20px; } }
.sector-gate { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sector-intro { margin-bottom: 0; }
.sector-locator { text-align: center; }
.sector-locator a.sector-minimap {
	display: block;
	width: 250px;
	height: 207px;
	margin: 0 auto 5px;
	background: url("../img/stadio_gray_21.jpg") no-repeat;
	border-radius: 5px;
}
.sector-locator a.sector-minimap img { display: block; }
.sector-neighbours { font-size: 14px; }
.sector-neighbours a { color: var(--c-green-900); font-weight: 700; margin: 0 4px; }

/* ---------- seat-map (§3.3) ---------- */
.seat-map-title { margin-top: 0; }
.seat-map-legend { font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
/* Swatch and its sentence wrap as one unit (fix 19/10). */
.seat-map-legend .legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seat-map-legend .seat { flex: 0 0 auto; }
@media (max-width: 359px) { .seat-map-legend .legend-item { white-space: normal; } }
.seat-map {
	border: 1px solid var(--c-divider);
	border-radius: 5px;
	overflow-x: auto;
	padding: 10px 10px 10px 4px;
	margin-bottom: 10px;
	-webkit-overflow-scrolling: touch;
	--row-label: 44px;
}
@media (min-width: 768px) { .seat-map { padding: 10px; --row-label: 54px; } }
.seat-map-inner { width: max-content; margin: 0 auto; }
.seat-row { display: flex; align-items: center; gap: 2px; margin-bottom: 2px; white-space: nowrap; }
.seat-row-label {
	flex: 0 0 var(--row-label);
	font-size: 12px;
	color: var(--c-text);
	text-align: right;
	padding-right: 5px;
	position: sticky; /* stays visible while the map scrolls sideways */
	left: 0;
	z-index: 1;
	background: var(--c-surface);
	box-shadow: -10px 0 0 var(--c-surface); /* also covers the map padding on the left */
	white-space: nowrap;
}
.seat, .seat-gap {
	flex: 0 0 var(--seat, 14px);
	width: var(--seat, 14px);
	height: var(--seat, 14px);
	font-size: calc(var(--seat, 14px) * .7);
	line-height: calc(var(--seat, 14px) - 2px);
	text-align: center;
	border-radius: 2px;
}
.seat {
	display: inline-block;
	background: #ffffff;
	border: 1px solid var(--c-seat-empty);
	color: #333333;
	overflow: hidden;
	letter-spacing: -1px;
}
a.seat.has-photo, span.seat.has-photo {
	background: var(--c-seat-photo);
	color: var(--c-seat-photo-text);
	border-color: #b8a700;
	text-decoration: none;
	font-weight: 700;
}
a.seat.has-photo:hover, a.seat.has-photo:focus-visible { color: #ffffff; background: var(--c-seat-photo-hover); }
/* more than one photo from the seat: dot in the top right corner */
.seat.has-many { position: relative; }
.seat.has-many::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 5px;
	height: 5px;
	border-radius: 0 0 0 5px;
	background: var(--c-burgundy);
}
.seat-map-pitch {
	margin: 8px 0 0 calc(var(--row-label) + 2px);
	height: 40px;
	border-radius: 5px;
	background: #2f6b2f url("../img/campo.jpg") repeat;
	color: #ffffff;
	text-align: center;
	font-size: 14px;
	line-height: 40px;
	text-transform: uppercase;
	letter-spacing: 2px;
}
.sector-total { font-weight: 700; }
.sector-stat { display: block; font-weight: 400; }
.sector-stat-sep { display: none; }
@media (min-width: 768px) {
	.sector-stat { display: inline; }
	.sector-stat-sep { display: inline; }
}

/* ---------- sector-comments ---------- */
.sector-comments { background: var(--c-panel); border-radius: 10px; padding: var(--panel-pad); margin-top: var(--space); }
.sector-comments ul { list-style: none; margin: 0; padding: 0; }
.sector-comments li { font-size: 14px; line-height: 1.45; padding: 8px 0; border-bottom: 1px solid var(--c-divider); }
.sector-comments li:last-child { border-bottom: 0; }
.sector-comments time { font-weight: 700; }
.comment-match { color: var(--c-burgundy); font-weight: 700; }
.comment-seat { color: var(--c-muted); }
.comment-seat::after { content: ":"; }
.sector-comments details { margin-top: 5px; }
.sector-comments summary { cursor: pointer; color: var(--c-green-active); font-weight: 700; padding: 8px 0; }

/* ---------- match-header / next-match ---------- */
.match-header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 5px 15px;
	background: var(--c-tint-panel);
	color: var(--c-green-900);
	border-radius: 10px;
	padding: var(--panel-pad);
	margin-bottom: var(--space);
}
.match-teams { font-size: 20px; font-weight: 700; flex-basis: 100%; }
@media (min-width: 768px) { .match-teams { font-size: 24px; flex-basis: auto; } }
.match-score { font-size: 20px; font-weight: 700; }
.match-competition { font-size: 14px; }
.next-match .match-header { margin-bottom: 0; }
.next-match { margin-bottom: var(--space); }

/* ---------- match-filters ---------- */
.match-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 20px;
	background: var(--c-tint-panel);
	border-radius: 5px;
	padding: 10px;
	margin-bottom: var(--space);
}
.match-filters label { display: flex; flex-direction: column; font-size: 14px; font-weight: 700; color: var(--c-green-900); gap: 4px; }
.match-filters select {
	border: 1px solid var(--c-divider);
	border-radius: 5px;
	padding: 6px 8px;
	background: #ffffff;
	min-width: 180px;
}

/* ---------- match-table ---------- */
.match-season { margin-bottom: var(--space); }
.match-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.match-table th { text-align: left; font-size: 12px; color: var(--c-muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--c-divider); }
.match-table td { padding: 8px; vertical-align: middle; }
.match-table tbody tr:nth-child(even) { background: var(--c-tint-zebra); }
.match-link {
	display: inline-block;
	background: var(--c-green-btn);
	color: #ffffff;
	font-weight: 700;
	font-size: 13px;
	padding: 3px 10px;
	border-radius: 5px;
	text-decoration: none;
	white-space: nowrap;
}
.match-link:hover, .match-link:focus-visible { background: var(--c-green-hover); color: #ffffff; }
.match-note-inline { color: var(--c-muted); font-size: 12px; }
.result-badge {
	display: inline-block;
	width: 24px;
	height: 24px;
	line-height: 24px;
	border-radius: 8px;
	text-align: center;
	font-size: 12px;
	font-weight: 700;
}
.result-win { background: var(--c-win); color: #ffffff; }
.result-draw { background: var(--c-draw); color: #111111; }
.result-loss { background: var(--c-loss); color: #ffffff; }

@media (max-width: 767px) {
	.match-table, .match-table thead, .match-table tbody, .match-table tr, .match-table td { display: block; }
	.match-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
	.match-table tr {
		display: grid;
		grid-template-columns: 34px minmax(0, 1fr) auto;
		grid-template-areas: "badge teams score" "badge meta link";
		gap: 2px 8px;
		padding: 10px 8px;
		border-bottom: 1px solid var(--c-divider);
	}
	.match-table td { padding: 0; }
	.match-table .cell-result { grid-area: badge; align-self: center; }
	.match-table .cell-teams { grid-area: teams; font-weight: 700; }
	.match-table .cell-score { grid-area: score; font-weight: 700; text-align: right; }
	.match-table .cell-date { grid-area: meta; color: var(--c-muted); font-size: 12px; }
	.match-table .cell-competition { display: none; }
	.match-table .cell-link { grid-area: link; text-align: right; }
}

/* ---------- stat-box ---------- */
.stats-grid { display: grid; gap: var(--space); }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.stat-box { background: var(--c-panel); border-radius: 10px; padding: var(--panel-pad); }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table th, .stat-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--c-divider); }
.stat-table thead th { font-size: 12px; color: var(--c-muted); }
.stat-table-totals td { font-weight: 700; text-align: right; }
.stat-high { color: var(--c-win); font-weight: 700; }
.stat-mid { color: #b35f00; font-weight: 700; }
.stat-low { color: var(--c-loss); font-weight: 700; }

/* ---------- social-links ---------- */
.social-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 20px; }
.social-links a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.social-links .icon { width: 32px; height: 32px; }
.social-links-footer .icon { width: 24px; height: 24px; }
.social-links-footer .social-label { font-size: 14px; }
.page-content .social-links-contact { flex-direction: column; justify-content: flex-start; padding-left: 0; margin-bottom: var(--space); }
.social-links-contact a { font-size: 16px; }
.icon-img { width: 32px; height: 32px; border-radius: 4px; }
.icon-img-plain { border-radius: 0; object-fit: contain; }

/* ---------- photo-lightbox ---------- */
.photo-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 50px 10px 10px;
}
.photo-lightbox[hidden] { display: none; }
.photo-lightbox figure {
	margin: 0;
	background: #ffffff;
	border-radius: 10px;
	padding: 10px;
	max-width: min(720px, 100%);
	max-height: 100%;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
}
/* with a video there is no photo to size the box: fix the width so it doesn't shrink when the player loads */
.photo-lightbox figure.has-video { width: min(720px, 100%); }
.photo-lightbox img { max-height: 70vh; width: auto; max-width: 100%; border-radius: 5px; display: block; }
.photo-lightbox figcaption { font-size: 14px; line-height: 1.45; margin-top: 10px; align-self: stretch; color: var(--c-burgundy); }
.lightbox-caption { font-weight: 700; }
.lightbox-comment { color: var(--c-muted); margin-top: 5px; }
.lightbox-sector { display: inline-block; margin-top: 5px; color: var(--c-burgundy-dark); font-weight: 700; }
.lightbox-counter { color: var(--c-muted); font-size: 12px; margin-top: 5px; }
.lightbox-close, .lightbox-prev, .lightbox-next {
	position: absolute;
	background: rgba(255, 255, 255, 0.9);
	color: #111111;
	border: 0;
	border-radius: 8px;
	width: 44px;
	height: 44px;
	font-size: 24px;
	line-height: 44px;
	cursor: pointer;
	padding: 0;
}
.lightbox-close { top: 8px; right: 8px; }
.lightbox-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lightbox-prev[hidden], .lightbox-next[hidden] { display: none; }
body.lightbox-open { overflow: hidden; }

/* ---------- video-facade ---------- */
.video-facade-wrap { align-self: stretch; margin-top: 10px; }
.video-facade {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: 8px;
	background-color: #111111;
	background-size: cover;
	background-position: center;
	cursor: pointer;
	color: #ffffff;
	font-size: 14px;
}
.video-facade::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 68px;
	height: 48px;
	margin: -24px 0 0 -34px;
	background: #cc0000;
	border-radius: 12px;
}
.video-facade::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	margin: -10px 0 0 -6px;
	border-style: solid;
	border-width: 10px 0 10px 17px;
	border-color: transparent transparent transparent #ffffff;
}
/* dimmed photo + label under the play button: the photo may itself be a screenshot of a player */
.video-facade { box-shadow: inset 0 0 0 2000px rgba(0, 0, 0, 0.4); }
.video-facade-label { position: absolute; left: 0; right: 0; top: 50%; margin-top: 34px; font-size: 16px; font-weight: 700; text-shadow: 0 1px 2px #000000; }
.video-notice { font-size: 12px; color: var(--c-muted); margin: 5px 0 0; }
.video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; display: block; }
