/* ===================================================================
   MyFIU Landing Page - Design System
   Tailwind CSS Hybrid: CSS Variables for tokens + Tailwind for layout
   Fonts loaded via CDN in index.html (Proxima Nova + Furore)
   =================================================================== */

/* ===================================================================
   Design Tokens as CSS Variables
   =================================================================== */
:root {
  /* Brand Colors */
  --brand-fiu-blue: #091f3f;
  --brand-gold: #b7872d;
  --brand-gold-200: #b7872d;

  /* Surface Colors */
  --surface-primary: #f2f2f7;
  --surface-secondary: #ffffff;
  --surface-alert-banner-multiple: #ffffff;
  --surface-alert-icon-outage: #ebd1da;
  --surface-alert-icon-multiple: #091f3f;

  /* Status Colors */
  --status-red-10: #f1dfe4;
  --status-orange-10: #fef3e6;
  --status-blue-10: #dae3f0;

  /* Text Colors */
  --text-primary: #091f3f;
  --text-secondary: #767676;
  --text-invert: #ffffff;
  --text-negative: #e10000;
  --text-alert: #fd9738;
  --text-info: #354ed4;

  /* Button Colors */
  --button-primary: #091f3f;
  --button-emphasis: #354ed4;
  --button-tertiary: #ffffff;

  /* Border Colors */
  --border-primary: #cfcfcf;

  /* Icon Colors */
  --icon-primary: #091f3f;
  --icon-inverted: #ffffff;
  --icon-tertiary: #b7872d;
  --icon-category-link: #354ed4;

  /* Spacing Scale */
  --spacing-4: 4px;
  --spacing-8: 8px;
  --spacing-12: 12px;
  --spacing-16: 16px;
  --spacing-20: 20px;
  --spacing-24: 24px;
  --spacing-32: 32px;
  --spacing-40: 40px;
  --spacing-48: 48px;
  --spacing-80: 80px;

  /* Border Radius */
  --radius-8: 8px;
  --radius-12: 12px;
  --radius-16: 16px;
  --radius-20: 20px;
  --radius-24: 24px;
  --radius-32: 32px;
  --radius-48: 48px;

  /* Typography - Proxima Nova (from Typekit CDN) */
  --font-family: 'proxima-nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Font Family Aliases (Figma text style collections) */
  --font-family-sm:  'proxima-nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-m:   'proxima-nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-l:   'proxima-nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-3xl: 'proxima-nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Font Sizes */
  --font-size-14: 14px;
  --font-size-16: 16px;
  --font-size-18: 18px;
  --font-size-24: 24px;
  --font-size-32: 32px;
  --font-size-40: 40px;

  /* Line Heights */
  --line-height-16: 16px;
  --line-height-18: 18px;
  --line-height-20: 20px;
  --line-height-26: 26px;
  --line-height-34: 34px;
  --line-height-40: 42px;

  /* Font Weights */
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  /* Additional Colors */
  --status-yellow-10: #f1eae5;
  --text-warning: #9f5109;
  --surface-input: #e3e3e8;
  --neutral-400: #d4d4dc;
  --radius-40: 40px;

  /* Shadows */
  --shadow-card: 0px 2px 25px -7px rgba(0, 0, 0, 0.15);
  --shadow-elevation: 0px 1px 5px 0px rgba(0, 0, 0, 0.25);
  --shadow-text: 1px 1px 1px rgba(0, 0, 0, 0.9);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

/* ===================================================================
   Reset & Base Styles
   Wrapped in @layer base so Tailwind v4 utilities (@layer utilities)
   can properly override these resets in the CSS cascade.
   =================================================================== */
@layer base {
  html {
    font-size: 16px;
    scroll-behavior: smooth;
  }

  body {
    font-family: var(--font-family);
    background-color: var(--surface-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  .page-wrapper {
    overflow-x: clip;
    width: 100%;
  }

  a {
    text-decoration: none;
    color: inherit;
  }

  button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
  }

  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  ul, ol {
    list-style: none;
  }
}

/* Skip Navigation Link (WCAG 2.4.1) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--brand-fiu-blue);
  color: var(--text-invert);
  padding: 12px 24px;
  border-radius: var(--radius-24);
  font-family: var(--font-family);
  font-size: var(--font-size-16);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 16px;
}

/* ===================================================================
   Accessibility: Focus Indicators (WCAG 2.4.7)
   =================================================================== */
:focus-visible {
  outline: 2px solid var(--brand-fiu-blue);
  outline-offset: 2px;
}

#search-input:focus-visible {
  outline: none;
}

/* ===================================================================
   Responsive Typography
   =================================================================== */
.section-title {
  font-family: var(--font-family-m);
  font-size: var(--font-size-32);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-34);
  text-align: center;
}

