/*
 * Stanford Cardinal — true-to-source edition.
 * Uses Stanford University's actual published identity colours (stanford.edu),
 * applied to CEMB's own brand, photography and content. Structured as a direct
 * parallel of home1.css (the earlier, more muted "Cardinal Maroon" variant) —
 * same selectors, same roles, different palette:
 *   --cemb-deep     -> Cardinal Red    #8c1515
 *   --cemb-deep-2   -> Cardinal Red X-Dark #7a0000
 *   --cemb-green    -> Digital Red     #b1040e (already matched the old theme)
 *   --cemb-green-bright / glows -> Digital Red Light #e50808
 *   darkest endpoints -> Cardinal Red XX-Dark #541107
 * This file only loads when the CEMB theme shell is active, alongside home1.css.
 */

.theme-stanford {
  --cemb-deep: #8c1515;
  --cemb-deep-2: #7a0000;
  --cemb-green: #b1040e;
  --cemb-green-bright: #e50808;
  --cemb-gold: #f6c453;
  --cemb-gold-bright: #fff0df;
  --cemb-white: #fff;
  --cemb-ink: #2e2d29;
  --cemb-ink-soft: #5d5b56;
  --cemb-border: #dad7cb;
  --cemb-shadow: 0 22px 55px rgba(122, 0, 0, .13);
  --cemb-booklet-tint: #fbf1f3;
  --cemb-booklet-stage-glow: #b1040e;
  --cemb-booklet-stage-mid: #8c1515;
  --cemb-booklet-stage-edge: #541107;
  background: #fff;
}

.theme-stanford .cemb-ref-hero {
  background: #8c1515;
}

.theme-stanford .cemb-ref-hero__veil {
  background: linear-gradient(90deg, #8c1515 0%, rgba(140, 21, 21, .97) 35%, rgba(140, 21, 21, .72) 57%, rgba(140, 21, 21, .08) 84%), linear-gradient(0deg, rgba(122, 0, 0, .58), transparent 52%);
}

/* Header and navigation */
.theme-stanford .site-header {
  background: linear-gradient(180deg, rgba(122, 0, 0, .84), rgba(122, 0, 0, .34));
  border-bottom-color: rgba(255, 255, 255, .14);
}

.theme-stanford .site-header.is-scrolled,
.theme-stanford .site-header.is-mega-open {
  background: #8c1515;
}

.theme-stanford .primary-nav {
  background: transparent;
}

.theme-stanford .brand__copy small b,
.theme-stanford .cemb-mega__eyebrow,
.theme-stanford .cemb-mega__intro > a {
  color: #f6c453;
}

.theme-stanford .primary-nav > a:not(.nav-search):not(.cemb-apply-btn)::after,
.theme-stanford .nav-dropdown__label::after {
  background: #f6c453;
}

.theme-stanford .cemb-mega__panel {
  background: linear-gradient(135deg, rgba(140, 21, 21, .98), rgba(122, 0, 0, .99));
  box-shadow: 0 32px 80px rgba(46, 45, 41, .42), inset 0 1px rgba(255, 255, 255, .08);
}

.theme-stanford .cemb-mega__panel::before {
  background: radial-gradient(circle at 18% 0, rgba(229, 8, 8, .28), transparent 36%), linear-gradient(115deg, rgba(255, 255, 255, .06), transparent 40%);
}

.theme-stanford .cemb-mega__feature::after {
  background: linear-gradient(180deg, transparent 30%, rgba(122, 0, 0, .9));
}

.theme-stanford .cemb-mega__links a svg {
  color: #f6c453;
}

.theme-stanford .cemb-btn--primary {
  background: #b1040e;
}

.theme-stanford .cemb-btn--primary:hover {
  background: #820000;
}

.theme-stanford .cemb-btn--outline {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, .72);
}

.theme-stanford .cemb-btn--outline:hover,
.theme-stanford .cemb-btn--outline:focus-visible {
  color: #8c1515;
  background: #fff;
  border-color: #fff;
}

/* Hero */
.theme-stanford .cemb-hero {
  background: #7a0000;
}

.theme-stanford .cemb-hero__veil {
  background: linear-gradient(90deg, rgba(122, 0, 0, .97) 0%, rgba(122, 0, 0, .79) 31%, rgba(122, 0, 0, .43) 55%, rgba(122, 0, 0, .14) 77%), linear-gradient(0deg, rgba(46, 45, 41, .56), transparent 48%);
}

