/*
Theme Name: CodeLoopSahil
Theme URI: https://example.com/codeloopsahil
Author: Sahil
Author URI: https://example.com
Description: A clean, modern, fully responsive WordPress theme built for blogs and business sites. Fast, lightweight, and customizer-ready.
Version: 1.0.0
Requires at least: 5.9
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: codeloopsahil
Tags: blog, e-commerce, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready

CodeLoopSahil WordPress Theme, Copyright 2026
CodeLoopSahil is distributed under the terms of the GNU GPL.
*/

/* -------------------------------------------------
   0. CSS RESET / BASE
------------------------------------------------- */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-text: #1f2328;
  --color-text-light: #5b6572;
  --color-bg: #ffffff;
  --color-bg-alt: #f6f8fb;
  --color-border: #e5e9ef;
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 10px;
  --max-width: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  font-size: 17px;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--color-primary-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 .6em;
  color: #101418;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.5rem; }

p { margin: 0 0 1.2em; }

ul, ol { padding-left: 1.4em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
}

/* -------------------------------------------------
   1. HEADER
------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  z-index: 100;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.site-branding { display: flex; align-items: center; gap: 12px; }

.site-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.site-title a { color: var(--color-text); }

.site-description {
  font-size: .85rem;
  color: var(--color-text-light);
  margin: 0;
}

.custom-logo { max-height: 46px; width: auto; }

/* Primary nav */
.primary-navigation ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.primary-navigation a {
  color: var(--color-text);
  font-weight: 500;
  font-size: .97rem;
}
.primary-navigation a:hover { color: var(--color-primary); }

.primary-navigation ul ul {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 12px 30px rgba(0,0,0,.08);
  min-width: 180px;
  margin-top: 10px;
}
.primary-navigation li { position: relative; }
.primary-navigation li:hover > ul { display: flex; }
.primary-navigation ul ul a { padding: 6px 10px; display: block; border-radius: 6px; }
.primary-navigation ul ul a:hover { background: var(--color-bg-alt); }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1.1rem;
}

/* -------------------------------------------------
   2. HERO / PAGE HEADER
------------------------------------------------- */
.page-header {
  padding: 48px 0 28px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  margin-bottom: 40px;
}
.page-header .container { text-align: center; }
.page-header .page-title { margin-bottom: 8px; }
.page-header .archive-description { color: var(--color-text-light); }

/* -------------------------------------------------
   3. LAYOUT
------------------------------------------------- */
.site-content {
  padding: 20px 0 60px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 48px;
  align-items: start;
}
.content-layout.no-sidebar { grid-template-columns: 1fr; }

/* -------------------------------------------------
   4. POSTS / CARDS
------------------------------------------------- */
.post-list { display: flex; flex-direction: column; gap: 40px; }

article.post-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
  background: #fff;
}
article.post-card:hover {
  box-shadow: 0 16px 32px rgba(16,20,24,.08);
  transform: translateY(-2px);
}

.post-thumbnail img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.post-card-body { padding: 24px; }

.entry-meta {
  font-size: .85rem;
  color: var(--color-text-light);
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.entry-meta a { color: var(--color-text-light); }

.entry-title { font-size: 1.4rem; margin-bottom: 10px; }
.entry-title a { color: #101418; }
.entry-title a:hover { color: var(--color-primary); }

.entry-summary { color: var(--color-text-light); }

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  margin-top: 8px;
}

/* Single post */
.single .entry-header { margin-bottom: 24px; }
.single .entry-title { font-size: 2.2rem; }
.single .post-thumbnail { margin-bottom: 28px; border-radius: var(--radius); overflow: hidden; }
.entry-content { font-size: 1.05rem; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content blockquote {
  margin: 1.6em 0;
  padding: 14px 22px;
  border-left: 4px solid var(--color-primary);
  background: var(--color-bg-alt);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}
.entry-content pre {
  background: #101418;
  color: #e5e9ef;
  padding: 18px;
  border-radius: 8px;
  overflow-x: auto;
}
.entry-content code {
  background: var(--color-bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .9em;
}
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.entry-content table th, .entry-content table td {
  border: 1px solid var(--color-border);
  padding: 10px 14px;
}

.entry-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  font-size: .9rem;
  color: var(--color-text-light);
}
.entry-footer a { font-weight: 500; }

/* Pagination */
.pagination, .post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.pagination .page-numbers {
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
}
.pagination .page-numbers.current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* -------------------------------------------------
   5. SIDEBAR / WIDGETS
------------------------------------------------- */
.widget-area .widget {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
  background: #fff;
}
.widget-title {
  font-size: 1.05rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li { padding: 8px 0; border-bottom: 1px dashed var(--color-border); }
.widget ul li:last-child { border-bottom: none; }

/* -------------------------------------------------
   6. COMMENTS
------------------------------------------------- */
.comments-area { margin-top: 48px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-body {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.comment-author { font-weight: 600; }
.comment-metadata { font-size: .82rem; color: var(--color-text-light); margin-bottom: 10px; }
.comment-respond input, .comment-respond textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: var(--font-body);
  margin-bottom: 14px;
}
.comment-respond textarea { min-height: 120px; }

/* -------------------------------------------------
   7. FORMS / BUTTONS
------------------------------------------------- */
button, .button, input[type="submit"] {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .15s ease;
}
button:hover, .button:hover, input[type="submit"]:hover { background: var(--color-primary-dark); }

.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

/* -------------------------------------------------
   8. FOOTER
------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  padding: 40px 0;
  margin-top: 60px;
}
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-bottom: 24px;
}
.site-info {
  text-align: center;
  font-size: .88rem;
  color: var(--color-text-light);
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
}

/* -------------------------------------------------
   9. RESPONSIVE
------------------------------------------------- */
@media (max-width: 880px) {
  .content-layout { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-block; }
  .primary-navigation {
    display: none;
    width: 100%;
    order: 3;
  }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul {
    flex-direction: column;
    gap: 4px;
    padding: 16px 0;
  }
  .primary-navigation ul ul {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 14px;
    margin-top: 0;
  }
  .site-header-inner { flex-wrap: wrap; }
  h1 { font-size: 1.9rem; }
}
