/*
Theme Name: TopCloserR Blog
Theme URI: https://topcloserr.com
Author: Antigravity
Author URI: https://topcloserr.com
Description: A minimalistic, premium blog theme with filters, grids, and featured post layout.
Version: 1.0
*/

:root {
  --bg-color: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-card: #ffffff;
  --text-main: #171717;
  --text-body: #525252;
  --text-muted: #737373;
  --border-color: #d4d4d4;
  --accent: rgb(50, 135, 91);
  --accent-hover: rgb(40, 110, 70);
  --hero-color: rgb(50, 135, 91);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-body);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent);
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-color);
  position: sticky;
  top: 0;
  z-index: 100;
  border-top: 4px solid var(--hero-color);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.header-navigation-wrapper {
  display: flex;
  align-items: center;
  gap: 48px;
}

.primary-navigation ul,
.header-right-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 32px;
}

.primary-navigation li,
.header-right-navigation li {
  position: relative;
}

.primary-navigation a,
.header-right-navigation a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-body);
  display: block;
  padding: 8px 0;
}

.primary-navigation a:hover,
.header-right-navigation a:hover {
  color: var(--accent);
}

/* Right Nav Styling */
.header-right-navigation a {
  font-weight: 600;
  color: var(--accent);
}

/* Dropdown styling */
.primary-navigation .sub-menu,
.header-right-navigation .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  min-width: 200px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
  z-index: 999;
}

.primary-navigation li:hover > .sub-menu,
.header-right-navigation li:hover > .sub-menu {
  display: flex;
}

.primary-navigation .sub-menu li,
.header-right-navigation .sub-menu li {
  width: 100%;
}

.primary-navigation .sub-menu a,
.header-right-navigation .sub-menu a {
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 400;
}

.primary-navigation .sub-menu a:hover,
.header-right-navigation .sub-menu a:hover {
  background: var(--bg-secondary);
}

/* Main */
.site-main {
  padding: 64px 0;
  min-height: 80vh;
}

/* Filters */
.post-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-body);
  padding: 8px 20px;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* Post Card */
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
  opacity: 1;
  transform: scale(1);
}

.post-card.hidden {
  display: none;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.06);
  border-color: var(--border-color);
}

.post-thumbnail {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-secondary);
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail img {
  transform: scale(1.05);
}

.post-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.post-category {
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--accent);
  font-weight: 600;
  border: 1px solid var(--border-color);
}

.post-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.post-title a {
  display: block;
  color: var(--text-main);
}

.post-title a:hover {
  color: var(--accent);
}

.post-excerpt {
  font-size: 0.95rem;
  color: var(--text-body);
  margin-bottom: 24px;
  flex-grow: 1;
}

.post-excerpt p {
  margin: 0;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: auto;
}

.read-more svg {
  transition: transform 0.3s ease;
}

.read-more:hover svg {
  transform: translateX(4px);
}

/* Featured Post */
.post-card.featured-post {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: stretch;
  background: var(--bg-secondary);
  border-left: 6px solid var(--hero-color);
}

.post-card.featured-post .post-thumbnail {
  flex: 1.2;
  aspect-ratio: auto;
}

.post-card.featured-post .post-content {
  flex: 1;
  padding: 48px;
  justify-content: center;
}

.post-card.featured-post .post-title {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.post-card.featured-post .post-excerpt {
  font-size: 1.1rem;
}

/* Single Post */
.single-container {
  max-width: 800px;
}

.single-header {
  margin-bottom: 40px;
  text-align: center;
}

.single-title {
  font-size: 3rem;
  line-height: 1.2;
  margin: 16px 0 0 0;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.single-thumbnail {
  margin-bottom: 48px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.single-thumbnail img {
  width: 100%;
  height: auto;
}

.single-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-body);
}

.single-content h2, .single-content h3 {
  color: var(--text-main);
  margin-top: 40px;
  margin-bottom: 16px;
}

.single-content p {
  margin-bottom: 24px;
}

.single-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.single-content blockquote {
  margin: 32px 0;
  padding-left: 24px;
  border-left: 4px solid var(--accent);
  font-style: italic;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 24px;
  border-radius: 0 8px 8px 0;
}

/* Pagination */
.pagination {
  margin-top: 64px;
  display: flex;
  justify-content: center;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.page-numbers {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-body);
  transition: var(--transition);
  background: var(--bg-color);
}

.page-numbers.current, .page-numbers:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Footer */
.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--bg-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
  
  .post-card.featured-post {
    flex-direction: column;
    border-left: none;
    border-top: 6px solid var(--hero-color);
  }
  
  .post-card.featured-post .post-thumbnail {
    aspect-ratio: 16/9;
  }
  
  .post-card.featured-post .post-content {
    padding: 24px;
  }
  
  .post-card.featured-post .post-title {
    font-size: 1.75rem;
  }
  
  .single-title {
    font-size: 2rem;
  }
}

/* Comments Section */
.comments-area {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border-color);
}

.comments-title {
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 32px;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 48px 0;
}

.comment-list .comment {
  margin-bottom: 32px;
}

.comment-body {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.comment-meta img.avatar {
  border-radius: 50%;
  width: 48px;
  height: 48px;
}

.comment-author {
  font-weight: 600;
  color: var(--text-main);
  font-size: 1.05rem;
}

.comment-metadata a {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.comment-content {
  color: var(--text-body);
  font-size: 1rem;
}

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

.reply a {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  padding: 6px 16px;
  border-radius: 100px;
  transition: var(--transition);
}

.reply a:hover {
  background: var(--accent);
  color: #ffffff;
}

/* Comment Form */
.comment-respond {
  background: var(--bg-secondary);
  padding: 32px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.comment-reply-title {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 24px;
  display: block;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-form-comment,
.comment-form-author,
.comment-form-email,
.comment-form-url {
  display: flex;
  flex-direction: column;
}

.comment-form label {
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: var(--transition);
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(50, 135, 91, 0.1);
}

.comment-form textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  margin-top: 8px;
}

.submit {
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.submit:hover {
  background: var(--accent-hover);
}

/* Static Page & Gutenberg Support */
.page-container {
  max-width: 900px;
  margin-top: 48px;
  margin-bottom: 64px;
}

.page-header {
  margin-bottom: 40px;
  text-align: center;
}

.page-title {
  font-size: 3rem;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.page-thumbnail {
  margin-bottom: 48px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.page-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-body);
}

/* WP Core Block basic supports */
.entry-content > * {
  margin-bottom: 24px;
}

.entry-content h2, .entry-content h3, .entry-content h4 {
  color: var(--text-main);
  margin-top: 48px;
  margin-bottom: 16px;
}

.entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Gutenberg Alignment Classes */
.alignwide {
  margin-left: calc(-10vw);
  margin-right: calc(-10vw);
  max-width: 120vw;
  width: auto;
}

.alignfull {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  max-width: 100vw;
  width: 100vw;
}

@media (max-width: 768px) {
  .page-title {
    font-size: 2.2rem;
  }
  .alignwide {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }
}