.discover-label {
  font-family: var(--font-family-3xl);
  font-size: var(--font-size-24);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-26);
  text-align: center;
}

@media (max-width: 768px) {
  .section-title {
    font-size: 28px;
    line-height: 32px;
  }
  .discover-label {
    font-size: var(--font-size-18);
    line-height: 22px;
  }
  #login-btn {
    font-size: var(--font-size-14);
    line-height: var(--line-height-16);
    padding-inline: var(--spacing-16);
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 28px;
    line-height: 32px;
  }
  .discover-label {
    font-size: 20px;
    line-height: 20px;
  }
}

/* ===================================================================
   Typography Utilities — Figma Text Styles (Collection 3)
   Named styles mapping to Figma's text style tokens.
   Usage: <h2 class="type-32">Section Title</h2>
   =================================================================== */
.type-14 {
  font-family: var(--font-family-sm);
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-16);
  letter-spacing: 0;
}

.type-16 {
  font-family: var(--font-family-m);
  font-size: var(--font-size-16);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-18);
  letter-spacing: 0;
}

.type-18 {
  font-family: var(--font-family-l);
  font-size: var(--font-size-18);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-20);
  letter-spacing: 0;
}

.type-24 {
  font-family: var(--font-family-3xl);
  font-size: var(--font-size-24);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-26);
  letter-spacing: 0;
}

.type-32 {
  font-family: var(--font-family-m);
  font-size: var(--font-size-32);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-34);
  letter-spacing: 0;
}

.type-40 {
  font-family: var(--font-family-3xl);
  font-size: var(--font-size-40);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-40);
  letter-spacing: 0;
}

/* ===================================================================
   Nav Bottom Feathering
   Thin gradient fade at the bottom of the sticky header so content
   blends smoothly as it scrolls underneath.
   =================================================================== */
nav.sticky {
  background: linear-gradient(to bottom, var(--surface-primary) calc(100% - 12px), transparent);
}

/* ===================================================================
   Persona Glider
   =================================================================== */
.persona-glider {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  border-radius: var(--radius-16);
  background: rgba(197, 201, 211, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: none;
  pointer-events: none;
  opacity: 0;
  transform: translateX(0);
  transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1),
              width 420ms cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 220ms ease;
}

/* ===================================================================
   Embla Carousel - Design Tokens (Figma Specs)
   =================================================================== */
:root {
  /* Hero Carousel Sizes */
  --hero-center-width: 918px;
  --hero-center-height: 400px;
  --hero-side-width: 823px;
  --hero-side-height: 320px;
  --hero-gap: 40px;
  --hero-side-scale: 0.80;
  --hero-side-opacity: 1;

  /* Quick Links Sizes */
  --quicklinks-card-width: 218px;
  --quicklinks-card-height: 56px;
  --quicklinks-icon-size: 24px;
  --quicklinks-gap: 40px;

  /* Apps Sizes */
  --apps-card-width: 200px;
  --apps-card-height: 146px;
  --apps-icon-size: 48px;
  --apps-gap: 46px;

  /* Discover Sizes */
  --discover-card-width: 376px;
  --discover-card-height: 520px;
  --discover-gap: 48px;

  /* Arrow Button Size */
  --arrow-size: 40px;

  /* Carousel Edge Fade — sized so the fade aligns with the hero card edges */
  --carousel-fade-width: clamp(12px, 3vw, 48px);
}

