/* ============================================================
   Dermastudio — custom additions on top of site-main-css.css
   - Blog cards + article layout
   - New site footer (dark, 4 columns)
   - Map embed
   - Desktop spacing improvements (text-heavy pages)
   - Accordion component
   ============================================================ */


/* ---------- Blog index: card grid ---------- */

.block-blog .blog-card {
  margin-bottom: 60px;
}

.block-blog .blog-card > a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.block-blog .blog-card-image {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  margin-bottom: 18px;
  background: #eee;
}

.block-blog .blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.block-blog .blog-card:hover .blog-card-image img {
  transform: scale(1.04);
}

.block-blog .blog-card-meta {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.block-blog .blog-card-meta .blog-card-cat::before {
  content: "· ";
  margin-right: 4px;
}

.block-blog .blog-card h3 {
  margin: 0 0 12px;
  line-height: 1.3;
}

.block-blog .blog-card p {
  color: #555;
  margin: 0 0 16px;
}

.block-blog .blog-card-more {
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
}


/* ---------- Team grid cards ---------- */

.block-team .team {
  margin-bottom: 60px;
}

.block-team .team img.responsive-img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  margin-bottom: 18px;
  background: #eee;
}

.block-team .team h3 {
  margin: 0 0 6px;
  line-height: 1.3;
}

.block-team .team p {
  color: #555;
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}


/* ---------- Article page: hero + body ---------- */

.article-hero {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: -1;
}

.cover.cover-small .slogan h1 {
  max-width: 900px;
}

.article-meta {
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #888;
}

.article-body {
  font-size: 17px;
  line-height: 1.7;
}

.article-body h2 {
  margin-top: 48px;
  margin-bottom: 16px;
}

.article-body p {
  margin: 0 0 18px;
}

.article-body strong {
  color: #111;
}

.article-back {
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
}


/* ---------- Contact map embed ---------- */

.map-embed {
  width: 100%;
  overflow: hidden;
  margin-top: 30px;
}

/* ---------- Contact page: map (left) + info stack (right) ---------- */

.block-contact-split .contact-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
}

.block-contact-split .contact-info-item h3 {
  margin: 0 0 12px;
}

.block-contact-split .contact-info-item p {
  margin: 0 0 12px;
  line-height: 1.6;
}

.block-contact-split .contact-info-item + .contact-info-item {
  padding-top: 28px;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}

@media only screen and (min-width: 1001px) {
  .block-contact-split .map-embed,
  .block-contact-split .contact-map {
    margin-top: 0;
    height: 100%;
  }
  .block-contact-split .contact-map .map-embed {
    height: 100%;
    min-height: 520px;
  }
  .block-contact-split .contact-map iframe {
    height: 100% !important;
    min-height: 520px;
  }
  .block-contact-split > .wrapper > .row {
    align-items: stretch;
  }
  .block-contact-split .contact-info {
    padding-left: 40px;
  }
}

@media only screen and (max-width: 1000px) {
  .block-contact-split .contact-info {
    margin-top: 40px;
  }
}


/* ---------- Desktop spacing & readability improvements ---------- */

@media only screen and (min-width: 1001px) {
  /* More breathing room between sections */
  .block.block-text {
    margin-bottom: 120px;
  }
  /* Default block-intro (in middle of page, NOT after hero):
     big space above, small space below — content "introduces" what follows */
  .block.block-text.block-intro {
    margin-top: 200px;
    margin-bottom: 80px;
  }
  /* Block intro right after the hero (with .pt class):
     equal space above and below (240px total each side) */
  .block.pt {
    padding-top: 180px;
  }
  .block.block-text.block-intro.pt {
    margin-top: 60px;
    margin-bottom: 240px;
  }
  /* Two consecutive intros (h2 + p pattern): collapse the gap so they
     read as one block. Resulting gap ≈ 20px between them. */
  .block.block-text.block-intro + .block.block-text.block-intro {
    margin-top: -60px;
  }
  .block.block-text.no-mb {
    margin-bottom: 0;
  }
  .block.block-team {
    margin-bottom: 120px;
  }

  /* Vertical centering ONLY for image+text rows (full-bleed pattern).
     Text-only multi-column grids must stay top-aligned (classic). */
  .block.block-text:has(.image-container) > .wrapper > .row {
    align-items: center;
  }
  .block.block-text:not(:has(.image-container)) > .wrapper > .row {
    align-items: flex-start;
  }

  /* When a text-only block (e.g. multi-col grid of conditions) follows
     an image+text block, give it room to breathe so it doesn't touch
     the image edge above. */
  .block.block-text:has(.image-container) + .block.block-text:not(:has(.image-container)) {
    margin-top: 120px;
  }
  /* Same when the previous element is a block-intro that itself follows an image */
  .block.block-text:has(.image-container) + .block.block-text.block-intro {
    margin-top: 160px;
  }

  .article-body {
    font-size: 18px;
    line-height: 1.75;
    max-width: 70ch;
    margin: 0 auto;
  }
  .article-body h2 {
    margin-top: 64px;
  }
}


