/* CSS for cheezyCMS */
html {
  height: 100%;
  margin: 0;
}

body {
  min-height: 100%;
  margin: 0;
  background-color: #333333;
  background-image: linear-gradient(to bottom, #3a3a3a, #404040);
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: hidden;
}

body.allow-scroll {
  overflow-y: auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.header {
  background: #35424a;
  color: #ffffff;
  padding: 10px 0;
}

.header h1 {
  margin: 0;
  text-align: center;
}

.navbar {
  display: flex;
  justify-content: center;
  background: linear-gradient(145deg, #aa0000, #800000);
  border-bottom: 1px solid #cc0000;
}

.navbar a {
  color: #ffffff;
  padding: 14px 20px;
  text-decoration: none;
  text-align: center;
}

/* Make nav links feel clickable: subtle lift + animated underline */
.navbar a {
  position: relative;
  display: inline-block;
  padding: 12px 18px;
  transition: transform 0.12s ease, color 0.12s ease;
}
.navbar a::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 8px;
  height: 2px;
  background: rgba(255,255,255,0.15);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.18s cubic-bezier(.2,.8,.2,1), background 0.18s;
}
.navbar a:hover::after,
.navbar a:focus::after,
.navbar a[aria-current="page"]::after {
  transform: scaleX(1);
  background: rgba(255,255,255,0.95);
}
.navbar a:hover,
.navbar a:focus {
  transform: translateY(-3px);
  outline: none;
}
.navbar a:focus-visible {
  box-shadow: 0 0 0 3px rgba(255,215,0,0.12), 0 2px 6px rgba(0,0,0,0.12);
  border-radius: 0.25rem;
}
/* More visible hover: highlight the link background to show clickability */
.navbar a:hover,
.navbar a:focus,
.navbar a:active {
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}

#grid {
  .submenu-items {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
  }
  .submenu-loading,
  .submenu-empty {
    color: #ffd54f;
    font-size: 0.9em;
    text-align: center;
    padding: 0.4em 0.3em;
  }
  .submenu-empty {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
  }
  display: grid;
  gap: 0.5rem;
  grid-auto-rows: auto;
  width: 100%;
}

.card {
  display: flex;
  padding: 0.35rem 0.5rem;
  text-decoration: none;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  height: auto;
  justify-content: center;
  /* Align items to the top so cards don't create dead vertical space above/below their content */
  align-items: flex-start;
  background: linear-gradient(145deg, #aa0000, #800000);
  border: 1px solid #cc0000;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.1),
             0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  position: relative;
  border-radius: 0.75rem;
}

/* News feed card: use block layout so table fills card and columns behave predictably */
.card.newsfeed-card {
  /* Keep same flex layout as regular .card so the card dimensions match other buttons */
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0.35rem 0.45rem 0.35rem 0.22rem;
  box-sizing: border-box;
}

.card:hover {
  transform: translateY(-2px) scale(1.02);
  background: linear-gradient(145deg, #cc0000, #aa0000);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.2),
             0 4px 8px rgba(0,0,0,0.3),
             0 0 4px rgba(255,0,0,0.2);
  border-color: #ff0000;
}

.card h3 {
  margin-top: 0;
}

.card a {
  color: #ffffff;
  font-size: 1.125rem;
  text-decoration: none;
  text-align: center;
  font-weight: 500;
}

.card > div {
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 500;
  text-align: center;
  font-family: system-ui, -apple-system, sans-serif !important;
}

.icon-container {
  display: flex;
  /* Top-align icons/text so cards don't get extra vertical dead space */
  align-items: flex-start;
  justify-content: center;
  padding: 0.25rem;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.icon-svg {
  width: 100%;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Newsfeed-specific overrides to prevent clipping and ensure SVG scales inside the card */
.card.newsfeed-card .icon-container {
  /* Remove the global oversized/min-height behavior for this card */
  min-height: 0 !important;
  margin-top: 0 !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  padding: 0.25rem !important;
  height: auto !important;
}

.card.newsfeed-card .icon-svg {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
}

/* DOM-based news box layout (used instead of SVG for consistent ellipsis and baseline) */
.news-box {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding: 3px 6px 4px 2px;
  flex: 1 1 auto;
  min-height: 0;
  font-size: 11px;
}
.news-title {
  font-weight: 600;
  color: #fff;
  font-size: 1em;
  letter-spacing: 0.02em;
  padding: 0;
  margin: 0 0 2px 0;
  text-align: center;
}
.news-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0;
  flex: 1 1 auto;
  justify-content: space-between;
}
.news-row {
  display: flex;
  gap: 0;
  align-items: center;
  width: 100%;
  overflow: hidden;
  padding: 0;
}
.news-row.news-row-empty {
  justify-content: center;
  padding: 2px 0;
}
.news-date {
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 28px;
  padding: 0;
  gap: 0;
}
.news-date-top,
.news-date-bottom {
  display: block;
  line-height: 1.02;
  text-align: center;
  white-space: nowrap;
}
.news-date-top {
  font-size: 0.6em;
  font-weight: 500;
}
.news-date-bottom {
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.news-msg {
  color: #fff;
  overflow: hidden;
  flex: 1 1 auto;
  font-size: 0.7em;
  line-height: 1.1;
  display: block;
  padding-right: 2px;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
.news-footer {
  text-align: center;
  color: #fff;
  font-weight: 600;
  padding-top: 2px;
  font-size: 0.82em;
  letter-spacing: 0.02em;
  margin-top: auto;
}

.card.newsfeed-card .icon-svg svg {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

.icon-svg svg {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
}

.icon-svg text {
  fill: rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3));
}

.icon-svg text:first-child {
  font-family: 'Material Icons' !important;
}

.icon-svg text:last-child {
  font-family: system-ui, -apple-system, sans-serif !important;
  font-weight: 500;
}

.icon-clip {
  width: 100%;
  display: flex;
  justify-content: center;
  /* Let the icon area size naturally so SVGs scale to fill the card like before */
  height: auto;
  flex: 1 1 auto;
}
.card.newsfeed-card .icon-clip {
  align-items: stretch;
}


/* Make the page-title area a full-width contrasting band behind the title */
.page-title {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

.page-title h1 {
  font-size: 1.875rem;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(170,0,0,0.4), 0 0 2px rgba(255,255,255,0.4);
  letter-spacing: 0.5px;
  margin: 0;
}

.footer {
  text-align: center;
  padding: 20px 0;
  background: #35424a;
  color: #ffffff;
  position: relative;
  bottom: 0;
  width: 100%;
}

/* Menu and submenu styles */
.menu-button {
  background: linear-gradient(145deg, #aa0000, #800000);
  color: #fff;
  border: 1px solid #cc0000;
  border-radius: 0.5em;
  padding: 0.4em 1em;
  font-weight: bold;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.menu-button:link,
.menu-button:visited {
  color: #fff;
  text-decoration: none;
}
.menu-button:hover {
  background: linear-gradient(145deg, #cc0000, #aa0000);
  border-color: #ff0000;
}
.menu-button.active {
  /* Selected chip: light -> mid yellow, with a darker yellow/gold border for strong contrast */
  background: linear-gradient(145deg, #fff59d, #ffd54f);
  color: #1a1a1a;
  border: 1px solid #c68f00; /* darker gold border to stand out against the yellow fill */
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 2px 6px rgba(0,0,0,0.08);
}
.menu-button.active:hover {
  border-color: #e6b800;
}

.submenu {
  display: none;
  position: absolute;
  z-index: 1001;
  background: #222;
  border: 1px solid #444;
  border-radius: 0.5em;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  /* reduce min-width so the submenu card narrows */
  min-width: 160px;
  max-width: 320px;
  /* reserve space for the breadcrumb which will be positioned at the top */
  padding: 2.0em 0.5em 0.5em 0.5em;
  text-align: left;
  margin: 0;
}
.submenu .breadcrumb {
  font-size: 0.98em;
  color: #fff; /* title text on red band */
  font-weight: bold;
  display: block;
  box-sizing: border-box;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin: 0;
  padding: 0.45em 0.5em;
  background: linear-gradient(145deg, #aa0000, #800000);
  border-top-left-radius: 0.5em;
  border-top-right-radius: 0.5em;
}
.submenu div,
.submenu a {
  color: #fff;
  margin: 0.15em 0;
  text-decoration: none;
}
.submenu [role="menuitem"] {
  font-weight: bold;
  display: block;
  padding: 0.36em 0.6em;
  border-radius: 0.25rem;
  position: relative;
  transition: background 0.12s ease;
  box-sizing: border-box;
  cursor: pointer;
  text-decoration: none;
}
.submenu a[role="menuitem"]:link,
.submenu a[role="menuitem"]:visited {
  color: #fff;
}
.submenu [role="menuitem"]:hover,
.submenu [role="menuitem"]:focus {
  /* Strong, full-row highlight so it's unmistakable */
  background: rgba(255,215,0,0.06); /* soft yellow-tinted highlight */
  color: #fff;
  cursor: pointer;
}
/* Full-height gold left bar when hovered/focused (not a tiny dot) */
.submenu [role="menuitem"]:hover::before,
.submenu [role="menuitem"]:focus::before {
  /* intentionally empty: left accent removed */
  content: none;
}
.submenu a[role="menuitem"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,215,0,0.12);
}
.submenu .arrow {
  position: absolute;
  right: 0.2em;
  color: #ffd54f;
}

.menu-loading {
  color: #ffd54f;
  padding: 0.4em 0.6em;
  text-align: center;
  font-size: 0.95em;
}

/* Breadcrumb links (top-level trail) */
.breadcrumb-link {
  color: #ffd54f;
  margin-right: 0.5em;
  text-decoration: underline;
  font-weight: 500;
}
.breadcrumb-sep {
  color: #ffd54f;
  margin-right: 0.5em;
  font-weight: bold;
}
.widget-card {
  /* Maximum widget height now fixed as requested: 100vh - 60px */
  --widget-card-max-height: calc(100vh - 60px);
  border: 2px solid #111;
  border-radius: 0.9em;
  background: rgba(0,0,0,0.18);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  padding: 1.2em 1em 1.2em 1em;
  margin-bottom: 1.25em;
  max-height: var(--widget-card-max-height);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-height: 0;
}
.widget-title {
  color: #fff;
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 0.5em;
  text-align: left;
}
.widget-header-row {
  display: table;
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-weight: bold;
  color: #fff;
  margin: 0.25em 0 0.5em 0;
  font-size: 1.2em;
}
.widget-header-row > div {
  display: table-cell;
  text-align: center;
  min-width: 80px;
  padding: 0 0.4em;
}
.widget-cards-container {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: var(--widget-card-content-max-height, none);
  width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
}

/* Video widget styles (scoped) */
.widget-card .video-item {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  width: 100%;
  align-items: center; /* center header/footer and video together */
}
.widget-card .video-header,
.widget-card .video-footer {
  color: #fff;
  font-size: 1.02em;
  padding: 0 0.4em;
  text-align: center; /* center text above/below video */
  width: 100%;
  max-width: 640px; /* match iframe max width so header/footer align */
  box-sizing: border-box;
}
.widget-card .video-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}
.widget-card .video-wrapper iframe {
  width: 100%;
  max-width: 640px; /* match original site's iframe size */
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  background: #000;
}

/* ensure header/footer line breaks don't exceed video width on small screens */
.widget-card .video-header,
.widget-card .video-footer {
  word-break: break-word;
  overflow-wrap: anywhere;
}
.widget-card-row {
  display: table;
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  padding: 0.14em 0.22em;
  margin: 0;
  overflow: visible;
  background: linear-gradient(145deg, #aa0000, #800000);
  border: 1px solid #cc0000;
  border-radius: 0.75rem;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.1), 0 2px 4px rgba(0,0,0,0.2);
  color: #fff;
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}
.widget-card-row:link,
.widget-card-row:visited {
  color: #ffffff;
}
.widget-card-row:hover {
  background: linear-gradient(145deg, #cc0000, #aa0000);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.2), 0 4px 8px rgba(0,0,0,0.3), 0 0 4px rgba(255,0,0,0.2);
  border-color: #ff0000;
}
.widget-card-row:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
.widget-cell {
  text-align: center;
  min-width: 80px;
  word-break: break-word;
  font-size: 1.08em;
  color: #fff;
  padding: 0.08em 0.12em;
  display: table-cell;
  vertical-align: middle;
  line-height: 1.32;
  white-space: normal;
}

.menu-row {
  display: flex;
  flex-direction: row;
  gap: 1px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.2em;
  position: relative;
}

.breadcrumb-container {
  margin: 0.5em 0 1em 0;
  color: #fff;
  font-size: 1em;
  text-align: left;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2em;
}
.breadcrumb-link {
  color: #ffd54f;
  margin-right: 0.5em;
  text-decoration: underline;
  font-weight: 500;
}
.breadcrumb-sep {
  color: #fff;
  margin-right: 0.5em;
  font-weight: bold;
}

.login-btn {
  display: inline-block;
  padding: 1em 2em;
  background: #2a7fff;
  color: #fff;
  font-size: 1.2em;
  border-radius: 6px;
  text-decoration: none;
  margin: 2em auto;
  text-align: center;
}