/* ===================================================================
   Embla Carousel - Base Styles
   =================================================================== */
.embla {
  position: relative;
  width: 100%;
}

.embla__viewport {
  overflow: hidden;
  width: 100%;
}

.embla__container {
  display: flex;
  touch-action: pan-y pinch-zoom;
}

.embla__slide {
  flex: 0 0 auto;
  min-width: 0;
}

/* ===================================================================
   Hero Carousel Styles
   =================================================================== */
#hero-carousel {
  padding-bottom: 0;
}

#hero-carousel .embla__container {
  align-items: center;
  /* No gap — negative margins on slides compensate for scale(0.8) whitespace
     so the visual gap between content edges is exactly 40px */
}

#hero-carousel .embla__slide {
  flex: 0 0 var(--hero-center-width);
  max-width: var(--hero-center-width);
  /* Overlap = 40px gap - (slide_width * 0.1 * 2) = 40 - 183.6 = -51.8px per pair.
     Applied as right-margin only so slide 0 starts flush at container edge,
     preventing Embla loop-mode from mis-centering on initial render. */
  margin-right: -51.8px;
}

#hero-carousel .embla__slide__inner {
  transition: transform var(--transition-normal), opacity var(--transition-normal);
  transform-origin: center center;
  width: 100%;
  height: var(--hero-center-height);
}

/* Side slides scale effect (applied via JS) */
#hero-carousel .embla__slide:not(.is-active) .embla__slide__inner {
  transform: scale(var(--hero-side-scale));
  opacity: var(--hero-side-opacity);
}

#hero-carousel .embla__slide.is-active .embla__slide__inner {
  transform: scale(1);
  opacity: 1;
}

/* Hero Pagination Dots */
.embla__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-top: var(--spacing-8);
}

.embla__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border-primary);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.embla__dot.is-active {
  width: 24px;
  border-radius: 4px;
  background-color: var(--brand-fiu-blue);
}

/* Hero Responsive */
@media (max-width: 1400px) {
  #hero-carousel .embla__slide {
    flex: 0 0 80vw;
    max-width: 80vw;
    margin-right: calc(40px - 8vw);    /* 40px visual gap with 80vw slides */
  }
  #hero-carousel .embla__slide__inner {
    height: 350px;
  }
}

@media (max-width: 1024px) {
  #hero-carousel .embla__slide {
    flex: 0 0 85vw;
    max-width: 85vw;
    margin-right: calc(40px - 8.5vw);  /* 40px visual gap with 85vw slides */
  }
  #hero-carousel .embla__slide__inner {
    height: 300px;
  }
}

@media (max-width: 768px) {
  #hero-carousel .embla__slide {
    flex: 0 0 90vw;
    max-width: 90vw;
    margin-right: calc(40px - 9vw);    /* 40px visual gap with 90vw slides */
  }
  #hero-carousel .embla__slide__inner {
    height: 250px;
  }
}

/* ===================================================================
   Arrow Navigation Buttons (Shared Styles)
   =================================================================== */
.embla__button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-primary);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.embla__button:hover:not(:disabled) {
  transform: translateY(-50%);
}

.embla__button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.embla__button--prev {
  left: 0;
}

.embla__button--next {
  right: 0;
}

/* Hide arrows on mobile */
@media (max-width: 768px) {
  .embla__button {
    display: none;
  }
}

/* ===================================================================
   Quick Links Carousel Styles
   =================================================================== */
.quicklink-card {
  min-width: var(--quicklinks-card-width);
  height: var(--quicklinks-card-height);
  border-radius: 40px;
  white-space: nowrap;
  padding-inline: 20px;
}

.quicklink-card__icon {
  width: var(--quicklinks-icon-size);
  height: var(--quicklinks-icon-size);
}

