/*
Theme Name: Benqu
Theme URI: https://benqu.example.com
Author: Benqu Team
Author URI: https://benqu.example.com
Description: A modern editorial pet blog theme inspired by the Benqu design — magazine-style layout, signature red accent (#ff002a), Playfair Display + Inter typography. Fully customizable via the Customizer with editable menus, logo, and widgets. AdSense ready.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: benqu
Tags: blog, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, editor-style
*/

/* ==========================================================================
   Reset + Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1a1a2e;
  background: #ffffff;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s ease; }
a:hover { color: #ff002a; }
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 .5em;
}
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { padding-left: 1.25rem; }

/* ==========================================================================
   Layout
   ========================================================================== */
.container-blog {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #ececec;
}
.site-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
@media (min-width: 768px) { .site-header-inner { height: 80px; } }
.site-branding { display: flex; align-items: center; gap: .5rem; }
.site-logo-icon {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: #ff002a; color: #fff;
}
.site-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 0;
}
.site-title a { color: inherit; }
.site-title .accent { color: #ff002a; }

.main-navigation { display: none; }
@media (min-width: 768px) { .main-navigation { display: flex; align-items: center; gap: 2rem; } }
.main-navigation ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 2rem; }
.main-navigation a {
  position: relative;
  font-size: .92rem; font-weight: 500;
  padding: .25rem 0;
}
.main-navigation a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 2px; background: #ff002a;
  transform: scaleX(0); transform-origin: left;
  transition: transform .22s ease;
}
.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after { transform: scaleX(1); }
.main-navigation .current-menu-item > a { color: #ff002a; }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: transparent; border: 0; cursor: pointer;
  transition: background .2s ease;
}
.icon-btn:hover { background: #fff5f6; }

/* Mobile menu toggle */
.menu-toggle { display: grid; }
@media (min-width: 768px) { .menu-toggle { display: none; } }

.mobile-menu {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 50;
}
.mobile-menu.is-open { display: block; }
.mobile-menu-panel {
  position: absolute; top: 0; right: 0;
  width: 280px; height: 100%;
  background: #fff;
  padding: 1.5rem;
  box-shadow: -8px 0 24px rgba(0,0,0,.1);
  overflow-y: auto;
}
.mobile-menu-panel ul { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.mobile-menu-panel li a {
  display: block;
  padding: .85rem 1rem;
  border-radius: .5rem;
  font-weight: 500;
}
.mobile-menu-panel li a:hover { background: #fff5f6; }
.mobile-menu-close {
  background: transparent; border: 0;
  font-size: 1.5rem; cursor: pointer;
  position: absolute; top: 1rem; right: 1rem;
}

/* ==========================================================================
   Buttons + Pills
   ========================================================================== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  background: #ff002a; color: #fff;
  font-weight: 600; font-size: .9rem;
  border-radius: 999px;
  border: 0; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(255,0,42,.5);
  color: #fff;
}
.pill {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .25rem .7rem;
  background: #ff002a; color: #fff;
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  border-radius: 999px;
}
.pill-outline {
  background: transparent; color: #ff002a;
  border: 1px solid #ff002a;
}
.meta {
  font-size: .78rem; color: #6b6b80;
  display: inline-flex; align-items: center; gap: .4rem;
}

/* ==========================================================================
   Section heading
   ========================================================================== */
.section-heading {
  display: flex; align-items: center; gap: 1rem;
  margin: 2rem 0;
}
.section-heading::before, .section-heading::after {
  content: ""; flex: 1; height: 1px; background: #ececec;
}
.section-heading h2 {
  margin: 0; font-size: 1.5rem;
  text-transform: uppercase; letter-spacing: .08em;
  font-family: 'Inter', sans-serif; font-weight: 700;
}
.section-heading h2 span { color: #ff002a; }

/* ==========================================================================
   Post grid + cards
   ========================================================================== */
.post-grid {
  display: grid; gap: 1.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

.card-post {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
}
.card-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px -10px rgba(0,0,0,.18);
}
.card-post .thumb {
  display: block; aspect-ratio: 4/3; overflow: hidden;
  border-radius: 12px 12px 0 0;
}
.card-post .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.card-post:hover .thumb img { transform: scale(1.05); }
.card-post .body { padding: 1.25rem; }
.card-post .post-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem; line-height: 1.3;
  margin: .5rem 0;
  color: #0f0f1e;
}
.card-post .post-title a { color: inherit; text-decoration: none; }
.card-post .post-title a:hover { color: #ff002a; }
.hero-feature h2 a, .hero-secondary h3 a { color: #fff; text-decoration: none; }
.card-post .excerpt {
  font-size: .9rem; color: #6b6b80;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-post .post-meta-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1rem;
  font-size: .78rem; color: #6b6b80;
}

/* Hero */
.hero-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1fr;
  margin-top: 2rem;
}
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1.4fr 1fr; } }
.hero-feature {
  position: relative; overflow: hidden;
  border-radius: 24px;
}
.hero-feature img { width: 100%; height: 420px; object-fit: cover; }
@media (min-width: 768px) { .hero-feature img { height: 560px; } }
.hero-feature .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(15,15,30,.9) 0%, rgba(15,15,30,.3) 50%, transparent 100%);
}
.hero-feature .content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 1.5rem; color: #fff;
}
@media (min-width: 768px) { .hero-feature .content { padding: 2.5rem; } }
.hero-feature h2 {
  color: #fff;
  font-size: 1.75rem; line-height: 1.15;
  margin: 1rem 0 .75rem;
  max-width: 36rem;
}
@media (min-width: 768px) { .hero-feature h2 { font-size: 3rem; } }
.hero-feature h2 a:hover { color: #ff002a; }
.hero-feature p { color: rgba(255,255,255,.85); max-width: 32rem; margin: 0; }

.hero-secondary { display: grid; gap: 1.5rem; }
.hero-secondary .item {
  position: relative; overflow: hidden;
  border-radius: 24px;
}
.hero-secondary .item img { width: 100%; height: 200px; object-fit: cover; }
@media (min-width: 768px) { .hero-secondary .item img { height: 270px; } }
.hero-secondary .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(15,15,30,.85), transparent 60%);
}
.hero-secondary .content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 1.25rem; color: #fff;
}
.hero-secondary h3 {
  font-size: 1.15rem; line-height: 1.3; margin: .5rem 0 0;
  color: #fff;
}