/* ---------- CTA arrow on standalone links inside .col-text ---------- *
   Pattern: <p><a href="...">Scopri ...</a></p>  inside an image+text col.
   We add a → at the end and animate it on hover, like the footer "Scrivici →". */

.col-text p > a:only-child::after,
.block-text .col-text p > a:only-child::after {
  content: " \2192";   /* → */
  display: inline-block;
  margin-left: 0.4em;
  transition: transform 0.25s ease;
}

.col-text p > a:only-child:hover::after,
.block-text .col-text p > a:only-child:hover::after {
  transform: translateX(4px);
}


/* ---------- Section dividers ----------
   Thin black line full-width across the wrapper, same style as the footer
   divider but in black. Quiet visual break between sections. Skipped on
   the very first intro (`.pt`) which is right after the hero. */

@media only screen and (min-width: 1001px) {
  .block.block-text.block-intro:not(.pt) > .wrapper {
    border-top: 1px solid rgba(0, 0, 0, 0.15) !important;
    padding-top: 80px !important;
  }

  /* Thin divider above the accordion (matches the footer/section style) */
  .block.block-text > .wrapper > .row > .col > .accordion {
    border-top: 1px solid rgba(0, 0, 0, 0.15) !important;
  }

  /* Divider above the team rows on /team — separates each role group */
  .block.block-team > .wrapper > .row {
    border-top: 1px solid rgba(0, 0, 0, 0.15) !important;
    padding-top: 40px !important;
  }
}

/* ---------- Page-title hero (pages without a photo: team, blog, contatti) ----------
   Acts as a static hero: title sits high (just below the header), no dividers
   above OR below. The immediately following intro paragraph also drops its top line. */

.block.block-text.block-intro.block-page-title {
  margin-top: 0 !important;
}
.block.block-text.block-intro.block-page-title > .wrapper {
  border-top: none !important;
  padding-top: 0 !important;
}
.block.block-text.block-intro.block-page-title + .block.block-text.block-intro > .wrapper {
  border-top: none !important;
  padding-top: 0 !important;
}
.block.block-text.block-intro.block-page-title + .block.block-text.block-intro {
  margin-top: 24px !important;
}

@media only screen and (min-width: 1001px) {
  .block.block-text.block-intro.block-page-title {
    margin-top: 260px !important;
    margin-bottom: 60px !important;
  }
  .block.block-text.block-intro.block-page-title + .block.block-text.block-intro {
    margin-top: 30px !important;
    margin-bottom: 160px !important;
  }
}

@media only screen and (max-width: 1000px) {
  .block.block-text.block-intro.block-page-title {
    margin-top: 180px !important;
    margin-bottom: 40px !important;
  }
}


/* ---------- General text styling inside content blocks ---------- */

/* Wider max-width so paragraphs don't stretch full-row width
   on big monitors. Applies to any col inside block-text. */
.block.block-text .col p {
  max-width: 65ch;
}
.block.block-text .col h2 {
  max-width: 32ch;
}

/* More breath between consecutive paragraphs inside the same column */
.block.block-text .col p + p,
.block.block-text .col ul + p,
.block.block-text .col p + ul {
  margin-top: 14px;
}

/* Headings: more space above when following text */
.block.block-text .col p + h2,
.block.block-text .col p + h3,
.block.block-text .col ul + h2,
.block.block-text .col ul + h3 {
  margin-top: 36px;
}

/* List items inside content blocks: comfortable line-height + spacing */
.block.block-text .col ul {
  padding-left: 0;
  list-style: none;
}
.block.block-text .col ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  line-height: 1.6;
}
.block.block-text .col ul li::before {
  content: "·";
  position: absolute;
  left: 6px;
  top: -2px;
  font-size: 22px;
  line-height: 1;
}

/* "Card-like" columns: when a col has just an h3+p (typical for
   feature/condition grids), give a little vertical padding so cards
   in the same row look aligned and breathe */
@media only screen and (min-width: 1001px) {
  .block.block-text .col-3 > h3,
  .block.block-text .col-4 > h3 {
    margin-bottom: 12px;
    font-size: 22px;
    line-height: 1.3;
  }
  .block.block-text .col-3 > p,
  .block.block-text .col-4 > p {
    font-size: 16px;
    line-height: 1.65;
  }
}

