/* ==========================================================================
   Appartamenti Offida - custom styles
   One-page layout: full-width section backgrounds + apartment galleries
   Accent colors reuse the template preset greens (#2c5f2d / #03a83a)
   so nothing clashes with the existing menu/buttons/footer.
   ========================================================================== */

:root {
  --ao-accent: #2c5f2d;
  --ao-accent-light: #03a83a;
  --ao-text: #252525;
  --ao-border: #e7e7e7;
}

html {
  scroll-behavior: smooth;
}

#sp-main-body {
  padding: 0;
}
.article-can-edit {
  display: none !important;
}

/* Break a section out of Joomla's .container so its background bleeds
   edge-to-edge, while its own inner .container keeps the content readable. */
.full-width-section {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* Anchor targets for the one-page menu (#appartamenti, #condizioni-e-servizi,
   #offerte, #territorio, #contatti, #dove-siamo): #sp-header is fixed/sticky
   at 80px tall, so jumping straight to an anchor would land its top edge
   right under the header. scroll-margin-top offsets that on both smooth
   scroll and scroll-snap; scroll-snap-align keeps each section snapping to
   the same offset if scroll-snap-type is ever enabled on the page. */
#home-intro,
#appartamenti,
#condizioni-e-servizi,
#offerte,
#territorio,
#contatti,
#dove-siamo {
  scroll-margin-top: 80px;
  scroll-snap-align: start;
}

/* Logo + slogan stacked instead of side by side.
   The theme gives .logo a fixed 80px height to vertically center it next
   to the horizontal menu; stacking needs it to size to its content instead,
   otherwise it adds the slogan's height on top of that fixed 80px. */
#sp-logo {
  display: flex;
  align-items: center;
}
#sp-logo .sp-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#sp-logo .sp-column .logo {
  display: block;
  height: auto;
  line-height: 1.2;
}
#sp-logo .sp-column .logo a {
  line-height: 1.2;
}
#sp-logo .sp-column .logo-slogan {
  display: block;
  line-height: 1.2;
  margin-top: 2px;
}

/* Mobile off-canvas menu: theme preset sets text color = background color
   (both dark green), making the items invisible. Force contrast. */
.offcanvas-menu,
.offcanvas-menu .offcanvas-inner,
.offcanvas-menu .offcanvas-inner a,
.offcanvas-menu .offcanvas-inner ul.menu > li a,
.offcanvas-menu .offcanvas-inner ul.menu > li span {
  color: #ffffff;
}
.offcanvas-menu .offcanvas-inner ul.menu > li a:hover,
.offcanvas-menu .offcanvas-inner ul.menu > li a:focus {
  color: var(--ao-accent-light);
}
.offcanvas-menu .close-offcanvas {
  color: #ffffff;
}

/* Sticky header gets a bit of lift once content scrolls under it */
#sp-header-wrapper {
  transition: box-shadow 0.2s ease;
}
#sp-header-wrapper.sticky,
#sp-header-wrapper.spst-fixed {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ---------- Section titles ---------- */
.section-title {
  position: relative;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ao-text);
}
.section-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 56px;
  height: 3px;
  background: var(--ao-accent-light);
  border-radius: 2px;
}

/* ---------- Hero carousel ---------- */
#hero .carousel-item img {
  width: 100%;
  height: 62vh;
  min-height: 340px;
  object-fit: cover;
}
#hero .carousel-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0) 35%);
  pointer-events: none;
}
#hero .carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.6);
  border: none;
  opacity: 1;
}
#hero .carousel-indicators .active {
  background-color: var(--ao-accent-light);
}
#hero .carousel-control-prev,
#hero .carousel-control-next {
  width: 4rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
#hero:hover .carousel-control-prev,
#hero:hover .carousel-control-next {
  opacity: 0.85;
}

/* ---------- Home intro contact strip ---------- */
#home-intro .row.mb-4 p {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--ao-border);
  border-radius: 999px;
  background: #fff;
}
#home-intro .row.mb-4 strong {
  color: var(--ao-accent);
}
#home-intro ul {
  padding-left: 1.1rem;
}
#home-intro ul li {
  margin-bottom: 0.5rem;
  line-height: 1.55;
}
#home-intro ul li::marker {
  color: var(--ao-accent-light);
}

