/* === DEFENSIOLOG — Main Stylesheet === */

:root {
  --c-bg: #FAFAF8;
  --c-surface: #FFFFFF;
  --c-text: #1a1a1a;
  --c-text-secondary: #6b6b6b;
  --c-text-muted: #9a9a9a;
  --c-border: rgba(0,0,0,0.08);
  --c-border-hover: rgba(0,0,0,0.15);
  --c-accent: #2a5a3a;
  --c-accent-light: #e8f0eb;
  --c-tag-bg: #f0f0ee;
  --c-tag-text: #555;
  --c-hero-bg: #1a2a3a;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
  --max-width: 1120px;
  --content-width: 680px;
  --radius: 10px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* === HEADER === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,250,248,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--c-text);
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
}

.logo-text {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 14px;
  color: var(--c-text-secondary);
  transition: color var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--c-text);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--c-border);
}

.lang-link {
  font-size: 13px;
  color: var(--c-text-muted);
  transition: color var(--transition);
}

.lang-link:hover { color: var(--c-text); }

.lang-current {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-toggle span {
  width: 20px;
  height: 1.5px;
  background: var(--c-text);
  transition: var(--transition);
}

/* === HERO === */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px 48px;
  text-align: center;
}

.hero-label {
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  color: var(--c-text);
}

.hero-desc {
  font-size: 16px;
  color: var(--c-text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

/* === POST CARDS GRID === */
.posts-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.post-card {
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}

.post-card:hover {
  border-color: var(--c-border-hover);
  transform: translateY(-2px);
}

.post-card-link { display: block; }

.post-card-cover {
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: var(--c-hero-bg);
  position: relative;
}

.post-card-cover--placeholder {
  background: linear-gradient(135deg, #1a2a3a 0%, #2a4a3a 50%, #1a3a2a 100%);
}

.post-card-format {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
}

.post-card-body { padding: 16px; }

.post-card-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 4px;
}

.post-card-desc {
  font-size: 13px;
  color: var(--c-text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--c-tag-bg);
  color: var(--c-tag-text);
  transition: background var(--transition);
}

a.tag:hover { background: var(--c-border-hover); }

.post-date {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-left: auto;
}

/* === SECTION HEADER === */
.section-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 24px 32px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
}

.section-desc {
  color: var(--c-text-secondary);
  margin-top: 8px;
}

/* === SINGLE POST — CLASSIC === */
.post--classic {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.post-header { margin-bottom: 32px; }

.post-category {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 12px;
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.post-subtitle {
  font-size: 18px;
  color: var(--c-text-secondary);
  line-height: 1.5;
}

.post-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--c-text-muted);
}

.reading-time::before {
  content: '·';
  margin-right: 16px;
}

/* Post cover */
.post-cover {
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
}

.post-cover img { width: 100%; }

.post-cover figcaption {
  font-size: 13px;
  color: var(--c-text-muted);
  padding: 8px 0;
  text-align: center;
}

/* === PROSE (article content) === */
.prose h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  margin: 48px 0 16px;
}

.prose h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 32px 0 12px;
}

.prose p { margin-bottom: 20px; }

.prose img {
  border-radius: var(--radius);
  margin: 32px 0;
}

.prose figure {
  margin: 32px 0;
}

.prose figure img {
  border-radius: var(--radius);
  margin: 0;
}

.prose figcaption {
  font-size: 13px;
  color: var(--c-text-muted);
  text-align: center;
  margin-top: 8px;
}

.prose blockquote {
  border-left: 3px solid var(--c-accent);
  padding-left: 20px;
  margin: 32px 0;
  font-style: italic;
  color: var(--c-text-secondary);
}

.prose ul, .prose ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.prose li { margin-bottom: 6px; }

