@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  color-scheme: light;
  --ink: #121c39;
  --navy: #111e43;
  --blue: #263bc9;
  --blue-deep: #1b2da3;
  --paper: #fbfaf7;
  --white: #fff;
  --muted: #4f5a75;
  --line: #dcdfea;
  --fog: #eef0fb;
  --coral: #f9a16c;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; }
body { margin: 0; font: 1rem/1.55 var(--sans); }
[lang=hi], [lang=ar], [lang=zh], [lang=ru] { --serif: Georgia, 'Noto Serif', serif; }
::selection { background: #dde2ff; color: var(--navy); }
:focus-visible { outline: 3px solid #5d74ff; outline-offset: 4px; }
a { color: inherit; text-underline-offset: .2em; }
a:hover { color: var(--blue-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
svg { vertical-align: middle; flex: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-block-start: 0; }
h1, h2 { font: 400 clamp(2.9rem, 5.2vw, 5.35rem)/.99 var(--serif); letter-spacing: -.026em; text-wrap: balance; }
h2 { font-size: clamp(2.3rem, 3.6vw, 3.7rem); margin-bottom: .43em; }
h3 { line-height: 1.23; text-wrap: pretty; }
p { max-inline-size: 72ch; }
.wrap { width: min(100% - 5rem, 1320px); margin-inline: auto; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip:focus { position: fixed; z-index: 10; inset-block-start: 1rem; inset-inline-start: 1rem; background: var(--white); padding: .6rem 1rem; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead { display: flex; align-items: center; gap: 1.4rem; min-height: 78px; }
.brand { display: inline-flex; align-items: center; gap: .67rem; color: var(--navy); text-decoration: none; min-width: max-content; }
.brand img { width: 36px; height: 36px; }
.brand span { display: block; font-size: 1rem; font-weight: 700; line-height: 1.14; letter-spacing: -.025em; max-inline-size: 9rem; }
.masthead nav { display: flex; gap: clamp(.6rem, 1.5vw, 1.6rem); align-items: center; margin-inline: auto; }
.masthead nav a { text-decoration: none; font-size: .86rem; white-space: nowrap; color: var(--ink); }
.masthead nav a:hover, .masthead nav [aria-current=page] { color: var(--blue); text-decoration: underline; }
.header-actions { display: flex; gap: .68rem; align-items: center; }
.language { display: inline-flex; align-items: center; gap: .38rem; }
.language select { background: transparent; border: 0; max-width: 6.1rem; padding-inline-end: .3rem; font-size: .88rem; }
.icon-link { display: inline-grid; width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 4px; place-items: center; color: inherit; }
.button { display: inline-flex; gap: .5rem; justify-content: center; align-items: center; border: 1px solid var(--blue); border-radius: 5px; padding: .63rem 1.08rem; min-height: 42px; color: var(--white); background: var(--blue); text-decoration: none; font-weight: 700; font-size: .92rem; line-height: 1.35; }
.button:hover { color: var(--white); background: var(--blue-deep); }
.button.secondary { background: transparent; color: var(--blue-deep); border-color: #aab5ea; }
.button.secondary:hover { background: var(--fog); }
.button:disabled { cursor: wait; opacity: .55; }
.hero { background: var(--navy); color: var(--white); }
.hero-grid { display: grid; grid-template-columns: 1.14fr .86fr; min-height: 410px; }
.hero-copy { align-self: center; padding: 4rem 2.75rem 5rem 0; }
[dir=rtl] .hero-copy { padding: 4rem 0 5rem 2.75rem; }
.hero h1 { margin: 0 0 1.2rem; text-wrap: initial; font-size: clamp(3.6rem, 6.8vw, 6rem); }
.hero p { color: #e0e6f9; max-inline-size: 34rem; font-size: 1.08rem; margin-bottom: 1.65rem; }
.hero-actions { display: flex; gap: .66rem; flex-wrap: wrap; }
.hero .button { background: var(--coral); border-color: var(--coral); color: var(--navy); }
.hero .button:hover { background: #ffba93; }
.hero .secondary { color: var(--white); background: transparent; border-color: #818fb9; }
.hero .secondary:hover { background: #26365e; }
.hero-image { height: 100%; min-height: 360px; overflow: hidden; background: #183b8f; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 52%; }
.search-dock { position: relative; margin-block-start: -1.85rem; z-index: 1; }
.searchbox { display: flex; background: var(--white); align-items: center; gap: .9rem; border: 1px solid var(--line); border-radius: 7px; padding: .55rem; box-shadow: 0 8px 24px #00000012; }
.searchbox > svg { margin-inline-start: .67rem; color: var(--blue); }
.searchbox input { flex: 1; min-width: 0; padding: .6rem 0; border: 0; background: transparent; }
.searchbox select { padding: .63rem .6rem; max-inline-size: 31%; border: 0; border-inline-start: 1px solid var(--line); background: var(--white); font-size: .9rem; }
.searchbox .button { min-width: 7rem; }
.section { padding-block: 3.4rem; }
.section + .section { border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; }
.text-link { color: var(--blue-deep); text-decoration-thickness: .06em; font-weight: 700; font-size: .92rem; }
.notice { border: 1px solid var(--line); background: var(--fog); border-radius: 5px; margin: 0 0 1rem; padding: .6rem .9rem; font-size: .88rem; color: var(--navy); display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.notice > span { flex: 1; min-inline-size: 12rem; }
.text-button { background: none; border: 0; padding: 0; cursor: pointer; text-align: start; text-decoration: underline; text-underline-offset: .2rem; color: var(--blue-deep); font-weight: 700; }
.event-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .9rem; }
.event-card { border: 1px solid var(--line); border-radius: 8px; background: var(--white); padding: 1.1rem; min-width: 0; position: relative; }
.event-card:hover { border-color: #919fe3; }
.card-top { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; flex-wrap: wrap; }
.kind, .tag { width: fit-content; border-radius: 4px; font-size: .79rem; font-weight: 700; padding: .19rem .48rem; background: var(--fog); color: var(--blue-deep); }
.tag { color: var(--ink); background: #f2e9de; }
.source-tag { color: #194532; background: #e3f1eb; }
.event-card h3 { margin: 0 0 .7rem; font-size: 1.13rem; }
.event-card h3 a, .item-row h3 a { text-decoration: none; }
.event-card h3 a:hover, .item-row h3 a:hover { text-decoration: underline; }
.card-date { color: var(--blue-deep); font-weight: 700; font-size: .86rem; margin: 0 0 .35rem; display: flex; gap: .42rem; align-items: center; }
.card-meta { margin: .1rem 0 0; font-size: .88rem; color: var(--muted); }
.lower-home { display: grid; grid-template-columns: 1.45fr 1fr; gap: 3.4rem; }
.lower-home section { min-width: 0; }
.item-row { border-top: 1px solid var(--line); padding: .92rem 0; display: grid; grid-template-columns: auto 1fr; gap: .85rem; align-items: start; }
.item-row h3 { margin: .15rem 0 .23rem; font-size: 1.07rem; }
.item-row p { margin: .1rem 0 0; font-size: .9rem; color: var(--muted); }
.row-icon { display: grid; height: 36px; width: 36px; color: var(--blue-deep); background: var(--fog); place-items: center; border-radius: 5px; }
.subject-list { list-style: none; padding: 0; margin: 0; }
.subject-list a { display: flex; align-items: center; gap: .7rem; border-top: 1px solid var(--line); padding: .69rem .13rem; text-decoration: none; line-height: 1.3; }
.subject-list a:hover { color: var(--blue-deep); background: var(--fog); }
.code, .date { font-variant-numeric: tabular-nums; }
.code { min-width: 3.4rem; color: var(--blue-deep); font-size: .87rem; font-weight: 700; }
footer { background: var(--navy); color: #e2e8fb; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.2rem 2.4rem; padding-block: 2rem; align-items: center; justify-content: space-between; }
.footer-inner .brand, footer a:hover { color: var(--white); }
.footer-inner p { margin: 0; font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .88rem; }
.page { min-height: 65vh; padding-block: 2rem 4rem; }
.page h1 { margin-bottom: .35em; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: .64rem; color: var(--muted); font-size: .88rem; margin-bottom: 1.55rem; }
.breadcrumb a { color: var(--blue-deep); }
.page-description { color: var(--muted); }
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; padding-bottom: .85rem; margin-block: .9rem 1.2rem; border-bottom: 1px solid var(--line); }
.tab { padding: .47rem .76rem; color: var(--blue-deep); border: 1px solid var(--line); background: var(--white); border-radius: 4px; text-decoration: none; font-weight: 700; font-size: .89rem; }
.tab[aria-current=page], .tab[aria-pressed=true] { background: var(--blue); color: var(--white); border-color: var(--blue); }
.filter-grid, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem 1rem; }
.filter-grid { grid-template-columns: repeat(3, minmax(0,1fr)); margin-block: .8rem 1.2rem; }
label.field { display: flex; flex-direction: column; gap: .32rem; font-weight: 700; font-size: .92rem; }
.field input, .field select, .field textarea, .select-search { border: 1px solid #a5acc2; border-radius: 4px; padding: .53rem .62rem; width: 100%; background: var(--white); color: var(--ink); font-size: .98rem; font-weight: 400; }
.field input:disabled, .field select:disabled { background: #e9ebf1; }
.field textarea { min-height: 106px; resize: vertical; }
.field small, .muted { color: var(--muted); font-weight: 400; }
.full { grid-column: 1/-1; }
.record-content { display: grid; grid-template-columns: 1.5fr 1fr; align-items: start; gap: 2rem; }
.record-pane { border-block-start: 1px solid var(--line); padding-block-start: 1.1rem; min-width: 0; }
.record-pane h2 { font-size: 2.25rem; }
.record-pane p { white-space: pre-wrap; overflow-wrap: anywhere; }
.metadata { margin: 0 0 1rem; background: var(--white); border: 1px solid var(--line); border-radius: 7px; padding: .95rem; }
.metadata div { display: grid; grid-template-columns: 1fr 1.2fr; gap: .6rem; padding: .4rem .1rem; overflow-wrap: anywhere; }
.metadata div + div { border-top: 1px solid var(--line); }
.metadata dt { font-weight: 700; }
.metadata dd { margin: 0; }
.pills { display: flex; gap: .49rem; flex-wrap: wrap; margin: 0 0 1rem; }
.form-panel { max-width: 880px; }
.form-section { margin-block: 1.5rem; border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem 1.2rem; background: var(--white); }
.form-section legend { font-size: 1.1rem; font-weight: 700; padding-inline: .44rem; }
.form-panel .form-section .form-section { margin-block: .4rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .62rem; align-items: center; }
.form-feedback { display: block; margin-block: .6rem; color: #8a2933; }
.form-feedback:empty { display: none; }
.subject-picker { position: relative; }
.subject-options, .tree { padding: .38rem; margin: .3rem 0; border: 1px solid var(--line); background: var(--white); border-radius: 5px; list-style: none; }
.subject-options:empty { display: none; }
.subject-options button { border: 0; display: flex; text-align: start; padding: .33rem; background: none; width: 100%; }
.subject-options button:hover { background: var(--fog); }
.tree { max-width: 900px; padding: .5rem .9rem; }
.tree li { border-bottom: 1px solid var(--line); padding: .55rem 0; }
.tree li:last-child { border: 0; }
.tree .code { display: inline-block; }
.country-tree a { display: grid; grid-template-columns: 3.4rem 1fr auto; gap: .4rem; align-items: center; text-decoration: none; }
.country-tree a:hover span { text-decoration: underline; }
.country-tree a .muted { text-align: end; }
.subject-filter { max-width: 530px; margin-bottom: 1rem; }
.dashboard-row { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.dashboard-row h3 { margin-bottom: .3rem; }
.dashboard-row input { margin: .4rem 0; max-width: 500px; display: block; }
.help { max-width: 800px; }
.help details { padding: .8rem 0; border-top: 1px solid var(--line); }
.help summary { color: var(--blue-deep); font-weight: 700; cursor: pointer; }
.empty { padding: 1.2rem; background: var(--fog); color: var(--muted); border-radius: 6px; }
.loading { min-height: 62vh; padding-block: 4rem; }
@media (max-width: 1220px) {
  .masthead { flex-wrap: wrap; gap: .7rem; padding-block: .82rem .65rem; }
  .masthead nav { order: 3; flex-basis: 100%; margin-inline: 0; overflow-x: auto; padding: .15rem .15rem .5rem; }
  .header-actions { margin-inline-start: auto; }
}
@media (max-width: 760px) {
  .wrap { width: min(100% - 2rem, 1320px); }
  .hero-grid { grid-template-columns: 1fr; }
  .masthead nav { flex-wrap: wrap; gap: .35rem .85rem; overflow-x: visible; }
  .hero-copy, [dir=rtl] .hero-copy { padding: 2rem 0 1.35rem; }
  .hero-image { min-height: 0; height: 142px; }
  .hero-image img { object-position: center 53%; }
  .hero h1 { font-size: clamp(3.25rem, 10vw, 5rem); }
  .search-dock { margin-block-start: -.95rem; }
  .searchbox { gap: .4rem; flex-wrap: wrap; }
  .searchbox > svg { margin-inline-start: .2rem; }
  .searchbox input { flex-basis: calc(100% - 2rem); }
  .searchbox select { flex: 1; max-inline-size: 100%; border-inline-start: 0; }
  .searchbox .button { min-width: 5.3rem; }
  .event-grid, .lower-home, .record-content { grid-template-columns: 1fr; gap: .9rem; }
  .lower-home { gap: 2rem; }
  .section { padding-block: 2.45rem; }
  .filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .section-heading { align-items: start; }
}
@media (max-width: 410px) {
  .masthead { gap: .5rem; }
  .brand { gap: .42rem; }
  .brand img { width: 31px; height: 31px; }
  .brand span { font-size: .81rem; max-inline-size: 6.3rem; }
  .header-actions { gap: .38rem; }
  .header-actions .button { padding-inline: .55rem; }
  .language { gap: .12rem; }
  .language > svg { display: none; }
  .language select { max-width: 4.5rem; }
  .icon-link { width: 31px; height: 33px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
