/* TechDocs — W3Schools-inspired learning docs theme */

:root {
  --w3s-green: #04AA6D;
  --w3s-dark: #282A35;
  --sidebar-bg: #f1f1f4;
  --body-bg: #f8f9fa;
  --card-bg: #fff;
  --text: #333;
  --muted: #666;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Source Sans Pro', 'Noto Sans SC', Arial, sans-serif;
  background: var(--body-bg);
  color: var(--text);
  line-height: 1.65;
}

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

/* Header */
.w3-top {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.w3-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 54px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--w3s-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--w3s-green);
  color: #fff;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
}

.brand-text {
  color: var(--w3s-dark);
}

.w3-right {
  display: flex;
  gap: 4px;
}

.w3-right .w3-button {
  font-weight: 600;
  color: var(--text);
  border-radius: 0;
  padding: 0 12px;
}

.w3-right .w3-button:hover {
  background: var(--w3s-green);
  color: #fff;
}

/* Layout */
.w3-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* Sidebar */
.sidebar { position: sticky; top: 74px; }

.sidebar-box {
  background: var(--sidebar-bg);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-left: 4px solid var(--w3s-green);
}

.sidebar-title {
  font-size: 14px;
  color: var(--w3s-dark);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.sidebar-links li + li { margin-top: 6px; }

.sidebar-links a {
  color: var(--text);
  font-size: 14px;
  display: block;
  padding: 4px 2px;
}

.sidebar-links a:hover { color: var(--w3s-green); }

.sidebar-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* Hero */
.hero {
  background: var(--w3s-dark);
  color: #fff;
  padding: 32px 24px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.hero-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
}

.hero-sub {
  margin: 0;
  opacity: 0.85;
  font-size: 15px;
}

/* Cards */
.tech-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.tech-card {
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tech-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.tech-thumb {
  width: 100%;
  height: 150px;
  overflow: hidden;
  background: #e9ecef;
}

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

.tech-body {
  padding: 16px;
}

.tech-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tech-badge {
  display: inline-block;
  background: #e8f5f0;
  color: var(--w3s-green);
  font-weight: 700;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
}

.tech-date {
  font-size: 12px;
  color: var(--muted);
}

.tech-title {
  font-size: 18px;
  margin: 0 0 10px;
  line-height: 1.35;
}

.tech-title a {
  color: var(--w3s-dark);
}

.tech-title a:hover {
  color: var(--w3s-green);
  text-decoration: none;
}

.tech-excerpt {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tech-btn {
  display: inline-block;
  background: var(--w3s-green);
  color: #fff;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
}

.tech-btn:hover {
  background: #039a5f;
  text-decoration: none;
}

.pagination {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.pagination .w3-button {
  background: #fff;
  color: var(--text);
  border: 1px solid #ddd;
  padding: 8px 14px;
  border-radius: 4px;
  font-weight: 600;
}

.pagination .w3-tag {
  background: var(--w3s-dark);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
}

/* Single post */
.tech-post {
  padding: 28px;
  border-radius: 8px;
}

.tech-post-head {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.tech-post .tech-title {
  font-size: 30px;
  margin: 10px 0 8px;
  color: var(--w3s-dark);
}

.tech-author {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 16px;
}

.tech-featured {
  margin-bottom: 24px;
  border-radius: 8px;
  overflow: hidden;
  background: #e9ecef;
}

.tech-featured img {
  width: 100%;
  height: auto;
  display: block;
}

.tech-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}

.tech-content p { margin: 0 0 18px; }

.tech-content h2,
.tech-content h3 {
  margin: 32px 0 14px;
  color: var(--w3s-dark);
  scroll-margin-top: 74px;
}

.tech-content h2 { font-size: 22px; border-bottom: 2px solid #e9ecef; padding-bottom: 8px; }
.tech-content h3 { font-size: 18px; }

.tech-content pre {
  background: #1d1f22;
  color: #e6e6e6;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}

.tech-content code {
  background: #f1f1f1;
  color: #d6336c;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
}

.tech-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.tech-content blockquote {
  border-left: 4px solid var(--w3s-green);
  margin: 18px 0;
  padding: 10px 16px;
  background: #f6fffb;
  color: #2b5f48;
  border-radius: 0 6px 6px 0;
}

.tech-tags {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  font-size: 14px;
}

.tech-tag {
  display: inline-block;
  background: #f1f1f4;
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  margin: 6px 6px 0 0;
  font-size: 13px;
}

.tech-tag:hover {
  background: var(--w3s-green);
  color: #fff;
  text-decoration: none;
}

.tech-nav {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

/* Comments */
.tech-comments {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 2px solid #e9ecef;
}

.tech-comments h3 {
  margin: 0 0 16px;
  color: var(--w3s-dark);
}

.comment {
  padding: 14px 16px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #fafafa;
  border: 1px solid #eee;
}

.comment-meta {
  margin-bottom: 6px;
}

.comment-body {
  color: #444;
  font-size: 14px;
}

.w3-form .w3-input {
  font-size: 14px;
  padding: 10px 12px;
}

.w3-button[type="submit"] {
  font-weight: 700;
}

/* Footer */
.w3-container.w3-center.w3-padding-16 {
  margin-top: 40px;
  background: var(--w3s-dark);
  color: #ccc;
  border-radius: 8px;
}
