:root{
  --berkeley-blue: #092c69;
  --berkeley-gold: #f3c212;
  --navy-deep: #001f3f;
}

.font-atkinson { font-family: 'Roboto', sans-serif; }

.text-berkeley-blue { color: var(--berkeley-blue); }
.bg-berkeley-blue   { background-color: var(--berkeley-blue); }
.text-berkeley-gold { color: var(--berkeley-gold); }
.bg-berkeley-gold   { background-color: var(--berkeley-gold); }

html { scroll-behavior: smooth; }
body { font-family: 'Roboto', sans-serif; }
p { font-size: 1.05rem; }

/* Fade in animation for page content */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Global smooth transitions for links */
a {
  transition: all 0.25s ease;
}

header nav a { transition: color 0.15s ease, background-color 0.15s ease; }

/* Hero background with parallax - full viewport, accounting for header */
.hero {
  position: relative;
  color: #fff;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center calc(50% + var(--hero-offset, 0px));
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 4rem; /* Account for header */
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    45deg,
   rgba(14, 75, 181, 0.8),
    rgba(10, 31, 166, 0.8)
  );
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero-title-shadow { text-shadow: 0 2px 12px rgba(0,0,0,0.35); }

@media (prefers-reduced-motion: reduce) {
  .hero { background-position: center 50% !important; background-attachment: scroll; }
  .fade-in { animation: none; }
}

/* Page header (for subpages) - hero style */
.page-header {
  position: relative;
  padding-top: 10rem;
  padding-bottom: 6rem;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center 70%; /* Focus on lower part of image to see campus */
  background-attachment: fixed;
  color: #fff;
  text-align: center;
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    45deg,
    rgba(14, 75, 181, 0.8),
    rgba(10, 31, 166, 0.8)
  );
  pointer-events: none;
  z-index: 0;
}
.page-header > * { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .page-header { background-attachment: scroll; }
}

@media (max-width: 768px) {
  .page-header {
    padding-top: 7rem;
    padding-bottom: 4rem;
  }
}

/* Section titles */
.section-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--berkeley-blue);
  margin-bottom: 0.75rem;
  position: relative;
}

/* Page title styling (white text on hero background) */
.page-title {
  font-size: 3rem;
  font-weight: 800;
  color: white;
  margin-bottom: 1rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.page-title-underline {
  width: 96px;
  height: 4px;
  background: var(--berkeley-gold);
  margin: 0 auto;
}

@media (max-width: 768px) {
  .page-title {
    font-size: 2rem;
  }
}

.nonline-section-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--berkeley-blue);
  margin-bottom: 0.75rem;
  position: relative;
}

/* Base background */
.bg { background: #ffffff; }

/* --- Cards Layout --- */
.info-cards {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 2rem;
  row-gap: 2rem;
  align-items: stretch;
}
@media (min-width: 768px) {
  .info-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2rem;
  }
}

.card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(9, 44, 105, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-color: rgba(9, 44, 105, 0.2);
}

/* --- Buttons --- */
.btn-gold {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  color: black;
  background-color: var(--berkeley-gold);
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-gold:hover {
  background-color: #d4a810;
}

.btn-gold:active {
  background-color: #b8920d;
}
.btn-light {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  color: #fff;
  background: transparent;
  border: 2px solid #fff;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-light:hover {
  background: rgba(255, 255, 255, 0.15);
}
.btn-light:active {
  background: rgba(255, 255, 255, 0.25);
}

.btn-blue {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  font-weight: 800;
  color: #fff;
  background: var(--berkeley-blue);
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-blue:hover {
  background: #0a3178;
}
.btn-blue:active {
  background: #0b3685;
}

/* --- Header / Hamburger --- */
.header-nav {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 50 !important;
}

header .max-w-7xl {
  position: relative;
}
#menu-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

/* Mobile-only hamburger shadow */
@media (max-width: 767.98px) {
  .hamburger {
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25),
                0 4px 12px rgba(0, 0, 0, 0.15);
    background: #fff;
  }
}

/* Disable shadow on desktop */
@media (min-width: 768px) {
  .hamburger {
    box-shadow: none !important;
  }
}

/* --- Full-rectangle clickable header links --- */
header nav ul {
  height: 100%;
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) {
  header nav ul {
    flex-direction: row;
    height: 100%;
  }
}

header nav .nav-item {
  display: flex;
  align-items: stretch;
  height: 100%;
}

header nav ul { height: 100%; }
@media (min-width: 768px) {
  header nav ul { display: flex; align-items: stretch; }
}

header nav li { height: 100%; display: flex; }

header nav .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: background-color .2s ease, color .2s ease;
}

