/* --- riga titoli della pagina (non header) --- */
.pageTitles {
  background: #000;
  padding: 0px 25px;
  width: 100%;
  position: sticky;
  top: 62px;
  z-index: 10;
  border-top: 1px solid #BA66FF;
}

.pageTitles__row {
  display: grid;
  /* Matching row grid logic:
     Row has Image (140px) + Val1 (variable).
     Header item 1 spans these two.
     Let's use a fluid grid that fits the screen.
     Col structure: [Img 140px] [Val1 1.2fr] [Val2 1fr] [Val3 1fr] [Val4 1fr] [Val5 1fr]
  */
  grid-template-columns: 140px 1fr 0.8fr 0.8fr 0.8fr 0.8fr;
  align-items: center;
  gap: 0px;
  /* Reduced gap to fit better */
  width: 100%;
  min-width: 0;
  font-family: 'HAL Four Grotesk', sans-serif;
  /* Override previous fixed width */
}

.pageTitles__item {
  color: rgba(255, 255, 255, .92);
  font-weight: 800;
  text-transform: uppercase;
  /* Reduced spacing to save space */
  font-size: 16px;
  /* Reduced font size to fit */
  white-space: normal;
  /* Allow wrapping if needed? User said "all info inside page" */
  word-break: break-word;
}

/* First title spans 2 columns (Image + Valore 1) */
.pageTitles__item:first-child {
  grid-column: span 2;
  font-family: 'HALGapVariableUnlicensed-Variable';
  font-size: 4rem;
  color: #BA66FF;
}

/* --- Background override to ensure black base --- */
.owner-page {
  min-height: 50vh;
}

/* --- tabelle ripetibili --- */
.ownerTable {
  margin: -20px 0 0 0;
  /* Raised the block further with negative margin */
  align-items: center;
  width: 100%;
}

.ownerTable__range-bg-wrapper {
  position: relative;
  width: 100%;
  background-color: #fff;
  /* Changed to white fallback so black text is visible until image is uploaded */
}

.owner-range-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.owner-range-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ownerTable__table {
  background: transparent;
  padding: 0;
  /* Remove top/bottom padding to let background cover fully */
  min-width: 0;
  width: 100%;
  position: relative;
  z-index: 1;
}

.ownerTable__row {
  display: grid;
  grid-template-columns: 140px 1fr 0.8fr 0.8fr 0.8fr 0.8fr;
  align-items: center;
  gap: 0px;
  padding: 50px 25px 16px;
  /* Increased top padding to 40px to move icons down */
  width: 100%;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

a.ownerTable__row:hover {
  opacity: 0.8;
}

.ownerTable__cell {
  font-weight: 900;
  text-transform: uppercase;
  font-family: 'HALGapVariableUnlicensed-Variable';
  font-size: 30px;
  color: #000;
  /* Changed to black as requested */
  white-space: normal;
  word-break: break-word;
  transition: color 0.3s;
}

.ownerTable__row:hover .ownerTable__cell {
  color: #BA66FF;
}

.ownerTable__cell--image {
  flex: 0 0 auto;
  width: 140px;
  height: auto;
  border-radius: 0px;
  overflow: visible;
  background: transparent;
  margin-top: 10px;
  position: relative;
  display: grid;
  place-items: center;
}

.ownerTable__cell--image img {
  width: 130px;
  height: auto;
  object-fit: contain;
  display: block;
  cursor: pointer;
  /* Indication it is clickable */
  transition: opacity 0.3s;
}

/* Hover Logic from style.css adaptation */
.ownerTable__cell--image .hover-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  width: 130px;
  /* Ensure same width limit */
}

/* Trigger hover when the ROW is hovered */
.ownerTable__row:hover .ownerTable__cell--image.has-hover .hover-img {
  opacity: 1;
}

.ownerTable__row:hover .ownerTable__cell--image.has-hover .main-img {
  opacity: 0;
}

.ownerTable__cell--image a {
  display: block;
  width: 100%;
  height: 100%;
}

