:root {
  --bg-deep: #020815;
  --bg-header: #02102a;
  --bg-logo: #041433;

  --accent-orange: #f36a21;
  --accent-red: #c3212a;
  --accent-white: #ffffff;

  --content-width: 1180px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Mukta", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background-color: var(--bg-deep);
  color: var(--accent-white);
}

/* Top multicolour stripe */
.top-stripe {
  height: 16px;
  background: linear-gradient(
    to right,
    var(--accent-orange) 0 15%,
    var(--accent-red) 15% 30%,
    #ffffff 30% 33%,
    #061329 33% 67%,
    #ffffff 67% 70%,
    var(--accent-red) 70% 85%,
    var(--accent-orange) 85% 100%
  );
}

/* Header banner with logo + clickable buttons */
.site-header {
  background-color: var(--bg-header);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 10;
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}

/* Left logo block with slanted right edge */
.logo-panel {
  display: flex;
  align-items: center;
  padding: 18px 0px 18px 32px;
  background-color: var(--bg-logo);
  position: relative;
  overflow: visible;
  z-index: 2;
}

.logo-panel::after {
  content: "";
  position: absolute;
  top: 0;
  right: -30px;
  width: 120px;
  height: 100%;
  background-color: var(--bg-logo);
  clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
  z-index: -1;
}

.logo-panel a {
  display: inline-flex;
  align-items: center;
}

.logo-panel img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 48px;
}

/* Right nav block with slanted left edge (mirror of logo) */
.nav-panel {
  background-color: var(--bg-header);
  display: flex;
  align-items: stretch;
  flex: 1;
  position: relative;
  overflow: visible;
  z-index: 1;
}

.nav-panel::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -90px;
  width: 160px;
  background-color: var(--bg-header);
  clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%);
  z-index: -1;
  pointer-events: none;
}

.main-nav {
  display: flex;
  margin-left: auto;
  font-weight: 800; /* bold */
  text-transform: uppercase;
  letter-spacing: 0.22em; /* wider spacing */
  font-size: 1rem; /* larger text */
}

.nav-item-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 38px; /* wider padding */
  text-decoration: none;
  color: var(--accent-white);
  background-color: #03112b;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.nav-item:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.nav-item-wrapper:last-child .nav-item {
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.nav-item::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px; /* thicker underline */
  width: 0;
  background-color: var(--accent-orange);
  transition: width 0.2s ease-out;
}