.theme-stanford .cemb-highlight {
  color: #f6c453;
}

/* Interior page heroes (About, Research sub-pages, Board pages, Guest House, Search, Showcase). */
.theme-stanford .cemb-about-hero {
  background: #8c1515;
}

.theme-stanford .cemb-about-hero__veil {
  background: linear-gradient(90deg, #8c1515 0%, rgba(140, 21, 21, .97) 35%, rgba(140, 21, 21, .72) 57%, rgba(140, 21, 21, .08) 84%), linear-gradient(0deg, rgba(122, 0, 0, .58), transparent 52%);
}

/* Leadership-letter heroes (Founder's Message, Chairman/BOG Message, Director's Message to
   Students, Founder Director legacy) use their own bespoke veils rather than the shared
   .cemb-about-hero__veil, so each needs its own Stanford-theme override. */
.theme-stanford .cemb-founder-message__hero-veil {
  background: linear-gradient(100deg, rgba(122, 0, 0, .99) 0%, rgba(122, 0, 0, .92) 53%, rgba(122, 0, 0, .65) 100%), linear-gradient(0deg, rgba(122, 0, 0, .75), transparent 55%);
}

.theme-stanford .cemb-founder-message__hero-veil::after {
  border-color: rgba(246, 196, 83, .16);
}

.theme-stanford .cemb-chairman-message__hero-veil {
  background: linear-gradient(100deg, rgba(122, 0, 0, .99) 0%, rgba(122, 0, 0, .93) 43%, rgba(122, 0, 0, .7) 72%, rgba(122, 0, 0, .6) 100%), linear-gradient(0deg, rgba(122, 0, 0, .72), transparent 62%);
}

.theme-stanford .cemb-chairman-message__hero-veil::after {
  background: linear-gradient(135deg, transparent 48%, rgba(246, 196, 83, .055) 48%, rgba(246, 196, 83, .055) 48.25%, transparent 48.25%), linear-gradient(45deg, transparent 68%, rgba(255, 255, 255, .04) 68%, rgba(255, 255, 255, .04) 68.25%, transparent 68.25%);
}

.theme-stanford .cemb-student-message__hero-photo::after {
  background: linear-gradient(90deg, var(--cemb-deep-2), transparent 42%), linear-gradient(0deg, rgba(122, 0, 0, .46), transparent 55%);
}

.theme-stanford .cemb-student-message__hero-veil {
  background: linear-gradient(90deg, rgba(122, 0, 0, 1) 0%, rgba(122, 0, 0, .98) 36%, rgba(122, 0, 0, .67) 55%, rgba(122, 0, 0, .08) 100%);
}

.theme-stanford .cemb-student-message__hero-veil::after {
  background: linear-gradient(transparent, rgba(246, 196, 83, .58));
}

.theme-stanford .cemb-legacy-hero__veil {
  background: radial-gradient(circle at 76% 42%, rgba(229, 8, 8, .17), transparent 28%), linear-gradient(105deg, rgba(122, 0, 0, .99) 0%, rgba(122, 0, 0, .94) 46%, rgba(122, 0, 0, .76) 100%);
}

.theme-stanford .cemb-search-hero__veil {
  background: linear-gradient(90deg, rgba(122, 0, 0, .94), rgba(122, 0, 0, .73) 48%, rgba(122, 0, 0, .45)), linear-gradient(0deg, rgba(46, 45, 41, .7), transparent 58%);
}

.theme-stanford .cemb-showcase-hero {
  background: radial-gradient(circle at 18% 22%, rgba(229, 8, 8, .3), transparent 42%),
              radial-gradient(circle at 82% 78%, rgba(246, 196, 83, .16), transparent 38%),
              linear-gradient(135deg, #7a0000 0%, #8c1515 50%, #541107 100%);
}

.theme-stanford .cemb-hero__badges {
  background: linear-gradient(135deg, rgba(177, 4, 14, .74), rgba(122, 0, 0, .92));
}

.theme-stanford .cemb-hero__badge-arrow {
  color: #f6c453;
  background: transparent;
}

.theme-stanford .cemb-hero__slider-dots button[aria-current="true"] span,
.theme-stanford .cemb-hero__rail-thumb {
  background: #f6c453;
}

.theme-stanford .cemb-hero__slider-nav button,
.theme-stanford .cemb-hero__slider-dots,
.theme-stanford .cemb-hero__rail {
  background-color: rgba(122, 0, 0, .64);
}

.theme-stanford .cemb-hero__slider-arrow {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, .68);
}

.theme-stanford .cemb-hero__slider-arrow:hover,
.theme-stanford .cemb-hero__slider-arrow:focus-visible {
  color: #8c1515;
  background: #fff;
  border-color: #fff;
}

/* Statistics and feature bands */
.theme-stanford .cemb-stats {
  background: radial-gradient(circle at 50% 0, rgba(229, 8, 8, .34), transparent 58%), #820000;
  border-top-color: rgba(255, 217, 178, .3);
}

.theme-stanford .cemb-stat__icon {
  filter: sepia(1) saturate(1.3) hue-rotate(335deg) brightness(1.1);
}

.theme-stanford .cemb-stat span {
  color: #fff;
}

.theme-stanford .cemb-campus-film__veil {
  background: linear-gradient(90deg, rgba(122, 0, 0, .9) 0%, rgba(122, 0, 0, .66) 39%, rgba(122, 0, 0, .22) 73%, rgba(46, 45, 41, .36) 100%), linear-gradient(0deg, rgba(46, 45, 41, .5), transparent 48%);
}

.theme-stanford .cemb-research {
  background: linear-gradient(180deg, #fff 0%, #f8f7f4 100%);
}

.theme-stanford .cemb-research-card {
  border-color: #dedbd2;
  background: rgba(255, 255, 255, .9);
}

.theme-stanford .cemb-research-card__icon {
  color: #b1040e;
  background: #f9eeee;
  border-color: #e7c0c2;
}

.theme-stanford .cemb-labs {
  background: radial-gradient(circle at 50% 0, rgba(229, 8, 8, .34), transparent 48%), #8c1515;
}

.theme-stanford .cemb-lab-card {
  background: #7a0000;
}

.theme-stanford .cemb-why__play,
.theme-stanford .cemb-filter-tab.is-active {
  color: #8c1515;
  background: #fff;
  border-color: #fff;
}

.theme-stanford .cemb-lightbox__explore-btn {
  color: #fff;
  background: transparent;
  border-color: #fff;
  box-shadow: none;
}

.theme-stanford .cemb-lightbox__explore-btn:hover,
.theme-stanford .cemb-lightbox__explore-btn:focus-visible {
  color: #8c1515;
  background: #fff;
  border-color: #fff;
  box-shadow: none;
}

.theme-stanford .cemb-carousel-btns button {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, .62);
}

.theme-stanford .cemb-carousel-btns button:hover,
.theme-stanford .cemb-carousel-btns button:focus-visible {
  color: #8c1515;
  background: #fff;
  border-color: #fff;
}

.theme-stanford .cemb-why__media::after {
  background: linear-gradient(0deg, rgba(122, 0, 0, .74) 0%, rgba(122, 0, 0, .1) 42%, transparent 62%);
}

/* Outcomes */
.theme-stanford .cemb-brochures {
  background: radial-gradient(circle at 88% 13%, rgba(229, 8, 8, .3), transparent 30%), radial-gradient(circle at 9% 88%, rgba(246, 196, 83, .1), transparent 24%), #7a0000;
}

.theme-stanford .cemb-outcome-row:hover {
  background: linear-gradient(135deg, rgba(177, 4, 14, .96), rgba(122, 0, 0, .99));
  border-left-color: #fff;
  border-bottom-color: rgba(255, 255, 255, .72);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.theme-stanford .cemb-outcome-row:hover .cemb-outcome-row__thumb {
  border-color: #fff;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .5), 0 0 20px rgba(255, 255, 255, .16);
}

.theme-stanford .cemb-outcome-row:hover .cemb-outcome-row__index,
.theme-stanford .cemb-outcome-row:hover strong,
.theme-stanford .cemb-thumb-zoom-btn {
  color: #fff;
}

.theme-stanford .cemb-outcome-row:hover .cemb-outcome-row__badge {
  color: #8c1515;
  background: #fff;
  border-color: #fff;
}

.theme-stanford .cemb-outcome-row:hover .cemb-outcome-row__arrow {
  color: #8c1515;
  background: #fff;
  border-color: #fff;
}

.theme-stanford .cemb-outcome-row__arrow {
  color: #fff;
  border-color: #fff;
}

.theme-stanford .cemb-outcome-row__thumb,
.theme-stanford .cemb-outcome-row:hover .cemb-outcome-row__img,
.theme-stanford .cemb-lightbox__media {
  background: #2e2d29;
}

.theme-stanford .cemb-outcome-row__thumb:hover .cemb-thumb-zoom-btn,
.theme-stanford .cemb-outcome-lightbox {
  background-color: rgba(46, 45, 41, .94);
}

.theme-stanford .cemb-lightbox__cta {
  background: linear-gradient(135deg, #8c1515, #7a0000);
}

.theme-stanford .cemb-lightbox__close {
  padding: 0;
  color: #fff;
  background: transparent;
  border-color: #fff;
}

.theme-stanford .cemb-lightbox__close span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.theme-stanford .cemb-lightbox__close:hover,
.theme-stanford .cemb-lightbox__close:focus-visible {
  color: #8c1515;
  background: #fff;
  border-color: #fff;
}

/* Lower homepage sections */
.theme-stanford .cemb-gallery,
.theme-stanford .cemb-news {
  background-color: #f8f7f4;
}

.theme-stanford .cemb-gallery__item button::after,
.theme-stanford .cemb-news-card__image::after {
  background-color: rgba(140, 21, 21, .12);
}

.theme-stanford .cemb-footer {
  position: relative;
  color: #fff;
  background: linear-gradient(135deg, #8c1515 0%, #7a0000 56%, #541107 100%);
  border-top: 5px solid #b1040e;
}

.theme-stanford .cemb-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 82% 12%, rgba(255, 255, 255, .08), transparent 30%);
}

.theme-stanford .cemb-footer__grid,
.theme-stanford .cemb-footer__bottom {
  position: relative;
  z-index: 1;
}

.theme-stanford .cemb-footer__col h2 {
  color: #fff;
}

.theme-stanford .cemb-footer__brand p,
.theme-stanford .cemb-footer__col ul a,
.theme-stanford .cemb-footer__contact a,
.theme-stanford .cemb-footer__newsletter p,
.theme-stanford .cemb-footer__bottom,
.theme-stanford .cemb-footer__bottom a {
  color: #fff;
}

.theme-stanford .cemb-footer__social a {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
}

.theme-stanford .cemb-newsletter-form input {
  color: #fff;
  background: rgba(122, 0, 0, .34);
  border-color: rgba(255, 255, 255, .24);
}

.theme-stanford .cemb-newsletter-form input::placeholder {
  color: rgba(255, 255, 255, .82);
}

.theme-stanford .cemb-newsletter-form input:focus {
  border-color: #f6c453;
}

.theme-stanford .cemb-footer__bottom {
  border-top-color: rgba(255, 255, 255, .18);
}

.theme-stanford .cemb-newsletter-form button {
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .72);
}

.theme-stanford .cemb-newsletter-form button:hover,
.theme-stanford .cemb-newsletter-form button:focus-visible {
  color: #8c1515;
  background: #fff;
  border-color: #fff;
}

.theme-stanford .cemb-footer__social a:hover {
  color: #8c1515;
  background: #fff;
  border-color: #fff;
}

.theme-stanford .cemb-footer__col a:hover,
.theme-stanford .cemb-footer__bottom a:hover {
  color: #f6c453;
}

/* Keep keyboard focus unmistakable against both light and dark regions. */
.theme-stanford :focus-visible {
  outline-color: #e50808;
}

@media (max-width: 1099px) {
  .theme-stanford .primary-nav {
    background: #8c1515;
  }
}

@media (max-width: 760px) {
  .theme-stanford .cemb-student-message__hero-photo::after {
    background: linear-gradient(0deg, var(--cemb-deep-2) 5%, rgba(122, 0, 0, .93) 44%, rgba(122, 0, 0, .2) 78%);
  }

  .theme-stanford .cemb-student-message__hero-veil {
    background: linear-gradient(0deg, rgba(122, 0, 0, .98) 6%, rgba(122, 0, 0, .75) 62%, rgba(122, 0, 0, .15));
  }
}
