/* ===============================
   MPSoL / MPSoWaL — style.css
   Modern Soviet Aesthetic
   =============================== */

:root {
  --bg: #0f0f12;
  --fg: #f0f0f0;
  --muted: #9a9a9a;
  --accent: #c9a86a;
  --border: #1f1f22;
  --card-bg: #18181b;
  --card-hover: #202024;
  --radius: 12px;
  --gap: 1.2rem;
  --transition: 0.25s ease;
  --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ====================================
   Insignia Background (optional)
   ==================================== */
/* For mpsowal.com, keep as-is or adjust path.
   For mps-ol.to, either remove or point to that site’s asset. */
.background-insignia {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 520px;
  height: 520px;
  background: url("/covers/_thumbs/mpsollogo.webp") no-repeat center/contain;
  opacity: 0.06;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: lighten;
}

.navbar,
.hero,
main,
footer {
  position: relative;
  z-index: 1;
}

/* Optional breathing animation for insignia */
@keyframes pulse-insignia {
  0%, 100% { opacity: 0.05; }
  50% { opacity: 0.08; }
}
.background-insignia.animate {
  animation: pulse-insignia 14s ease-in-out infinite;
}

/* ====================================
   Global Typography
   ==================================== */
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.5;
  font-size: 16px;
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #e0c98b;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.small {
  font-size: 0.85rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

/* ====================================
   Buttons
   ==================================== */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #111;
  padding: 0.4rem 1.1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--transition), transform var(--transition);
}

.btn:hover {
  background: #040404;
  color: var(--fg);
  transform: translateY(-2px);
}

/* ====================================
   Hero
   ==================================== */
.hero.hero-narrow {
  margin-bottom: 1.5rem;
  text-align: left;
}

.hero.hero-narrow h1 {
  font-size: 1.9rem;
  margin: 0 0 0.25rem;
}

.hero.hero-narrow .sub {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.8;
}

/* ====================================
   Annex page layout
   ==================================== */
.annex-main {
  max-width: 780px;
  margin-top: 3rem;
  margin-bottom: 3rem;
}

/* About block */
.annex-about {
  margin-top: 1.5rem;
  margin-bottom: 1.75rem;
}

/* Make the details card look clean */
.about-mpsowal.qa-block.qa-small details {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.22);
}

.about-mpsowal.qa-block.qa-small summary {
  cursor: pointer;
  font-weight: 500;
}

.about-mpsowal.qa-block.qa-small summary::-webkit-details-marker {
  display: none;
}

/* ABOUT BLOCK HEADINGS */
.about-mpsowal h4 {
  margin-top: 1rem;
  margin-bottom: 0.3rem;
  font-size: 1rem;
  font-weight: 600;
}

.about-mpsowal ul {
  margin: 0.25rem 0 0.75rem 0.85rem;
}

.about-mpsowal ul li {
  margin-bottom: 0.2rem;
}

/* ====================================
   Annex Form Block
   ==================================== */
.annex-form {
  margin-top: 0.5rem;
  padding: 1.5rem 1.5rem 1.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.32);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.45);
}

.annex-form h2 {
  font-size: 1.05rem;
  margin: 1.2rem 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.annex-form h2:first-of-type {
  margin-top: 0.4rem;
}

.annex-form hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 1.2rem 0 0.9rem;
}

/* Form labels + inputs */
.annex-form label {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}

.annex-form label span {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 500;
  font-size: 0.88rem;
  opacity: 0.9;
}

.annex-form input[type="text"],
.annex-form input[type="number"],
.annex-form input[type="date"],
.annex-form select,
.annex-form textarea {
  width: 100%;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.45rem 0.55rem;
  background: rgba(0, 0, 0, 0.45);
  color: #f4f4f4;
  font: inherit;
}

.annex-form input:focus,
.annex-form select:focus,
.annex-form textarea:focus {
  outline: none;
  border-color: rgba(192, 192, 96, 0.8);
  box-shadow: 0 0 0 1px rgba(192, 192, 96, 0.3);
}

/* 2-column grid for certain rows */
.annex-form .form-grid {
  display: grid;
  gap: 0.8rem;
}

@media (min-width: 720px) {
  .annex-form .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Submit button alignment */
.annex-form .form-actions {
  margin-top: 1.4rem;
  text-align: right;
}

/* Dropdown sections inside the annex form */
.annex-form .form-section {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.28);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.annex-form .form-section:last-of-type {
  margin-bottom: 0;
}

.annex-form .form-section summary {
  cursor: pointer;
  list-style: none;
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.annex-form .form-section summary::-webkit-details-marker {
  display: none;
}

.annex-form .form-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.annex-form .form-section-sub {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Highlight open section */
.annex-form .form-section[open] {
  border-color: rgba(192, 192, 96, 0.7);
}

.annex-form .form-section-body {
  padding: 0.4rem 0.9rem 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 0.7rem;
}

/* ====================================
   Archive Grid & Cards
   ==================================== */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
  margin-top: 2rem;
}

.archive-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background var(--transition), transform var(--transition);
}

.archive-card:hover {
  background: var(--card-hover);
  transform: translateY(-3px);
}

/* Thumbnail */
.thumb {
  aspect-ratio: 2 / 3;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
  transition: transform 0.25s ease;
}

.archive-card:hover .thumb img {
  transform: scale(1.012);
}

/* Card Content */
.card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.2rem 0 1.2rem;
}

.doc-title {
  font-size: 1.05rem;
  margin: 0;
}

.series {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.blurb,
.metadata,
.summary {
  padding: 0 1.2rem;
}

.blurb {
  font-size: 0.95rem;
  margin: 0.5rem 0 0.8rem;
}

.metadata p,
.summary p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

.summary {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 0.8rem 1.2rem;
  font-size: 0.85rem;
}

/* Function icons */
.function-icon {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.f1 { background: #d36850; }
.f2 { background: #c4a652; }
.f3 { background: #5578a3; }
.f4 { background: #7b9b64; }
.f5 { background: #af70b1; }
.f6 { background: #69a8a8; }
.f7 { background: #c48956; }
.f8 { background: #a65d7f; }
.f9 { background: #7b77c6; }
.f10 { background: #af5c5c; }
.f11 { background: #a2a569; }
.f12 { background: #8a8a8a; }

/* ====================================
   Footer
   ==================================== */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 1rem;
  text-align: center;
  opacity: 0.75;
  font-size: 0.9rem;
  border-top: 1px solid #eee;
}

.site-footer p + p {
  margin-top: 0.5rem;
}

/* ====================================
   Responsive adjustments
   ==================================== */
@media (max-width: 600px) {
  .wrap {
    padding: 1rem;
  }

  .archive-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    display: block;
    text-align: center;
  }
}