/* ==========================================================================
   Single post
   ========================================================================== */
.single-hero {
  background: #fff5f6;
  border-bottom: 1px solid #ececec;
  padding: 3rem 0 4rem;
  text-align: center;
}
.single-hero .inner { max-width: 720px; margin-inline: auto; }
.single-hero h1 {
  font-size: 2rem; line-height: 1.15; margin: 1rem 0 1.25rem;
}
@media (min-width: 768px) { .single-hero h1 { font-size: 3rem; } }
.single-hero .excerpt {
  font-size: 1.15rem; color: #6b6b80;
}
.single-hero .meta-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem;
  margin-top: 1.75rem;
  font-size: .9rem; color: #6b6b80;
}

.single-cover {
  margin-top: -2rem; position: relative; z-index: 5;
}
.single-cover img {
  width: 100%; aspect-ratio: 16/8; object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 12px 40px -10px rgba(0,0,0,.18);
}

.single-content {
  max-width: 760px; margin: 3rem auto;
  padding: 0 1.25rem;
  font-size: 1.05rem; line-height: 1.85; color: #2a2a3a;
}
.single-content p { margin: 0 0 1.25rem; }
.single-content h2 { font-size: 1.75rem; margin: 2.5rem 0 1rem; }
.single-content h3 { font-size: 1.35rem; margin: 2rem 0 .85rem; }
.single-content blockquote {
  border-left: 4px solid #ff002a;
  padding: .25rem 0 .25rem 1.25rem;
  margin: 2rem 0;
  font-style: italic; color: rgba(26,26,46,.85);
}
.single-content img { border-radius: 12px; margin: 1.5rem 0; }
.single-content ul, .single-content ol { margin: 0 0 1.25rem 1.5rem; }
.single-content a { color: #ff002a; text-decoration: underline; }

.author-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.5rem;
  background: #fff5f6;
  border-radius: 16px;
  margin-top: 2.5rem;
}
.author-avatar {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: 999px;
  background: #ff002a; color: #fff;
  font-family: 'Playfair Display', serif; font-size: 1.4rem;
}

