/* ==========================
   VARIABLES
========================== */
:root {
    /* Colors */
    --primary-color: #1A5276;
    --text-color: #555;
    --label-color: #333;
    --title-color: #000;
    --nav-bg-color: rgba(122, 122, 122, 0.795);
    --overlay-color: rgba(0,0,0,0.45);
    --overlay-blur: 3px;

    /* Font sizes */
    --title-size: 1.4rem;
    --card-title-size: 1.3rem;
    --meta-size: 0.95rem;
    --input-size: 1rem;

    /* Spacing & radius */
    --card-padding: 20px;
    --card-radius: 14px;
    --popup-padding: 24px;
    --popup-radius: 16px;
}

/* ==========================
   GLOBAL RESET
========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================
   BODY
========================== */
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: var(--text-color);
    background: #fff;
}

/* ==========================
   MODERN NAVBAR
========================== */
.main-header {
  background: white;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;

  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 64px;
}

/* Brand (ERTI) */
.brand {
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--primary-color);
  letter-spacing: 0.5px;
}

/* Nav links */
.main-nav {
  display: flex;
  gap: 28px;
}

.main-nav a {
  position: relative;
  text-decoration: none;
  color: #444;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 4px 0;
  transition: color 0.2s ease;
}

/* Animated underline */
.main-nav a::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.25s ease;
}

.main-nav a:hover {
  color: var(--primary-color);
}

.main-nav a:hover::after {
  width: 100%;
}

/* Active page */
.main-nav a.active {
  color: var(--primary-color);
}

.main-nav a.active::after {
  width: 100%;
}

/* ==========================
   HEADINGS
========================== */
h1, #popup-content h2, .card-title {
    margin: 0 0 12px 0; /* default bottom margin for spacing */
    font-size: var(--title-size);
    color: var(--primary-color);
}

main h1 {
  font-size: 1.8rem;
  margin: 2rem 0 1rem;
  text-align: center;
  color: var(--primary-color);
}


/* Make the wrapper <div> full-width */
h1:first-of-type + #navigation-menu {
    margin-top: 0;            /* remove any gap above nav */
}

/* ==========================
   LAYOUT
========================== */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
  }

.page-layout {
    display: flex;
    justify-content: center;
    gap: 1rem;
}
.ad {
    flex: 0 0 150px;
}
.card-container {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

/* ==========================
   ACTIVE FILTER CHIPS
========================== */

#active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 4px 10px;
  border-radius: 16px;

  background: #e8f1f7;
  color: var(--primary-color);

  font-size: 0.8rem;
  font-weight: 500;
}

.filter-chip button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

/* ==========================
   CARDS (activities and training)
========================== */
.card-title {
    grid-column: 1 / -1;
    font-size: var(--card-title-size);
    color: var(--title-color);
    margin-bottom: 2px;
    line-height: 1.2;
}

.card-logo {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 80px;
    height: 80px;
    padding: 10px;
    object-fit: contain;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    z-index: 10;
}

.card-owner {
    font-size: 0.85rem;
    color: #777;
    margin-top: -6px;
    margin-bottom: 8px;
  }

.meta {
    color: #666;
    font-size: 0.88rem;       /* slightly smaller */
    line-height: 1.35;       /* key for breathing room */
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.meta .label {
    font-weight: 500;
    color: #333;
}
.meta.social a {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
  }

.social-icon-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.social-icon-wrapper {
    display: inline-block;
    width: 16px;
    height: 16px;
    overflow: hidden;
}

.location-row.clickable {
    cursor: pointer;
  }
  
  .location-row.clickable:hover span:last-child {
    text-decoration: underline;
  }
  
  .location-row.clickable:hover {
    opacity: 0.85;
  }

  .location-row.clickable:active {
    transform: translateY(1px);
  }

/* Normalize all social / meta icons */
.social-icon {
    width: 20px;
    height: 20px;
  
    display: block;
    object-fit: contain;
  
    /* Normalize visual weight across different SVGs */
    transform: scale(0.85);
  
    /* Optional: smoother look */
    transition: transform 0.15s ease;
  }
  
  /* Slight hover polish (optional) */
  .meta.social a:hover .social-icon {
    transform: scale(0.95);
  }

.organizador-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}
.organizador-link:hover {
    text-decoration: underline;
}

