
/*
  Rosatom Forum UI System
  - Uses ONLY Rosatom corporate font (see assets/css/fonts.css)
  - Colors come from theme options (inc/setup.php -> :root variables) and Bootstrap vars.
*/

:root{
  /* Color tokens (source of truth: theme vars + Bootstrap vars) */
  --ra-primary: var(--bs-primary);
  --ra-primary-contrast: #fff;
  --ra-bg: var(--bs-body-bg);
  --ra-surface: var(--bs-body-bg);
  --ra-text: var(--bs-body-color);
  --ra-muted: var(--bs-secondary-color);
  --ra-border: rgba(var(--bs-border-color-rgb), .18);

  /* State tokens */
  --ra-focus-ring: rgba(var(--bs-primary-rgb), .25);
  --ra-success: var(--bs-success);
  --ra-danger: var(--bs-danger);

  /* Radii & shadows */
  --ra-radius-sm: 12px;
  --ra-radius-md: 16px;
  --ra-radius-lg: 20px;
  --ra-shadow-sm: 0 .25rem .75rem rgba(0,0,0,.06);
  --ra-shadow-md: 0 .6rem 1.6rem rgba(0,0,0,.10);
}

html{font-size:16px;}
body{
  font-family: var(--font-rosatom);
  font-weight: 400;
  line-height: 1.55;
  color: var(--ra-text);
  background: var(--ra-bg);
}

/* Typography (h1–h4): consistent scale, same font, minimal weights */
h1,h2,h3,h4{
  font-family: var(--font-rosatom);
  letter-spacing: -0.01em;
}
h1{font-size:3rem;line-height:1.12;color:var(--ra-primary);font-weight:700;}
h2{font-size:2rem;line-height:1.2;color:var(--bs-secondary);font-weight:700;}
h3{font-size:1.5rem;line-height:1.25;color:var(--ra-text);font-weight:700;}
h4{font-size:1.25rem;line-height:1.3;color:var(--ra-text);font-weight:700;}

/* Links */
a{color:var(--ra-primary);text-decoration-thickness:.08em;text-underline-offset:.16em;}
a:hover,a:focus{color:var(--ra-primary);text-decoration:underline;}

/* Focus-visible (forms/buttons/links) */
a:focus-visible,button:focus-visible,[role="button"]:focus-visible,
input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline: none;
  box-shadow: 0 0 0 .2rem var(--ra-focus-ring);
}

/* Forms */
.form-label{font-weight:700;}
.form-control,.form-select{
  border-radius: var(--ra-radius-sm);
  border-color: var(--ra-border);
}
.form-control:focus,.form-select:focus{
  border-color: var(--ra-primary);
  box-shadow: 0 0 0 .2rem var(--ra-focus-ring);
}
.form-check-input:focus{
  box-shadow: 0 0 0 .2rem var(--ra-focus-ring);
}

/* Buttons */
.btn{
  border-radius: var(--ra-radius-sm);
}

/* Cards */
.ra-card{
  display: block;
  background: var(--ra-surface);
  border: 1px solid var(--ra-border);
  border-radius: var(--ra-radius-lg);
  box-shadow: var(--ra-shadow-sm);
}
.ra-card--hover{transition: transform .18s ease, box-shadow .18s ease;}
.ra-card--hover:hover{transform: translateY(-2px);box-shadow: var(--ra-shadow-md);}

/* Tables (Materials) */
.ra-table-wrap{
  overflow-x: auto;
  border: 1px solid var(--ra-border);
  border-radius: var(--ra-radius-lg);
  box-shadow: var(--ra-shadow-sm);
  background: var(--ra-surface);
}
.ra-table{
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.ra-table thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(var(--bs-primary-rgb), .04);
  color: var(--ra-text);
  font-weight: 700;
  padding: .9rem 1.125rem; /* ~14px / 18px */
  border-bottom: 1px solid #D8E0F0;
}
.ra-table tbody td{
  padding: .875rem 1.125rem; /* ~14px / 18px */
  border-bottom: 1px solid #D8E0F0;
}

