/* ============================================================
   cm.css  —  v2.0  (refactored & modernized)
   Autore: laraclerici.it
   Modifiche: CSS custom properties, rimosse regole nested non valide,
   rimossi prefissi vendor obsoleti, float sostituiti con CSS Grid,
   font-weight leggibile, CTA button sticky mobile.
   ============================================================ */

/* ──────────────────────────────────────────
   1. CSS CUSTOM PROPERTIES (design tokens)
   ────────────────────────────────────────── */
:root {
  --color-primary:    #048a86;
  --color-accent:     #17a2b8;
  --color-navy:       rgba(0, 0, 128, 0.9);
  --color-text:       #535864;
  --color-border:     #3689a4;
  --color-oncologia:  rgba(127, 35, 35, 0.85);
  --color-success:    #34872f;
  --color-events:     #048a86;
  --font-main:        "Comfortaa", cursive;
  --font-brand:       "Didact Gothic", sans-serif;
  --radius-card:      0.85rem;
  --radius-badge:     50%;
  --transition-base:  0.3s ease;
  --shadow-card:      0 1px 20px rgba(0, 0, 0, 0.15);
}

/* ──────────────────────────────────────────
   2. BASE
   ────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  padding-top: 0;
  font-family: var(--font-main);
  font-weight: 300;
  background-color: #fff;
  overflow-x: hidden;
  font-size: 0.9rem;
  color: var(--color-text);
}

/* Desktop: aumentato da 100 a 300 per leggibilità */
@media (min-width: 992px) {
  body {
    font-weight: 300;
  }
}

.b {
  font-weight: 700;
}

#developer {
  font-size: 0 !important;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: inherit;
  text-decoration: none;
}

/* ──────────────────────────────────────────
   3. NAVBAR
   ────────────────────────────────────────── */
#mainNav {
  background-image: transparent;
  padding-top: 17px;
  padding-bottom: 17px;
  transition: padding-top 0.3s, padding-bottom 0.3s;
}

#mainNav .navbar-brand {
  margin-right: 1rem;
  font-size: 1.63em;
  font-family: var(--font-brand);
  color: #fff !important;
  border-radius: 7px;
  transition: all 0.2s;
}

.navbar-brand {
  font-family: var(--font-main);
  font-weight: 700;
}

.navbar-brand1 {
  display: inline-block;
  padding: 0.3125rem 0;
  font-size: 0.75rem !important;
  line-height: inherit;
  white-space: nowrap;
  color: #fff !important;
}

#mainNav .navbar-nav {
  margin-right: 5rem;
  border-radius: 7px;
  background-color: transparent;
}

#mainNav .nav-item .nav-link {
  padding: 1em !important;
  font-weight: 300;
}

#mainNav .nav-item.active {
  border-bottom: 1px solid #fff;
}
#mainNav .nav-item:hover {
  border-bottom: 1px solid #fff;
}

/* Navbar shrink */
#mainNav.navbar-shrink {
  padding-top: 0;
  padding-bottom: 0;
  background-image: linear-gradient(to bottom right, var(--color-accent), var(--color-navy));
  border-bottom: 2px solid var(--color-accent);
}
#mainNav.navbar-shrink .navbar-brand {
  font-size: 1.49em;
  padding: 10px 0;
  color: #fff !important;
}
#mainNav.navbar-shrink .navbar-brand1 {
  color: #fff !important;
  background-color: transparent !important;
}
#mainNav.navbar-shrink .nav-item {
  color: #fff;
  background-color: transparent !important;
}

/* Desktop navbar */
@media (min-width: 992px) {
  #mainNav {
    padding-top: 20px;
    padding-bottom: 20px;
    border-bottom: none;
  }
  #mainNav .navbar-brand {
    margin-right: 2rem;
    margin-left: 2rem;
    font-size: 1.75em;
    font-family: var(--font-brand);
    text-transform: uppercase;
    font-weight: bold;
    color: #fff !important;
    border-radius: 7px;
    transition: all 0.3s;
  }
  #mainNav .navbar-nav {
    margin-right: 2rem;
    margin-left: 2rem;
  }
  #mainNav .nav-item .nav-link {
    padding: 0 1.2em !important;
    font-weight: 300;
    font-size: 1rem !important;
  }
  #mainNav .nav-item {
    margin-right: 0.4rem;
  }
  #mainNav.navbar-shrink .navbar-brand {
    font-size: 1.55em;
  }
}