.nav-item:hover::after,
.nav-item.is-active::after {
  width: 100%;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-item-wrapper.has-dropdown > .nav-item {
  padding-right: 46px;
}

.nav-item-wrapper.has-dropdown > .nav-item::before {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--accent-white);
  transform: translateY(-50%);
  opacity: 0.7;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  min-width: 220px;
  background: rgba(3, 17, 43, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.55);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.nav-item-wrapper.has-dropdown:hover .nav-dropdown,
.nav-item-wrapper.has-dropdown:focus-within .nav-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-item {
  display: block;
  padding: 9px 24px 9px 28px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-left: 3px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus {
  color: var(--accent-orange);
  border-left-color: var(--accent-orange);
  background: rgba(255, 255, 255, 0.04);
}

/* Wrapper for the rest of the page */
.pattern-wrapper {
  position: relative;
  z-index: 1;
  background-color: #020815;
  padding-bottom: 80px;
  overflow: hidden;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.pattern-wrapper::before,
.pattern-wrapper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 900px;
  pointer-events: none;
}

.pattern-wrapper::before {
  background: radial-gradient(circle at top, #12244b 0, #020815 60%);
  z-index: -2;
}

/* Grid tiling overlay */
.pattern-wrapper::after {
  background: url("../images/grid_tiling.webp") top center / cover no-repeat;
  opacity: 0.22;
  z-index: -1;
}

.page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 20px 0;
}

.site-footer {
  background-color: #010814;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 32px 20px;
  flex-shrink: 0;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.6);
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-note {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  flex: 1 1 360px;
}

.footer-links {
  display: inline-flex;
  gap: 20px;
  flex: 0 0 auto;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-links a {
  color: var(--accent-orange);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus {
  opacity: 0.8;
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Hero image area */
.hero {
  background-color: #071632;
  padding: 18px;
  border-radius: 3px;
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.7);
  margin-bottom: 40px;
}

.hero-frame {
}

.hero-frame img {
  display: block;
  width: 100%;
  height: auto;
}

/* Title & copy */
.page-title {
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2.1rem, 2.6vw, 2.6rem);
  line-height: 1.1;
  margin-bottom: 22px;
}

.page-title span {
  display: block;
}

.page-title .accent {
  color: var(--accent-orange);
}

.section-title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 1.2;
  margin: 40px 0 20px;
  color: var(--accent-orange);
}

.text-block {
  font-size: 0.97rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}

.text-block p + p {
  margin-top: 14px;
}

.text-block a {
  color: var(--accent-orange);
  text-decoration: none;
}

.text-block a:hover {
  text-decoration: underline;
}

.library-sections {
  margin-top: 40px;
  padding: 20px;
  background-color: rgba(7, 22, 50, 0.3);
  border-radius: 5px;
  border-left: 4px solid var(--accent-orange);
}

.library-sections h3 {
  color: var(--accent-orange);
  margin-bottom: 10px;
}

.library-sections a {
  color: var(--accent-orange);
  text-decoration: none;
  font-weight: 600;
}

.library-sections a:hover {
  text-decoration: underline;
}

.library-books {
  margin-top: 50px;
}

.library-books__intro {
  margin-bottom: 20px;
}

.library-books__description {
  color: rgba(255, 255, 255, 0.8);
  max-width: 780px;
}

.library-books__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 340px));
  gap: 24px;
  justify-content: center;
  margin-top: 2em;
}

.library-books__card {
  background: rgba(7, 22, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
  min-height: 100%;
  width: min(340px, 100%);
  justify-self: center;
  box-sizing: content-box;
}

.library-books__card:hover,
.library-books__card:focus {
  transform: translateY(-3px);
  border-color: rgba(243, 106, 33, 0.6);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.6);
  border-width: 1.5px;
}

.library-books__thumb {
  background: #010814;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border-radius: 8px 8px 0 0;
}

.library-books__thumb img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.library-books__thumb-placeholder {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
}

.library-books__meta {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.library-books__title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.5rem;
  line-height: 1em;
}

.library-books__subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.library-books__publine {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
}

.library-books__empty {
  margin-top: 20px;
  padding: 24px;
  background: rgba(7, 22, 50, 0.4);
  border-radius: 8px;
  border-left: 4px solid var(--accent-orange);
}

/* Single page styles */
.single-page .page-header {
  margin-bottom: 40px;
}

.single-page .page-title {
  margin-bottom: 10px;
}

.single-page .page-date {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.single-page .content {
  /*max-width: 920px;*/
}

.single-page .content p {
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.9);
  margin: 1rem 0;
}

.single-page .content img,
.single-page .content figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
}

.single-page .content figure {
  margin: 24px auto;
  text-align: center;
}

.single-page .content ul,
.single-page .content ol {
  margin: 1rem 0 1.5rem;
  padding-left: 1.6rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
}

.single-page .content ul {
  list-style: none;
}

.single-page .content ul li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.55rem;
}

.single-page .content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  transform: translateY(-50%);
}

.single-page .content ol {
  counter-reset: article-ordered;
}

.single-page .content ol li {
  counter-increment: article-ordered;
  margin-bottom: 0.6rem;
  padding-left: 0.5rem;
}

