:root {
  --crimson: #8b0a1a;
  --crimson-dark: #5e0612;
  --crimson-light: #b71c2c;
  --gold: #d4a04a;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --bg: #f7f4f0;
  --card: #ffffff;
  --border: #e3dcd0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  max-width: 100%;
}

.hero {
  position: relative;
  background:
    linear-gradient(rgba(94, 6, 18, 0.88), rgba(139, 10, 26, 0.92)),
    repeating-linear-gradient(45deg, transparent, transparent 30px, rgba(255,255,255,0.03) 30px, rgba(255,255,255,0.03) 32px);
  color: #fff;
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
  border-bottom: 4px solid var(--gold);
  overflow: hidden;
  width: 100%;
}

/* Gold corner accents */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  width: 48px;
  height: 48px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.7;
}
.hero::before {
  left: 0;
  border-width: 3px 0 0 3px;
}
.hero::after {
  right: 0;
  border-width: 3px 3px 0 0;
}

.hero__logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: nowrap;
}

.hero__logos img {
  height: 40px;
  width: auto;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  flex-shrink: 0;
}

.hero__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.75rem;
}

.hero__title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hero__subtitle-row {
  max-width: 720px;
  margin: 0.25rem auto 0;
}

.hero__subtitle {
  display: block;
  font-style: italic;
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--gold);
  line-height: 1.25;
}

.hero__flags {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  background: #fff;
  padding: 5px 8px;
  border-radius: 6px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.hero__flags img {
  height: 16px;
  width: auto;
  object-fit: contain;
  flex-shrink: 1;
  min-width: 0;
}

@media (min-width: 640px) {
  .hero__flags { gap: 27px; padding: 6px 14px; }
  .hero__flags img { height: 22px; }
}

@media (min-width: 640px) {
  .hero__logos { gap: 2rem; margin-bottom: 2rem; }
  .hero__logos img { height: 72px; }
  .hero__subtitle { font-size: 2.25rem; }
}

.hero__meta {
  font-size: 0.95rem;
  margin-top: 1rem;
  opacity: 0.95;
}

.hero__arm {
  display: block;
  width: 100%;
  max-width: 700px;
  height: auto;
  margin: 1rem auto 0;
}

.hero__meta strong { display: block; font-size: 1.1rem; margin-bottom: 0.15rem; }

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--crimson-dark);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1 0 auto;
  min-width: max-content;
  background: transparent;
  color: rgba(255,255,255,0.75);
  border: none;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}

.tab.active {
  color: #fff;
  border-bottom-color: var(--gold);
}

.tab__date {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.7;
  margin-top: 2px;
}

main { max-width: 800px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.event { display: none; }
.event.active { display: block; }

.event__header {
  text-align: center;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.event__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--crimson);
  margin-bottom: 0.4rem;
}

.event__venue {
  font-size: 0.9rem;
  color: var(--muted);
}

.session {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.session__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--crimson);
  color: #fff;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.session__time {
  display: none;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,0.15);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}

.session__title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.session__title small {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: 2px;
  font-style: italic;
}

.session__chevron {
  font-size: 2em;
  line-height: 1;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.session.open .session__chevron { transform: rotate(180deg); }

.session__body {
  display: none;
  padding: 1rem 1.25rem 1.25rem;
}

.session.open .session__body { display: block; }

.moderators {
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--bg);
  border-left: 3px solid var(--gold);
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.moderators strong { color: var(--crimson); }

.talk {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--border);
}

.talk:last-child { border-bottom: none; }

.talk__time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--crimson);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 2px;
}

.talk__title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.2rem;
}

.talk__title small {
  display: block;
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  margin-top: 2px;
}

.talk__speaker {
  font-size: 0.82rem;
  color: var(--crimson);
  font-weight: 600;
  margin-top: 0.35rem;
}

.talk__speaker .country {
  font-weight: 400;
  color: var(--muted);
}

.break {
  text-align: center;
  padding: 0.85rem;
  background: var(--bg);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
  font-weight: 600;
}

.break .time {
  display: inline-block;
  margin-right: 0.5rem;
  color: var(--crimson);
}

.sponsors {
  background: #fff;
  padding: 1.6rem 1rem;
  text-align: center;
  border-top: 4px solid var(--gold);
}

.sponsors__title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--crimson);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
}

.sponsors__title small {
  display: block;
  font-size: 0.6rem;
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 0.2rem;
}

.sponsors__grid--main {
  justify-content: center;
  margin-bottom: calc(1.25rem + 6px);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.sponsor--main {
  height: 43px !important;
  max-width: 200px !important;
}

.sponsor--main-lg {
  height: 56px !important;
  max-width: 260px !important;
}

.sponsors__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.1rem 1.5rem;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.sponsors__grid img {
  height: 35px;
  width: auto;
  max-width: 125px;
  object-fit: contain;
  filter: grayscale(20%);
  opacity: 0.9;
  transition: opacity 0.2s, filter 0.2s;
}

.sponsors__grid img:hover {
  opacity: 1;
  filter: grayscale(0%);
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--crimson-dark);
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
}

footer a { color: var(--gold); text-decoration: none; }