/* CTA button in navbar — visibile su mobile */
.btn-cta-nav {
  background-color: var(--color-primary);
  color: #fff !important;
  border-radius: 2rem;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  transition: background-color var(--transition-base);
  white-space: nowrap;
}
.btn-cta-nav:hover {
  background-color: var(--color-accent);
  color: #fff !important;
}

/* ──────────────────────────────────────────
   4. HERO / CAROUSEL
   ────────────────────────────────────────── */
/* Mobile: no fixed attachment (non funziona su iOS) */
.carousel-item {
  height: 60vh;
  min-height: 250px;
  background: no-repeat center center scroll;
  background-size: cover;
}

/* Desktop */
@media (min-width: 992px) {
  .carousel-item {
    height: 85vh;
    min-height: 200px;
    background: no-repeat center center scroll; /* fixed rimosso per performance */
    background-size: cover;
  }
}

#slide {
  height: 30vh;
  min-height: 200px;
  background: no-repeat center center scroll;
  background-size: cover;
}

#slide1 {
  height: 77vh;
  min-height: 400px;
  background: no-repeat center center scroll;
  background-size: cover;
}

/* ──────────────────────────────────────────
   5. LAYOUT HELPERS
   ────────────────────────────────────────── */
.centered {
  text-align: center;
}

@media (min-width: 992px) {
  .left {
    text-align: left;
    margin-left: 5rem;
    margin-right: 17rem;
  }
  .right {
    text-align: right;
    margin-right: 5rem;
    margin-left: 18rem;
  }
}

.cols {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 768px) {
  .cols {
    display: block;
  }
}

.col {
  width: 90%;
  margin: 1rem;
  cursor: pointer;
}

.row1 {
  width: 100%;
  margin: 0 auto;
}

/* ──────────────────────────────────────────
   6. FORM — CSS Grid (sostituisce float)
   ────────────────────────────────────────── */
.form-grid-wrapper {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 0 1rem;
}

@media (max-width: 868px) {
  .form-grid-wrapper {
    grid-template-columns: 1fr;
  }
}

/* Manteniamo compatibilità con id esistenti */
#form {
  box-sizing: border-box;
}
#form1 {
  box-sizing: border-box;
}
#form2 {
  box-sizing: border-box;
  width: 35%;
}
@media (max-width: 868px) {
  #form,
  #form1,
  #form2 {
    width: 100%;
  }
}

/* Floating labels */
.floating-label-form-group {
  position: relative;
}
.floating-label-form-group input,
.floating-label-form-group textarea {
  font-size: 1.0625rem;
  position: relative;
  z-index: 1;
  padding-right: 5%;
  padding-left: 5%;
  resize: none;
  background: none;
  box-shadow: 0.07rem 0.07rem 0.07rem 0.07rem #aaaa;
}
.floating-label-form-group label {
  font-size: 0.35em;
  line-height: 0.565em;
  position: relative;
  z-index: 0;
  top: 0.2em;
  display: block;
  margin: 0;
  transition: top 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}
.floating-label-form-group:not(:first-child) {
  padding-left: 14px;
  border-left: 1px solid #e9ecef;
}
.floating-label-form-group-with-value label {
  top: 0;
  opacity: 1;
}
.floating-label-form-group-with-focus label {
  color: #18BC9C;
}
form .row:first-child .floating-label-form-group {
  border-top: 1px solid #e9ecef;
}

/* ──────────────────────────────────────────
   7. BUTTONS
   ────────────────────────────────────────── */
#sendMessageButton {
  background-color: var(--color-success);
  color: #fff;
  border: 2px solid #3c6721;
  cursor: pointer;
  transition: background-color var(--transition-base);
}
#sendMessageButton:hover {
  background-color: #396f39;
}

