/* Amenidades Section Styles */
/* Note: body styles removed as this is integrated into existing page */

/* Base: mobile images exist in DOM but hidden on desktop */
.amenidad-image-mobile {
    display: none;
}

/* Amenidades Section */
.amenidades-section {
    padding: 0 0 80px 0;
    background-color: #344835;
    position: relative;
}

.amenidades-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.amenidades-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-top: 80px;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.amenidades-title {
    font-family: 'Playfair Display SC', serif;
    font-size: 71px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    margin: 0;
    padding: 0;
    line-height: 1.1;
    text-align: left;
}

.amenidades-subtitle {
    font-family: 'Lato', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: #ffffff;
    width: 35%;
    margin: 0;
    line-height: 1.6;
    text-align: left;
}

/* Amenidades List */
.amenidades-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin: 0;
}

.amenidad-row {
    position: relative;
    width: 100%;
    min-height: 120px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid #d9d9d9;
    background-color: #344835;
}

.amenidad-row:last-child {
    border-bottom: 2px solid #d9d9d9;
}

.amenidad-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex-direction: column;
    text-align: center;
}

.amenidad-title {
    font-family: 'Playfair Display SC', serif;
    font-size: 140px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #ffffff;
    text-align: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.amenidad-row:hover .amenidad-title {
    color: #e7eadb;
}

/* Image Preview (Desktop) */
.image-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    margin-left: 40px;
    transform: translateY(-50%) scale(1);
    width: 500px;
    height: 600px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.image-preview.active {
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .amenidades-container {
        padding: 0 20px;
    }
    
    .amenidades-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 60px;
        padding-top: 60px;
        padding-left: 0;
        padding-right: 0;
    }
    
    .amenidades-title {
        font-size: 48px;
        margin-bottom: 20px;
        width: 100%;
        text-align: left;
    }
    
    .amenidad-row {
        padding: 0;
        min-height: 120px;
        border-bottom: 1px solid #d9d9d9;
    }
    
    .amenidad-title {
        font-size: 48px;
    }
    
    .amenidad-row:hover .amenidad-title {
        color: #e7eadb;
    }
    
    /* Mobile: Show image inline */
    .amenidad-content {
        flex-direction: column;
    }
    
    .amenidad-image-mobile {
        width: 100%;
        height: 300px;
        object-fit: cover;
        margin-top: 16px;
        display: block;   /* force visible on mobile */
    }
    
    /* Hide fixed preview on mobile */
    .image-preview {
        display: none;
    }
}

/* Tablet Styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .amenidades-title {
        font-size: 60px;
    }
    
    .amenidades-subtitle {
        width: 40%;
        font-size: 26px;
    }
    
    .amenidad-title {
        font-size: 100px;
    }
    
    .image-preview {
        width: 400px;
        height: 500px;
    }
}

/* Large Desktop */
@media screen and (min-width: 1920px) {
    .amenidades-container {
        max-width: 1600px;
    }
    
    .amenidades-title {
        font-size: 71px;
    }
    
    .amenidades-subtitle {
        font-size: 30px;
    }
    
    .amenidad-title {
        font-size: 160px;
    }
    
    .image-preview {
        width: 600px;
        height: 700px;
    }
}

/* === OVERRIDES TO MATCH REFERENCE LAYOUT === */

/* Make the whole block full width and remove side padding */
.amenidades-section {
    padding: 0;
}

.amenidades-container {
    max-width: none;
    margin: 0;
    padding: 0; /* no lateral padding so lines touch the edges */
}

/* Header closer to first line, no extra space below */
.amenidades-header {
    padding-top: 60px;
    padding-left: 40px;
    padding-right: 40px;
    margin-bottom: 0;
}

/* Title smaller like reference */
.amenidades-title {
    font-size: 48px;
    letter-spacing: 0.08em;
}

/* Subtitle smaller / tighter */
.amenidades-subtitle {
    font-size: 18px;
    width: 35%;
    line-height: 1.4;
}

/* Lines: remove "tall" feel and any extra space */
.amenidad-row {
    min-height: 90px;   /* reduce height; rows sit right on the borders */
    padding: 0;
    border-bottom: 2px solid #d9d9d9;
}


