/**
 * SANA STUDIO — Cargo Collective "Polaris" Design System
 * Inspired directly by https://cargocollective.com/sagejenson
 * Exact Cargo Polaris structure, typography, yellow hover highlights, and fixed left navigation.
 */

:root {
  --bg: #ffffff;
  --text: #000000;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border: #e0e0e0;
  --border-dark: #222222;
  --highlight-hover: #ffff00; /* Signature Cargo yellow hover */
  --highlight-active: #ccffcc; /* Signature Cargo green active */
  --highlight-alt: #ffccff;
  --code-bg: #f5f5f5;

  --sidebar-width: 210px;
  --sidebar-left: 35px;
  --sidebar-top: 35px;
  --content-left: 270px;
}

/* Dark Theme Support (Toggleable or System) */
[data-theme="dark"] {
  --bg: #0e0e10;
  --text: #ffffff;
  --text-secondary: #aaaaaa;
  --text-muted: #666666;
  --border: #242428;
  --border-dark: #444448;
  --highlight-hover: #333300;
  --highlight-active: #003311;
  --highlight-alt: #330033;
  --code-bg: #18181c;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12px;
  line-height: 1.6;
  -webkit-text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
}

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

img, video {
  max-width: 100%;
  height: auto;
  display: block;
  border: 0;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: 12px;
  color: inherit;
  border-radius: 0 !important;
}

/* ==========================================================================
   CARGO POLARIS FIXED LEFT SIDEBAR (.site_header & .navigation)
   ========================================================================== */

.cargo_sidebar {
  position: fixed;
  top: var(--sidebar-top);
  left: var(--sidebar-left);
  width: var(--sidebar-width);
  z-index: 1000;
  font-size: 12px;
  line-height: 1.8em;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.site_header {
  margin-bottom: 25px;
}

.header_text {
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.header_text a {
  color: var(--text);
  text-decoration: none;
}

.header_text a:hover {
  background: var(--highlight-hover);
  color: #000;
}

.site_tagline {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.navigation {
  margin: 0;
  padding: 0;
  list-style: none;
}

.navigation ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.navigation li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.navigation a,
.navigation span {
  padding: 1px 3px;
  display: inline-block;
  color: var(--text-secondary);
}

.navigation a:hover {
  background: var(--highlight-hover);
  color: #000 !important;
}

.navigation a:active {
  background: #333333;
  color: #ffffff !important;
}

.navigation li.active a {
  background: var(--highlight-active);
  color: #000 !important;
  font-weight: 500;
}

.nav_section_title {
  font-weight: bold;
  color: var(--text);
  margin-top: 18px;
  margin-bottom: 4px;
  font-size: 12px;
}

.project_links_sublist {
  padding-left: 0;
  margin-bottom: 12px;
}

.project_links_sublist li a {
  color: var(--text);
  font-size: 12px;
}

.page_link a {
  color: var(--text-secondary);
}

.page_link a:hover {
  background: var(--highlight-hover);
  color: #000;
}

.sidebar_footer {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar_footer a {
  color: var(--text-secondary);
}

.sidebar_footer a:hover {
  background: var(--highlight-hover);
  color: #000;
}

.theme_toggle_btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 2px 6px;
  font-size: 10px;
  cursor: pointer;
  margin-top: 10px;
  color: var(--text-secondary);
}

.theme_toggle_btn:hover {
  background: var(--highlight-hover);
  color: #000;
}

/* Mobile Header / Toggle */
.mobile_bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 50px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  z-index: 1001;
}

.mobile_bar_title {
  font-size: 14px;
  font-weight: bold;
}

.mobile_menu_btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}

@media (max-width: 860px) {
  .mobile_bar {
    display: flex;
  }
  .cargo_sidebar {
    display: none;
    top: 50px;
    left: 0;
    width: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    max-height: calc(100vh - 50px);
  }
  .cargo_sidebar.open {
    display: block;
  }
  .cargo_content {
    margin-left: 0 !important;
    padding: 70px 20px 60px !important;
    max-width: 100% !important;
  }
}

/* ==========================================================================
   CARGO POLARIS MAIN CONTENT (.cargo_content)
   ========================================================================== */

.cargo_content {
  margin-left: var(--content-left);
  padding: 35px 40px 100px;
  max-width: 960px;
}

/* Filter Tag Strip */
.filter_wrapper {
  margin-bottom: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.filter_tag {
  border: 1px solid var(--border);
  padding: 2px 6px;
  font-size: 11px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
}

.filter_tag:hover {
  background: var(--highlight-hover);
  color: #000;
  border-color: #000;
}

.filter_tag.active {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

[data-theme="dark"] .filter_tag.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

/* ==========================================================================
   THUMBNAILS GALLERY (Exact Sage Jenson Cargo Grid)
   ========================================================================== */

.cargo_thumbs_grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 30px;
}

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

.cargo_thumb_entry {
  display: flex;
  flex-direction: column;
}

.cargo_thumb_media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  overflow: hidden;
  margin-bottom: 8px;
}

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

.cargo_thumb_media video {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.cargo_thumb_entry:hover .cargo_thumb_media video {
  opacity: 1;
}

.cargo_thumb_caption {
  font-size: 12px;
  line-height: 1.5;
}

.cargo_thumb_title {
  color: var(--text);
  font-weight: normal;
  display: inline;
}

.cargo_thumb_entry:hover .cargo_thumb_title {
  background: var(--highlight-hover);
  color: #000;
}

.cargo_thumb_meta {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

/* ==========================================================================
   SHOWREEL EMBED SECTION (Minimal Cargo Style)
   ========================================================================== */

.cargo_showreel_box {
  margin-bottom: 50px;
  border: 1px solid var(--border);
  padding: 10px;
  background: var(--bg);
}

.cargo_video_player_wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.cargo_video_player_wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cargo_player_bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.cargo_player_btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text);
}

.cargo_player_btn:hover {
  background: var(--highlight-hover);
  color: #000;
}

/* ==========================================================================
   DEDICATED PROJECT PAGE (Sage Jenson Cargo Style)
   ========================================================================== */

.cargo_project_container {
  max-width: 780px;
}

.cargo_project_header {
  margin-bottom: 30px;
}

.cargo_project_title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 6px;
  line-height: 1.3;
}