.ownerTable__cell--image a:hover img {
  opacity: 0.8;
}

/* --- Separatore (immagine) tra le righe --- */
.ownerTable__divider {
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.ownerTable__divider img {
  width: 100%;
  height: auto;
  display: block;
}

/* Fallback if no image uploaded, keeping space */
.ownerTable__divider:not(:has(img)) {
  height: 40px;
  background-image: url('../images/divider.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border-bottom: 1px solid rgb(0, 0, 0);
}

/* Immagine Header in alto */
.owner-header-image {
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.owner-header-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Galleria Owner Page --- */
.gallery-owner-page {
  background-color: #fff;
  padding: 20px 20px;
}

.gallery-owner-container {
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-owner-title {
  font-family: 'HALGapVariableUnlicensed-Variable';
  text-transform: uppercase;
  font-size: 4rem;
  margin-bottom: 0 0 50px 0;
  text-align: center;
}

/* Ensure requested owner-title h1 is centered */
h1.owner-title {
  text-align: center;
  width: 100%;
  font-size: 4rem;
  margin: 0 0 95px 0;
}

.gallery-owner-description {
  font-family: 'HAL Four Grotesk', sans-serif;
  font-size: 1.2rem;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto 60px;
  text-align: center;
}

.gallery-owner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

/* --- Single Owner Page --- */
.single-owner-page {
  background-color: #fff;
  min-height: 50vh;
  padding: 60px 20px;
}

.single-owner-main-image {
  margin-bottom: 63px;
  display: flex;
  justify-content: center;
}

.single-owner-main-image img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}


/* --- Black Bottom Section --- */
.single-owner-bottom-section {
  background-color: #000;
  color: #fff;
  padding: 60px 0;
  align-items: center;
}

/* Ensure inner container is centered */
.single-owner-bottom-section .owner-inner {
  max-width: 1200px;
  /* Assuming this matches other inner containers */
  margin: 0 auto;
  padding: 0 20px;
  align-items: center;
}

.single-owner-section-title {
  text-align: center;
  margin-top: 60px;
}

.single-owner-section-title h2 {
  font-family: 'HALGapVariableUnlicensed-Variable';
  text-transform: uppercase;
  font-size: 3rem;
  color: #fff;
  /* White title on black bg */
  text-align: left;
}

.single-owner-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* 4 Columns as requested */
  gap: 20px;
  grid-row-gap: 50px;
  margin-top: 40px;
}

.single-owner-gallery-item {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.single-owner-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  aspect-ratio: 3/5;
  object-fit: contain;
}

.gallery-item-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  /* Remove gap as requested */
  border: 2px solid #BA66FF;
  /* Purple border */
  background-color: #000;
  align-items: center;
  padding-left: 15px;
}

.gallery-col {
  background-color: #000000;
  /* White text on black bg */
  color: #BA66FF;
  line-height: 1;
  word-break: break-word;
  padding: 10px;
}

.gallery-col p {
  margin-bottom: 0px;
}

.owner-name {
  padding-bottom: 15px;
}

.owner-name p {
  line-height: 0.8;
}

/* First Column: HAL Gap Variable */
.gallery-col:nth-child(1) {
  font-family: 'HALGapVariableUnlicensed-Variable';
  text-transform: uppercase;
  color: #BA66FF;
  font-size: 1.5rem;
  /* Usually looks better with this font */
}

/* Second Column: HAL Four Grotesk */
.gallery-col:nth-child(2) {
  font-family: 'HAL Four Grotesk', sans-serif;
  color: #BA66FF;
  font-size: 0.9rem;
}

/* Responsive Gallery */
@media (max-width: 1024px) {
  .single-owner-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .single-owner-gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {

  .gallery-col:nth-child(1) {
    text-align: center;
    font-size: 2rem;
  }
}

/* --- New Info Section --- */
.single-owner-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* 4 Columns as requested */
  gap: 25px 70px;
  max-width: 1000px;
  margin: 0 auto;
  /* Center the grid */
}

.single-owner-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
}