.quicklink-card__label {
  font-family: var(--font-family-m);
  font-size: var(--font-size-16);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-18);
}

@media (max-width: 768px) {
  .quicklink-card__label {
    font-size: var(--font-size-14);
    line-height: var(--line-height-16);
  }
}

@media (max-width: 480px) {
  .quicklink-card {
    border-radius: 32px;
  }
  .quicklink-card__label {
    font-size: 0.8125rem;
    line-height: 1rem;
  }
}

.embla--quicklinks {
  display: flex;
  align-items: center;
}

.embla--quicklinks .embla__viewport {
  flex: 1;
  margin: 0 16px;
}

.embla--quicklinks.is-centered .embla__container {
  justify-content: center;
}

.embla--quicklinks .embla__slide {
  flex: 0 0 auto;
  margin-right: var(--quicklinks-gap);
}

.embla--quicklinks .embla__button--prev {
  position: relative;
  left: auto;
  transform: none;
}

.embla--quicklinks .embla__button--next {
  position: relative;
  right: auto;
  transform: none;
}

.embla--quicklinks .embla__button:hover:not(:disabled) {
  transform: none;
}

@media (max-width: 1024px) {
  :root {
    --quicklinks-card-width: 190px;
    --quicklinks-card-height: 50px;
    --quicklinks-icon-size: 22px;
    --quicklinks-gap: 28px;
  }
}

@media (max-width: 768px) {
  :root {
    --quicklinks-card-width: 165px;
    --quicklinks-card-height: 46px;
    --quicklinks-icon-size: 20px;
    --quicklinks-gap: 12px;
  }

  /* Match quick links & apps section padding to the hero card edge (5vw each side) */
  section[aria-label="Quick links"],
  section[aria-label="Apps"] {
    padding-left: 5vw;
    padding-right: 5vw;
  }

  .embla--quicklinks .embla__viewport {
    margin: 0;
  }
}

@media (max-width: 480px) {
  :root {
    --quicklinks-card-width: 148px;
    --quicklinks-card-height: 42px;
    --quicklinks-icon-size: 18px;
    --quicklinks-gap: 10px;
  }
}

/* ===================================================================
   Apps Carousel Styles
   =================================================================== */
.app-card {
  width: var(--apps-card-width);
  height: var(--apps-card-height);
  border-radius: var(--radius-32);
  overflow: hidden;
}

@media (max-width: 480px) {
  .app-card {
    border-radius: 24px;
  }
}

.app-card__icon {
  width: var(--apps-icon-size);
  height: var(--apps-icon-size);
}


.app-card__label {
  font-family: var(--font-family-l);
  font-size: var(--font-size-18);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-20);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .app-card__label {
    font-size: var(--font-size-14);
    line-height: 1.1rem;
  }
}

@media (max-width: 480px) {
  .app-card__label {
    font-size: 0.8125rem;
    line-height: 1rem;
  }
}

.embla--apps {
  display: flex;
  align-items: center;
}

.embla--apps .embla__viewport {
  flex: 1;
  margin: 0 16px;
}

.embla--apps .embla__container {
  /* No gap — use margin-right on slides for Embla loop compatibility */
}

.embla--apps.is-centered .embla__container {
  justify-content: center;
}

.embla--apps .embla__slide {
  flex: 0 0 var(--apps-card-width);
  margin-right: var(--apps-gap);
}

.embla--apps .embla__button--prev {
  position: relative;
  left: auto;
  transform: none;
}

.embla--apps .embla__button--next {
  position: relative;
  right: auto;
  transform: none;
}

.embla--apps .embla__button:hover:not(:disabled) {
  transform: none;
}

@media (max-width: 1024px) {
  :root {
    --apps-card-width: 170px;
    --apps-card-height: 126px;
    --apps-icon-size: 40px;
    --apps-gap: 32px;
  }
}