#sendMessageButton1 {
  background-image: linear-gradient(to right, var(--color-primary) 7%, rgba(53,69,69,1) 80%);
  background-color: rgba(53,69,69,1);
  color: #fff;
  border: 2px solid #576060;
  cursor: pointer;
  transition: border-color var(--transition-base);
}
#sendMessageButton1:hover {
  border-color: var(--color-primary);
}

#confermato {
  background-color: var(--color-primary);
  color: #fff;
  cursor: pointer;
}

.button {
  font-size: 1em;
  padding: 10px 20px;
  color: #fff;
  border: 1px solid;
  border-radius: 20px;
  text-decoration: none;
  transition: background-color var(--transition-base);
}
.button:hover {
  background-color: #06D85F;
}

/* ──────────────────────────────────────────
   8. TYPOGRAPHY UTILS
   ────────────────────────────────────────── */
#strong {
  font-size: 1rem;
  border-bottom: 1px solid #fff;
  padding-bottom: 1.1px;
  color: #fff !important;
}
#navlink {
  color: #fff;
  font-size: 0.9rem;
  transition: font-size var(--transition-base);
}
#navlink:hover {
  font-size: 1rem;
  border-radius: 0.2em;
}
#weight  { font-size: 1.2rem; font-weight: 900; }
#weight2 { font-weight: 900; }
#closed  { color: red; }
#open    { color: darkgreen; }
#hr      { color: #5da69b; }
#message { font-size: 0.9rem !important; }
#arrow   { color: #424c4b; }

/* ──────────────────────────────────────────
   9. CARDS & PROJECT ITEMS
   ────────────────────────────────────────── */
#card {
  border-top-left-radius: calc(1.55rem - 1px);
  border-top-right-radius: calc(1.55rem - 1px);
}

.portfolio-item {
  margin-bottom: 30px;
}

.fh5co-project-item {
  display: block;
  width: 100%;
  position: relative;
  background: #fff;
  overflow: hidden;
  z-index: 9;
  bottom: 0;
  margin-bottom: 30px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  transition: bottom var(--transition-base), box-shadow var(--transition-base);
}
.fh5co-project-item figure {
  height: 210px;
  overflow: hidden;
  position: relative;
}
.fh5co-project-item figure .overlay {
  opacity: 0;
  visibility: hidden;
  z-index: 10;
  inset: 0;
  position: absolute;
  background: rgba(0, 0, 0, 0.4);
  transition: opacity 0.7s, visibility 0.7s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fh5co-project-item figure .overlay i {
  z-index: 12;
  color: #fff;
  font-size: 30px;
  transition: var(--transition-base);
}
.fh5co-project-item img {
  z-index: 8;
  width: 100%;
  transition: transform var(--transition-base);
}
.fh5co-project-item .fh5co-text {
  padding: 0 10px 10px 20px;
  text-align: center;
}
.fh5co-project-item .fh5co-text h2 {
  font-size: 20px;
  font-weight: bold;
  margin: 0 0 10px;
  color: var(--color-border);
  text-decoration: none !important;
}
.fh5co-project-item .fh5co-text span {
  color: #b3b3b3;
  font-size: 16px;
  font-weight: 400;
  text-decoration: none !important;
}
.fh5co-project-item .fh5co-text p {
  color: #000;
  transition: var(--transition-base);
}
.fh5co-project-item:hover,
.fh5co-project-item:focus {
  bottom: 7px;
  text-decoration: none;
  box-shadow: var(--shadow-card);
}
.fh5co-project-item:hover img,
.fh5co-project-item:focus img {
  transform: scale(1.2);
}
.fh5co-project-item:hover figure .overlay,
.fh5co-project-item:focus figure .overlay {
  opacity: 1;
  visibility: visible;
}

/* ──────────────────────────────────────────
   10. MAP & MEDIA
   ────────────────────────────────────────── */
#map {
  border-radius: var(--radius-card);
}
@media (max-width: 768px) {
  #map {
    max-width: 98%;
    max-height: 90%;
  }
  .macbook-wrap img {
    max-width: 100%;
  }
}

