﻿/* Mobile-specific styles (applied when viewport <= 900px via link media attribute) */
/* Layout */
.container, .container-head { width: 100%; padding: 0 16px; }
.hero { height: 140px; }
.header-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.logo {
  width: 100%;
}
.logo img {
  height: 44px;
  width: auto;
  max-width: 100%;
}
.header-right {
  position: relative;
  align-items: stretch;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.top-bar {
  justify-content: space-between;
}

/* Ensure mobile header elements do not shrink the nav */
.header-container {
  max-width: 100%;
}
.main-nav {
  min-width: 100%;
  width: 100%;
}

/* Navigation mobile behavior */
.nav-toggle {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 12px;
  right: 16px;
  width: auto;
  min-width: 44px;
  min-height: 44px;
  background: rgba(250, 244, 232, 0.96);
  border: 1px solid rgba(118, 82, 50, 0.18);
  border-radius: 12px;
  color: #4b3821;
  font-size: 22px;
  cursor: pointer;
  padding: 8px 10px;
  margin: 0;
  z-index: 1101;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
}
.main-nav { width: 100%; position: relative; z-index: 100; }
.main-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: linear-gradient(180deg, #f8f0dd 0%, #efe0c4 100%);
  color: #3c2e1c;
  padding: 10px 0;
  border-radius: 8px;
  position: fixed;
  top: 60px;
  right: 16px;
  width: min(220px, calc(100vw - 28px));
  max-width: 220px;
  z-index: 1000;
  box-sizing: border-box;
  border: 1px solid rgba(115, 78, 39, 0.16);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.14);
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  opacity: 0;
  transform: translateX(18px);
  pointer-events: none;
  visibility: hidden;
  transition: transform 240ms ease, opacity 240ms ease, visibility 240ms ease;
}
.main-nav ul.open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  visibility: visible;
}
.main-nav ul li { padding: 0; width: 100%; }
.main-nav a {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  color: #222;
}
.main-nav > ul > li + li > a {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.main-nav a {
  transition: background 180ms ease, color 180ms ease, padding-left 180ms ease;
}
.main-nav a:hover {
  background: rgba(192, 44, 39, 0.08);
  color: #c02c27;
  padding-left: 20px;
}
.main-nav a.active {
  font-weight: 700;
  color: #c02c27;
}
.main-nav a.active::after { display: none; }
.activity-layout { display: none !important; }
.activity-section .section-title { display: none !important; }
/* Submenu as inline collapsible blocks */
.main-nav .submenu {
  position: relative;
  top: 0;
  left: 0;
  box-shadow: none;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  display: none;
  margin-left: 0;
  background: transparent;
  padding-left: 16px;
}
.main-nav .submenu.open { display: block; }
.main-nav .submenu::before { display: none; }
.main-nav .submenu li a {
  padding: 10px 16px;
  font-size: 15px;
  color: #333;
}
.main-nav .submenu li a:hover {
  background: rgba(192, 44, 39, 0.06);
  color: #c02c27;
}
.main-nav .submenu li {
  width: 100%;
}

/* Sections */
/* Only the mobile header buttons in news and announcements should use white links and white pseudo-icon */
.news-section .section-title > .more-link,
.announcements .section-title > .more-link {
  position: static;
  top: auto;
  right: auto;
  left: auto;
  transform: none;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  text-decoration: none;
  margin-left: auto;
}
.news-section .section-title > .more-link::after,
.announcements .section-title > .more-link::after {
  content: '';
  display: inline-block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.25);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 17L17 7' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/><polyline points='7 7 17 7 17 17' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/></svg>");
}
.section-title > .more-linkxw,
.section-title > .more-link-right {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  transform: none !important;
  margin-left: auto !important;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 20px;
}
.section-title-center { width: 100%; }
.research-grid { grid-template-columns: 1fr; padding: 30px 16px; }
.photo-news-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
.quick-links { grid-template-columns: 1fr 1fr !important; }

/* Hide heavy UI on small screens */
.hero-arrow {
  display: flex !important;
  width: 18px !important;
  height: 37px !important;
  border-radius: 0 20px 20px 0 !important;
  right: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: rgba(255, 255, 255, 0.18) !important;
}
.hero-arrow.next {
  left: auto !important;
  right: 0px !important;
  border-radius: 20px 0 0 20px !important;
}
.hero-arrow span {
  font-size: 10px !important;
}
.activity-main { width: 100%; }

/* Cards/images adjustments */
.photo-card img { height: 140px; }

/* News list stacking */
.news-top-layout { flex-direction: column; gap: 12px; }
.news-list { order: 2; }
.main-news { order: 1; }
.news-list-item h4 { max-width: none; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Slight touch-ups */
.section-title-center { gap: 8px; }

/* Improve tappable areas */
.main-nav a, .main-nav .submenu li a { -webkit-tap-highlight-color: rgba(0,0,0,0.06); }

/* Ensure hamburger hidden on larger screens if CSS loaded directly */
@media (min-width: 901px) { .nav-toggle{ display: none !important; } }
@media (min-width: 901px) {  .top-bar{display: none;} }
@media (min-width: 901px) {  .activity-layout{display: none!p;} }

 .top-bar{display: none;}
/* Fixes for stacked layout and overflowing containers */
.container-jxky { width: 100% !important; padding: 0 16px !important; }
.container-fluid { width: 100% !important; padding: 0 12px !important; }
.header-right, .header-container, .main-nav, .main-nav ul, .main-nav ul li { width: 100% !important; }
.news-container { display: flex !important; flex-direction: column !important; gap: 12px !important; }
.college-news { width: 100% !important; margin-left: 0 !important; }
.announcements { width: 100% !important; order: 2 !important; }
.news-top-layout { align-items: stretch !important; }
.main-news img { width: 100% !important; height: auto !important; max-height: 220px; object-fit: cover; }

/* Ensure right column boxes don't overlap hero area */
.announce-list { padding: 8px 0 0 0 !important; }
.announce-item { padding: 8px 10px !important; border-bottom: 1px dashed rgba(0,0,0,0.06) !important; }

/* Reduce large fixed paddings that cause overflow */
body, html { -webkit-text-size-adjust: 100%; }

/* Ensure research container also collapses */
.research-grid {
  grid-template-columns: 1fr !important;
  padding: 24px 12px !important;
  background-image: none !important;
  background-color: transparent !important;
}

/* Tweak quick links spacing */
.quick-links { gap: 8px !important; }

/* Force mobile containers and layout to fit viewport */
html, body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}
.container,
.container-head,
.container-jxky,
.container-fluid {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 16px !important;
}

.news-container,
.news-top-layout,
.activity-layout,
.photo-news-grid,
.research-grid,
.quick-links {
  width: 100% !important;
  max-width: 100% !important;
}

.news-top-layout {
  flex-direction: column !important;
  align-items: stretch !important;
}

.main-news,
.news-list,
.announcements,
.activity-main,
.activity-thumbs,
.photo-card,
.research-item {
  width: 100% !important;
}

.activity-layout {
  flex-direction: column !important;
  align-items: stretch !important;
}

.activity-main {
  width: 100% !important;
}

.activity-track {
  width: 100% !important;
}

.activity-slide {
  min-width: 100% !important;
}

.activity-thumbs {
  flex-wrap: wrap !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

.photo-card {
  width: 100% !important;
}

.photo-card img {
  width: 100% !important;
  max-width: 100% !important;
}

.quick-links {
  grid-template-columns: 1fr 1fr!important;
}