@media (min-width: 640px) {
  .hero { padding: 4rem 2rem 3rem; }
  .hero__title { font-size: 2.25rem; }
  .event__title { font-size: 1.6rem; }
  .session__title { font-size: 1.05rem; }
  .talk { grid-template-columns: 110px 1fr; gap: 1.25rem; }
}

@media (min-width: 900px) {
  .hero__title { font-size: 2.75rem; }
  .hero__subtitle { font-size: 2.75rem; }
}

/* ══════════════════════════════════════════════════════════
   STICKY SITE HEADER
   ══════════════════════════════════════════════════════════ */
:root { --site-header-h: 0px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #ffffff;
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 0.75rem 0.75rem;
  overflow: hidden;
}

.site-header__logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.site-header__logos img {
  height: 44px;
  width: auto;
  max-width: 30%;
  min-width: 0;
  object-fit: contain;
  flex-shrink: 1;
}

/* Sehiyyə logo 30% bigger than the other two */
.site-header__logos .logo--sehiyye { height: 57px; }

@media (min-width: 640px) {
  .site-header { padding: 0.875rem 1rem; }
  .site-header__logos { gap: 1.75rem; }
  .site-header__logos img { height: 61px; max-width: 220px; }
  .site-header__logos .logo--sehiyye { height: 79px; }
}

/* ══════════════════════════════════════════════════════════
   MULTI-SCREEN MANAGEMENT
   ══════════════════════════════════════════════════════════ */
.screen { display: none; }
.screen.active { display: block; }

#screen-lang.active {
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════════════
   LANG SCREEN — 30% smaller than default hero
   ══════════════════════════════════════════════════════════ */
.hero--lang {
  padding: 1.25rem 1.25rem 1rem;
}
.hero--lang .hero__title {
  font-size: 1.05rem;
}
.hero--lang .hero__subtitle {
  font-size: 1.05rem;
}
.hero--lang .hero__meta {
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

@media (min-width: 640px) {
  .hero--lang { padding: 2rem 2rem 1.5rem; }
  .hero--lang .hero__title { font-size: 1.575rem; }
  .hero--lang .hero__subtitle { font-size: 1.575rem; }
}

/* ── Language picker ── */
.lang-pick {
  background: var(--crimson-dark);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  gap: 1.25rem;
}

.lang-pick__label {
  color: rgba(255,255,255,0.8);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lang-pick__btns {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
}

.lang-btn {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  padding: 0.7rem 1.75rem;
  color: var(--gold);
  font-size: 1.225rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
  letter-spacing: 0.05em;
}

.lang-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: var(--gold);
}

/* Mobile: lang buttons 30% smaller */
@media (max-width: 639px) {
  .lang-btn {
    font-size: 0.86rem;
    padding: 0.49rem 1.22rem;
    border-radius: 8px;
  }
}

/* ══════════════════════════════════════════════════════════
   PAGE NAV — sticky just below site-header on screens 2 & 3
   top is set dynamically via JS: --site-header-h CSS variable
   ══════════════════════════════════════════════════════════ */
.page-nav {
  position: sticky;
  top: var(--site-header-h);
  z-index: 190;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.nav-back {
  background: none;
  border: none;
  color: var(--crimson);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-back:hover { background: rgba(139,10,26,0.08); }

.page-nav__title {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-nav__title span {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-nav__title small {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Event / session picker ── */
.event-pick {
  background: var(--bg);
  padding: 1.25rem 1rem 3rem;
  max-width: 600px;
  margin: 0 auto;
}

.event-pick__label {
  text-align: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.event-card {
  display: block;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--crimson);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.event-card:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.event-card__date {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--crimson);
  background: rgba(139,10,26,0.08);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.event-card__name {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.event-card__venue {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Hide tabs when single event is shown ── */
.tabs.single-event { display: none; }

/* ══════════════════════════════════════════════════════════
   LANGUAGE FILTERING
   ══════════════════════════════════════════════════════════ */
body[data-lang="az"] .t-en { display: none; }
body[data-lang="en"] .t-az { display: none; }

/* EN mode: restore <small class="t-en"> to primary text appearance */
body[data-lang="en"] .talk__title .t-en {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  font-style: normal;
  color: inherit;
  opacity: 1;
  margin-top: 0;
  line-height: 1.35;
}

body[data-lang="en"] .session__title .t-en {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  font-style: normal;
  color: inherit;
  opacity: 1;
  margin-top: 0;
}

body[data-lang="en"] .event__title .t-en {
  display: inline;
}

body[data-lang="en"] .event__venue .t-en,
body[data-lang="az"] .event__venue .t-az,
body[data-lang="en"] .event__title .t-en,
body[data-lang="az"] .event__title .t-az {
  font-size: inherit;
  font-style: normal;
  font-weight: inherit;
  color: inherit;
}

/* ══════════════════════════════════════════════════════════
   MOBILE FIXES
   ══════════════════════════════════════════════════════════ */
.talk__title,
.session__title,
.event__title {
  overflow-wrap: break-word;
  word-break: break-word;
}

main { overflow-x: hidden; }