@media (max-width: 768px) {
  :root {
    --apps-card-width: 140px;
    --apps-card-height: 108px;
    --apps-icon-size: 36px;
    --apps-gap: 20px;
  }
  .embla--apps .embla__viewport {
    margin: 0;
  }
}

@media (max-width: 480px) {
  :root {
    --apps-card-width: 136px;
    --apps-card-height: 96px;
    --apps-icon-size: 32px;
    --apps-gap: 16px;
  }
}

/* ===================================================================
   Discover Carousel Styles
   =================================================================== */
.embla--discover {
  display: flex;
  align-items: center;
}

.embla--discover .embla__viewport {
  flex: 1;
  margin: 0 16px;
}

.embla--discover .embla__container {
  gap: var(--discover-gap);
}

.embla--discover.is-centered .embla__container {
  justify-content: center;
}

.embla--discover .embla__slide {
  flex: 0 0 calc(30% - var(--discover-gap) * 3 / 4);
  /* 4 columns: (100% - 3 gaps) / 4 = 25% - 24px */
}

.embla--discover .embla__button--prev {
  position: relative;
  left: auto;
  transform: none;
}

.embla--discover .embla__button--next {
  position: relative;
  right: auto;
  transform: none;
}

.embla--discover .embla__button:hover:not(:disabled) {
  transform: none;
}

.embla--discover .embla__button:disabled {
  display: none;
}

/* Discover Responsive Columns */
@media (max-width: 1280px) {
  .embla--discover .embla__slide {
    flex: 0 0 calc(33.333% - var(--discover-gap) * 2 / 3);
  }
}

@media (max-width: 1024px) {
  .embla--discover .embla__slide {
    flex: 0 0 calc(50% - var(--discover-gap) / 2);
  }
}

@media (max-width: 768px) {
  .embla--discover .embla__viewport {
    margin: 0;
    overflow: visible;
  }
  .embla--discover .embla__container {
    flex-direction: column;
    transform: none !important;
    gap: 32px;
  }
  .embla--discover .embla__slide {
    flex: 0 0 auto;
  }
  .embla--discover .embla__button {
    display: none;
  }
}

/* ===================================================================
   Carousel Edge Fade (Apps & Quick Links)
   =================================================================== */
.embla--quicklinks:not(.is-centered) .embla__viewport,
.embla--apps:not(.is-centered) .embla__viewport {
  -webkit-mask-image: linear-gradient(to right, transparent, black var(--carousel-fade-width), black calc(100% - var(--carousel-fade-width)), transparent);
  mask-image: linear-gradient(to right, transparent, black var(--carousel-fade-width), black calc(100% - var(--carousel-fade-width)), transparent);
}

/* ===================================================================
   Loading State
   =================================================================== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===================================================================
   Bottom Sheet
   =================================================================== */
#persona-bottom-sheet-overlay.is-open {
  opacity: 1;
}

#persona-bottom-sheet.is-open {
  translate: 0;
}

/* ===================================================================
   Utility Classes
   =================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hide native search input clear button (we use a custom one) */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* Hide scrollbar utility for horizontal scroll sections */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ===================================================================
   AppArmor Emergency Notifications
   The AppArmor script injects HTML with .emergency/.row/.columns
   classes. These styles are needed because Tailwind Preflight resets
   the injected h2/p elements and this project lacks the Foundation
   CSS framework that fiu.edu uses to style them.
   =================================================================== */
#AppArmorAlertID_35 {
  height: auto !important;
}

#AppArmorAlertID_35 .emergency {
  background-color: #962604;
  color: #ffffff;
  padding: 1.5rem 0;
  margin-bottom: 1.5rem;
}

#AppArmorAlertID_35 .row {
  max-width: 75rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

#AppArmorAlertID_35 h2 {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

#AppArmorAlertID_35 p {
  color: #ffffff;
  font-size: 1.25rem;
  line-height: 1.5;
  margin-bottom: 0;
}

/* ===================================================================
   Print Styles
   =================================================================== */
@media print {
  .nav,
  #search-overlay {
    display: none;
  }
}
