/*
Theme Name: Tile Image Generator Theme
Description: A modern, responsive WordPress theme based on the Tile Image Generator styling with sidebar navigation and clean design.
Author: Aidan Warner
Version: 1.0
Text Domain: tile-theme
*/

/* Reset and Base Styles */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
  border: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 100%;
  font-style: inherit;
  font-weight: inherit;
  margin: 0;
  outline: 0;
  padding: 0;
  vertical-align: baseline;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #f8fafc;
  color: #334155;
  line-height: 1.6;
  font-size: 16px;
}

/* Accessibility */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  width: 3rem;
  height: 3rem;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.mobile-nav-toggle span {
  width: 1.25rem;
  height: 0.125rem;
  background-color: #475569;
  transition: all 0.3s ease;
}

.mobile-nav-toggle--active span:nth-child(1) {
  transform: rotate(45deg) translate(0.25rem, 0.25rem);
}

.mobile-nav-toggle--active span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle--active span:nth-child(3) {
  transform: rotate(-45deg) translate(0.25rem, -0.25rem);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 400px;
  background-color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 900;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 2rem 1.5rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  margin-top: 2rem;
}

.sidebar-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.sidebar-header a {
  color: inherit;
  text-decoration: none;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 1rem 0;
}

.sidebar-nav li {
  border: none;
  padding: 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  text-align: right;
}

.sidebar-nav a:hover {
  background-color: #f1f5f9;
  color: #475569;
  border-left-color: #cbd5e1;
}

.sidebar-nav .current-menu-item a,
.sidebar-nav .current-page-ancestor a,
.sidebar-nav .current_page_item a {
  background-color: #eff6ff;
  color: #2563eb;
  border-left-color: #2563eb;
  font-weight: 600;
}

.sidebar-ads {
  padding: 1.5rem;
  margin-top: auto;
}

/* Main Content */
.main-content {
  margin-left: 400px;
  min-height: 100vh;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* Content Sections */
.content-section {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 3rem;
  width: 100%;
  max-width: 800px;
}

/* Articles and Posts */
.post-article {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 3rem;
  width: 100%;
  max-width: 800px;
}

.post-title {
  margin: 0 0 1rem 0;
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.post-title a {
  color: inherit;
  text-decoration: none;
}

.post-title a:hover {
  color: #2563eb;
}

.post-meta {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.post-meta a {
  color: #2563eb;
  text-decoration: none;
}

.post-meta a:hover {
  text-decoration: underline;
}

/* Hide categories and related separators - only in WordPress post meta */
.post-categories {
  display: none;
}

/* Hide the separator before categories in post meta only */
.post-meta .post-author + .meta-separator,
.post-meta .post-categories + .meta-separator {
  display: none;
}

.post-content {
  line-height: 1.7;
}

.post-excerpt p {
  margin-bottom: 1rem;
}

.post-excerpt p:last-of-type {
  margin-bottom: 0;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin: 2rem 0 1rem 0;
  font-weight: 600;
  color: #1e293b;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.75rem; }
.post-content h3 { font-size: 1.5rem; }
.post-content h4 { font-size: 1.25rem; }
.post-content h5 { font-size: 1.125rem; }
.post-content h6 { font-size: 1rem; }

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content a {
  color: #2563eb;
  text-decoration: underline;
}

.post-content a:hover {
  color: #1d4ed8;
}

.post-content ul,
.post-content ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  border-left: 4px solid #2563eb;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #6b7280;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

.post-content code {
  background-color: #f1f5f9;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.post-content pre {
  background-color: #1e293b;
  color: #f8fafc;
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 3rem;
}

.btn-primary {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
}

.btn-primary:hover {
  background-color: #1d4ed8 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-primary:focus,
.btn-primary:active {
  background-color: #1d4ed8 !important;
  color: #ffffff !important;
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
  color: #334155;
}

/* Read More Button Specific Styling */
.post-content .btn,
a.btn {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  text-decoration: none !important;
}

.post-content .btn:hover,
a.btn:hover {
  background-color: #1d4ed8 !important;
  color: #ffffff !important;
}

.post-content .btn:focus,
.post-content .btn:active,
a.btn:focus,
a.btn:active {
  background-color: #1d4ed8 !important;
  color: #ffffff !important;
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
  width: 100%;
  max-width: 800px;
}

.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #475569;
  transition: all 0.2s ease;
}

.pagination a:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.pagination .current {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* Comments */
.comments-section {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 3rem;
  width: 100%;
  max-width: 800px;
}

.comments-title {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.comment {
  border-bottom: 1px solid #e2e8f0;
  padding: 1.5rem 0;
}

.comment:last-child {
  border-bottom: none;
}

.comment-meta {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.comment-content {
  line-height: 1.6;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Widgets */
.widget {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.widget-title {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.widget li:last-child {
  border-bottom: none;
}

.widget a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s ease;
}

.widget a:hover {
  color: #2563eb;
}

/* Footer */
.site-footer {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
  width: 100%;
  max-width: 800px;
}

.site-footer p {
  margin: 0.25rem 0;
}

.site-footer a {
  color: #2563eb;
  text-decoration: underline;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: flex;
  }

  .sidebar {
    width: 320px;
    transform: translateX(-100%);
  }

  .sidebar--open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    padding: 5rem 1rem 2rem;
    width: 100%;
    align-items: stretch;
  }

  .content-section,
  .post-article,
  .comments-section {
    padding: 1.5rem;
    border-radius: 0.5rem;
  }

  .sidebar-header h1 {
    font-size: 1.25rem;
  }

  .post-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 5rem 0.75rem 1.5rem;
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    width: 100%;
    align-items: stretch;
  }

  .content-section,
  .post-article,
  .comments-section {
    padding: 1rem;
    margin: 0 0 1.5rem 0;
    border-radius: 0.25rem;
  }

  .post-title {
    font-size: 1.25rem;
  }
}

/* Large Desktop */
@media (min-width: 1200px) {
  .sidebar {
    width: 420px;
  }

  .main-content {
    margin-left: 420px;
    padding: 3rem;
  }

  .content-section,
  .post-article,
  .comments-section {
    max-width: 900px;
    padding: 3rem;
  }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 350px;
  }

  .main-content {
    margin-left: 350px;
    padding: 2rem 1.5rem;
  }

  .content-section,
  .post-article,
  .comments-section {
    max-width: 700px;
  }

  .mobile-nav-toggle {
    display: none;
  }
}

/* Focus styles for accessibility */
.mobile-nav-toggle:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus,
.btn:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .sidebar,
  .mobile-nav-toggle,
  .sidebar-ads {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }
}