/* Column sizing (override inline widths in template)
   Note: we keep Material column flexible, because the last column is fixed in px.
   This avoids unintended horizontal overflow while still keeping Material widest. */
.ra-table thead th:nth-child(1){ width: auto !important; }   /* Материал */
.ra-table thead th:nth-child(2){ width: 22% !important; }   /* Категория */
.ra-table thead th:nth-child(3){ width: 10% !important; }   /* Год */
.ra-table thead th:nth-child(4){ width: 56px !important; }  /* Действие */
.ra-table tbody td:nth-child(3){ white-space: nowrap; }     /* Год без переносов */
.ra-table tbody td:nth-child(1){ overflow-wrap: anywhere; } /* длинные слова/URL не раздувают таблицу */

/* Zebra */
.ra-table tbody tr:nth-child(odd){ background: #fff; }
.ra-table tbody tr:nth-child(even){ background: #F6F8FF; }

/* Row hover (and keyboard focus) */
@media (hover:hover){
  .ra-table tbody tr:hover{ background: #EAF0FF; }
}
.ra-table tbody tr:focus-within{ background: #EAF0FF; }

/* Action icon button */
.materials-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: transparent;
  color: var(--ra-primary);
  text-decoration: none;
  transition: background-color .15s ease, opacity .15s ease;
}
.materials-link:hover,
.materials-link:focus{
  color: var(--ra-primary);
  text-decoration: none;
  background: #EAF0FF;
  opacity: 1;
}
.materials-link:focus-visible{
  outline: none;
  box-shadow: 0 0 0 .2rem var(--ra-focus-ring);
}

/* Mobile: avoid horizontal scroll, allow wrapping in “Материале” */
@media (max-width: 575.98px){

  .ra-table thead th{ padding: .75rem .9rem; }
  .ra-table tbody td{ padding: .7rem .9rem; }

  .ra-table tbody td:nth-child(1){
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .ra-table thead th:nth-child(1){ width: auto !important; }
  .ra-table thead th:nth-child(2){ width: 32% !important; }
  .ra-table thead th:nth-child(3){ width: 5rem !important; }
  .ra-table thead th:nth-child(4){ width: 48px !important; }

  .materials-link{
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
}


.hero-bg{min-height:260px;background-size:cover;background-position:center;}

/* Header (two bars)
   - header--home: overlays hero, white text
   - header--inner: white background, primary text */
.site-header{width:100%;}
.site-header__bar{width:100%;}
.site-header__bar--top{padding:.6rem 0;}
.site-header__bar--bottom{padding:.25rem 0;}
.site-header__top{min-height:64px;}
.site-header__project-title{font-size:1rem;line-height:1.2;}

.site-header__logo-link{display:inline-flex;align-items:center;max-width:100%;}
.site-header__logo-img{max-width:100%;height:48px;max-height:48px;width:auto;display:block;}

.site-header__nav{padding:0;}
.site-header__lang{white-space:nowrap;}
.site-header__nav .navbar-toggler{padding:.35rem .55rem;}
.site-header__nav .navbar-collapse{padding-top:.5rem;}

@media (min-width: 768px){
  .site-header__nav .navbar-collapse{padding-top:0;}
}

/* Inner pages: white background, primary UI */
.site-header.header--inner .site-header__bar{background:var(--bs-body-bg);color:var(--bs-primary);}
.site-header.header--inner .site-header__bar--bottom{border-bottom:1px solid rgba(0,0,0,.08);}
.site-header.header--inner .navbar-nav .nav-link{color:var(--bs-primary);}
.site-header.header--inner .navbar-nav .nav-link:hover,
.site-header.header--inner .navbar-nav .nav-link:focus{color:var(--bs-primary);text-decoration:underline;}
.site-header.header--inner .navbar-nav .nav-link.active{color:var(--bs-primary);text-decoration:underline;font-weight:700;}
.site-header.header--inner .navbar-toggler{color:var(--ra-primary);border-color:rgba(var(--bs-primary-rgb), .25);}

/* Home: overlay hero, white UI */
.site-header.header--home{position:absolute;top:0;left:0;right:0;z-index:1030;}
.site-header.header--home .site-header__bar--top{background:linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,0));color:#fff;}
.site-header.header--home .site-header__bar--bottom{background:rgba(0,0,0,.12);color:#fff;}
.site-header.header--home .site-header__project-title{color:#fff;}
.site-header.header--home .site-header__logo-img{filter:brightness(0) saturate(100%) invert(1);}
.site-header.header--home .navbar-nav .nav-link{color:#fff;}
.site-header.header--home .navbar-nav .nav-link:hover,
.site-header.header--home .navbar-nav .nav-link:focus{color:#fff;text-decoration:underline;opacity:.95;}
.site-header.header--home .navbar-nav .nav-link.active{color:#fff;text-decoration:underline;font-weight:700;}
.site-header.header--home .navbar-toggler{border-color:rgba(255,255,255,.4);}
.site-header.header--home .navbar-toggler{color:#fff;}
.site-header.header--home .lang-switcher{color:#fff;}

/* Language switcher: keep button look, but match menu color */
.site-header .lang-switcher .btn{
  box-shadow: none;
}

.site-header.header--inner .lang-switcher .btn{
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: rgba(var(--bs-primary-rgb), .35);
  --bs-btn-hover-color: var(--bs-primary);
  --bs-btn-hover-bg: rgba(var(--bs-primary-rgb), .08);
  --bs-btn-hover-border-color: rgba(var(--bs-primary-rgb), .45);
  --bs-btn-active-color: var(--bs-primary);
  --bs-btn-active-bg: rgba(var(--bs-primary-rgb), .12);
  --bs-btn-active-border-color: rgba(var(--bs-primary-rgb), .55);
}
.site-header.header--inner .lang-switcher .btn-check:checked + .btn{
  font-weight: 700;
}

.site-header.header--home .lang-switcher .btn{
  --bs-btn-color: #fff;
  --bs-btn-border-color: rgba(255,255,255,.6);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: rgba(255,255,255,.16);
  --bs-btn-hover-border-color: rgba(255,255,255,.85);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: rgba(255,255,255,.22);
  --bs-btn-active-border-color: #fff;
}
.site-header.header--home .lang-switcher .btn-check:checked + .btn{
  font-weight: 700;
}

/* Make room for overlay header on the hero */
.site-header.header--home + .site-main{padding-top:0 !important;}
.site-header.header--home + .site-main .rf-home-hero__container{padding-top:7.5rem;}
.site-footer a{color:var(--ra-primary);}
.site-footer a:hover,.site-footer a:focus{color:var(--ra-primary);opacity:.9;text-decoration:underline;}
.year-switcher .dropdown-menu{min-width:6rem;}
.content :where(p){margin-bottom:.75rem;}
.content img{max-width:100%;height:auto;}

/* Ensure primary buttons follow theme variables incl. hover/active. */
.btn-primary{
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-hover);
  --bs-btn-hover-border-color: var(--primary-hover);
  --bs-btn-active-bg: var(--primary-active);
  --bs-btn-active-border-color: var(--primary-active);
}

/* Optional accent button style (if used). */
.btn-accent{
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--accent-hover);
  --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--accent-active);
  --bs-btn-active-border-color: var(--accent-active);
}

.lang-switcher .fa-language{opacity:.9;}

.site-footer .footer-hub-logo{max-width:240px;height:auto;filter:none;opacity:.95;}

/* Speakers page */
.speakers-page .speaker-card{display:flex;flex-direction:row;flex-wrap:wrap;}
.speakers-page .speaker-card__media{flex:0 0 200px;padding:1rem;}
.speakers-page .speaker-card__img{width:200px;height:200px;object-fit:cover;border-radius:50%;display:block;}
.speakers-page .speaker-card__body{flex:1 1 260px;}

/* Front page (Home page CPT) hero */
.rf-home-hero{
  position: relative;
  width: 100%;
  min-height: 640px;
  overflow: hidden;
  background-color: var(--ra-bg);
  background-image: none;
  margin-bottom: 2rem;
}
.rf-home-hero__bg{
  position: absolute;
  left: 0;
  right: 0;
  top: -12%;
  bottom: -12%;
  z-index: 0;
  background-size: cover;
  background-position: center;
  transform: translate3d(0,0,0) scale(1.08);
  will-change: transform;
}
.rf-home-hero__overlay{
  position:absolute;
  inset:0;
  z-index: 1;
  background: rgba(0,0,0,.15);
}
.rf-home-hero__container{
  position: relative;
  z-index: 2;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}
.rf-home-hero__top{
  display:flex;
  justify-content:flex-end;
}
.rf-home-hero__year-switcher{
  display:flex;
  align-items:center;
  gap:.5rem;
}
.rf-home-hero__year-label{
  color: rgba(255,255,255,.95);
  font-size: .95rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.rf-home-hero__bottom{
  max-width: 50%;
}

@media (max-width: 991.98px){
  .rf-home-hero__bottom{max-width:100%;}
}
.rf-home-hero__title{
  margin: 0 0 .75rem 0;
  color: #fff;
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 2px 18px rgba(0,0,0,.45);
}
.rf-home-hero__date{
  color: rgba(255,255,255,.95);
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 0 2px 18px rgba(0,0,0,.45);
}
.rf-home-hero .btn-outline-secondary{
  --bs-btn-color: #fff;
  --bs-btn-border-color: rgba(255,255,255,.75);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: rgba(255,255,255,.18);
  --bs-btn-hover-border-color: #fff;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: rgba(255,255,255,.22);
  --bs-btn-active-border-color: #fff;
}
.rf-home-content{margin-top: 1.25rem;}


/* Personnel cards (Profile / Contact style) */
.rf-person-card,
.contact-card{
  height: 100%;
}
.rf-person-card__left{
  min-height: 180px;
}
.rf-person-card__img{
  width: 120px;
  height: 120px;
  object-fit: cover;
}
.rf-person-card__initials{
  width: 120px;
  height: 120px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  color: #0b0b0b;
  background: rgba(255,255,255,0.85);
}
.rf-person-card__lead p:last-child{
  margin-bottom: 0;
}

/* Keep speaker cards same height within a row */
.speakers-page .row > [class*="col-"]{
  display: flex;
}
.speakers-page .row > [class*="col-"] > .rf-person-card{
  flex: 1 1 auto;
}
@media (max-width: 767.98px){
  .rf-person-card__left{
    min-height: 0;
  }
  .rf-person-card__img,
  .rf-person-card__initials{
    width: 104px;
    height: 104px;
  }
}

/* Speakers: larger portraits */
.speakers-page .rf-person-card__img,
.speakers-page .rf-person-card__initials,
.page-template-page-speakers .rf-person-card__img,
.page-template-page-speakers .rf-person-card__initials{
  width: 200px !important;
  height: 200px !important;
}

/* Speakers: keep contact button strictly below the portrait */
.speakers-page .rf-person-card__left,
.page-template-page-speakers .rf-person-card__left{
  flex-direction: column !important;
}

/* University single: hero (photo + logo + name) */
.ra-uni-hero{
  position: relative;
}
.ra-uni-hero__media{
  position: relative;
}
.ra-uni-hero__photo{
  display:block;
  width:100%;
  height: 320px;
  object-fit: cover;
}
@media (min-width: 992px){
  .ra-uni-hero__photo{ height: 380px; }
}
.ra-uni-hero__body{
  display:flex;
  align-items:center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}
.ra-uni-hero--has-photo .ra-uni-hero__body{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  padding: 1.25rem 1.25rem;
  background: linear-gradient(to top, rgba(17,24,39,.72), rgba(17,24,39,0));
}
.ra-uni-hero__logo{
  flex: 0 0 auto;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--ra-radius-sm);
  padding: .5rem .75rem;
  display:flex;
  align-items:center;
}
.ra-uni-hero__logo-img{
  display:block;
  height: 56px;
  width:auto;
  max-width: 200px;
}
.ra-uni-hero--has-photo .ra-uni-hero__title{
  color:#fff;
  text-shadow: 0 2px 18px rgba(0,0,0,.35);
}
@media (max-width: 575.98px){
  .ra-uni-hero__photo{ height: 260px; }
  .ra-uni-hero__body{ padding: .9rem 1rem; }
  .ra-uni-hero__logo{ padding: .4rem .6rem; }
  .ra-uni-hero__logo-img{ height: 44px; }
}

/* University single: social networks list (inline, no underline) */
.single-university .ra-uni-social{
  display: flex;
  flex-wrap: nowrap;
  gap: .25rem 1rem;
}
.single-university .ra-uni-social li{
  margin: 0;
}
.single-university .ra-uni-social a{
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.single-university .ra-uni-social a:hover,
.single-university .ra-uni-social a:focus{
  text-decoration: none;
}
@media (max-width: 575.98px){
  .single-university .ra-uni-social{ flex-wrap: wrap; }
}


/* Footer */
.site-footer{
  background: var(--ra-surface);
  border-top: 1px solid var(--ra-border);
}
.site-footer__title{
  font-weight: 700;
  color: var(--ra-primary);
  margin-bottom: .5rem;
}
.site-footer__item{
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  margin-bottom: .45rem;
}
.site-footer__icon{
  color: var(--ra-primary);
  margin-top: .1rem;
}

.site-footer__menu{
  columns: 2;
  column-gap: 2rem;
}
.site-footer__menu li{
  break-inside: avoid;
}
@media (max-width: 767.98px){
  .site-footer__menu{columns: 1;}
}

/* Registration honeypot: must not use display:none */
.rf-visually-hidden{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}
.rf-honeypot{
  /* semantic hook; visibility handled via .rf-visually-hidden */
}


.rf-dl dt{font-weight:700;}
.rf-dl dd{margin:0 0 .5rem 0;}
.rf-dl dd:last-child{margin-bottom:0;}


/* Program timeline (two columns, based on direction-l / direction-r idea) */
.rf-timeline{
  position: relative;
  list-style: none;
  margin: 2rem 0;
  padding: 0;
}
.rf-timeline:before{
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--bs-primary);
  transform: translateX(-1px);
}
.rf-timeline__item{
  position: relative;
  width: 50%;
  padding: 0 2rem 2rem;
  box-sizing: border-box;
}
.rf-timeline__item.direction-l{ left: 0; text-align: right; }
.rf-timeline__item.direction-r{ left: 50%; text-align: left; }

.rf-timeline__marker{
  position: absolute;
  top: .35rem;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--bs-body-bg);
  border: 2px solid var(--bs-primary);
}
.rf-timeline__item.direction-l .rf-timeline__marker{ right: -7px; }
.rf-timeline__item.direction-r .rf-timeline__marker{ left: -7px; }

.rf-timeline__card{
  display: inline-block;
  text-align: left;
  padding: 1rem 1.25rem;
  max-width: 560px;
}
.rf-timeline__item.direction-l .rf-timeline__card{ text-align: left; }

.rf-timeline__head{
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
}
.rf-timeline__title{
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--bs-primary);
}
.rf-timeline__time{
  font-weight: 700;
  color: var(--bs-primary);
}
.rf-timeline__meta{
  margin-top: .35rem;
  color: rgba(0,0,0,.65);
}
.rf-timeline__desc{
  margin-top: .75rem;
}
.rf-timeline__links{
  margin-top: .75rem;
}

.rf-timeline__people{
  margin-top: .75rem;
}
.rf-timeline__people-title{
  font-weight: 700;
  color: var(--bs-primary);
  margin-bottom: .35rem;
}
.rf-people-list{
  margin: 0;
  padding-left: 1.1rem;
}
.rf-people-list li{
  margin-bottom: .25rem;
}
.rf-person-meta{
  color: rgba(0,0,0,.65);
  font-size: .9rem;
}

@media (max-width: 767.98px){
  .rf-timeline:before{ left: 16px; transform:none; }
  .rf-timeline__item{
    width: 100%;
    left: 0 !important;
    padding: 0 0 1.5rem 2.5rem;
    text-align: left;
  }
  .rf-timeline__marker{ left: 9px !important; right: auto !important; }
  .rf-timeline__card{ max-width: 100%; }
}
