/* ===================================================================
   doniyorbek.uz — Design System
   =================================================================== */

/* --- 1. CSS Custom Properties (Light Theme) --- */
:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --brand-color: #2a7ae2;
  --brand-color-dark: #1756b4;
  --on-brand-color: #ffffff;
  --grey-color: #828282;
  --grey-color-light: #f0f0f0;
  --grey-color-dark: #616161;
  --border-color: #e0e0e0;
  --card-bg: #fafafa;
  --code-bg: #f5f5f5;
  --highlight-bg: #fafafa;
  --shadow-color: rgba(0, 0, 0, 0.05);
  --shadow-color-hover: rgba(0, 0, 0, 0.1);
  --table-row-bg: #fafafa;
  --table-header-bg: #f0f0f0;
  --table-header-border: #e0e0e0;
  --table-header-border-bottom: #d0d0d0;
  --link-visited: #2a7ae2;
  --svg-icon-fill: #828282;
  --success-color: #2e7d32;
  --success-color-dark: #1b5e20;
  --success-bg: #f0f0f0;
  --danger-color: #c62828;
  --danger-color-dark: #b71c1c;
  --danger-bg: #fbe9e9;
  --warning-color: #b26500;
  --warning-bg: #fafafa;
  --warning-border: #b26500;
  --muted-surface: rgba(0, 0, 0, 0.04);
}

/* --- 2. Dark Theme --- */
[data-theme="dark"] {
  --bg-color: #111111;
  --text-color: #e0e0e0;
  --brand-color: #7aa7ff;
  --brand-color-dark: #5a90e0;
  --on-brand-color: #111111;
  --grey-color: #999999;
  --grey-color-light: #1f1f1f;
  --grey-color-dark: #cccccc;
  --border-color: #2a2a2a;
  --card-bg: #1a1a1a;
  --code-bg: #0a0a0a;
  --highlight-bg: #1a1a1a;
  --shadow-color: rgba(0, 0, 0, 0.4);
  --shadow-color-hover: rgba(0, 0, 0, 0.6);
  --table-row-bg: #1a1a1a;
  --table-header-bg: #0a0a0a;
  --table-header-border: #2a2a2a;
  --table-header-border-bottom: #3a3a3a;
  --link-visited: #7aa7ff;
  --svg-icon-fill: #999999;
  --success-color: #81c784;
  --success-color-dark: #a5d6a7;
  --success-bg: #1f1f1f;
  --danger-color: #ef9a9a;
  --danger-color-dark: #e57373;
  --danger-bg: #2a1a1a;
  --warning-color: #ffcc80;
  --warning-bg: #1f1f1f;
  --warning-border: #ffcc80;
  --muted-surface: rgba(255, 255, 255, 0.04);
}

/* --- 3. Base Reset & Typography --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
hr,
dl,
dd,
ol,
ul,
figure {
  margin: 0;
  padding: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 10px 18px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background-color: var(--brand-color);
  color: var(--on-brand-color);
  font-weight: 600;
  font-size: 14px;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  text-decoration: none;
  outline: 2px solid var(--text-color);
}

body {
  font: 400 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: var(--text-color);
  background-color: var(--bg-color);
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
ul,
ol,
dl,
figure,
.highlight {
  margin-bottom: 15px;
}

main {
  display: block;
}

img {
  max-width: 100%;
  vertical-align: middle;
}

figure>img {
  display: block;
}

figcaption {
  font-size: 14px;
}

ul,
ol {
  margin-left: 30px;
}

li>ul,
li>ol {
  margin-bottom: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
}

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

a:visited {
  color: var(--link-visited);
}

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

blockquote {
  color: var(--grey-color);
  border-left: 4px solid var(--border-color);
  padding-left: 15px;
  font-size: 18px;
  letter-spacing: -1px;
  font-style: italic;
}

blockquote> :last-child {
  margin-bottom: 0;
}

pre,
code {
  font-size: 15px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  background-color: var(--code-bg);
}

code {
  padding: 1px 5px;
}

pre {
  padding: 8px 12px;
  overflow-x: auto;
}

pre>code {
  border: 0;
  padding-right: 0;
  padding-left: 0;
}

/* --- 4. Layout Wrapper --- */
.wrapper {
  max-width: calc(800px - (30px * 2));
  margin-right: auto;
  margin-left: auto;
  padding-right: 30px;
  padding-left: 30px;
}

@media screen and (max-width: 800px) {
  .wrapper {
    max-width: calc(800px - (30px));
    padding-right: 15px;
    padding-left: 15px;
  }
}

/* --- 5. Site Header --- */
.site-header {
  border-bottom: 1px solid var(--border-color);
  min-height: 55.95px;
  position: relative;
}

.site-header .wrapper::after {
  content: "";
  display: table;
  clear: both;
}

.site-title {
  font-size: 26px;
  font-weight: 300;
  line-height: 54px;
  letter-spacing: -1px;
  margin-bottom: 0;
  float: left;
}

