/* ==========================================================================
   PORTAL AMERICANA - CUSTOM STYLE SYSTEM (CLEAN & NATIVE)
   ========================================================================== */

/* 1. Global Reset & Box Model */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Brand Colors */
  --color-primary: #090440;
  /* Dark Navy Blue */
  --color-purple: #e0b0ff;
  /* Soft Lavender */
  --color-green: #9bf960;
  /* Lime Green */
  --color-orange: #f8952a;
  /* institutional Orange */
  --color-white: #ffffff;

  /* Brand Fonts */
  --font-family: 'Montserrat', sans-serif;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-primary);
  color: var(--color-white);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 2. Main Header */
.main-header {
  background-color: var(--color-primary);
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
}

.header-logo {
  display: block;
  max-width: 100%;
  height: auto;
}

/* 3. Portal Main Content Layout */
.portal-main {
  width: 100%;
}

/* ==========================================================================
   DESKTOP STYLES (default view for screens > 768px)
   ========================================================================== */
.desktop-view {
  display: block;
  background-color: var(--color-primary);
}

.mobile-view {
  display: none;
}

.campus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: calc(100vh - 121px);
  /* Viewport height minus header (~121px) */
  min-height: 700px;
  width: 100%;
}

/* Card General Styling */
.campus-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 30px 60px 30px;
  box-sizing: border-box;
}

/* Premium Background Image Fade Transitions */
.card-overlay-normal,
.card-overlay-hover {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-overlay-normal {
  z-index: 1;
  opacity: 1;
}

.card-overlay-hover {
  z-index: 2;
  opacity: 0;
}

/* Background image mappings */
.card-barranquilla .card-overlay-normal {
  background-image: url('../images/bg-barranquilla-desktop.png');
}

.card-barranquilla .card-overlay-hover {
  background-image: linear-gradient(rgba(9, 4, 64, 0.45), rgba(9, 4, 64, 0.45)), url('../images/bg-barranquilla-desktop-hover.png');
}

.card-medellin .card-overlay-normal {
  background-image: url('../images/bg-medellin-desktop.png');
}

.card-medellin .card-overlay-hover {
  background-image: linear-gradient(rgba(9, 4, 64, 0.45), rgba(9, 4, 64, 0.45)), url('../images/bg-medellin-desktop-hover.jpg');
}

.card-monteria .card-overlay-normal {
  background-image: url('../images/bg-monteria-desktop.png');
}

.card-monteria .card-overlay-hover {
  background-image: linear-gradient(rgba(9, 4, 64, 0.45), rgba(9, 4, 64, 0.45)), url('../images/bg-monteria-desktop-hover.png');
}

/* Active Hover Action */
.campus-card:hover .card-overlay-hover {
  opacity: 1;
}

/* Card Body Content */
.card-body {
  position: relative;
  z-index: 5;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.card-subtitle {
  font-size: 32px;
  font-weight: 400;
  color: var(--color-white);
  text-transform: none;
  letter-spacing: normal;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  margin-bottom: 2px;
}

.card-title {
  font-size: 48px;
  font-weight: 900;
  color: var(--color-white);
  text-transform: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  margin-bottom: 25px;
}

.button-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

/* Core Buttons Style */
.btn {
  font-family: var(--font-family);
  font-size: 20px;
  font-weight: 800;
  color: var(--color-primary);
  border: none;
  border-radius: 16px;
  padding: 15px 45px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.btn:active {
  transform: translateY(-1px);
}

/* Button variants based on campus styles */
.btn-purple {
  background-color: var(--color-purple);
}

.btn-purple:hover {
  background-color: #d196f7;
}

.btn-green {
  background-color: var(--color-green);
}

.btn-green:hover {
  background-color: #8be551;
}

.btn-orange {
  background-color: var(--color-orange);
}

.btn-orange:hover {
  background-color: #e08018;
}

/* ==========================================================================
   MOBILE STYLES (for screens <= 768px)
   ========================================================================== */
@media (max-width: 768px) {

  /* 1. Reset Header on Mobile (Clean look, removes any bottom borders) */
  .main-header {
    border-bottom: none !important;
    box-shadow: none !important;
    padding: 15px 10px;
  }

  .desktop-view {
    display: none;
  }

  .mobile-view {
    display: block;
    background-color: var(--color-primary);
    padding: 15px;
    width: 100%;
  }

  .mobile-section-title {
    font-size: 16px;
    font-weight: 900;
    color: var(--color-white);
    text-align: center;
    text-transform: uppercase;
    margin: 5px 0 20px 0;
    letter-spacing: 0.5px;
  }

  .mobile-campus-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
  }

  /* Mobile Cards Layout */
  .mobile-card {
    position: relative;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    padding: 15px;
    width: 100%;
    min-height: 200px;
    box-sizing: border-box;
  }

  /* Apply dark translucent overlays permanently on mobile for readability */
  .mobile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(9, 4, 64, 0.3);
    border-radius: 8px;
    z-index: 1;
  }

  .mobile-card-spacer {
    height: 30px;
    position: relative;
    z-index: 2;
  }

  .mobile-card-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  /* Mobile Background mappings */
  .card-barranquilla-mobile {
    background-image: url('../images/bg-barranquilla-mobile.png');
  }

  .card-medellin-mobile {
    background-image: url('../images/bg-medellin-mobile.png');
  }

  .card-monteria-mobile {
    background-image: url('../images/bg-monteria-mobile.png');
    /* Clean line removal for Montería Card */
    border-bottom: none !important;
    box-shadow: none !important;
  }

  /* Mobile Text Styling */
  .mobile-card-subtitle {
    font-size: 16px;
    font-weight: 400;
    color: var(--color-white);
    margin-bottom: 2px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.7);
  }

  .mobile-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 15px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.7);
  }

  /* Full width button behavior on mobile */
  .btn-block {
    display: block;
    width: 100%;
    text-align: center;
  }

  .btn-mobile {
    font-size: 14px;
    padding: 10px 0;
    border-radius: 16px;
  }
}