/*
Theme Name: Luca Madonini Portfolio
Description: Portfolio theme per industrial designer Luca Madonini
Version: 2.0
Author: Luca Madonini
Author URI: https://lucamadonini.com
*/

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Reset link WordPress */
a, a:visited, a:hover, a:focus, a:active {
  color: inherit;
  text-decoration: none;
  outline: none;
}

:root {
  --black: #111;
  --gray: #888;
  --light: #f2f2f0;
  --white: #fff;
  --gap: 12px;
  --header-h: 64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', Helvetica, Arial, sans-serif;
  background: var(--white);
  color: var(--black);
  font-size: 13px;
  letter-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════
   INTRO COLLAGE DINAMICO
═══════════════════════════════════════ */
#intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  cursor: pointer;
  background: #fff;
  overflow: hidden;
}

.intro-name {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  text-align: center;
  pointer-events: none;
  opacity: 1;
}
.intro-name-main {
  display: block;
  color: #111;
  font-size: 19.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}
.intro-name-sub {
  display: block;
  font-weight: 300;
  color: #888;
  font-size: 15.6px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 8px;
  white-space: nowrap;
}

.intro-bottom {
  position: absolute;
  bottom: 36px;
  right: 44px;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.intro-bottom.visible { opacity: 1; }
.intro-enter {
  color: #999;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}

/* Ogni immagine del collage */
.intro-img {
  position: absolute;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.4s ease, transform 1.4s ease;
}
.intro-img.visible {
  opacity: 1;
  transform: translateY(0);
}
.intro-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#intro.exiting {
  transition: opacity 0.7s ease;
  opacity: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════
   MAIN SITE (hidden until intro exits)
═══════════════════════════════════════ */
#site {
  opacity: 0;
  transition: opacity 0.6s ease 0.3s;
}
#site.visible { opacity: 1; }

/* ── HEADER ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--white);
  z-index: 100;
  border-bottom: 1px solid #e8e8e8;
}

.logo {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}
.logo span {
  font-weight: 300;
  color: var(--gray);
  margin-left: 10px;
}

nav a {
  font-family: 'Inter', Helvetica, Arial, sans-serif;
  text-decoration: none !important;
  color: var(--gray) !important;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-left: 28px;
  transition: color 0.2s;
}
nav a:hover, nav a.active { color: var(--black) !important; }

/* ── VIEWS ── */
.view { display: none; padding-top: var(--header-h); min-height: 100vh; }
.view.active { display: block; }

/* ── HOME: MASONRY GRID ── */
#view-home { padding: 32px; padding-top: calc(var(--header-h) + 32px); }

.grid {
  columns: 3;
  column-gap: 12px;
}
@media (max-width: 900px) { .grid { columns: 2; } }
@media (max-width: 560px) { .grid { columns: 1; } }

.grid-item {
  display: block;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--light);
  text-decoration: none !important;
}
.grid-item img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: bottom;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.grid-item:hover img { transform: scale(1.04); }

.grid-item .overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 40px 18px 18px;
  background: linear-gradient(to top, rgba(0,0,0,0.52) 0%, transparent 100%);
  color: #fff;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.grid-item:hover .overlay { opacity: 1; }

.overlay-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.overlay-client {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  margin-top: 4px;
  opacity: 0.9;
}
.overlay-cat {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  margin-top: 2px;
  opacity: 0.65;
}

/* ── PROJECT PAGE ── */
#view-project { padding-top: var(--header-h); }

.project-hero {
  width: 100%;
  background: var(--light);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.project-hero img {
  display: block;
  max-height: 88vh;
  max-width: 100%;
  width: auto;
  height: auto;
}
@media (max-width: 700px) {
  .project-hero img {
    max-height: none;
    width: 100%;
  }
}

.project-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  padding: 64px 48px 96px;
  max-width: 1200px;
}
@media (max-width: 720px) {
  .project-body { grid-template-columns: 1fr; padding: 40px 24px 64px; }
}

.project-title-big {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 10px;
}
.project-name {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.15;
  margin-bottom: 32px;
}
.meta-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}
.meta-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 4px;
}
.meta-value { font-size: 13px; font-weight: 400; }

.project-desc {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.75;
  color: #333;
  padding-top: 6px;
}
.project-desc p + p { margin-top: 20px; }