.reservar-btn {
    padding: 6px 12px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 4px;
}  

/* Make Ubicación and Reservar identical */
.card-actions .reservar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 6px 12px;
    min-height: 32px;

    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;

    border-radius: 6px;
    background-color: var(--primary-color);
    color: white;

    border: none;
    text-decoration: none;
    cursor: pointer;
}

.card-actions .reservar-btn:hover {
    background-color: #0056b3;
    text-decoration: none;
}

.card-actions {
  display: flex;
  gap: 10px;
}

/* ==========================
   POPUP
========================== */
#popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: none;
    background: var(--overlay-color);
    backdrop-filter: blur(var(--overlay-blur));
}
#popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  background: white;
  border-radius: var(--popup-radius);
  padding: var(--popup-padding);

  width: 90%;
  max-width: 420px;
  max-height: 85vh;

  overflow: hidden; /* 🔥 popup itself does NOT scroll */

  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  z-index: 1000;
  display: none;
}

#popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #888;
}
#popup-close:hover { color: var(--primary-color); }

.popup-logo {
    display: block;
    max-width: 100px;
    margin: 0 auto 12px auto;
}

#popup .label {
    font-weight: 600;
    color: var(--label-color);
}

#popup p {
    margin-bottom: 6px;
    line-height: 1.4;
}

#popup h2 {
    margin-bottom: 12px;
}

/* Center social icons inside organizer popup */
#popup .meta.social {
    display: flex;
    justify-content: center;   /* horizontal center */
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}

/* Contact buttons inside organizer popup */
#popup .popup-contact-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 14px 0;
    flex-wrap: nowrap;
    max-width: 100%;
}

#popup .popup-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: #f4f6f8;
    color: #333;
    text-decoration: none;
    font-size: clamp(0.62rem, 2.2vw, 0.85rem);
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;      /* 🔑 no line breaks */
}

/* Prevent long phone/email from breaking layout */
#popup .popup-contact-btn > span:last-child {
    white-space: nowrap;     /* 🔒 force single line */
    flex-shrink: 1;
    min-width: 0;
}

#popup .popup-contact-btn:hover {
    background-color: #e6ebf0;
    transform: translateY(-1px);
}

