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

body {
  font-family: Georgia, serif;
  background-color: #000;
  color: #f1ead8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: #ffa500; text-decoration: none; }
a:hover { text-decoration: underline; }

.header { width: 100%; display: block; position: relative; }
.header img {
  width: 100%;
  height: auto;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

@media (max-width: 1024px) {
  .header img { width: 105%; margin-left: -2.5%; max-width: none; }
}
@media (max-width: 820px) {
  .header img { width: 110%; margin-left: -5%; }
}
@media (max-width: 640px) {
  .header img { width: 118%; margin-left: -9%; }
}
@media (max-width: 480px) {
  .header img { width: 125%; margin-left: -12.5%; }
}

.kufi-row {
  --kufi-height: clamp(62px, 9vw, 91px);
  position: relative;
  display: flex;
  align-items: stretch;
  width: clamp(80%, 1050px, 95%);
  height: var(--kufi-height);
  margin: calc(-1 * var(--kufi-height) + 11px) auto 0;
}
.kufi-row img.kufi-side {
  height: 100%;
  width: auto;
  display: block;
  flex-shrink: 0;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}
.kufi-row .kufi-middle {
  flex: 1;
  background-image: url('kufi-mid-repeat.jpg');
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: left center;
}
.kufi-row .title {
  position: absolute;
  top: -5%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  color: #FFA500;
  white-space: nowrap;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 4px auto 28px;
  padding: 0 24px;
  flex-grow: 1;
}

.article-list { list-style: none; padding: 0; margin: 0; }
.article-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid #2a2a2a;
}
.article-card .thumb {
  width: 88px; height: 88px; object-fit: cover;
  flex-shrink: 0; border: 1px solid #333;
}
.article-card .meta { flex: 1; }
.article-card h2 { font-size: 1.6rem; margin-bottom: 4px; font-weight: 400; }
.article-card h2 a { color: #ffa500; }
.article-card .description { color: #c8c2b1; font-size: 1rem; line-height: 1.5; }
.article-card .row {
  margin-top: 8px; font-size: 0.85rem; color: #888;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #444;
  border-radius: 10px;
  font-size: 0.8rem;
  color: #c8c2b1;
}

.article {
  width: 100%;
  max-width: 760px;
  margin: 4px auto;
  padding: 0 24px 80px;
  flex-grow: 1;
}
.article .cover { margin-bottom: 24px; }
.article .cover img { width: 100%; height: auto; display: block; border: 1px solid #222; }
.article .cover figcaption { font-size: 0.85rem; color: #888; margin-top: 6px; text-align: center; }
.article h1 { font-size: clamp(1.5rem, 5vw, 2.6rem); line-height: 1.1; font-weight: 400; color: #ffa500; margin-bottom: 8px; }
.article .description { color: #c8c2b1; font-size: 1.1rem; margin-bottom: 16px; }
.article .meta-row { font-size: 0.85rem; color: #888; margin-bottom: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.article .content { font-size: 1.05rem; line-height: 1.7; color: #f1ead8; }
.article .content p { margin: 0.9em 0; }
.article .content h2, .article .content h3 { margin: 1.5em 0 0.4em; font-weight: 400; color: #ffd07a; }
.article .content h2 { font-size: 1.6rem; }
.article .content h3 { font-size: 1.3rem; }
.article .content a { color: #ffa500; text-decoration: underline; }
.article .content img { max-width: 100%; height: auto; }
.article .content blockquote {
  border-left: 3px solid #444;
  padding: 4px 16px;
  margin: 1em 0;
  color: #c8c2b1;
  font-style: italic;
}
.article .content code {
  background: #1a1a1a;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}
.article .content pre {
  background: #111;
  padding: 14px 16px;
  border-radius: 4px;
  overflow-x: auto;
  border: 1px solid #222;
}
.article .content pre code { background: none; padding: 0; }

.article .content .footnotes {
  font-size: 0.78em;
  color: #b0aaa0;
  border-top: 1px solid #222;
  margin-top: 2em;
  padding-top: 1em;
}
.article .content .footnotes h2 { display: none; }
.article .content .footnotes ol { padding-left: 1.5em; }
.article .content .footnotes li { margin: 0.15em 0; line-height: 1.4; }
.article .content .footnotes li p { margin: 0; }
.article .content .footnotes a { color: #ffa500; }

/* Language switcher */
.lang-switch-wrap {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 10;
}
.lang-switch {
  position: relative;
}
.lang-switch summary {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #100e08;
  border: 1px solid #3a2d14;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary span {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffa500;
}
.lang-globe {
  width: 13px;
  height: 13px;
  color: #c8a060;
  flex-shrink: 0;
}
.lang-chevron {
  width: 10px;
  height: 10px;
  color: #c8a060;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.lang-switch[open] .lang-chevron { transform: rotate(180deg); }
.lang-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  list-style: none;
  min-width: 100%;
  background: #100e08;
  border: 1px solid #3a2d14;
  border-radius: 5px;
  overflow: hidden;
}
.lang-list li a {
  display: block;
  padding: 7px 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #c8a060;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.lang-list li a:hover { color: #ffa500; background: rgba(255,165,0,0.07); text-decoration: none; }

.empty-state { text-align: center; color: #888; padding: 60px 20px; }

.site-footer { text-align: center; color: #888; padding: 28px 16px; font-size: 14px; border-top: 1px solid #1f1f1f; margin-top: auto; }
.site-footer a { color: #ffa500; }

@media (max-width: 1099px) {
  .kufi-row { width: 96%; }
}

@media (min-width: 1100px) {
  .container { margin-top: -8px; }
  .article { margin-top: -8px; }
}
