/* =========================
   Base (global)
   ========================= */
* { box-sizing: border-box; }
img { max-width: 100%; height: auto; }

html, body { width: 100%; }
body { overflow-x: hidden; }

:root {
	--size: 200px;
	--sizeMobile: 70px;
}

div[id$="Sezione"] { display: none; }
div[id$="Sezione"]:target { display: block; }
/* =========================
   DESKTOP >= 700px
   ========================= */
@media screen and (min-width: 700px) {
	html {
		scroll-behavior: smooth;
		height: 100vh;
	}
	body {
		font-family: 'Open Sans',sans-serif;
		margin: 0;
		background: #FFFFFF;
		width: 100vw;
		height: 100%;
	}

	#signin {
		position: absolute;
		text-align: center;
		right: 0;
		width: 100px;
		height: 40px;
	}

	.logo {
		display: block;
		position: relative;
		overflow: hidden;
		width: var(--size);
		height: var(--size);
		left: calc(50% - var(--size)/2);
		transform: translate3d(0px, 0px, 0px);
	}

	#menu {
		text-align: center;
		padding: 30px 8px;
	}

	.social {
		width: auto;
		display: block;
		text-align: center;
		font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
		line-height: 1.2;
	}
	.social ul {
		width: auto;
		display: block;
		font-size: 0;
		text-align: center;
		color: #000000;
		background-color: #FFFFFF;
		border: transparent;
		margin: 0;
		padding: 0;
		list-style: none;
		position: relative;
		z-index: 999999990;
		border-radius: 3px;
	}
	.social li {
		display: inline-block;
		position: relative;
		font-size: 0;
		margin: 0;
		padding: 0;
	}
	.social > ul > li > span, .social > ul > li > a {
		font-size: 22px;
		color: inherit;
		text-decoration: none;
		padding: 20px 20px;
		font-weight: 400;
		text-transform: uppercase;
		letter-spacing: 2px;
		display: block;
		position: relative;
		transition: all 0.3s;
	}

	h1 {
		line-height: 1;
		font-size: 28px;
		font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
		color: rgb(0,0,0);
		text-align: center;
	}
	h2 {
		line-height: 1;
		font-size: 28px;
		font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
		color: rgb(255,255,255);
	}
	h3 {
		font-size: 16px; /* fix */
		font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
		color: rgb(255,255,255);
	}

	#divisore {
		display: block;
		margin-left: auto;
		margin-right: auto;
		width: 10%;
		padding: 30px;
	}

	p {
		font-size: 16px;
		color: rgb(0,0,0);
		text-align: center;
	}

	.parallax {
		background-image: url("img/Biblioteca_schizzo2.jpg");
		min-height: 700px;
		background-attachment: fixed;
		background-position: center;
		background-repeat: no-repeat;
		background-size: cover;
	}

	

	.pagine {
		width: 100%;
		height: 100%;
		overflow: hidden;
	}

	.citazione {
		font-style: italic;
		text-align: right;
		padding-right: 300px;
	}

	.card {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		background: #353535;
		font-size: 3rem;
		color: #fff;
		box-shadow:
			rgba(3, 8, 20, 0.1) 0px 0.15rem 0.5rem,
			rgba(2, 8, 20, 0.1) 0px 0.075rem 0.175rem;
		height: 100%;
		width: 100%;
		border-radius: 4px;
		transition: all 500ms;
		overflow: hidden;
		background-size: cover;
		background-position: center;
		background-repeat: no-repeat;
		padding: 0;
		margin: 0;
	}

	.container {
		display: flex;
		width: 100%;
		padding: 4% 2%;
		height: 100vh;
	}

	.box {
		flex: 1;
		overflow: hidden;
		transition: .5s;
		margin: 0 2%;
		box-shadow: 0 20px 30px rgba(0,0,0,.1);
		line-height: 0;
	}

	.box > img {
		width: 100%;
		height: calc(100% - 10vh);
		object-fit: cover;
		transition: .5s;
	}
	.box > .card {
		width: 100%;
		height: calc(100% - 10vh);
		object-fit: cover;
		transition: .5s;
	}
	.box > span {
		font-size: 1.5vh;
		display: block;
		text-align: center;
		height: 2vh;
		line-height: 1.5;
		background: white;
		font-style: bold;
	}

	.box:hover { flex: 1 1 40%; }
	.box:hover > img { width: 100%; height: 100%; }

	.wrapper {
		width: 70%;
		margin: 40px auto;
	}

	div.gallery { margin-top: 30px; }

	div.gallery ul {
		list-style-type: none;
		margin-left: 35px;
	}

	div.gallery ul li, div.gallery li a {
		-webkit-transition: all 0.1s ease-in-out;
		-moz-transition: all 0.1s ease-in-out;
		-o-transition: all 0.1s ease-in-out;
		transition: all 0.1s ease-in-out;
	}

	div.gallery ul li {
		position: relative;
		float: left;
		width: 300px;
		height: 300px;
		margin: 5px;
		padding: 5px;
		z-index: 0;
	}
	div.gallery ul li:hover { z-index: 5; }

	div.gallery ul li a {
		position: absolute;
		left: 0;
		top: 0;
		border: 1px solid #dddddd;
		padding: 5px;
		width: 300px;
		height: 300px;
		background: #f0f0f0;
	}

	div.gallery ul li a:hover {
		width: 300px;
		height: 300px;
		margin-top: -150px;
		margin-left: -150px;
		top: 65%;
		left: 65%;
	}
}

