:root {
  --blue: #3a4aff;
  --blue-deep: #170fff;
  --blue-soft: #8da9ff;
  --surface: #f6f9ff;
  --header: #ebf0ff;
  --ink: #171925;
  --muted: #454a57;
  --white: #fff;
}

* { box-sizing: border-box; padding: 0; margin: 0; }
html { scroll-behavior: smooth; }
body {
  color: var(--ink);
  background: var(--white);
  font-family: var(--font-manrope), sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 51px;
  padding: 12px 24px;
  border: 0;
  border-radius: 16px;
  color: white;
  background: var(--blue);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease;
}
.button svg {
  display: block;
  flex-shrink: 0;
  width: 1.1em;
  height: 1.1em;
}
.button:hover { background: var(--blue-deep); transform: translateY(-1px); }
.button:focus-visible, .back-button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 40%, transparent);
  outline-offset: 2px;
}

.site-header { position: relative; isolation: isolate; height: 310px; background: var(--header); overflow: hidden; }
.site-header__inner { position: relative; z-index: 2; width: min(100%, 1440px); height: 100%; margin: 0 auto; }
.brand { position: absolute; z-index: 2; left: 65px; top: 56px; display: flex; align-items: flex-start; gap: 12px; color: var(--blue-deep); }
.brand img { width: 58px; height: 79px; object-fit: contain; }
.brand span { display: flex; flex-direction: column; line-height: 1.05; text-transform: none; }
.brand strong { font-size: 36px; font-weight: 800; letter-spacing: -1.8px; white-space: nowrap; text-transform: uppercase; }
.brand em { font-size: 36px; font-weight: 400; font-style: normal; letter-spacing: -1.9px; white-space: nowrap; text-transform: uppercase; }
.site-header__tagline { position: absolute; left: 65px; top: 150px; z-index: 2; color: var(--muted); font-size: 20px; }
.site-header__soldier { position: absolute; right: 0; top: 0; z-index: 1; width: 492px; max-width: 100%; height: 310px; transform: scaleX(-1); pointer-events: none; }
.site-header__soldier img { display: block; width: 100%; height: 100%; object-fit: cover; }
.search { position: absolute; z-index: 3; left: 65px; top: 216px; display: flex; align-items: center; gap: 16px; }
.search__field { width: 450px; height: 51px; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border: 1px solid var(--blue-soft); border-radius: 16px; background: white; }
.search__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #31353e;
}
.search__icon svg {
  display: block;
  width: 20px;
  height: 20px;
}
.search input { width: 100%; border: 0; outline: 0; color: var(--ink); font-size: 20px; line-height: 1.25; background: transparent; }
.search input::placeholder { color: #3f3f3f; opacity: 1; }

.home-main { width: min(100%, 1440px); min-height: 714px; margin: 0 auto; padding: 24px 65px 50px; }
.hero-grid { display: grid; grid-template-columns: repeat(3, 400px); gap: 50px; align-items: start; }
.hero-card { display: block; position: relative; isolation: isolate; width: 400px; height: 640px; overflow: hidden; border: 1px solid var(--blue-soft); border-radius: 24px; background: white; cursor: pointer; transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.hero-card:hover { border-color: var(--blue); box-shadow: 0 12px 32px rgba(58, 74, 255, 0.18); transform: translateY(-2px); }
.hero-card:hover .hero-card__button { background: var(--blue-deep); transform: translateY(-1px); }
.hero-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 40%, transparent); outline-offset: 3px; }
.hero-card__portrait { position: relative; z-index: 0; height: 400px; overflow: hidden; }
.hero-card__portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hero-card__body { position: relative; z-index: 0; height: 240px; padding: 10px 32px 44px; text-align: center; display: flex; flex-direction: column; gap: 0; }
.hero-card h2 { margin: 0 0 2px; font-size: 24px; line-height: 1.28; font-weight: 650; white-space: nowrap; }
.hero-card p, .hero-card time { display: block; margin: 0; font-size: 20px; line-height: 1.3; }
.hero-card p { margin-bottom: 2px; }
.hero-card__ribbons { margin-top: auto; margin-bottom: 8px; min-height: 42px; display: flex; justify-content: space-around; align-items: center; gap: 12px; overflow: hidden; }
.hero-card__ribbons img { width: auto; height: auto; max-height: 42px; max-width: 72px; object-fit: contain; }
.hero-card__button { width: 100%; min-height: 51px; margin-top: 0; pointer-events: none; }
.empty-state { width: min(640px, 100%); margin-top: 70px; padding: 42px; border-radius: 24px; background: var(--surface); }
.empty-state p { margin: 10px 0 24px; font-size: 18px; }