.single-page .content ol li::marker {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.single-page .content figcaption {
  margin-top: 10px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.single-page .content figcaption::before,
.single-page .content figcaption::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
}

/* List page styles */
.list-page .page-header {
  margin-bottom: 40px;
}

.page-list {
  display: grid;
  gap: 30px;
}

.page-item {
  background-color: rgba(7, 22, 50, 0.5);
  padding: 25px;
  border-radius: 5px;
  border-left: 4px solid var(--accent-orange);
}

.page-item h2 {
  margin-bottom: 10px;
}

.page-item h2 a {
  color: var(--accent-white);
  text-decoration: none;
  font-size: 1.3rem;
}

.page-item h2 a:hover {
  color: var(--accent-orange);
}

.page-item .page-summary {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
  line-height: 1.6;
}

.page-item .page-date {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.history-articles {
  margin-top: 10px;
}

.history-articles .page-header {
  margin-bottom: 32px;
}

.history-articles .page-description {
  background: rgba(2, 8, 21, 0.35);
  border-left: 4px solid var(--accent-orange);
  padding: 18px 22px;
  border-radius: 8px;
  margin-top: 16px;
}

.article-card-grid {
  gap: 28px;
}

.article-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card__thumb {
  position: relative;
  height: 220px;
  padding: 0;
  overflow: hidden;
  background: #010814;
  border-radius: 8px 8px 0 0;
}

.article-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-card__thumb-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  background: radial-gradient(
    circle at 30% 30%,
    rgba(243, 106, 33, 0.25),
    rgba(1, 8, 20, 0.95)
  );
}

.article-card__thumb-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
}

.article-card__badge {
  display: inline-flex;
  align-items: center;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(1, 8, 20, 0.6);
}

.article-card__date {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(255 255 255);
  text-shadow: 1px 1px 3px #000000;
}

.article-card__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.article-card .library-books__title {
  line-height: 1.2;
}

.article-card__author {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.article-card__summary {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
  margin-top: 8px;
}

.article-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  font-size: 1rem;
  margin-top: auto;
  padding-top: 14px;
  color: var(--accent-orange);
}

.article-card__cta::after {
  content: "→";
  font-size: 2rem;
  line-height: 0.5em;
}

.article-empty {
  background: rgba(2, 8, 21, 0.45);
  border-radius: 8px;
  border-left: 4px solid var(--accent-orange);
  padding: 24px;
  color: rgba(255, 255, 255, 0.85);
}

.article-single {
  background: #071632;
  border-radius: 12px;
  padding: 36px;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 30px;
}

.article-single .page-header {
  margin-bottom: 20px;
}

.article-single__meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

.article-single__description {
  background: rgba(2, 8, 21, 0.4);
  border-left: 4px solid var(--accent-orange);
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.85);
}

.article-single .content {
  max-width: 100%;
}

.article-single .content a {
  color: #7becff;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease,
    background-color 0.2s ease;
}

.article-single .content a:hover,
.article-single .content a:focus-visible {
  color: #fff6ec;
}

.article-single .content a:active {
  color: var(--accent-white);
  border-bottom-color: var(--accent-white);
}

.article-single .content a:visited {
  color: #c57bff;
}

@media (max-width: 720px) {
  .article-single {
    padding: 24px;
  }
}

/* Responsive behaviour */
@media (max-width: 1170px) {
  .header-inner {
    flex-direction: column;
  }

  .logo-panel {
    clip-path: none;
    padding: 14px 20px;
    justify-content: center;
  }

  .logo-panel::after {
    content: none;
  }

  .nav-panel {
    justify-content: center;
  }

  .nav-panel::before {
    content: none;
  }

  .main-nav {
    margin-left: 0;
    font-size: 0.9rem;
    letter-spacing: 0.18em;
  }

  .nav-item {
    padding: 14px 20px;
  }

  .hero {
    padding: 14px;
  }
}

@media (max-width: 600px) {
  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.85rem;
    letter-spacing: 0.16em;
  }

  .nav-item {
    padding: 10px 16px;
  }

  .page {
    padding-top: 28px;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .page-list {
    gap: 20px;
  }

  .page-item {
    padding: 20px;
  }
}