.cargo_project_subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.cargo_media_stack {
  margin: 30px 0;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.cargo_media_stack_item {
  width: 100%;
  background: #000;
}

.cargo_media_stack_item video,
.cargo_media_stack_item img {
  width: 100%;
  height: auto;
  display: block;
}

.cargo_media_caption {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.cargo_project_body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  margin: 30px 0;
}

.cargo_project_body p {
  margin-bottom: 16px;
}

.cargo_specs_block {
  margin: 25px 0;
  padding: 15px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.cargo_specs_block strong {
  color: var(--text);
}

.cargo_breakdown_block {
  margin: 35px 0;
  padding: 20px;
  border: 1px solid var(--border);
  background: var(--code-bg);
}

.cargo_breakdown_block h4 {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 10px;
}

.cargo_project_pagination {
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.cargo_project_pagination a {
  color: var(--text-secondary);
}

.cargo_project_pagination a:hover {
  background: var(--highlight-hover);
  color: #000;
}

/* ==========================================================================
   JOURNAL & LAB NOTES (Minimalist Cargo Blog)
   ========================================================================== */

.cargo_post_list {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.cargo_post_item {
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border);
}

.cargo_post_header {
  margin-bottom: 8px;
}

.cargo_post_title {
  font-size: 14px;
  font-weight: bold;
}

.cargo_post_title a:hover {
  background: var(--highlight-hover);
  color: #000;
}

.cargo_post_meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.cargo_post_summary {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 8px;
}

/* Article Reader Typography */
.cargo_article_content {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
  margin: 25px 0;
}

.cargo_article_content h1,
.cargo_article_content h2,
.cargo_article_content h3 {
  font-size: 14px;
  font-weight: bold;
  margin: 25px 0 10px;
}

.cargo_article_content p {
  margin-bottom: 14px;
}

.cargo_article_content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: 12px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.5;
  margin: 16px 0;
}

.cargo_article_content code {
  font-family: monospace;
  font-size: 11px;
  background: var(--code-bg);
  padding: 1px 4px;
  border: 1px solid var(--border);
}

.cargo_article_content pre code {
  background: transparent;
  border: none;
  padding: 0;
}

.cargo_article_content blockquote {
  border-left: 2px solid var(--text);
  padding-left: 12px;
  margin: 16px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.cargo_article_content img {
  margin: 20px 0;
  border: 1px solid var(--border);
}

/* ==========================================================================
   ABOUT / BIO SECTION (Cargo Collective style)
   ========================================================================== */

.cargo_about_layout {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.cargo_about_bio {
  font-size: 13px;
  line-height: 1.7;
  max-width: 650px;
}

.cargo_about_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 15px;
}

.cargo_about_table th {
  text-align: left;
  border-bottom: 1px solid var(--text);
  padding: 6px 0;
  font-weight: bold;
}

.cargo_about_table td {
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
  color: var(--text-secondary);
}

/* ==========================================================================
   ADMIN CMS (Clean Cargo Collective Utility UI)
   ========================================================================== */

.admin_auth_screen {
  max-width: 360px;
  margin: 80px auto;
  border: 1px solid var(--border);
  padding: 25px;
  background: var(--bg);
}

.admin_dashboard_wrap {
  padding-top: 10px;
}

.admin_tab_bar {
  display: flex;
  gap: 4px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.admin_tab_link {
  background: transparent;
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-secondary);
}

.admin_tab_link:hover {
  background: var(--highlight-hover);
  color: #000;
}

.admin_tab_link.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

[data-theme="dark"] .admin_tab_link.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.admin_row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.admin_row_thumb {
  width: 50px;
  height: 35px;
  object-fit: cover;
  background: #000;
  margin-right: 12px;
}

.form_field {
  margin-bottom: 15px;
}

.form_field label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.form_input {
  width: 100%;
  border: 1px solid var(--border);
  padding: 6px 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
}

.form_input:focus {
  border-color: var(--text);
  outline: none;
}

textarea.form_input {
  min-height: 90px;
  font-family: inherit;
}

.dropzone_box {
  border: 1px dashed var(--border);
  padding: 15px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 4px;
}

.dropzone_box:hover {
  background: var(--highlight-hover);
  color: #000;
  border-color: #000;
}

.admin_modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
}

.admin_modal.active {
  opacity: 1;
  pointer-events: auto;
}

.admin_modal_card {
  background: var(--bg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 25px;
}

.toast_banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #000;
  color: #fff;
  padding: 6px 14px;
  font-size: 11px;
  z-index: 3000;
  display: none;
}

[data-theme="dark"] .toast_banner {
  background: #fff;
  color: #000;
}