.site-header--compact { position: relative; z-index: 5; height: 198px; overflow: visible; background: white; }
.site-header--compact .search { left: auto; right: 71px; top: 214px; }
.site-header--compact .brand { color: var(--blue-deep); }
.detail-main { width: min(100%, 1440px); margin: 0 auto; padding: 16px 55px 32px; overflow: hidden; }
.detail-toolbar { height: 59px; display: flex; align-items: flex-start; }
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 51px;
  padding: 12px 24px;
  border: 1px solid var(--blue-deep);
  border-radius: 16px;
  color: var(--blue-deep);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}
.back-button svg {
  display: block;
  flex-shrink: 0;
  width: 1.1em;
  height: 1.1em;
}
.hero-profile { position: relative; isolation: isolate; display: flex; gap: 24px; align-items: center; width: 100%; min-height: 562px; margin: 16px 10px; padding: 48px 100px 48px 0; overflow: hidden; border-radius: 24px; background: var(--surface); }
.hero-profile__map { position: absolute; z-index: -1; top: 14px; left: 367px; width: 943px; height: 534px; opacity: .66; }
.hero-profile__portrait { position: relative; flex: 0 0 350px; height: 466px; overflow: hidden; border-radius: 16px; }
.hero-profile__portrait img { object-fit: cover; object-position: center top; }
.hero-profile__content { align-self: stretch; width: 714px; display: flex; flex-direction: column; gap: 16px; }
.hero-profile h1 { color: var(--blue); font-size: 48px; line-height: 1.38; font-weight: 800; }
.hero-profile__dates { display: flex; align-items: center; gap: 29px; }
.hero-profile__dates time { padding: 10px; border: 1px solid var(--ink); font-size: 20px; }
.shoulder-board { display: flex; flex: 0 0 121px; width: 121px; height: 47px; align-items: center; justify-content: center; }
.shoulder-board img { display: block; flex: 0 0 auto; width: 47px; height: 121px; max-width: none; transform: rotate(90deg); }
.hero-profile__content > p { font-size: 20px; }
.awards { display: flex; flex-direction: column; gap: 8px; font-size: 20px; }
.awards__list { display: flex; gap: 8px; }
.awards__list figure { position: relative; width: 128px; height: 243px; overflow: hidden; border: 1px solid var(--blue-soft); border-radius: 16px; background: color-mix(in srgb, white 65%, transparent); }
.awards__list img { object-fit: contain; padding: 16px 10px; }
.awards__list .award--crop img { left: -100% !important; width: 200% !important; max-width: none !important; padding: 16px 20px; object-fit: contain; }
.story-block { width: 100%; margin: 16px 0; padding: 16px; border-radius: 16px; background: var(--surface); }
.story-block h2, .photo-archive h2 { font-size: 48px; line-height: 1.38; }
.story-block p { margin-top: 8px; color: #1e1e1e; font-size: 24px; line-height: 1.38; white-space: pre-line; }
.photo-archive { margin-top: 8px; }
.photo-gallery { position: relative; width: calc(100% + 110px); margin-left: -55px; overflow: hidden; }
.photo-gallery__track { display: flex; justify-content: center; gap: 24px; min-width: max-content; }
.photo-gallery__item { position: relative; width: 430px; height: 765px; overflow: hidden; border-radius: 16px; }
.photo-gallery__item:nth-child(2) { width: 344px; }
.photo-gallery__item:nth-child(3) { width: 720px; }
.photo-gallery__open {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: zoom-in;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.photo-gallery__open:hover { transform: scale(1.01); box-shadow: 0 12px 32px color-mix(in srgb, var(--blue) 18%, transparent); }
.photo-gallery__open:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 40%, transparent); outline-offset: 3px; }
.photo-gallery__item img { object-fit: cover; }
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  backdrop-filter: blur(4px);
}
.photo-lightbox__panel {
  position: relative;
  width: min(100%, 1200px);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.photo-lightbox__figure { width: 100%; margin: 0; display: grid; gap: 12px; }
.photo-lightbox__image-wrap {
  position: relative;
  width: 100%;
  height: min(78vh, 900px);
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 64px color-mix(in srgb, var(--ink) 28%, transparent);
}
.photo-lightbox__image { object-fit: contain; }
.photo-lightbox__caption { color: white; font-size: 18px; line-height: 1.4; text-align: center; }
.photo-lightbox__counter { color: color-mix(in srgb, white 82%, var(--blue-soft)); font-size: 16px; font-weight: 600; }
.photo-lightbox__close svg,
.gallery-arrow svg {
  display: block;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
}
.photo-lightbox__close {
  position: absolute;
  z-index: 2;
  top: -8px;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-size: 22px;
  line-height: 1;
  transform: translateY(-100%);
}
.photo-lightbox__close:hover { background: var(--blue-deep); }
.photo-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
}
.photo-lightbox__nav--prev { left: -8px; }
.photo-lightbox__nav--next { right: -8px; }
.gallery-arrow {
  position: absolute;
  z-index: 4;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-size: 22px;
  line-height: 1;
  transform: translateY(-50%);
}
.gallery-arrow--left { left: 16px; }
.gallery-arrow--right { right: 16px; }
.sources-link { margin: 48px 0; text-align: center; }
.sources-link a { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
.sources-main { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 90px; }
.sources-main h1 { margin: 30px 0 12px; color: var(--blue); font-size: clamp(38px, 6vw, 64px); }
.sources-intro { max-width: 720px; color: #4d5568; font-size: 18px; line-height: 1.55; }
.sources-list { display: grid; gap: 10px; margin-top: 34px; }
.sources-list article { display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 18px; border: 1px solid #dce1ec; border-radius: 14px; background: #f8f9fc; }
.sources-list img { width: 92px; height: 108px; object-fit: contain; }
.sources-list h2 { margin-bottom: 7px; font-size: 18px; }
.sources-list p, .sources-list a { color: #50596e; font-size: 13px; line-height: 1.55; }
.sources-list a { color: var(--blue); text-decoration: underline; }
.source-review { display: inline-flex; margin-top: 8px; padding: 4px 8px; border-radius: 999px; color: #795b19; background: #fff0c9; font-size: 11px; font-weight: 800; }

@media (max-width: 1000px) {
  .site-header { height: auto; min-height: 265px; padding: 28px 20px; }
  .site-header__inner { display: flex; flex-direction: column; gap: 24px; }
  .brand { position: relative; left: auto; top: auto; }
  .brand strong, .brand em { font-size: clamp(17px, 4vw, 30px); white-space: normal; }
  .site-header__tagline { position: relative; left: auto; top: auto; font-size: 16px; max-width: 65%; }
  .site-header__soldier { right: 0; width: 410px; height: 265px; }
  .search, .site-header--compact .search { position: relative; left: auto; right: auto; top: auto; width: min(100%, 590px); }
  .search__field { width: 100%; }
  .home-main { padding: 24px 20px; }
  .hero-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 400px)); gap: 28px; }
  .detail-main { padding: 16px 20px; overflow: visible; }
  .site-header--compact { min-height: 220px; }
  .hero-profile { margin-inline: 0; padding: 28px; flex-direction: column; align-items: stretch; }
  .hero-profile__portrait { width: min(350px, 100%); }
  .hero-profile__content { width: 100%; }
  .hero-profile h1 { font-size: clamp(34px, 7vw, 48px); }
  .story-block h2, .photo-archive h2 { font-size: clamp(32px, 7vw, 48px); }
  .story-block p { font-size: 19px; }
  .photo-gallery { width: calc(100% + 40px); margin-left: -20px; }
  .photo-lightbox { padding: 16px; }
  .photo-lightbox__panel { max-height: calc(100vh - 32px); }
  .photo-lightbox__nav--prev { left: 8px; }
  .photo-lightbox__nav--next { right: 8px; }
  .photo-lightbox__close { top: 8px; right: 8px; transform: none; }
}

@media (max-width: 520px) {
  .site-header__soldier { opacity: .3; }
  .site-header__tagline { max-width: 100%; }
  .brand img { width: 42px; height: 58px; }
  .search { flex-direction: column; }
  .hero-card { width: 100%; height: auto; }
  .hero-card__portrait { height: 100vw; max-height: 400px; }
  .hero-card__body { height: auto; min-height: 240px; }
  .hero-card h2 { white-space: normal; }
  .hero-profile__portrait { flex-basis: auto; height: 440px; }
  .awards__list { overflow-x: auto; }
  .photo-gallery__item, .photo-gallery__item:nth-child(2), .photo-gallery__item:nth-child(3) { width: 82vw; height: 600px; }
}

/* Shared-hosting compatibility layer. The main visual rules come from the Next.js app. */
.hero-card__portrait > img,.hero-profile__portrait > img{width:100%;height:100%;object-fit:cover;display:block}
.hero-card__ribbons img{width:72px;height:30px;object-fit:contain}
.awards__list figure img{width:100%;height:100%;object-fit:contain}
.shoulder-board img{width:47px;height:121px;object-fit:contain}
.photo-gallery__item{margin:0;flex:none}
.photo-gallery__open img{display:block;width:100%;height:100%;object-fit:cover}
.photo-gallery__item figcaption{position:absolute;inset:auto 12px 12px;padding:7px 10px;border-radius:6px;color:#fff;background:rgba(9,23,44,.76);font-size:14px}
.hosting-lightbox{position:fixed;width:min(1200px,94vw);height:min(88vh,900px);border:0;padding:42px 70px 52px;background:#101317;overflow:visible}
.hosting-lightbox::backdrop{background:rgba(0,0,0,.8)}
.hosting-lightbox figure{width:100%;height:100%;margin:0;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:10px}
.hosting-lightbox img{width:100%;height:100%;min-height:0;object-fit:contain}
.hosting-lightbox figcaption{color:#fff;text-align:center;font-size:17px}.hosting-lightbox figcaption:empty{display:none}
.hosting-lightbox button{position:absolute;z-index:2;display:grid;place-items:center;width:46px;height:46px;border:0;border-radius:50%;color:#fff;background:#17467f;font-size:30px;line-height:1;cursor:pointer}
.hosting-lightbox__close{right:10px;top:5px}.hosting-lightbox__nav{top:50%;transform:translateY(-50%)}.hosting-lightbox__nav--prev{left:12px}.hosting-lightbox__nav--next{right:12px}
.hosting-lightbox__counter{position:absolute;left:50%;bottom:12px;margin:0;color:#fff;transform:translateX(-50%)}

.admin-body{margin:0;background:#f3f5f8;color:#172130;font:15px Arial,sans-serif}
.admin-layout{min-height:100vh;display:grid;grid-template-columns:230px minmax(0,1fr)}
.admin-sidebar{position:sticky;top:0;height:100vh;box-sizing:border-box;padding:24px 18px;background:#172b4d;color:#fff;display:flex;flex-direction:column;gap:28px}
.admin-brand{color:#fff;text-decoration:none;font-size:20px;font-weight:800}
.admin-sidebar nav{display:grid;gap:5px}.admin-sidebar nav a,.admin-link-button{display:block;color:#dbe7f7;text-decoration:none;border:0;background:transparent;padding:11px 10px;text-align:left;font:inherit;cursor:pointer}.admin-sidebar nav a:hover,.admin-link-button:hover{background:#24436f;color:#fff}
.admin-sidebar form{margin-top:auto}.admin-main{min-width:0;padding:26px 34px 70px}.admin-topbar{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:26px}.admin-topbar span{color:#657183}.admin-topbar h1{margin:3px 0 0;font-size:28px}
.admin-login{min-height:100vh;display:grid;place-items:center;padding:20px}.admin-login-card{width:min(410px,100%);box-sizing:border-box;padding:30px;background:#fff;border:1px solid #dce2ea}.admin-login-card label{display:grid;gap:7px;margin:18px 0;font-weight:700}
.admin-body input,.admin-body textarea,.admin-body select{box-sizing:border-box;width:100%;border:1px solid #bac4d0;background:#fff;padding:10px 12px;font:inherit;color:inherit}.admin-body textarea{resize:vertical;line-height:1.5}.admin-body input[type=checkbox]{width:auto}.admin-body input[type=range]{padding:0}
.admin-button,.upload-button{display:inline-flex;align-items:center;justify-content:center;border:0;background:#17467f;color:#fff!important;text-decoration:none;padding:11px 17px;font-weight:700;cursor:pointer}.admin-button--secondary{background:#fff!important;color:#17467f!important;border:1px solid #17467f}.danger-button,.danger{border:0;background:#a12626!important;color:#fff!important;padding:9px 13px;cursor:pointer}
.admin-page-actions,.admin-actions{display:flex;gap:12px;margin-bottom:20px}.admin-table-wrap{overflow:auto;background:#fff;border:1px solid #dce2ea}.admin-table{width:100%;border-collapse:collapse}.admin-table th,.admin-table td{text-align:left;padding:13px 15px;border-bottom:1px solid #e3e7ec}.admin-table a{color:#17467f}.row-actions{display:flex;gap:7px}.row-actions form{margin:0}.row-actions button{border:1px solid #9eabba;background:#fff;padding:7px 9px;cursor:pointer}
.stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:24px}.stat-grid article{background:#fff;border:1px solid #dce2ea;padding:24px}.stat-grid strong{display:block;font-size:34px;color:#17467f}.stat-grid span{color:#657183}
.admin-form{display:grid;gap:20px}.admin-form section{background:#fff;border:1px solid #dce2ea;padding:22px}.admin-form h2{font-size:19px;margin:0 0 18px}.admin-form label{display:grid;gap:7px;font-weight:700}.admin-form section>label+label{margin-top:16px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.span-2{grid-column:1/-1}.checkbox{display:flex!important;align-items:center;flex-direction:row}.sticky-submit{position:sticky;bottom:0;padding:12px 0;background:#f3f5f8}
.form-message{padding:12px 14px;margin-bottom:16px}.form-message--error{background:#ffeded;color:#941f1f}.form-message--success{background:#e9f7ee;color:#19683a}
.portrait-tool{display:grid;grid-template-columns:280px 1fr;gap:25px}.portrait-preview{width:280px;aspect-ratio:1;overflow:hidden;background:#e8edf3}.portrait-preview img{width:100%;height:100%;object-fit:cover}.upload-button{position:relative;overflow:hidden;margin-bottom:15px}.upload-button input{position:absolute;inset:0;opacity:0;cursor:pointer}.upload-status{min-height:20px;color:#566476}
.award-search{max-width:480px;margin-bottom:14px}.selected-awards{display:grid;gap:6px;margin-bottom:14px}.selected-awards__item{display:grid;grid-template-columns:1fr auto auto auto;gap:6px;align-items:center;padding:8px 10px;background:#eef3f8}.selected-awards__item button{border:1px solid #aeb9c6;background:#fff;width:32px;height:30px;cursor:pointer}.award-picker{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;max-height:520px;overflow:auto}.award-option{border:1px solid #d9e0e8;padding:9px;display:grid!important;grid-template-columns:auto 48px 1fr;align-items:center;gap:8px;font-size:12px}.award-option[hidden]{display:none!important}.award-option img{width:48px;height:58px;object-fit:contain}.catalog-admin-grid{display:grid;gap:8px}.catalog-admin-grid article{display:grid;grid-template-columns:66px 1fr auto;align-items:center;gap:14px;background:#fff;border:1px solid #dce2ea;padding:10px 14px}.catalog-admin-grid img{width:58px;height:65px;object-fit:contain}.catalog-admin-grid span{display:block;margin-top:4px;color:#687485;font-size:12px}.catalog-admin-grid a{color:#17467f}
@media(max-width:900px){.admin-layout{grid-template-columns:1fr}.admin-sidebar{position:static;height:auto}.admin-sidebar nav{grid-template-columns:repeat(4,1fr)}.admin-main{padding:20px}.award-picker{grid-template-columns:repeat(3,1fr)}}
@media(max-width:650px){.hosting-lightbox{width:96vw;height:86vh;padding:56px 12px 44px}.hosting-lightbox__nav--prev{left:8px}.hosting-lightbox__nav--next{right:8px}.admin-sidebar nav{grid-template-columns:1fr 1fr}.form-grid,.portrait-tool,.stat-grid{grid-template-columns:1fr}.span-2{grid-column:auto}.portrait-preview{width:100%}.award-picker{grid-template-columns:1fr}.row-actions{display:grid}}

