/*
Theme Name: iSquared Blog
Theme URI: https://blog.isquaredsoftware.com
Author: Leo
Author URI: https://blog.isquaredsoftware.com
Description: A clean, reading-focused developer blog theme inspired by blog.isquaredsoftware.com. Features a dark header, two-column layout with sidebar, code syntax highlighting, and responsive design.
Version: 1.0.0
License: MIT
Text Domain: isquared-blog
*/

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

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --heading: #111111;
  --link: #0875b4;
  --link-hover: #065a8c;
  --accent: #2b6cb0;
  --accent-light: #ebf4ff;
  --header-bg: #90D5FF;
  --header-text: #333333;
  --border: #e0e0e0;
  --border-light: #f0f0f0;
  --code-bg: #f5f5f5;
  --code-text: #c7254e;
  --pre-bg: #1e2a36;
  --pre-text: #e0e0e0;
  --tag-bg: #edf2f7;
  --tag-text: #4a5568;
  --tag-hover-bg: #e2e8f0;
  --max-width: 1100px;
  --content-width: 68%;
  --sidebar-width: 28%;
  --radius: 4px;
}

html {
  height: 100%;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body,
h1, h2, h3, h4, h5, h6 {
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

/* ===== Site Header ===== */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 1rem 1.5rem;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}

.site-title {
  font-size: 3rem;
  font-weight: 400;
  line-height: 1.15;
}

.site-title a {
  color: #111111;
  text-decoration: none;
}

.site-title a:hover {
  color: #2b6cb0;
  text-decoration: none;
}

.site-tagline {
  font-size: 0.95rem;
  color: #555555;
  margin-top: 0.2rem;
  font-weight: 300;
}

.header-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-shrink: 0;
  padding-bottom: 0.3rem;
}

.header-nav a {
  color: #333333;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}

.header-nav a:hover {
  color: #000000;
  text-decoration: none;
}

.header-nav a.nav-cta {
  font-weight: 700;
  color: #2b6cb0;
}

/* ===== Layout ===== */
.site-container {
  flex: 1 0 auto;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

.content-area {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

/* ===== Posts List ===== */
.post-item {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-light);
}

.post-item:last-child {
  border-bottom: none;
}

.post-title {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.post-title a {
  color: var(--heading);
  text-decoration: none;
}

.post-title a:hover {
  color: var(--link);
  text-decoration: none;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.post-excerpt {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.read-more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--link);
}

.read-more::after {
  content: " →";
}

/* ===== Single Post ===== */
.single-post .post-header {
  margin-bottom: 2rem;
}

.single-post .post-title {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #333;
}

.post-content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
  color: var(--heading);
  font-weight: 700;
}

.post-content h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--heading);
  font-weight: 700;
}

.post-content h4 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--heading);
  font-weight: 700;
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.25rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.35rem;
}

.post-content blockquote {
  margin: 1.25rem 0;
  padding: 0.5rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--accent-light);
  color: #2d3748;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ===== Code ===== */
.post-content code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono",
    "Menlo", "Monaco", "Consolas", monospace;
  font-size: 0.88em;
  word-break: break-word;
}

.post-content pre {
  background: var(--pre-bg);
  color: var(--pre-text);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.25rem 0;
  line-height: 1.5;
  font-size: 0.9rem;
}

.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  word-break: normal;
}

/* ===== Footer Widgets ===== */
.footer-widgets {
  background: #edf2f7;
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.5rem;
  margin-top: 3rem;
}

.footer-widgets-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.footer-widget-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.footer-widget ul {
  list-style: none;
}

.footer-widget ul li {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.footer-widget ul li a {
  color: var(--text-light);
  text-decoration: none;
  line-height: 1.4;
}

.footer-widget ul li a:hover {
  color: var(--link);
  text-decoration: none;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-link {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.2em 0.65em;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

.tag-link:hover {
  background: var(--tag-hover-bg);
  color: var(--tag-text);
  text-decoration: none;
}

.tag-link .tag-count {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.pagination a {
  color: var(--link);
}

.pagination .page-info {
  color: var(--text-muted);
  font-weight: 400;
}

/* ===== Site Footer ===== */
.site-footer {
  background: #0a1f3f;
  color: #a0aec0;
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
}

.footer-nav a {
  color: #a0aec0;
  text-decoration: none;
}

.footer-nav a:hover {
  color: #ffffff;
  text-decoration: none;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social a {
  color: #a0aec0;
  font-size: 0.85rem;
}

.footer-social a:hover {
  color: #ffffff;
  text-decoration: none;
}

/* ===== Responsive ===== */
@media (max-width: 800px) {
  .site-container {
    padding: 1.5rem 1rem;
  }

  .footer-widgets-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .site-title {
    font-size: 1.7rem;
  }

  .single-post .post-title {
    font-size: 1.5rem;
  }

  .post-title {
    font-size: 1.3rem;
  }

  .post-content {
    font-size: 1rem;
  }

  .header-inner {
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  .header-nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}

/* ===== WordPress Specific ===== */
.wp-caption {
  max-width: 100%;
  margin: 1rem 0;
}

.wp-caption-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

.alignleft {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
}

.alignright {
  float: right;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal;
}

/* ===== Comments ===== */
.comments-area {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comments-title {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.comment-list {
  list-style: none;
}

.comment {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.comment-author {
  font-weight: 600;
  font-size: 0.95rem;
}

.comment-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.comment-content {
  font-size: 0.95rem;
}

/* ===== Comment Form ===== */
.comment-form textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  resize: vertical;
  min-height: 100px;
  box-sizing: border-box;
}

.comment-form .form-submit {
  margin-top: 0.6rem;
  text-align: right;
}

.comment-form input[type="submit"] {
  padding: 0.45rem 1.4rem;
  background: var(--link);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
}

.comment-form input[type="submit"]:hover {
  background: var(--link-hover);
}

/* ===== GitHub Login for Comments ===== */
.github-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  background: #24292e;
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
  margin-bottom: 1rem;
}

.github-login-btn:hover {
  background: #1b1f23;
  color: #fff;
  text-decoration: none;
}

.github-user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent-light);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.github-avatar {
  border-radius: 50%;
  flex-shrink: 0;
}

.github-logout {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}

.github-logout:hover {
  color: var(--text);
  text-decoration: none;
}

/* ===== Search Form ===== */
.search-form {
  display: flex;
  gap: 0.3rem;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface);
}

.search-form button {
  padding: 0.4rem 0.8rem;
  background: var(--link);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.search-form button:hover {
  background: var(--link-hover);
}

/* ===== Page Template ===== */
.page .post-content h2 {
  margin-top: 2rem;
}

/* ===== Archive / Category pages ===== */
.archive-title {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--heading);
}

.archive-description {
  margin-bottom: 2rem;
  color: var(--text-light);
}