.project-gallery {
  padding: 0 48px 80px;
  columns: 2;
  column-gap: var(--gap);
}
@media (max-width: 720px) {
  .project-gallery { columns: 1; padding: 0 24px 60px; }
}
.project-gallery img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--light);
  break-inside: avoid;
  margin-bottom: var(--gap);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray);
  cursor: pointer;
  transition: color 0.2s;
  margin: 32px 48px;
  user-select: none;
}
.back-btn:hover { color: var(--black); }
.back-btn:hover svg { transform: translateX(-3px); }
.back-btn svg { transition: transform 0.2s; }

/* ── ABOUT PAGE ── */
#view-about {
  padding: calc(var(--header-h) + 64px) 48px 96px;
  max-width: 860px;
}
@media (max-width: 720px) { #view-about { padding: calc(var(--header-h) + 40px) 24px 60px; } }

.about-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gray); margin-bottom: 24px; }
.about-headline { font-size: 28px; font-weight: 300; line-height: 1.35; margin-bottom: 40px; max-width: 600px; }
.about-text { font-size: 15px; font-weight: 300; line-height: 1.8; color: #333; max-width: 560px; }
.about-text p + p { margin-top: 20px; }
.about-contact { margin-top: 56px; padding-top: 32px; border-top: 1px solid #e8e8e8; }
.about-contact a { display: block; font-size: 13px; color: var(--black); text-decoration: none; margin-bottom: 8px; transition: color 0.2s; }
.about-contact a:hover { color: var(--gray); }

/* ── PAGE TRANSITIONS ── */
.view { animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hero progetto ── */
.project-hero {
  width: 100%;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}
.project-hero.is-landscape {
  background: #eee;
  max-height: 82vh;
  overflow: hidden;
}
.project-hero.is-landscape img {
  display: block; width: 100%; height: 82vh; object-fit: cover;
}
.project-hero.is-portrait {
  background: #fff;
  padding: 72px 0;
}
.project-hero.is-portrait img {
  display: block; max-height: 88vh; max-width: 48%;
  width: auto; height: auto; object-fit: contain;
}
@media (max-width: 700px) {
  .project-hero.is-landscape { max-height: 50vw; }
  .project-hero.is-landscape img { height: 50vw; }
  .project-hero.is-portrait { padding: 40px 0; }
  .project-hero.is-portrait img { max-width: 80%; }
}

/* ── Gallery margini generosi ── */
.project-gallery {
  padding: 60px 10% 80px;
  columns: 2;
  column-gap: 32px;
}
@media (max-width: 900px) { .project-gallery { padding: 48px 6% 60px; column-gap: 20px; } }
@media (max-width: 720px) { .project-gallery { columns: 1; padding: 32px 24px 60px; } }
.project-gallery img {
  display: block; width: 100%; height: auto;
  background: var(--light); break-inside: avoid; margin-bottom: 32px;
}

/* ── Footer ritorno home ── */
.project-footer {
  margin-top: 40px; padding: 56px 48px;
  border-top: 1px solid #e8e8e8;
  text-align: center; cursor: pointer;
  transition: background 0.2s; user-select: none;
}
.project-footer:hover { background: #fafafa; }
.project-footer-label {
  font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gray); margin-bottom: 12px;
}
.project-footer-title {
  font-size: 20px; font-weight: 300; letter-spacing: 0.06em; color: var(--black);
}
.project-footer-arrow {
  display: block; font-size: 18px; color: #ccc;
  margin-top: 16px; transition: transform 0.3s;
}
.project-footer:hover .project-footer-arrow { transform: translateY(5px); }

/* ── Contact ── */
#view-contact-inner {
  padding: calc(var(--header-h) + 64px) 48px 96px;
  max-width: 860px;
}
@media (max-width: 720px) {
  #view-contact-inner { padding: calc(var(--header-h) + 40px) 24px 60px; }
}

/* ── Pagine statiche (About, Contact) ── */
.static-page-inner {
  padding: calc(var(--header-h) + 64px) 48px 96px;
  max-width: 860px;
}
@media (max-width: 720px) {
  .static-page-inner { padding: calc(var(--header-h) + 40px) 24px 60px; }
}

/* ── About + Contact shared styles ── */
.about-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 24px;
}
.about-headline {
  font-size: 28px;
  font-weight: 300;
  line-height: 1.35;
  margin-bottom: 40px;
  max-width: 600px;
}
.about-text {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.8;
  color: #333;
  max-width: 560px;
}
.about-text p + p { margin-top: 20px; }
.about-contact {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid #e8e8e8;
}
.about-contact a {
  display: block;
  font-size: 13px;
  color: var(--black);
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.2s;
}
.about-contact a:hover { color: var(--gray); }

/* ── Curtain effect su pagina progetto ── */
body.single #site {
  will-change: transform;
  transform-origin: top center;
}