.prose code {
  font-size: 14px;
  background: var(--c-tag-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.prose pre {
  background: #1a1a1a;
  color: #e0e0e0;
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 14px;
}

.prose--narrow {
  max-width: 580px;
  margin: 0 auto;
}

/* === SINGLE POST — MINIMAL === */
.post--minimal {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 80px 24px;
}

.post-header--minimal {
  margin-bottom: 48px;
}

.post-header--minimal time {
  font-size: 13px;
  color: var(--c-text-muted);
  display: block;
  margin-bottom: 12px;
}

/* === SCROLLYTELLING HERO === */
.scrolly-hero {
  width: 100%;
  min-height: 60vh;
  background-size: cover;
  background-position: center;
  background-color: var(--c-hero-bg);
  position: relative;
  display: flex;
  align-items: flex-end;
}

.scrolly-hero-overlay {
  width: 100%;
  padding: 48px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.post-category--light { color: rgba(255,255,255,0.6); }

.post-title--hero {
  color: #fff;
  max-width: 640px;
}

.post-subtitle--hero {
  color: rgba(255,255,255,0.7);
  max-width: 540px;
}

.post-meta-bar--hero {
  color: rgba(255,255,255,0.5);
}

/* === POST FOOTER === */
.post-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
}

.post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.post-nav-link {
  padding: 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.post-nav-link:hover { border-color: var(--c-border-hover); }

.post-nav-label {
  font-size: 12px;
  color: var(--c-text-muted);
  display: block;
  margin-bottom: 4px;
}

.post-nav-title {
  font-size: 14px;
  font-weight: 500;
}

.post-nav-next { text-align: right; }

/* === FOOTER === */
.site-footer {
  border-top: 1px solid var(--c-border);
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.footer-title {
  font-size: 14px;
  font-weight: 500;
}

.footer-desc {
  font-size: 13px;
  color: var(--c-text-secondary);
  margin-bottom: 16px;
}

.footer-meta {
  font-size: 12px;
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.rss-link {
  color: var(--c-text-muted);
  transition: color var(--transition);
}

.rss-link:hover { color: var(--c-text); }

/* === MOBILE === */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-toggle { display: flex; }

  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: 16px 24px;
    gap: 12px;
  }

  .main-nav.open .lang-switcher {
    border-left: none;
    margin-left: 0;
    padding-left: 0;
    padding-top: 8px;
    border-top: 1px solid var(--c-border);
  }

  .hero { padding: 48px 20px 32px; }
  .posts-grid { grid-template-columns: 1fr; padding: 0 20px 48px; }
  .post--classic, .post--minimal { padding: 32px 20px 48px; }
  .scrolly-hero-overlay { padding: 32px 20px; }
  .post-nav { grid-template-columns: 1fr; }
}


/* === ALLIANCES === */
.alliances-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.alliance-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  transition: border-color var(--transition), transform var(--transition);
}

.alliance-card:hover {
  border-color: var(--c-border-hover);
  transform: translateY(-2px);
}

.alliance-card-link { display: block; padding: 20px; }

.alliance-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.alliance-card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
}

.alliance-card-type {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--c-accent-light);
  color: var(--c-accent);
  white-space: nowrap;
}

.alliance-card-desc {
  font-size: 13px;
  color: var(--c-text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.alliance-card-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--c-text-muted);
}

.alliance-stat strong { color: var(--c-text); font-weight: 500; }

.alliance-info-bar {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--c-text-secondary);
  flex-wrap: wrap;
}

.alliance-info-bar strong { color: var(--c-text); font-weight: 500; }

.alliance-members {
  margin: 32px 0;
  padding: 24px;
  background: var(--c-bg);
  border-radius: var(--radius);
}

.alliance-members-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 16px;
}

.members-table {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--c-surface);
  border-radius: 6px;
  font-size: 14px;
}

.member-flag {
  font-size: 12px;
  color: var(--c-text-muted);
  font-weight: 500;
  min-width: 24px;
}

.member-name { flex: 1; }

.member-year { font-size: 12px; color: var(--c-text-muted); }

@media (max-width: 768px) {
  .alliances-grid { grid-template-columns: 1fr; }
  .alliance-info-bar { flex-direction: column; gap: 8px; }
  .members-table { grid-template-columns: 1fr; }
}
