/* assets/css/style.css */

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

@font-face {
    font-family: "CreatoDisplayRegular";
    src: url("../fonts/CreatoDisplay-Regular.otf") format("opentype");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "CreatoDisplayBold";
    src: url("../fonts/CreatoDisplay-Bold.otf") format("opentype");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}


@font-face {
    font-family: 'Tan Mon Cheri';
    src: url('../fonts/tan-mon-cheri.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@import url('https://fonts.cdnfonts.com/css/denora');

body.dark {
    font-family: "CreatoDisplayRegular";
    background: #050505;
    background-size: 200% 200%;
    animation: bg-shift 22s ease-in-out infinite;
    color: #f5f5f5;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}



/* --- top ticker (scritta che cammina) --- */

.top-ticker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    overflow: hidden;
    z-index: 10;

    display: flex;          /* attiva flexbox */
    align-items: center;    /* centro verticale del contenuto */
}

.ticker-inner {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: ticker-scroll 30s linear infinite;
    font-size: 1rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #000000;
    font-family: "CreatoDisplayBold";
    font-weight: 1000;          /* per sicurezza, abbina il peso al font */
    letter-spacing: 0.08em;    /* opzionale, ma spesso bello per i ticker */
    text-transform: uppercase; /* se ti piace stile “headline” */
    
}


.ticker-inner span {
    padding-right: 0%;
    display: inline-block;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}



/* --- hero layout --- */

.hero {
    position: relative;
    padding-top: 90px; /* per non coprire la barra */
    padding-bottom: 40px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    position: relative;
    max-width: 1100px;
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 3.5rem;
    align-items: center;
    justify-content: center;
    text-align: left;
    padding: 2.5rem 2rem;
    z-index: 2;
}

.hero-text {
    flex: 1;
    text-align: left;
}

.subtitle {
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #b4b4b4;
    margin-bottom: 0.8rem;
}

.hero-text h1 {
    white-space: pre-line;
    font-family: 'Tan Mon Cheri', 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: clamp(2.2rem, 3vw, 3.8rem);
    line-height: 0.9;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.role {
    font-family: "CreatoDisplayRegular";
    font-size: 0.95rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #d1d1d1;
    margin-bottom: 1.6rem;
}

.contacts {
    list-style: none;
    margin-bottom: 2rem;
}

.contacts li {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
    font-size: 0.95rem;
}

.contacts a {
    color: #f5f5f5;
    text-decoration: none;
}

.contacts a:hover {
    text-decoration: underline;
}

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #ffffff;
    background: #ffffff;
    color: #000000;
    font-size: 1rem;
    flex-shrink: 0;
}

/* icone SVG/PNG dentro il quadrato */
.icon img {
    width: 18px;
    height: 18px;
    display: block;
}

.buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.btn {
    padding: 0.6rem 1.4rem;
    border-radius: 10px;
    border: 1px solid #f5f5f5;
    background: transparent;
    color: #f5f5f5;
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
}

.btn.small {
    padding: 0.45rem 0.9rem;
    font-size: 0.75rem;
}

.btn.primary {
    background: #050505;
    color: #f5f5f5;
}

/* Pulsante: bianco → hover trasparente con bordo/testo bianchi */
.btn.invert-hover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;              /* pill shape */
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .06s ease;
}

.btn.invert-hover:hover {
  background: transparent;
  color: #ffffff;
  border-color: #ffffff;
}

.btn.invert-hover:active {
  transform: translateY(1px);
}

.btn.invert-hover:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.25);
}

.btn.invert-hover[disabled],
.btn.invert-hover.disabled {
  opacity: .6;
  pointer-events: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    background: #f5f5f5;
    color: #050505;
    border-color: #f5f5f5;
}

.btn.outline {
    background: transparent;
}


.hero-photo {
    flex: 0 0 320px;
    display: flex;
    justify-content: center;
}
.hero-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}


.photo-card {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 3 / 4;
    perspective: 1000px;
    border-radius: 14px;
    overflow: hidden;
}

.photo-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: inherit;
}