/* Mobile: paragraphs full-width again */
@media only screen and (max-width: 1000px) {
  .block.block-text .col p,
  .block.block-text .col h2,
  .block.block-text .col h3 {
    max-width: none;
  }
}


/* ---------- Full-bleed image blocks (desktop only) ----------
   For .block.block-text rows that contain an .image-container.image-left
   or .image-container.image-right, the image extends to the viewport edge,
   spanning 50vw, and the text col sits inside the wrapper. */

@media only screen and (min-width: 1001px) {

  /* The mobile-only duplicate image is in the DOM with width:0% on desktop,
     but in a CSS grid it still claims a cell. Hide it completely on desktop. */
  .block.block-text .image-container.image-container-mobile {
    display: none;
  }

  .block.block-text:has(.image-container.image-left) > .wrapper,
  .block.block-text:has(.image-container.image-right) > .wrapper {
    max-width: none;
    padding: 0;
    overflow: visible;
  }

  .block.block-text:has(.image-container.image-left) > .wrapper > .row,
  .block.block-text:has(.image-container.image-right) > .wrapper > .row {
    display: grid;
    grid-template-columns: 50vw 1fr;
    gap: 0;
    margin: 0;
    align-items: stretch;
    min-height: 37.5vw;
  }

  .block.block-text:has(.image-container.image-right) > .wrapper > .row {
    grid-template-columns: 1fr 50vw;
  }

  /* Image col: full bleed on the page edge, stretches to row height */
  .block.block-text .image-container.image-left,
  .block.block-text .image-container.image-right {
    flex: none;
    width: 50vw;
    max-width: none;
    padding: 0;
    margin: 0;
    height: 100%;
  }

  .block.block-text .image-container.image-left { grid-column: 1; grid-row: 1; }
  .block.block-text .image-container.image-right { grid-column: 2; grid-row: 1; }

  .block.block-text .image-container img.responsive-img,
  .block.block-text .image-container img.image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Text col: padding inside, max-width on text, vertically centered */
  .block.block-text:has(.image-container.image-left) > .wrapper > .row > .col-text,
  .block.block-text:has(.image-container.image-right) > .wrapper > .row > .col-text {
    width: auto;
    max-width: none;
    flex: none;
    padding: 60px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .block.block-text:has(.image-container.image-left) > .wrapper > .row > .col-text { grid-column: 2; grid-row: 1; }
  .block.block-text:has(.image-container.image-right) > .wrapper > .row > .col-text { grid-column: 1; grid-row: 1; }

  .block.block-text:has(.image-container) > .wrapper > .row > .col-text p,
  .block.block-text:has(.image-container) > .wrapper > .row > .col-text h2,
  .block.block-text:has(.image-container) > .wrapper > .row > .col-text h3 {
    max-width: 50ch;
  }

  /* Consecutive image+text blocks: no gap between them (continuous rhythm) */
  .block.block-text:has(.image-container) {
    margin-bottom: 0;
  }
}


/* ---------- Accordion overrides (ensure they win over generic rules) ---------- */

.accordion-content {
  max-height: 0 !important;
}

.accordion-item.open > .accordion-content {
  max-height: 4000px !important;
}


/* ============================================================
   New site footer — same beige+black style of the site,
   but 4-column structured layout (left-aligned).
   ============================================================ */

footer.site-footer {
  background-color: #fdf4e8;
  text-align: left;
  padding: 100px 0 30px;
  margin-top: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}

footer.site-footer .wrapper {
  overflow: visible;
}

footer.site-footer .site-footer-top {
  font-family: 'ClashGrotesk-Light', sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #000;
  margin-bottom: 36px;
  padding-bottom: 14px;
}

footer.site-footer .site-footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 60px;
}

footer.site-footer h4 {
  font-family: 'ClashGrotesk-Light', sans-serif;
  font-size: 14px;
  line-height: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000 !important;
  margin: 0 0 24px;
  text-align: left;
}

footer.site-footer p,
footer.site-footer li {
  font-family: 'ClashGrotesk-Light', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #000 !important;
  margin: 0 0 10px;
  text-align: left;
}

footer.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

footer.site-footer ul li {
  padding-left: 0;
}

footer.site-footer ul li:before {
  content: none;
}