.site-title,
.site-title:visited {
  color: var(--text-color);
}

/* --- 6. Theme Toggle Button --- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--grey-color);
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 160px;
  z-index: 10;
  transition: color 0.2s, border-color 0.2s;
}

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

.theme-icon {
  display: none;
}

[data-theme-preference="light"] .theme-icon-light,
[data-theme-preference="dark"] .theme-icon-dark,
[data-theme-preference="system"] .theme-icon-system {
  display: block;
}

@media screen and (max-width: 600px) {
  .theme-toggle {
    right: 70px;
  }
}

/* --- 7. Site Navigation --- */
.site-nav {
  float: right;
  line-height: 54px;
}

.site-nav .nav-trigger {
  display: none;
}

.site-nav .menu-icon {
  display: none;
}

.site-nav .page-link {
  color: var(--text-color);
  line-height: 1.5;
}

.site-nav .page-link:not(:last-child) {
  margin-right: 20px;
}

@media screen and (max-width: 600px) {
  .site-nav {
    position: absolute;
    top: 9px;
    right: 15px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-align: right;
  }

  .site-nav label[for="nav-trigger"] {
    display: block;
    float: right;
    width: 36px;
    height: 36px;
    line-height: 0;
    padding-top: 10px;
    text-align: center;
    cursor: pointer;
  }

  .site-nav .menu-icon {
    display: block;
    float: right;
    width: 36px;
    height: 26px;
    line-height: 0;
    padding-top: 10px;
    text-align: center;
  }

  .site-nav .menu-icon>svg {
    fill: var(--text-color);
  }

  .site-nav input~.trigger {
    clear: both;
    display: none;
  }

  .site-nav input:checked~.trigger {
    display: block;
    padding-bottom: 5px;
  }

  .site-nav .page-link {
    display: block;
    padding: 5px 10px;
    margin-left: 20px;
  }

  .site-nav .page-link:not(:last-child) {
    margin-right: 0;
  }
}

/* --- 8. Page Content --- */
.page-content {
  padding: 30px 0;
  flex: 1;
}

.page-content .wrapper {
  padding-top: 0;
}

.post-title {
  font-size: 42px;
  letter-spacing: -1px;
  line-height: 1;
}

@media screen and (max-width: 800px) {
  .post-title {
    font-size: 36px;
  }
}

.post-content {
  margin-bottom: 30px;
}

.post-content h2 {
  font-size: 32px;
}

.post-content h3 {
  font-size: 26px;
}

.post-content h4 {
  font-size: 20px;
}

@media screen and (max-width: 800px) {
  .post-content h2 {
    font-size: 28px;
  }

  .post-content h3 {
    font-size: 22px;
  }

  .post-content h4 {
    font-size: 18px;
  }
}

/* --- 9. Profile Photo (Home Page) --- */
.profile-photo-wrap {
  text-align: center;
  margin-bottom: 20px;
}

.profile-photo {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
}

.home-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 10px;
  margin-bottom: 15px;
  line-height: 1.3;
}

/* --- 10. Site Footer --- */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 28px 0;
  margin-top: auto;
  font-size: 14px;
  color: var(--grey-color);
  background-color: var(--bg-color);
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--grey-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.4;
  transition: color 0.15s ease;
}

.footer-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--svg-icon-fill);
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--brand-color);
  text-decoration: none;
}

.footer-link:hover svg {
  color: var(--brand-color);
}

.footer-link:focus-visible {
  outline: 2px solid var(--brand-color);
  outline-offset: 3px;
  border-radius: 4px;
  color: var(--brand-color);
}

.footer-link:focus-visible svg {
  color: var(--brand-color);
}

.footer-copyright {
  font-size: 13px;
  color: var(--grey-color);
  margin: 0;
  white-space: nowrap;
}

@media screen and (max-width: 680px) {
  .site-footer {
    padding: 24px 0;
  }

  .site-footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }

  .footer-links {
    justify-content: center;
    gap: 12px 18px;
  }

  .footer-copyright {
    white-space: normal;
  }
}

/* --- 11. Tables (General) --- */
table {
  margin-bottom: 30px;
  width: 100%;
  text-align: left;
  color: var(--text-color);
  border-collapse: collapse;
  border: 1px solid var(--border-color);
}

table th,
table td {
  padding: 8px 12px;
}

table th {
  background-color: var(--table-header-bg);
  border: 1px solid var(--table-header-border);
  border-bottom-color: var(--table-header-border-bottom);
}

table td {
  border: 1px solid var(--border-color);
}

table tr:nth-child(even) {
  background-color: var(--table-row-bg);
}

/* --- 12. 404 / Not Found --- */
.not-found-container {
  margin: 10px auto;
  max-width: 600px;
  text-align: center;
}

.not-found-title {
  margin: 30px 0;
  font-size: 4em;
  line-height: 1;
  letter-spacing: 0;
}

/* --- 13. Animations --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}