/* =============================================
   PHP Tutorial For Beginners - Main Stylesheet
   ============================================= */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  background: #f0f2f5;
}

a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; color: #0044aa; }
a:visited { color: #5544bb; }

img { max-width: 100%; height: auto; }

/* =============================================
   HEADER
   ============================================= */
.site-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 22px 0;
  border-bottom: 3px solid #0066cc;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-title a {
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.3px;
}

.site-title a:hover {
  color: #66bbdd;
  text-decoration: none;
}

.site-desc {
  color: #9ab;
  font-size: 13px;
  margin-top: 4px;
  letter-spacing: 0.3px;
}

/* =============================================
   NAVIGATION TABS
   ============================================= */
.nav-tabs {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav-tabs ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.nav-tabs li a {
  display: block;
  padding: 13px 18px;
  color: #555;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.nav-tabs li a:hover,
.nav-tabs li.active a {
  color: #0066cc;
  border-bottom-color: #0066cc;
  text-decoration: none;
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
.main-container {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 28px;
  align-items: start;
}

/* =============================================
   POSTS / ARTICLES
   ============================================= */
.post-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 28px 30px;
  margin-bottom: 20px;
}

.post-date {
  color: #888;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.post-title {
  font-size: 21px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 16px;
  line-height: 1.3;
}

.post-title a {
  color: #1a1a2e;
  text-decoration: none;
}

.post-title a:hover {
  color: #0066cc;
  text-decoration: none;
}

.post-body {
  color: #444;
  line-height: 1.75;
}

.post-body p {
  margin-bottom: 14px;
}

.post-body h2 {
  font-size: 18px;
  color: #1a1a2e;
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e8f0fe;
}

.post-body h3 {
  font-size: 16px;
  color: #1a1a2e;
  margin: 18px 0 8px;
}

.post-body ul,
.post-body ol {
  margin: 8px 0 14px 26px;
}

.post-body li {
  margin-bottom: 5px;
}

.post-body strong, .post-body b {
  color: #222;
}

/* Code Blocks */
pre {
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 6px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 14px 0;
  font-family: 'Consolas', 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.65;
  border-left: 4px solid #0066cc;
}

code {
  font-family: 'Consolas', 'Courier New', Courier, monospace;
  font-size: 13px;
}

p code, li code, td code {
  background: #f0f4ff;
  padding: 1px 6px;
  border-radius: 3px;
  color: #c7254e;
  font-size: 13px;
}

.step-label {
  display: inline-block;
  background: #0066cc;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 3px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.note {
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  padding: 12px 16px;
  margin: 14px 0;
  border-radius: 0 4px 4px 0;
  font-size: 14px;
}

/* Post Footer */
.post-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.post-labels {
  font-size: 12px;
  color: #888;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.post-labels span {
  font-weight: 600;
  color: #555;
}

.post-labels a {
  display: inline-block;
  padding: 2px 9px;
  background: #f0f4ff;
  border-radius: 12px;
  color: #0066cc;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}

.post-labels a:hover {
  background: #0066cc;
  color: #fff;
  text-decoration: none;
}

/* Post Navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  font-size: 13px;
}

.post-nav a {
  color: #0066cc;
  font-weight: 500;
}

.post-nav a:hover {
  text-decoration: underline;
}

/* =============================================
   HOMEPAGE POST LIST
   ============================================= */
.home-post {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 22px 26px;
  margin-bottom: 16px;
  border-left: 4px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.home-post:hover {
  border-left-color: #0066cc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.home-post .post-date {
  color: #888;
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.home-post h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.home-post h2 a {
  color: #1a1a2e;
  text-decoration: none;
}

.home-post h2 a:hover {
  color: #0066cc;
  text-decoration: none;
}

.home-post .excerpt {
  color: #666;
  font-size: 13px;
  line-height: 1.5;
}

.read-more {
  display: inline-block;
  margin-top: 8px;
  color: #0066cc;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Date group header */
.date-group-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin: 24px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0e0e0;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar-widget {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-widget h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #1a1a2e;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #0066cc;
}

/* Category List */
.category-list {
  list-style: none;
}

.category-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #f0f0f0;
}

.category-list li:last-child {
  border-bottom: none;
}

.category-list li a {
  color: #444;
  font-size: 14px;
  text-decoration: none;
}

.category-list li a:hover {
  color: #0066cc;
}

.category-list li .count {
  background: #f0f4ff;
  color: #0066cc;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

/* Popular Posts */
.popular-posts {
  list-style: none;
}

.popular-posts li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.popular-posts li:last-child {
  border-bottom: none;
}

.popular-posts li a {
  color: #444;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  display: block;
}

.popular-posts li a:hover {
  color: #0066cc;
}

/* Subscribe */
.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subscribe-form input[type="text"] {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  color: #333;
  width: 100%;
}

.subscribe-form input[type="text"]:focus {
  outline: none;
  border-color: #0066cc;
}

.subscribe-form button {
  background: #0066cc;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.subscribe-form button:hover {
  background: #0044aa;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: #1a1a2e;
  color: #9ab;
  text-align: center;
  padding: 22px 20px;
  margin-top: 40px;
  font-size: 13px;
}

.site-footer a {
  color: #66bbdd;
}

.site-footer a:hover {
  color: #fff;
}

/* =============================================
   PAGE (php.html / codeigniter.html)
   ============================================= */
.page-content {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 30px;
}

.page-content h1 {
  font-size: 26px;
  color: #1a1a2e;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid #0066cc;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 800px) {
  .main-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .site-title a {
    font-size: 20px;
  }

  .post-card {
    padding: 20px;
  }
}