.footer1 {
  max-height: 100px;
}

/* ──────────────────────────────────────────
   11. TIMELINE
   ────────────────────────────────────────── */
.timeline {
  list-style: none;
  padding: 10px 0;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background-color: #eee;
  margin-left: -1.5px;
}
.timeline > li {
  margin-bottom: 20px;
  position: relative;
}
.timeline > li::after {
  content: "";
  display: table;
  clear: both;
}
.timeline > li > .timeline-panel {
  width: 46%;
  float: left;
  border: 1px solid #d4d4d4;
  border-radius: 2px;
  padding: 38px;
  position: relative;
  box-shadow: 0 1px 6px rgba(0,0,0,0.175);
}
.timeline > li > .timeline-panel::before {
  position: absolute;
  top: 26px;
  right: -15px;
  display: inline-block;
  border: 15px solid transparent;
  border-left-color: #ccc;
  border-right-width: 0;
  content: "";
}
.timeline > li > .timeline-panel::after {
  position: absolute;
  top: 27px;
  right: 15px;
  display: inline-block;
  border: 14px solid transparent;
  border-left-color: #fff;
  border-right-width: 0;
  content: "";
}
.timeline > li > .timeline-badge {
  color: #fff;
  width: 90px;
  height: 90px;
  line-height: 20px;
  font-size: 1em;
  text-align: center;
  position: absolute;
  top: -10px;
  left: 50%;
  margin-left: -45px;
  background-color: #999;
  z-index: 100;
  box-shadow: 0.2rem 0.2rem 0.2rem #aaaa;
  border-radius: var(--radius-badge);
  background-image: url(../img/profile.png);
}
.timeline > li.timeline-inverted > .timeline-panel {
  float: right;
}
.timeline > li.timeline-inverted > .timeline-panel::before {
  border-left-width: 0;
  border-right-width: 15px;
  border-right-color: #ccc;
  left: -15px;
  right: auto;
}
.timeline > li.timeline-inverted > .timeline-panel::after {
  border-left-width: 0;
  border-right-width: 14px;
  border-right-color: #fff;
  left: -14px;
  right: auto;
}
.timeline-badge.primary { background-color: #2e6da4 !important; }
.timeline-badge.success { background-color: #3f903f !important; }
.timeline-badge.warning { background-color: #f0ad4e !important; }
.timeline-badge.danger  { background-color: #d9534f !important; }
.timeline-badge.info    { background-color: #5bc0de !important; }
.timeline-title { margin-top: 0; color: inherit; }
.timeline-body > p,
.timeline-body > ul { margin-bottom: 0; }
.timeline-body > p + p { margin-top: 5px; }

@media (max-width: 767px) {
  ul.timeline::before { left: 20px; }
  ul.timeline > li > .timeline-panel {
    width: calc(100% - 60px);
    float: right;
  }
  ul.timeline > li > .timeline-badge {
    left: 6px;
    margin-left: 0;
    top: 25px;
  }
  ul.timeline > li > .timeline-panel::before {
    border-left-width: 0;
    border-right-width: 15px;
    border-right-color: #ccc;
    left: -15px;
    right: auto;
  }
  ul.timeline > li > .timeline-panel::after {
    border-left-width: 0;
    border-right-width: 14px;
    border-right-color: #fff;
    left: -14px;
    right: auto;
  }
}

/* ──────────────────────────────────────────
   12. SPECIAL SECTIONS
   ────────────────────────────────────────── */
#eventi {
  background-color: var(--color-events);
  color: #fff;
}

#oncologia {
  background-image: linear-gradient(to right,
    rgba(127, 35, 35, 0.73) 9%,
    rgba(127, 35, 35, 0.93) 90%
  );
  color: #fff !important;
  margin-bottom: 1rem;
  border-top-left-radius: 3.7rem;
  border-bottom-right-radius: 0.7rem;
  border-top-right-radius: 0.7rem;
}

.panel-title1 {
  font-size: 110%;
  font-weight: 400;
}

.nav-news1 {
  color: #dd202f;
  font-size: 0.15rem;
}