#popup .popup-contact-btn .social-icon {
    display: block;              /* removes inline baseline behavior */
    position: relative;
    top: 0;                    /* optical correction */
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
/* ==========================
   LOCATION MODAL
========================== */
.location-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
  }
  
  .location-overlay.open {
    display: flex;
  }
  
  /* Modal card */
  .location-card {
    background: white;
    border-radius: 14px;
    padding: 20px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
    position: relative;
  }
  
  /* Title */
  .location-card h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
  }
  
  /* Generic text */
  .location-card p {
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-color);
  }
  
  /* Embedded map */
  .location-card iframe {
    width: 100%;
    height: 220px;
    border: 0;
    border-radius: 10px;
    margin-bottom: 12px;
  }
  
  /* Close button */
  .location-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #888;
  }
  
  .location-close:hover {
    color: var(--primary-color);
  }
  
  /* Actions area (if used later) */
  .location-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
  }
  
  /* Header row: title + nav icons (future-proof) */
  .location-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }
  
  /* Address row: icon + text + map links */
  .location-address-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }
  
  .location-address-row p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-color);
  }
  
  #location-address {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
  }
  
  #location-nav-links {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  
  /* ==========================
     CLICKABLE LOCATION PILL
  ========================== */
  /* Soft button appearance */
  .location-row.clickable {
    margin-left: 24px;
    padding: 0px 8px;
    min-height: 22px;
    align-items: center;
    border-radius: 8px;
    background-color: #f4f6f8;
    width: fit-content;
    font-size: 0.70rem;   /* slightly smaller than .meta (0.88rem) */
    gap: 1.5px;   /* ↓ smaller space between pin and text */
    cursor: pointer;
  
    transition:
      background-color 0.15s ease,
      box-shadow 0.15s ease,
      transform 0.05s ease;
  }
  
  /* Hover feedback: whole pill reacts */
  .location-row.clickable:hover {
    background-color: #e9eef3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }
  
  /* Active feedback: pressed feel */
  .location-row.clickable:active {
    background-color: #dde5ec;
    transform: translateY(1px);
  }
  
  /* Text styling (interactive but not loud) */
  .location-row.clickable .location-text {
    color: var(--primary-color);
    font-weight: 500;
  }
  

  /* Prevent underline inside clickable location pill */
.location-row.clickable:hover,
.location-row.clickable:hover * {
  text-decoration: none !important;
}

/* Make location pin match text height */
.location-row.clickable .social-icon-wrapper {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
  }
  
  .location-row.clickable .social-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

/* ==========================
    MOBILE NAV
========================== */

.current-page,
.menu-toggle{
  display:none;
}

.menu-toggle{
  display:none;
  background:none;
  border:none;
  cursor:pointer;
  padding:6px;
  color:#000;
}

.menu-toggle span{
  display:block;
  width:20px;
  height:2px;
  background:#000;
  margin:4px 0;
  transition:all .25s ease;
}


/* ==========================
   MOBILE ADJUSTMENTS
========================== */
/* Very small screens (phones) */
@media (max-width: 480px) {

    /* Logo smaller on mobile */
    .card-logo {
      width: 64px;
      height: 64px;
      padding: 8px;
    }
  
    /* Prevent long phone/email from overflowing popup buttons */
    #popup .popup-contact-btn > span:last-child {
      max-width: 150px;
    }
  
    /* Slightly smaller social icons inside cards */
    .actividad .meta .social-icon-wrapper {
      width: 14px;
      height: 14px;
    }
  }
  
  /* Small screens (phones & small tablets) */
  @media (max-width: 600px) {
  
    /* Banner moves into content flow */
    .card-banner {
      position: static;
      top: auto;
      right: auto;
  
      width: 100%;
      max-width: 260px;
      aspect-ratio: 3 / 4;
  
      margin: 0 auto 12px auto;
    }
  
    /* Card layout adapts */
    .card-left {
      padding-right: 0;
      padding-bottom: 0;
    }
  
    .location-address-row {
      gap: 8px;
    }
  
    /* Filters layout adjustments */
    .search-group {
      grid-column: span 1;
    }
  
    .clear-filters-btn {
      width: 100%;
    }
  
    .filters-bar {
      gap: 12px;
    }
  }
  
  @media (max-width: 600px) {
    .description-row {
      flex-direction: column;
    }
  
    .description-row .card-actions {
      align-items: flex-end;
    }
  }

  @media (max-width:640px){

    .nav-container{
      display:grid;
      grid-template-columns:auto 1fr auto;
      align-items:center;
    }
  
    .current-page{
      display:block;
      font-weight:600;
      text-align:right;   /* pushes it toward the hamburger */
      padding-right:6px;  /* tiny spacing from hamburger */
      color:#444;
    }
  
    .menu-toggle{
      display:block;
    }
  
    .main-nav{
      display:none;
      position:absolute;
      top:64px;
      left:0;
      width:100%;
      background:white;
      flex-direction:column;
      padding:8px 0;
      border-bottom:1px solid #eee;
    }
  
    .main-nav.open{
      display:flex;
    }
  
    .main-nav a{
      padding:12px 24px;
    }

    .main-nav a::after{
      display:none; /* removes underline animation */
    }
  
    .main-nav a.active{
      background:#f4f6f8;
      color:var(--primary-color);
      font-weight:600;
    }

    .menu-toggle.open span:nth-child(1){
      transform:translateY(6px) rotate(45deg);
    }
    
    .menu-toggle.open span:nth-child(2){
      opacity:0;
    }
    
    .menu-toggle.open span:nth-child(3){
      transform:translateY(-6px) rotate(-45deg);
    }    

    .brand {
      margin-left: 10px;
    }
  
  }