.photo-card-front,
.photo-card-back {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    backface-visibility: hidden;
}


.photo-card-back {
    background: rgba(8,8,8,0.96);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.4rem 1.2rem;
    text-align: center;
}

.photo-back-title {
    font-family: "Cormorant Garamond", "Times New Roman", serif;
    font-size: 1.4rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.photo-back-role {
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #d1d1d1;
    margin-bottom: 0.8rem;
}

.photo-back-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #c9c9c9;
}
@keyframes float-photo {
    0% {
        transform: translateY(0px) scale(1);
        box-shadow: 0 18px 50px rgba(0,0,0,0.65);
    }
    50% {
        transform: translateY(-6px) scale(1.02);
        box-shadow: 0 24px 60px rgba(0,0,0,0.8);
    }
    100% {
        transform: translateY(0px) scale(1);
        box-shadow: 0 18px 50px rgba(0,0,0,0.65);
    }
}



/* leggera animazione di movimento per la foto rotonda */
@keyframes float-photo {
    0% {
        transform: translateY(0px) scale(1);
        box-shadow: 0 18px 50px rgba(0,0,0,0.65);
    }
    50% {
        transform: translateY(-6px) scale(1.02);
        box-shadow: 0 24px 60px rgba(0,0,0,0.8);
    }
    100% {
        transform: translateY(0px) scale(1);
        box-shadow: 0 18px 50px rgba(0,0,0,0.65);
    }
}




/* pagine interne */

.page {
    padding-top: 90px;
    padding-bottom: 40px;
    min-height: 100vh;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    padding-inline: 1.5rem;
}

.page h2 {
    font-family: 'Tan Mon Cheri', 'Cormorant Garamond', serif;
    font-size: 2.1rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.6rem;
}


/* viewer pdf */

.pdf-viewer-container {
    background: rgba(8,8,8,0.95);
    border-radius: 18px;
    padding: 1.2rem 1.4rem 1.4rem;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    box-shadow: 0 18px 50px rgba(0,0,0,0.55);
    max-width: 960px;
    margin: 2rem auto 1.5rem;
}

#pdf-canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    max-height: 70vh;
    background: #111;
    border-radius: 12px;
}

.pdf-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

#page-info {
    font-size: 0.85rem;
    color: #bfbfbf;
}

.page-buttons {
    margin-top: 2rem;
}

/* form contatti */

.contact-form {
    max-width: 600px;
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    font-family: "CreatoDisplayRegular";
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
    border: 1px solid #3a3a3a;
    background: rgba(5,5,5,0.96);
    color: #f5f5f5;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #f5f5f5;
}

/* admin tabella */

.admin-section {
    margin-top: 2rem;
}

.admin-section h3 {
    font-size: 1rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.contacts-table {
    overflow-x: auto;
    margin-top: 1rem;
}

.contacts-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.contacts-table th,
.contacts-table td {
    border-bottom: 1px solid #262626;
    padding: 0.5rem 0.6rem;
    vertical-align: top;
}

.contacts-table th {
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    color: #bfbfbf;
}

.error {
    color: #ff6b6b;
    margin-top: 0.5rem;
}

.success {
    color: #7ddc7d;
    margin-top: 0.5rem;
}

/* trigger admin nascosto */

#admin-trigger {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 110px;
    height: 22px;
    opacity: 0;
    cursor: pointer;
    z-index: 20;
}

/* responsive */

@media (max-width: 900px) {
    .hero-content {
        gap: 2.2rem;
    }
}

@media (max-width: 768px) {
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
        padding-inline: 1.4rem;
    }

    .hero-text {
        text-align: center;
    }

    .hero-text h1 {
        white-space: pre-line;
        letter-spacing: 0.13em;
        font-size: clamp(2rem, 8vw, 2.6rem);
    }

    .hero-photo {
        flex: 0 0 auto;
    }

    .photo-card {
        max-width: 240px;
        margin-top: 0.5rem;
    }

    .contacts li {
        justify-content: center;
    }

    .buttons {
        justify-content: center;
    }

    .page {
        padding-inline: 1.25rem;
    }
}