/* ---------- Apartments ---------- */
.apartment {
  background: #fff;
  border: 1px solid var(--ao-border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
@media (max-width: 575.98px) {
  .apartment {
    padding: 1.25rem;
  }
}

.apartment h3 {
  font-weight: 700;
  margin-bottom: 2rem;
}

.apartment .apt-capacity {
  font-size: 14px;
  color: var(--ao-accent);
  font-weight: 600;
}

/* "Posizione / Dotazioni / Prezzi" eyebrow labels */
.apartment .apt-label {
  margin-top: 1.25rem;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--ao-accent);
  border-bottom: 2px solid var(--ao-accent-light);
  display: inline-block;
  padding-bottom: 0.25rem;
}
.apartment .col-md-7 > .apt-label:first-child {
  margin-top: 0;
}

.apartment .apt-note {
  margin-top: 1rem;
  color: var(--ao-text);
}

/* Apartment / territorio photo galleries (glightbox) */
.apt-gallery .apt-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  cursor: zoom-in;
  border-radius: 8px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.apt-gallery a {
  display: block;
  overflow: hidden;
  border-radius: 8px;
}

.apt-gallery .apt-thumb:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

/* ---------- Price table ---------- */
.apartment-pricing {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ao-border);
}
.price-table-wrap {
  margin-top: 1rem;
}
.price-table {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.price-table thead th {
  background: var(--ao-accent);
  color: #fff;
  font-weight: 600;
  border-color: var(--ao-accent);
}
.price-table tbody tr:hover {
  background-color: rgba(3, 168, 58, 0.08);
}

/* ---------- Condizioni e Servizi ---------- */
#condizioni-e-servizi h4 {
  margin-top: 2rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--ao-accent-light);
  color: var(--ao-accent);
  font-weight: 700;
}
#condizioni-e-servizi p {
  line-height: 1.7;
}

/* ---------- Offerte (Swiper carousel, see html/mod_articles/swiper.php) ---------- */
.offers-empty {
  font-size: 1.1rem;
  padding: 1rem 0;
}
.offers-swiper {
  padding: 0.5rem 3rem 3rem;
}
.offers-swiper .swiper-slide {
  height: auto;
  display: flex;
}
.offer-card {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--ao-border);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}
.offer-title {
  font-weight: 700;
  color: var(--ao-accent);
  margin-bottom: 0.75rem;
}
.offer-text {
  flex: 1;
  color: var(--ao-text);
}
.offer-text p:last-child {
  margin-bottom: 0;
}
.offer-link {
  margin-top: 1rem;
  font-weight: 600;
  color: var(--ao-accent);
  text-decoration: none;
}
.offer-link:hover {
  color: var(--ao-accent-light);
  text-decoration: underline;
}
/* Nav arrows sit in the section's own side padding, outside the cards */
.offers-swiper .swiper-button-prev,
.offers-swiper .swiper-button-next {
  color: var(--ao-accent);
  background: #fff;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  top: 45%;
}
.offers-swiper .swiper-button-prev::after,
.offers-swiper .swiper-button-next::after {
  font-size: 0.9rem;
  font-weight: 700;
}
.offers-swiper .swiper-button-prev {
  left: 0;
}
.offers-swiper .swiper-button-next {
  right: 0;
}
@media (max-width: 575.98px) {
  .offers-swiper {
    padding-left: 2.25rem;
    padding-right: 2.25rem;
  }
  .offers-swiper .swiper-button-prev,
  .offers-swiper .swiper-button-next {
    width: 1.875rem;
    height: 1.875rem;
  }
  .offers-swiper .swiper-button-prev::after,
  .offers-swiper .swiper-button-next::after {
    font-size: 0.75rem;
  }
}
.offers-swiper .swiper-pagination-bullet-active {
  background: var(--ao-accent);
}

/* ---------- Territorio ---------- */
#territorio p {
  line-height: 1.7;
}
#territorio a {
  font-weight: 600;
}

/* ---------- Dove Siamo rows ---------- */
#dove-siamo .row {
  border-color: var(--ao-border) !important;
}
#dove-siamo .fw-bold {
  color: var(--ao-accent);
}

/* ---------- Footer module ---------- */
.footer-module {
  text-align: center;
  padding: 0.5rem 0;
}
.footer-brand {
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}
#sp-footer .footer-contact a,
#sp-bottom .footer-contact a {
  color: rgba(255, 255, 255, 0.85);
}
.footer-contact .footer-sep {
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.5);
}
.footer-copyright {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}
.footer-links {
  margin-top: 0.35rem;
  font-size: 0.85rem;
}
.footer-links a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: underline;
}
.footer-links a:hover {
  color: #fff;
}

/* ---------- Contatti ---------- */
#contatti .fs-5 strong {
  color: var(--ao-accent);
}
#contatti .contact-map {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--ao-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* The email/tel two-column rows (home intro + contatti) use Bootstrap's
   col-md-6, which kicks in right at 768px - too narrow for the email
   address next to the phone number without wrapping unevenly. Keep them
   stacked until there is real room, matching the nav's own ~992px switch. */
@media (min-width: 768px) and (max-width: 991.98px) {
  #home-intro .row.mb-4 > div,
  #contatti .row.mt-4 > div {
    flex: 0 0 100%;
    max-width: 100%;
  }
  #home-intro .row.mb-4 > div:first-child {
    margin-bottom: 1rem;
  }
}