/* =========================
   MOBILE <= 699px
   ========================= */
@media screen and (max-width: 699px) {
	html { scroll-behavior: smooth; }
	body {
		font-family: 'Open Sans',sans-serif;
		margin: 0;
		background: #FFFFFF;
	}

	.logo {
		display: block;
		position: relative;
		overflow: hidden;
		width: var(--sizeMobile);
		height: var(--sizeMobile);
		left: calc(50% - var(--sizeMobile)/2);
		transform: translate3d(0px, 0px, 0px);
	}

	h1 {
		line-height: 1;
		font-size: 24px;
		font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
		color: rgb(0,0,0);
		text-align: center;
		margin: 10px 0 6px 0;
	}
	h2 {
		line-height: 1;
		font-size: 24px;
		font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
		color: rgb(255,255,255);
	}
	h3 {
		font-size: 12px; /* fix */
		font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
		color: rgb(255,255,255);
	}
	p {
		font-size: 12px;
		color: rgb(0,0,0);
		text-align: center;
		margin: 6px 0;
	}

	/* Menu wrapper: niente blocco enorme */
	#menu {
		max-width: 480px;
		margin: 0 auto;
		background-color: transparent;
		height: auto;
		color: inherit;
		border-radius: 0;
		padding: 8px 0;
	}

	#cssmenu {
		border-radius: 10px;
		overflow: hidden;
		background-color: #333;
		position: relative;
	}

	/* Parallax mobile-friendly */
	.parallax{
		background-attachment: scroll;
		min-height: auto;
		padding-bottom: 20px;
	}

	/* Sezioni: su mobile NON tagliare lo scroll */
	.pagine{
		width: 100%;
		height: auto;
		overflow: visible;
		padding: 18px 12px;
	}

	.citazione{
		text-align: center;
		padding-right: 0;
	}

	/* Progetti/Concorsi: da hover-flex a grid tap-friendly */
	.container{
		display: grid;
		grid-template-columns: 1fr 1fr;  /* cambia a 1fr se vuoi 1 colonna */
		gap: 12px;
		padding: 14px;
		height: auto;
	}

	.box{
		margin: 0;
		box-shadow: 0 10px 18px rgba(0,0,0,.10);
		line-height: normal;
	}

	.box > img,
	.box > .card{
		height: 160px;
	}

	.box:hover{ flex: unset; }

	/* Software AEC gallery: da float a grid */
	.wrapper { width: 92%; margin: 20px auto; }

	div.gallery ul{
		margin-left: 0;
		padding: 0;
		display: grid;
		grid-template-columns: 1fr; /* oppure 1fr 1fr */
		gap: 12px;
		list-style: none;
	}

	div.gallery ul li{
		float: none;
		width: auto;
		height: auto;
		margin: 0;
		padding: 0;
	}

	div.gallery ul li a{
		position: relative;
		left: auto;
		top: auto;
		width: 100%;
		height: 180px;
		display: block;
		border-radius: 10px;
		overflow: hidden;
	}

	div.gallery ul li a:hover{
		width: 100%;
		height: 180px;
		margin: 0;
		top: 0;
		left: 0;
	}
	.student-avatar { width: 90px !important; height: 90px !important; }
}

/* =========================
   Sezione Pubblicazioni
   ========================= */
#Architettura_Pubblicazioni{
	text-align: center;
	line-height: 200px;
	left: 0;
	right: 0;
	height: 200px;
	background: rgba(100,100,100,.3);
}

/* =========================
   Galleria allievi (UniversitaLettere_Sezione)
   ========================= */
.students-grid {
	width: min(1000px, 92%);
	margin: 40px auto;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 28px;
}

.student-card {
	text-decoration: none;
	color: inherit;
	display: grid;
	justify-items: center;
	gap: 12px;
	padding: 18px 10px;
	border-radius: 10px;
	transition: transform .2s ease, box-shadow .2s ease;
	box-shadow: 0 10px 22px rgba(0,0,0,.08);
	background: rgba(255,255,255,.85);
	backdrop-filter: blur(2px);
}

.student-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 28px rgba(0,0,0,.12);
}