/* Desktop hover and active states */
@media (min-width: 768px) {
  header nav .nav-link:hover {
    background-color: rgba(9, 44, 105, 0.05);
  }

  header nav .nav-link.active {
    background-color: rgba(243, 194, 18, 0.15);
    color: var(--berkeley-blue);
    font-weight: 700;
  }
}

@media (max-width: 1024px) {
  header nav .nav-link {
    font-size: 0.8rem;
  }
  .truncate {
    font-size: 1.25rem;
  }
  .text-3xl {
    font-size: 3rem;
  }
}

@media (max-width: 860px) {
  header nav .nav-link {
    font-size: 0.8rem;
  }
  .truncate {
    font-size: 1rem;
  }
  .text-3xl {
    font-size: 2.5rem;
  }
}

/* Fix header layout and prevent overlap */
.header-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-nav .flex.items-center.space-x-3 {
  max-width: 60%;
  overflow: hidden;
}

.header-nav .flex.items-center.space-x-3 span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fix header text on very small screens */
@media (max-width: 768px) {
  .header-nav .flex.items-center.space-x-3 {
    max-width: 70%;
  }

  header .flex.items-center.space-x-3 span {
    font-size: 0.875rem !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }

  header .flex.items-center.space-x-3 img {
    height: 2.25rem !important;
  }
}

@media (max-width: 640px) {
  .header-nav .flex.items-center.space-x-3 {
    max-width: 65%;
  }

  header .flex.items-center.space-x-3 span {
    font-size: 0.75rem !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }

  header .flex.items-center.space-x-3 img {
    height: 2rem !important;
  }
}

@media (max-width: 480px) {
  .header-nav .flex.items-center.space-x-3 {
    max-width: 60%;
  }

  header .flex.items-center.space-x-3 span {
    font-size: 0.65rem !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }

  header .flex.items-center.space-x-3 img {
    height: 1.75rem !important;
  }
}

header nav .nav-link:focus-visible {
  outline: 2px solid var(--berkeley-gold);
  outline-offset: -2px;
}

/* Mobile menu */
.mobile-nav-link {
  display: block;
  width: 100%;
  padding: 1rem 1.5rem;
  text-align: left;
  background: #ffffff;
  text-decoration: none;
  color: inherit;
  transition: background-color .2s ease;
}

.mobile-nav-link:hover {
  background-color: rgba(9, 44, 105, 0.05);
}

.mobile-nav-link.active {
  background-color: rgba(243, 194, 18, 0.2);
  color: var(--berkeley-blue);
  font-weight: 700;
  border-left: 4px solid var(--berkeley-gold);
}

.mobile-menu {
  transition: max-height 0.3s ease;
  max-height: 0;
  overflow: hidden;
}

.mobile-menu:not(.hidden) {
  max-height: 500px;
}

/* Mobile hamburger styles */
@media (max-width: 767.98px) {
  #nav-menu ul {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #ffffff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    z-index: 1000;
  }

  #nav-menu li {
    width: 100%;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
  }

  #nav-menu a.nav-link {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    text-align: left;
    background: #ffffff;
  }

  #nav-menu a.nav-link:hover {
    background-color: rgba(9, 44, 105, 0.05);
  }

  #nav-menu a.nav-link.active {
    background-color: rgba(243, 194, 18, 0.2);
    color: var(--berkeley-blue);
    font-weight: 700;
    border-left: 4px solid var(--berkeley-gold);
  }
}

/* Home page footer integration */
.hero-footer {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  z-index: 1;
}

.hero-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  margin: 0 0.5rem;
  font-size: 0.9rem;
}

.hero-footer a:hover {
  color: var(--berkeley-gold);
}

@media (max-width: 768px) {
  .hero-footer {
    bottom: 1rem;
  }

  .hero-footer a {
    margin: 0 0.25rem;
  }
}

@media (max-width: 480px) {
  .hero-footer {
    bottom: 0.75rem;
  }

  .hero-footer a {
    margin: 0 0.15rem;
  }
}

/* Adjust hero content spacing on mobile */
@media (max-width: 768px) {
  .hero h1 {
    margin-bottom: 1rem !important;
  }

  .hero p {
    margin-bottom: 1.5rem !important;
  }

  .hero .flex.flex-col.sm\\:flex-row {
    gap: 0.75rem !important;
    margin-bottom: 3rem !important;
  }

  .hero-footer .flex {
    gap: 0.25rem !important;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    margin-bottom: 0.75rem !important;
  }

  .hero p {
    margin-bottom: 1rem !important;
  }

  .hero .flex.flex-col.sm\\:flex-row {
    gap: 0.5rem !important;
    margin-bottom: 2rem !important;
  }
}

@media (max-width: 420px) {
  .hero > div.fade-in {
    transform: translateY(-40px);
  }
}

@media (max-width: 380px) {
  .hero-footer .flex.flex-wrap {
    display: none;
  }
}