/* ==========================================================================
   Page + Archive
   ========================================================================== */
.page-hero {
  background: #fff5f6;
  border-bottom: 1px solid #ececec;
  padding: 3.5rem 0;
  text-align: center;
}
.page-hero h1 { font-size: 2.5rem; margin: 1rem 0 .5rem; }
@media (min-width: 768px) { .page-hero h1 { font-size: 3.5rem; } }
.page-hero p { color: #6b6b80; max-width: 520px; margin: 0 auto; }

.content-with-sidebar {
  display: grid; gap: 3rem;
  grid-template-columns: 1fr;
  margin-top: 3rem;
}
@media (min-width: 1024px) {
  .content-with-sidebar { grid-template-columns: 1fr 320px; }
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar { display: flex; flex-direction: column; gap: 2.5rem; }
.sidebar-section { display: flex; flex-direction: column; gap: 1rem; }
.sidebar-extra-widgets { display: flex; flex-direction: column; gap: 2.5rem; }
.widget h4, .sidebar-section h4 {
  font-size: .8rem;
  text-transform: uppercase; letter-spacing: .12em;
  font-family: 'Inter', sans-serif; font-weight: 700;
  margin: 0 0 1rem;
}
.widget ul, .sidebar-section ul { list-style: none; padding: 0; margin: 0; }
.widget_categories ul, .widget_archive ul, .widget_pages ul, .widget_meta ul, .widget_nav_menu ul {
  border: 1px solid #ececec;
  border-radius: 12px;
  overflow: hidden;
}
.widget_categories li a, .widget_archive li a, .widget_pages li a, .widget_meta li a, .widget_nav_menu li a, .widget_categories li {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem;
  border-bottom: 1px solid #ececec;
  font-size: .9rem;
}
.widget_categories li { gap: .75rem; }
.widget_categories li a { padding: 0; border: 0; flex: 1; }
.widget_categories .count { color: #6b6b80; font-size: .85rem; }
.widget_categories li:last-child a, .widget_archive li:last-child a, .widget_pages li:last-child a, .widget_meta li:last-child a, .widget_nav_menu li:last-child a { border-bottom: 0; }
.widget_categories li a:hover, .widget_archive li a:hover { background: #fff5f6; }

.widget_search input[type="search"] {
  width: 100%;
  padding: .85rem 1rem .85rem 2.5rem;
  background: #f5f5f7;
  border: 1px solid #ececec;
  border-radius: 999px;
  font-size: .9rem;
}
.widget_search { position: relative; }
.widget_search button { display: none; }

.tagcloud a {
  display: inline-flex; align-items: center;
  padding: .25rem .7rem;
  margin: 0 .25rem .35rem 0;
  background: transparent;
  border: 1px solid #ff002a;
  color: #ff002a;
  font-size: .75rem;
  border-radius: 999px;
}
.tagcloud a:hover { background: #ff002a; color: #fff; }

/* ==========================================================================
   Pagination + comments
   ========================================================================== */
.pagination {
  display: flex; justify-content: center; gap: .5rem;
  margin: 3rem 0;
}
.pagination .page-numbers {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid #ececec;
  font-size: .9rem; font-weight: 500;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: #ff002a; color: #fff; border-color: #ff002a;
}

.comments-area { max-width: 760px; margin: 3rem auto; padding: 0 1.25rem; }
.comment-list { list-style: none; padding: 0; }
.comment-body {
  padding: 1.25rem;
  background: #fff5f6;
  border-radius: 12px;
  margin-bottom: 1rem;
}
.comment-form input, .comment-form textarea {
  width: 100%;
  padding: .85rem 1rem;
  border: 1px solid #ececec;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.comment-form .submit { background: #ff002a; color: #fff; border: 0; padding: .75rem 1.5rem; border-radius: 999px; cursor: pointer; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #0f0f1e;
  color: #c4c4d0;
  padding: 4rem 0 2rem;
  margin-top: 5rem;
}
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.site-footer a { color: #c4c4d0; }
.site-footer a:hover { color: #ff002a; }
.footer-cols {
  display: grid; gap: 2.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .footer-cols { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-cols ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .9rem; }
.site-footer .brand {
  display: flex; align-items: center; gap: .5rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; color: #fff;
  margin-bottom: 1rem;
}
.site-footer .brand .accent { color: #ff002a; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding-top: 2rem; margin-top: 3rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .85rem; color: rgba(255,255,255,.6);
}

/* ==========================================================================
   Newsletter
   ========================================================================== */
.newsletter {
  background: #fff5f6;
  padding: 3.5rem 0;
  margin-top: 4rem;
  text-align: center;
}
.newsletter h2 { font-size: 2rem; margin: 0 0 .75rem; }
.newsletter p { color: #6b6b80; max-width: 520px; margin: 0 auto 1.75rem; }
.newsletter form {
  display: flex; gap: .5rem; max-width: 460px; margin: 0 auto;
}
.newsletter input[type="email"] {
  flex: 1;
  padding: .85rem 1.25rem;
  border: 1px solid #ececec;
  border-radius: 999px;
  background: #fff;
}

/* ==========================================================================
   Utility / Accessibility
   ========================================================================== */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); -webkit-clip-path: inset(50%); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}
.alignleft { float: left; margin-right: 1.5rem; }
.alignright { float: right; margin-left: 1.5rem; }
.aligncenter { display: block; margin-inline: auto; }
.alignwide { max-width: 1100px; margin-inline: auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.wp-caption { margin-bottom: 1.5rem; }
.wp-caption-text { font-size: .85rem; color: #6b6b80; text-align: center; margin-top: .5rem; }

/* AdSense compatibility — give ad slots predictable spacing without breaking layout */
.adsense-slot {
  display: block;
  margin: 2rem auto;
  text-align: center;
  min-height: 90px;
  overflow: hidden;
}
.adsense-slot ins { display: block !important; }

/* ==========================================================================
   Browse by Category section (front page) — hardened
   ========================================================================== */
.category-section { margin-top: 4rem !important; }
.category-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 1rem !important;
  list-style: none !important;
  padding: 0 !important;
}
@media (min-width: 640px) {
  .category-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (min-width: 1024px) {
  .category-grid { grid-template-columns: repeat(6, 1fr) !important; }
}
.category-card {
  position: relative !important;
  display: block !important;
  height: 140px !important;
  border-radius: 1rem !important;
  overflow: hidden !important;
  text-decoration: none !important;
  margin: 0 !important;
}
.category-card img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: transform 500ms cubic-bezier(.2,.6,.2,1) !important;
  display: block !important;
  max-width: none !important;
}
.category-card:hover img { transform: scale(1.1) !important; }
.category-card-overlay {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(15,15,30,.45) !important;
  transition: background 220ms ease !important;
}
.category-card:hover .category-card-overlay { background: rgba(255,0,42,.55) !important; }
.category-card-content {
  position: relative !important;
  z-index: 1 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  text-align: center !important;
  padding: .5rem !important;
}
.category-card-name {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  color: #fff !important;
}
.category-card-count {
  font-size: .75rem !important;
  opacity: .85 !important;
  margin-top: .15rem !important;
  color: #fff !important;
}

/* ==========================================================================
   Custom Recent Posts widget (with thumbnail)
   ========================================================================== */
.benqu-recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.benqu-recent-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: .85rem;
  padding: .75rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.benqu-recent-item:last-child { border-bottom: 0; }
.benqu-recent-thumb {
  display: block;
  width: 80px; height: 80px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff5f6;
}
.benqu-recent-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.benqu-recent-body {
  display: flex; flex-direction: column;
  justify-content: center;
  gap: .25rem;
  min-width: 0;
}
.benqu-recent-cat {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  color: #ff002a;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-decoration: none;
  width: max-content;
}
.benqu-recent-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: .95rem;
  line-height: 1.3;
  font-weight: 700;
  color: #0f0f1e;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.benqu-recent-title:hover { color: #ff002a; }
.benqu-recent-date {
  font-size: .72rem;
  color: #6b6b80;
}