.student-avatar {
	width: 140px;
	height: 140px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid rgba(0,0,0,.08);
}

.student-caption {
	font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: 18px;
}

/* model-viewer wrapper */
.mv-wrap {
	width: min(1200px, 94%);
	height: 72vh;
	margin: 20px auto 50px auto;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 14px 28px rgba(0,0,0,.12);
	background: #f7f7f7;
}

model-viewer.mv {
	width: 100%;
	height: 100%;
	background: transparent;
}

/* Mobile tweaks (allievi + viewer) */
@media screen and (max-width: 699px) {
	.students-grid { gap: 16px; }
	.student-avatar { width: 90px; height: 90px; border-radius: 50%;object-fit: cover;	border: 3px solid rgba(0,0,0,.08);}
	.student-caption { font-size: 14px; }
	.mv-wrap { height: 62vh; }
}

/* =========================
   Bottone “Torna alla galleria”
   ========================= */
.back-to-gallery {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 20px auto 10px auto;
	padding: 8px 16px;
	text-decoration: none;
	font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
	font-size: 18px;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #000;
	background: rgba(255,255,255,.85);
	border-radius: 20px;
	box-shadow: 0 6px 14px rgba(0,0,0,.12);
	transition: all .2s ease;
}
.back-to-gallery:hover {
	background: #000;
	color: #fff;
	transform: translateX(-2px);
}
.back-to-gallery::before {
	content: "←";
	font-size: 20px;
	line-height: 1;
}

/* =========================
   Hotspot (model-viewer)
   ========================= */
.hotspot{
	font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
	text-transform: uppercase;
	letter-spacing: 1px;
	padding: 8px 12px;
	border-radius: 16px;
	border: 0;
	cursor: pointer;
	background: rgba(255,255,255,.90);
	box-shadow: 0 8px 18px rgba(0,0,0,.18);
}
.hotspot:hover{
	background: #000;
	color: #fff;
}

/* =========================
   PDF Floating Window (modal)
   ========================= */
.pdf-modal-overlay{
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.45);
	z-index: 999999998;
	display: none;
}

.pdf-modal{
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(1100px, 92vw);
	height: min(80vh, 900px);
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	z-index: 999999999;
	box-shadow: 0 18px 40px rgba(0,0,0,.25);
	display: none;
}

.pdf-modal-header{
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px;
	border-bottom: 1px solid rgba(0,0,0,.08);
	background: rgba(255,255,255,.95);
}

.pdf-modal-title{
	font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: 18px;
	margin: 0;
}

.pdf-modal-actions{
	display: flex;
	gap: 8px;
}

.pdf-modal-btn{
	border: 0;
	border-radius: 16px;
	padding: 8px 12px;
	cursor: pointer;
	background: rgba(0,0,0,.08);
	font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
	text-transform: uppercase;
	letter-spacing: 1px;
}
.pdf-modal-btn:hover{
	background: #000;
	color: #fff;
}

.pdf-modal-body{
	width: 100%;
	height: calc(100% - 48px);
}

.pdf-frame{
	width: 100%;
	height: 100%;
	border: 0;
}
@media screen and (max-width: 699px) {

  /* NASCONDE TUTTE LE SEZIONI */
  div[id$="Sezione"] {
    display: none;
  }

  /* MOSTRA SOLO LA SEZIONE TARGET */
  div[id$="Sezione"]:target {
    display: block;
  }

}
.pdf-buttons{
  width: min(1200px, 94%);
  margin: -30px auto 40px auto; /* si “aggancia” visivamente sotto al viewer */
  display: flex;
  justify-content: center;
  gap: 12px;
}

.pdf-btn{
  border: 0;
  border-radius: 18px;
  padding: 10px 14px;
  cursor: pointer;
  background: rgba(255,255,255,.90);
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 16px;
}

.pdf-btn:hover{
  background: #000;
  color: #fff;
}
/* === Istruzioni navigazione model-viewer === */
.mv-instructions{

  top: 12px;
  left: 12px;
  z-index: 5;
  max-width: 260px;
  padding: 10px 12px;
  font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: .5px;
  text-transform: uppercase;
  background: rgba(255,255,255,.85);
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  pointer-events: none; /* 👈 NON blocca il modello */
}
.mv-help-btn{
 
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
  font-size: 20px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 6px 14px rgba(0,0,0,.18);
}

.mv-help-panel{
  
  top: 56px;
  right: 12px;
  z-index: 5;
  max-width: 260px;
  padding: 10px 12px;
  background: rgba(255,255,255,.9);
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  font-family: "Pathway Gothic One", Helvetica, Arial, sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  display: none;
}

.mv-help-panel.visible{
  display: block;
}
.desktop-only{ display: inline; }
.mobile-only{ display: none; }

@media (max-width: 699px){
  .desktop-only{ display: none; }
  .mobile-only{ display: inline; }
}