/* Text size & tracking inside each line */
.amenidad-title {
    font-size: 72px;    /* slightly smaller than your 140px */
    letter-spacing: 0.06em;
    line-height: 1;
}

/* Update text colors to match SVG reference (#e7eadb) */
.amenidades-title,
.amenidades-subtitle,
.amenidad-title {
    color: #e7eadb;
}

/* === FINAL AMENDIDADES FIXES === */

/* 1. Remove the line between AMENIDADES and GOLF */
.amenidad-row:first-child {
    border-top: none !important;
}

/* 2. Add more spacing between AMENIDADES and GOLF */
.amenidades-header {
    margin-bottom: 120px !important; /* adjust until it matches your reference */
    padding-top: 80px !important;
}

/* 3. Force subtitle into two lines and match reference width */
.amenidades-subtitle {
    max-width: 360px;      /* controls wrapping */
    font-size: 24px;
    line-height: 1.4;
    white-space: normal;
}

/* Optional: make title size match the reference better */
.amenidades-title {
    font-size: 62px !important;
    letter-spacing: 0.07em;
}

/* === ROW SPACING + THINNER LINES === */
.amenidad-row {
    min-height: 150px;              /* more vertical space between lines */
    border-bottom: 1px solid #d9d9d9;  /* thinner line */
}

/* Make sure first row doesn't get a top border */
.amenidad-row:first-child {
    border-top: none;
}