/* iPhone / iPad (Safari) – versione semplice della card SENZA animazione */
@supports (-webkit-touch-callout: none) {
    .photo-card {
        width: 100%;
        max-width: 280px;   /* puoi aumentare/diminuire */
        height: 360px;      /* altezza fissa così non sparisce */
        aspect-ratio: auto;
        animation: none;    /* niente float */
        transform: none;
        box-shadow: 0 12px 30px rgba(0,0,0,0.6);
    }

    .photo-card-front,
    .photo-card-back {
        position: relative;
        inset: auto;
        backface-visibility: visible;
        transform: none;
    }

    /* Mostriamo solo il fronte, nascondiamo il retro */
    .photo-card-back {
        display: none;
    }

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

/* iframe di fallback per il PDF */
.pdf-iframe {
    display: none;
    width: 100%;
    height: 80vh;
    border: none;
    border-radius: 12px;
    background: #111;
}

@media (max-width: 1024px) {
    .hero-content {
        gap: 2.5rem;
        padding: 2.2rem 1.8rem;
    }

    .hero-photo {
        flex: 0 0 280px;
    }

    .photo-card {
        max-width: 280px;
    }

    .hero-text h1 {
        font-size: clamp(2.6rem, 4vw, 3.4rem);
    }
}


/* piccolo logo come separatore nel ticker */
.ticker-icon {
    display: flex;
    width: 20px;
    height: 20px;
    margin: 0 0.55rem;
    background-image: url('../img/logo-star.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
    transform: translateY(1px);
    align-items: center;    /* centro verticale del contenuto */
    
}


@media (max-width: 480px) {
    .icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .hero-text h1 {
        font-size: clamp(1.9rem, 7.5vw, 2.3rem);
    }
}


/* viewer immagini portfolio */
.portfolio-viewer {
    background: rgba(8,8,8,0.95);
    border-radius: 18px;
    padding: 1.2rem 1.4rem 1.4rem;
    border: 1px solid #2a2a2a;
    box-shadow: 0 18px 50px rgba(0,0,0,0.55);
    max-width: 960px;
    margin: 2rem auto 1.5rem;
}

.portfolio-frame {
    width: 100%;
    overflow: hidden;
    background: #050505;
}

.portfolio-frame img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}


/* === Override: niente box portfolio-viewer, viewer più grande con frecce di lato === */
.portfolio-viewer {
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 0;
    max-width: 90vw;              /* più grande del 70% */
    margin: 2rem auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.portfolio-frame {
    width: 100%;
    max-width: 1600px;            /* viewer molto grande */
    border-radius: 0;
    overflow: hidden;
}

.portfolio-frame img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Frecce di lato come elementi a fianco del riquadro */
.nav-arrow {
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 2.2rem;
    cursor: pointer;
    padding: 0;
}

/* Su mobile manteniamo le regole precedenti (niente frecce, viewer full width) */
@media (max-width: 768px) {
    .portfolio-viewer {
        max-width: 100%;
        margin: 1.5rem auto 1rem;
    }
}


/* Pagina portfolio full-width */
.page-portfolio {
    max-width: 100%;
}

/* === Portfolio quasi full-screen === */
.portfolio-viewer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    max-width: 100vw;
    margin: 1.5rem auto;
    padding: 0 3vw;
    background: transparent;
    border: none;
    box-shadow: none;
}

.portfolio-frame {
    flex: 1 1 auto;
    max-width: 1800px;
    min-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050505;
    border-radius: 0;
    overflow: hidden;
}

.portfolio-frame img {
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
}

/* Frecce di lato, grandi */
.nav-arrow {
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 2.8rem;
    cursor: pointer;
    padding: 0;
}

/* Mobile: viewer pieno, niente frecce (si usa lo swipe) */
@media (max-width: 768px) {
    .portfolio-viewer {
        max-width: 100%;
        margin: 1.5rem auto 1rem;
        padding: 0 1rem;
    }
    .nav-arrow {
        display: none;
    }
}


/* Titolo e sottotitolo portfolio allineati a sinistra */
.page-portfolio h2,
.page-portfolio .page-subtitle {
    max-width: 1000px;
    margin-left: 3vw;
    margin-right: auto;
    text-align: left;
}

/* Bottoni in basso del portfolio allineati a destra */
.page-portfolio .page-buttons {
    justify-content: flex-end;
}

/* Frecce laterali in stile pulsante rettangolare */
.nav-arrow {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 1px solid #ffffff;
    background: transparent;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* un po' di spazio dal bordo esterno */
.nav-arrow-left {
    margin-left: 1vw;
}

.nav-arrow-right {
    margin-right: 1vw;
}


/* === Override: Portfolio titolo e bottoni centrati === */
.page-portfolio h2,
.page-portfolio .page-subtitle {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Bottoni in basso del portfolio centrati */
.page-portfolio .page-buttons {
    justify-content: center;
}

/* Responsive mobile per il portfolio: layout più leggero */
@media (max-width: 768px) {
    .portfolio-viewer {
        flex-direction: column;
        gap: 1rem;
        max-width: 100%;
        margin: 1rem auto;
        padding: 0 1rem;
    }

    .portfolio-frame {
        min-height: auto;
        max-width: 100%;
    }

    .portfolio-frame img {
        max-height: 70vh;
    }

    .page-portfolio h2,
    .page-portfolio .page-subtitle {
        padding-inline: 1rem;
    }
}


/* Lightbox immagini portfolio (mobile) */
.image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.image-lightbox.is-visible {
    display: flex;
}

.image-lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-lightbox-close {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #ffffff;
    background: rgba(0,0,0,0.6);
    color: #ffffff;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* solo mobile: il frame diventa “cliccabile” */
@media (max-width: 768px) {
    .portfolio-frame {
        cursor: zoom-in;
    }
}

.page-cv .page-buttons {
    display: flex;
    justify-content: center;   /* allinea al centro orizzontale */
    gap: 1rem;                 /* distanza fra i bottoni */
}


/* === Analytics UI (Admin) === */
.admin-analytics {
  display: grid;
  gap: 16px;
}
@media (min-width: 900px) {
  .admin-analytics {
    grid-template-columns: 1.1fr 1fr;
    align-items: start;
  }
}
.card-ana {
  background: #0c0c0c;
  border: 1px solid #1f1f1f;
  border-radius: 14px;
  padding: 14px;
}
.card-ana h4 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin: 6px 0 10px;
}
.kpi {
  background: linear-gradient(180deg, #111 0%, #0a0a0a 100%);
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.kpi .label { font-size: .8rem; opacity: .8; }
.kpi .value { font-size: 1.3rem; font-weight: 700; }

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.tbl th, .tbl td {
  padding: 8px 10px;
  border-bottom: 1px solid #1f1f1f;
  text-align: left;
}
.tbl th { opacity: .8; font-weight: 600; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #101010;
  border: 1px solid #1f1f1f;
  font-weight: 700;
  font-size: .95rem;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: #151515;
  border: 1px solid #1f1f1f;
  overflow: hidden;
}
.bar > span {
  display: block; height: 100%;
  background: #fff;
  width: 0%;
  transition: width .3s ease;
}

.help {
  margin: 6px 0 0;
  font-size: .85rem; opacity: .7;
}

/* === Contatti centrati === */
.contact-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
  text-align: center;
}
.contact-card {
  margin: 16px auto 0;
  padding: 18px;
  border: 1px solid #222;
  border-radius: 16px;
  background: #0b0b0b;
  max-width: 640px;
}
.contact-card .form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.contact-card label {
  display: block;
  text-align: left;
  font-size: .95rem;
  margin: 8px 0 6px;
}
.contact-card input[type="text"],
.contact-card input[type="email"],
.contact-card textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #292929;
  background: #0a0a0a;
  color: #f5f5f5;
}
.contact-card textarea { min-height: 140px; resize: vertical; }

.contact-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

@media (min-width: 800px) {
  .contact-card .form-row.two {
    grid-template-columns: 1fr 1fr;
  }
}
