/* ==============================================================================
   KENDIR KENEVIR | EDITORIAL DESIGN SYSTEM
   Contemporary Scientific Journal × Agricultural Research Archive
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;450;500;600&family=Space+Grotesk:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- DESIGN TOKENS (CSS VARIABLES) --- */
:root {
  /* LIGHT THEME (DEFAULT: Cool Mineral / Technical Grey) */
  --bg: #E9ECEA;
  --surface: #F2F4F2;
  --surface-alt: #E2E6E3;
  --surface-contrast: #FFFFFF;

  --text: #111513;
  --text-secondary: #58615D;
  --text-muted: #7B8580;
  --text-dim: #9FAAA3;

  --border: #BEC7C2;
  --border-strong: #98A49E;
  --border-subtle: #D2D8D4;

  --accent: #13C995;
  --accent-hover: #0BAE80;
  --accent-soft: #C9F3E5;
  --accent-contrast: #07120E;

  /* TYPOGRAPHY TOKENS */
  --font-heading: 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* CONTAINER & SPACING */
  --container-width: min(100% - 48px, 1440px);
  --reading-width: 720px;
  --header-height: 56px;
  --transition-theme: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

[data-theme="dark"] {
  /* DARK THEME (Calm Night / Technical Obsidian) */
  --bg: #0E1210;
  --surface: #141916;
  --surface-alt: #19201C;
  --surface-contrast: #1F2723;

  --text: #E8ECE9;
  --text-secondary: #A3ADA7;
  --text-muted: #737E77;
  --text-dim: #4B554F;

  --border: #29342E;
  --border-strong: #3C4A43;
  --border-subtle: #1C2420;

  --accent: #31D7A3;
  --accent-hover: #58E7B9;
  --accent-soft: #173D31;
  --accent-contrast: #07120E;
}

/* --- BASE RESETS & EDITORIAL FOUNDATION --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important; /* STRICT ENFORCEMENT: Square everywhere */
  box-shadow: none !important;  /* STRICT ENFORCEMENT: No drop shadows */
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  transition: var(--transition-theme);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- TYPOGRAPHIC HIERARCHY --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text);
  line-height: 1.15;
}

h1 {
  font-size: clamp(40px, 4.8vw, 76px);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(28px, 3vw, 46px);
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.015em;
}

p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.65;
}

p.lead {
  font-size: clamp(18px, 1.6vw, 22px);
  color: var(--text);
  line-height: 1.55;
  font-weight: 400;
}

.text-reading {
  max-width: var(--reading-width);
}

.text-meta {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease;
}

a:hover {
  color: var(--accent);
}

/* --- EDITORIAL CONTAINER & 12-COL GRID --- */
.container {
  width: var(--container-width);
  margin-inline: auto;
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 28px);
  }
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .grid-12 {
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .grid-12 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* --- EDITORIAL SECTION STRUCTURE --- */
.section-editorial {
  border-top: 1px solid var(--border);
  padding-block: clamp(56px, 7vw, 108px);
}

.section-editorial.compact {
  padding-block: clamp(36px, 4vw, 64px);
}

.section-head-editorial {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

/* --- RESTRAINED PUBLICATION MASTHEAD (NAVBAR) --- */
.site-nav {
  position: sticky;
  top: 0;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  height: 56px;
  display: flex;
  align-items: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  width: 100%;
  flex-wrap: nowrap;
}

.nav-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand-sub {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-item a,
.nav-link {
  font-size: 13.5px;
  font-weight: 450;
  color: var(--text-secondary);
  padding: 6px 4px;
  position: relative;
  text-decoration: none;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease;
}

.nav-item a:hover,
.nav-link:hover {
  color: var(--text);
}

.nav-item a.active,
.nav-link.active {
  color: var(--text);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
}

.nav-item-btn a {
  border: 1px solid var(--border-strong);
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap !important;
  transition: all 0.15s ease;
}

.nav-item-btn a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* THEME TOGGLE (MINIMAL [ ☼ / ◐ ]) */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap !important;
  transition: var(--transition-theme);
}

.theme-toggle-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

/* COPILOT NAV TRIGGER BUTTON */
.copilot-nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(45, 60, 40, 0.2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap !important;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.copilot-nav-trigger:hover {
  background: var(--accent);
  color: #051008;
  border-color: var(--accent);
}

.copilot-nav-dot {
  width: 7px;
  height: 7px;
  background: #38b000;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px rgba(56, 176, 0, 0.6);
  animation: kkPulseDot 2s infinite ease-in-out;
}

@keyframes kkPulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* NAVBAR ADAPTATION WHEN COPILOT SIDEBAR IS OPEN */
body.kk-copilot-open .site-nav .nav-brand-sub {
  display: none !important;
}

body.kk-copilot-open .site-nav .nav-menu {
  gap: 10px !important;
}

body.kk-copilot-open .site-nav .nav-item a,
body.kk-copilot-open .site-nav .nav-link {
  font-size: 13px !important;
  padding: 4px 3px !important;
}

@media (max-width: 1080px) {
  .site-nav .nav-brand-sub {
    display: none !important;
  }
  .site-nav .nav-menu {
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .site-nav .nav-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-nav .nav-inner::-webkit-scrollbar {
    display: none;
  }
  .site-nav .nav-menu {
    gap: 10px;
  }
}

/* --- BUTTONS & CONTROLS (STRICTLY SQUARE) --- */
.btn-editorial-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 140ms ease;
}

.btn-editorial-primary:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.btn-editorial-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 140ms ease;
}

.btn-editorial-secondary:hover {
  border-color: var(--text);
  color: var(--text);
}

.link-editorial {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition: all 140ms ease;
}

.link-editorial:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* --- EDITORIAL TABLES & LISTS --- */
.table-editorial {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-editorial th {
  text-align: left;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}

.table-editorial td {
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  vertical-align: middle;
}

.table-editorial tr:hover td {
  background-color: var(--surface);
}

/* --- EDITORIAL FORMS --- */
.input-editorial, .textarea-editorial, .select-editorial {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 12px 14px;
  min-height: 46px;
  transition: border-color 140ms ease;
}

.input-editorial:focus, .textarea-editorial:focus, .select-editorial:focus {
  outline: none;
  border-color: var(--accent);
}

.label-editorial {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* --- PUBLICATION COLOPHON (FOOTER) --- */
.site-footer-editorial {
  border-top: 1px solid var(--border);
  background-color: var(--bg);
  padding-block: 48px 32px;
  margin-top: auto;
  font-size: 13px;
}

.footer-meta-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 12px;
}