footer.site-footer a,
footer.site-footer a:visited,
footer.site-footer a:hover {
  font-family: 'ClashGrotesk-Light', sans-serif;
  color: #000 !important;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

footer.site-footer a:hover {
  border-bottom-color: #000;
}

footer.site-footer .site-footer-cta {
  display: inline-block;
  margin-top: 18px;
  padding: 13px 26px;
  background: transparent;
  color: #000 !important;
  font-family: 'ClashGrotesk-Light', sans-serif;
  font-size: 14px;
  letter-spacing: 0.04em;
  border: 1px solid #000 !important;
  transition: background 0.2s ease, color 0.2s ease;
}

footer.site-footer .site-footer-cta:hover {
  background: #000;
  color: #fdf4e8 !important;
}

footer.site-footer .site-footer-bottom {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'ClashGrotesk-Light', sans-serif;
  font-size: 13px;
  color: #000;
}

footer.site-footer .site-footer-bottom a {
  color: #000 !important;
}

/* Responsive footer */

@media only screen and (max-width: 1000px) {
  footer.site-footer .site-footer-cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
}

@media only screen and (max-width: 600px) {
  footer.site-footer {
    padding: 60px 0 25px;
  }
  footer.site-footer .site-footer-cols {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  footer.site-footer .site-footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    margin-top: 50px;
  }
}


/* ============================================================
   Hero marquee — scrolling strip of the 5 clinical areas,
   anchored to the bottom of the homepage hero (.cover).
   Visible within the initial viewport on desktop.
   ============================================================ */

/* Slogan sits just above the marquee (marquee is glued to the image base) */
.cover .slogan {
  bottom: 110px;
}
@media only screen and (max-width: 1000px) {
  .cover .slogan {
    bottom: 90px;
  }
}
@media only screen and (max-width: 600px) {
  .cover .slogan {
    bottom: 70px;
  }
}

.hero-marquee {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  z-index: 200;
  padding: 14px 0;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
  pointer-events: auto;
}

.hero-marquee-track {
  display: flex;
  align-items: center;
  gap: 36px;
  width: max-content;
  animation: hero-marquee-scroll 40s linear infinite;
  will-change: transform;
}

.hero-marquee:hover .hero-marquee-track {
  animation-play-state: paused;
}

.hero-marquee-item {
  font-family: 'ClashGrotesk-Light', sans-serif;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  padding: 4px 6px;
  opacity: 0.92;
  user-select: none;
}

.hero-marquee-sep {
  font-family: 'ClashGrotesk-Light', sans-serif;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1;
  user-select: none;
}

@keyframes hero-marquee-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

@media only screen and (max-width: 1000px) {
  .hero-marquee {
    padding: 12px 0;
  }
  .hero-marquee-track {
    gap: 28px;
    animation-duration: 32s;
  }
  .hero-marquee-item {
    font-size: 12px;
    letter-spacing: 0.18em;
  }
}

@media only screen and (max-width: 600px) {
  .hero-marquee {
    padding: 10px 0;
  }
  .hero-marquee-track {
    gap: 22px;
  }
  .hero-marquee-item {
    font-size: 11px;
    letter-spacing: 0.14em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-marquee-track {
    animation: none;
  }
}


/* ============================================================
   Cover overlay — stronger darkening on hero images so white
   logo/menu/title remain readable against bright photos.
   ============================================================ */

.cover .swiper-slide:before {
  background-color: #000 !important;
  opacity: 0.4 !important;
}

/* Blog article hero (single-slide cover, no swiper) */
.cover.cover-blog .article-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0.4;
  z-index: 1;
}


/* ============================================================
   Accordion (used on text-heavy pages: dermatologia, ecc.)
   ============================================================ */

.accordion {
  border-top: 1px solid #e5e5e5;
}

.accordion-item {
  border-bottom: 1px solid #e5e5e5;
}

.accordion-trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 24px 50px 24px 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 18px;
  color: inherit;
  position: relative;
  display: block;
}

.accordion-trigger:focus {
  outline: none;
}

.accordion-trigger:focus-visible {
  outline: 1px solid rgba(0, 0, 0, 0.4);
  outline-offset: -1px;
}

.accordion-trigger::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  line-height: 1;
  font-weight: 200;
  transition: transform 0.3s ease;
}

.accordion-item.open .accordion-trigger::after {
  content: "−";
  transform: translateY(-50%) rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.accordion-item.open .accordion-content {
  max-height: 1500px;
}

.accordion-content-inner {
  padding: 0 50px 28px 0;
  font-size: 16px;
  line-height: 1.7;
  color: #555;
}

.accordion-content-inner p {
  margin: 0 0 14px;
}

.accordion-content-inner p:last-child {
  margin-bottom: 0;
}