.single-owner-info-text {
  font-family: 'HAL Four Grotesk', sans-serif;
  font-size: 1rem;
  color: #000;
  text-transform: uppercase;
  align-items: center;
}

/* Copied and adapted from artisti.css */
.oval-box {
  display: inline-block;
  line-height: 1;
  font-family: 'HALGapVariableUnlicensed-Variable';
  color: #000;
  font-size: 2.5rem;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
  .single-owner-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .single-owner-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Owners Page Mobile Optimization --- */
/* --- Owners Page Mobile Optimization --- */
/* --- Owners Page Mobile Optimization (Horizontal Scroll) --- */
/* --- Owners Page Mobile Optimization (Card Layout) --- */
@media (max-width: 768px) {

  /* Hide the top header row completely */
  .pageTitles {
    display: none;
  }

  .ownerTable {
    margin-top: 0px;
    /* Add some top spacing since title is gone */
  }

  /* Reset Scroll if it was there (cleaning up previous attempt) */
  .ownerTable,
  .ownerTable__table,
  .ownerTable__range-bg-wrapper {
    overflow-x: visible;
    width: 100%;
    min-width: 0;
  }

  /* The Card Container (Row) */
  .ownerTable__row {
    display: grid;
    /* Use Grid for the layout */
    grid-template-columns: 1fr 1fr;
    /* 2 Columns for stats */
    gap: 30px;
    /* Gap between items */
    padding: 60px 20px;
    /* Spacing inside the card */
    text-align: center;
    border-bottom: 0px solid rgba(0, 0, 0, 0.1);
    /* Remove row border if any */
  }

  /* Image: Top Center, Full Width */
  .ownerTable__cell--image {
    grid-column: 1 / -1;
    /* Span all cols */
    margin: 0 auto 15px;
    /* Center and spacing bottom */
    width: 140px;
    /* Fixed width for logo */
  }

  .ownerTable__cell--image img {
    width: 100%;
  }

  /* Value 1 (Owner ID #86205): Center, Full Width, Big Font */
  .ownerTable__cell:nth-child(2) {
    grid-column: 1 / -1;
    display: flex;
    /* Add flex to handle label positioning */
    flex-direction: column;
    /* Ensure label is on top */
    align-items: center;
    gap: 10px;
    font-family: 'HALGapVariableUnlicensed-Variable';
    font-size: 4rem;
    /* Big like the screenshot */
    margin-bottom: 55px;
    /* Space before stats */
    color: #000;
  }

  /* Values 2-5 (Stats): 2x2 Grid */
  /* They will naturally fall into the 1fr 1fr grid */
  .ownerTable__cell:nth-child(3),
  .ownerTable__cell:nth-child(4),
  .ownerTable__cell:nth-child(5),
  .ownerTable__cell:nth-child(6) {
    display: flex;
    flex-direction: column;
    /* Value bottom, Label top */
    align-items: center;
    gap: 0px;
    font-family: 'HALGapVariableUnlicensed-Variable';
    font-size: 2.5rem;
    /* Big Bold Value */
    line-height: 1;
  }

  /* The Label (pseudo-element) */
  .ownerTable__cell:nth-child(3)::before,
  .ownerTable__cell:nth-child(4)::before,
  .ownerTable__cell:nth-child(5)::before,
  .ownerTable__cell:nth-child(6)::before {
    content: attr(data-label);
    font-family: 'HAL Four Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    color: #000;
    margin-bottom: 2px;
    display: block;
    order: -1;
    /* Force visual order to top */
  }

  .gallery-item-info {
    gap: 70px;
  }
}

/* Resize specific images to 80% */
img[src*="geisha.png"],
img[src*="asso-di-bastoni-1.png"],
img[src*="stidda.png"],
img[src*="rosario.png"],
img[src*="sacro-cuore.png"],
img[src*="rondine.png"] {
  width: 100% !important;
  margin: 0 auto;
  display: block;
}