/* === DESKTOP HOVER: REAL BACKGROUND DIV, NOT ::after === */
@media (min-width: 769px) {
    .image-preview {
        display: none !important;
    }

    /* Disable the previous ::after image (if still present) */
    .amenidad-row::after {
        content: none;
    }

    .amenidad-row {
        position: relative;
        overflow: hidden;
        transition: min-height 0.4s ease;
    }

    /* The div we add from JS that holds the photo */
    .amenidad-bg-desktop {
        position: absolute;
        inset: 0;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 0;
    }

    /* Keep text above the image */
    .amenidad-content {
        position: relative;
        z-index: 1;
    }

    .amenidad-title {
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    /* On hover: grow row, fade in image, fade out text */
    .amenidad-row.has-image:hover {
        min-height: 420px; /* adjust height as you like */
    }

    .amenidad-row.has-image:hover .amenidad-bg-desktop {
        opacity: 1;
    }

    .amenidad-row.has-image:hover .amenidad-title {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* === MOBILE IMAGE (already mostly there, just keep this) === */
@media (max-width: 768px) {
    .amenidad-image-mobile {
        width: 100%;
        height: 300px;
        object-fit: cover;
        margin-top: 16px;
        display: block;
    }
}

/* === FIX SUBTITLE: NO ELLIPSIS, LEFT, ~TWO LINES === */
/* Desktop */
@media (min-width: 769px) {
  .amenidades-subtitle {
    /* remove previous clamp behavior */
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
    text-overflow: clip;

    /* position + size */
    max-width: 420px;       /* controls where it breaks to 2 lines */
    margin: 0;              /* remove centering */
    margin-right: 80px;     /* nudges it a bit to the left from the edge */
    font-size: 24px;
    line-height: 1.4;
    text-align: left;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .amenidades-subtitle {
    /* remove clamp / ellipsis on mobile */
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
    text-overflow: clip;

    width: 100%;
    max-width: 100%;
    margin: 20px 0 0 0;     /* space under AMENIDADES */
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    text-align: left;
  }
}

/* === AMENITIES – MOBILE LAYOUT === */
@media (max-width: 768px) {
  /* Container and header spacing */
  .amenidades-section {
    padding: 0 0 40px 0;
  }

  .amenidades-container {
    padding: 0 16px;
  }

  .amenidades-header {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 40px;
    margin-bottom: 24px;
  }

  .amenidades-title {
    font-size: 32px;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    text-align: left;
  }

  .amenidades-subtitle {
    font-size: 14px;
    line-height: 1.4;
    max-width: 230px;
    margin: 0;
    text-align: left;
  }

  /* List & rows */
  .amenidades-list {
    width: 100%;
    border-top: 1px solid #d9d9d9;
  }

  .amenidad-row {
    min-height: auto;
    padding: 12px 0 24px;
    border-bottom: 1px solid #d9d9d9;
    background-color: #344835;
  }

  .amenidad-content {
    align-items: flex-start;
    text-align: left;
  }

  .amenidad-title {
    font-size: 24px;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
  }

  /* The static image card under each title */
  .amenidad-image-mobile {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;      /* tweak if you want taller/shorter cards */
    object-fit: cover;
    background-color: #e7eadb; /* acts like your placeholder rectangles */
  }

  /* Don't use the desktop hover background on mobile */
  .amenidad-bg-desktop {
    display: none !important;
  }
}

/* === MOBILE FIX FOR AMENIDADES TITLE + DESCRIPTION === */
@media (max-width: 768px) {
  /* Section wrapper */
  .amenidades-section {
    padding-top: 20px !important;   /* reduce huge top spacing */
  }

  /* Container */
  .amenidades-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Title "AMENIDADES" */
  .amenidades-title {
    font-size: 32px !important;        /* smaller so the whole word fits */
    line-height: 1.1 !important;
    margin: 0 0 12px 0 !important;
    text-align: left !important;
  }

  /* Description under the title */
  .amenidades-subtitle {
    font-size: 14px !important;        /* match amenity subtitles */
    line-height: 1.4 !important;
    max-width: 240px !important;       /* aligns visually with list below */
    margin: 0 0 24px 0 !important;     /* tighten spacing */
    text-align: left !important;
  }

  /* Divider line below title/description */
  .amenidades-header {
    margin-bottom: 12px !important;
  }
}

/* === AMENIDADES – MOBILE POLISH === */
@media (max-width: 768px) {
  /* Pull the whole section a bit higher */
  .amenidades-section {
    padding-top: 8px !important;
  }

  .amenidades-container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .amenidades-header {
    padding-top: 12px !important;
    margin-bottom: 12px !important;
    align-items: flex-start;
  }

  /* Title "AMENIDADES" */
  .amenidades-title {
    font-size: 24px !important;      /* smaller so it feels like your mock */
    letter-spacing: 0.06em;
    line-height: 1.1 !important;
    margin: 0 0 4px 0 !important;
    text-align: left !important;
  }

  /* Subtitle under title */
  .amenidades-subtitle {
    font-size: 12px !important;
    line-height: 1.35 !important;
    max-width: 210px !important;
    margin: 0 0 10px 0 !important;
    text-align: left !important;
  }

  /* First divider sits closer to header */
  .amenidades-list {
    border-top: 1px solid #d9d9d9;
  }

  /* Row text to match mock */
  .amenidad-row {
    padding: 10px 0 18px !important;
    border-bottom: 1px solid #d9d9d9;
  }

  .amenidad-title {
    font-size: 20px !important;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    text-align: left;
  }

  /* Image rectangles under each title */
  .amenidad-image-mobile {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background-color: #e7eadb;
  }

  /* Remove any desktop hover image effect on mobile */
  .amenidad-bg-desktop {
    display: none !important;
  }

  /* ===== Fade-in / fade-up animation for rows ===== */
  .amenidad-row {
    opacity: 0;
    transform: translateY(18px);
    animation: amenidadFadeUp 0.6s ease-out forwards;
  }

  /* Staggered delays */
  .amenidad-row:nth-child(1) { animation-delay: 0.05s; }
  .amenidad-row:nth-child(2) { animation-delay: 0.10s; }
  .amenidad-row:nth-child(3) { animation-delay: 0.15s; }
  .amenidad-row:nth-child(4) { animation-delay: 0.20s; }
  .amenidad-row:nth-child(5) { animation-delay: 0.25s; }
  .amenidad-row:nth-child(6) { animation-delay: 0.30s; }
  .amenidad-row:nth-child(7) { animation-delay: 0.35s; }
}

/* Keyframes used above */
@keyframes amenidadFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === MOBILE ALIGNMENT FIX FOR AMENIDADES + GOLF === */
@media (max-width: 768px) {
  /* Remove side padding from the outer container */
  .amenidades-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Give the header consistent inner padding */
  .amenidades-header {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  /* Give each row the SAME padding so "GOLF" lines up with "AMENIDADES" */
  .amenidad-row {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  /* Make sure the mobile image cards also align with the text */
  .amenidad-image-mobile {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }
}

