/*
Theme Name: CatVira
Theme URI: https://catvira.com
Author: CatVira
Author URI: https://catvira.com
Description: A premium, editorial-style WordPress theme built for CatVira — a cat products and cat care recommendation website. Fast, accessible, SEO-friendly, and built for Amazon affiliate marketing without requiring a page builder.
Version: 1.0.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: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: catvira
Tags: blog, e-commerce, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, theme-options, right-sidebar, custom-colors
*/

/* ==========================================================================
   1. CSS VARIABLES / DESIGN TOKENS
   ========================================================================== */
:root {
  /* Colors */
  --cv-bg: #ffffff;
  --cv-bg-soft: #f7f6f3;
  --cv-bg-soft-2: #f1efe9;
  --cv-text: #1c1b19;
  --cv-text-muted: #5c584f;
  --cv-border: #e7e3da;
  --cv-accent: #b5622f;       /* warm terracotta - "sophisticated cat" accent */
  --cv-accent-dark: #94491f;
  --cv-accent-soft: #f4e3d6;
  --cv-success: #3f7d5b;
  --cv-danger: #b23b3b;
  --cv-star: #d9a441;
  --cv-white: #ffffff;

  /* Typography */
  --cv-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --cv-font-heading: Georgia, "Iowan Old Style", "Palatino Linotype", serif;

  /* Layout */
  --cv-max-width: 1180px;
  --cv-radius: 14px;
  --cv-radius-sm: 8px;
  --cv-shadow: 0 2px 10px rgba(28,27,25,0.06);
  --cv-shadow-lg: 0 10px 30px rgba(28,27,25,0.10);
  --cv-space: 1.5rem;
}

/* ==========================================================================
   2. RESET / BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--cv-font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--cv-text);
  background: var(--cv-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cv-accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.3em; }
h1, h2, h3, h4, h5 {
  font-family: var(--cv-font-heading);
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 0.6em;
  color: var(--cv-text);
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1.2em; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px,1px,1px,1px);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--cv-accent); color: #fff;
  padding: 0.8em 1.2em; z-index: 10000;
}
.skip-link:focus { left: 0.5em; top: 0.5em; }
:focus-visible {
  outline: 3px solid var(--cv-accent);
  outline-offset: 2px;
}
.container {
  max-width: var(--cv-max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section { padding: 3.5rem 0; }
.section--soft { background: var(--cv-bg-soft); }
.section-title { text-align: center; margin-bottom: 0.4em; }
.section-sub {
  text-align: center; color: var(--cv-text-muted);
  max-width: 620px; margin: 0 auto 2.5rem; font-size: 1.05rem;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none !important;
}
.btn-primary { background: var(--cv-accent); color: #fff; }
.btn-primary:hover { background: var(--cv-accent-dark); }
.btn-secondary { background: transparent; color: var(--cv-text); border-color: var(--cv-border); }
.btn-secondary:hover { border-color: var(--cv-text); }
.btn-amazon {
  background: var(--cv-text); color: #fff; width: 100%;
  justify-content: center; padding: 0.9em 1.2em; font-size: 0.95rem;
}
.btn-amazon:hover { background: var(--cv-accent-dark); }
.btn-block { width: 100%; justify-content: center; }

/* ==========================================================================
   3. HEADER
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--cv-border);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding: 0.9rem 1.25rem;
  max-width: var(--cv-max-width); margin: 0 auto;
}
.site-branding { display: flex; align-items: center; gap: 0.6em; }
.site-branding a { color: var(--cv-text); text-decoration: none; display: flex; align-items: center; gap: .5em; }
.site-logo-icon { width: 34px; height: 34px; flex-shrink: 0; color: var(--cv-accent); }
.site-title {
  font-family: var(--cv-font-heading); font-weight: 700;
  font-size: 1.5rem; margin: 0; letter-spacing: -0.01em;
}
.site-description { font-size: 0.75rem; color: var(--cv-text-muted); margin: 0; }
.custom-logo-link img { max-height: 42px; width: auto; }

.main-nav { display: none; }
.main-nav ul { list-style: none; display: flex; gap: 1.6rem; margin: 0; padding: 0; }
.main-nav a {
  color: var(--cv-text); font-weight: 500; font-size: 0.97rem;
  padding: 0.4em 0; border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav .current-menu-item > a { border-color: var(--cv-accent); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 0.6rem; }
.header-search-toggle, .menu-toggle {
  background: none; border: 1px solid var(--cv-border); border-radius: 999px;
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--cv-text);
}
.header-search-toggle:hover, .menu-toggle:hover { border-color: var(--cv-accent); }
.header-search-form { display: none; padding: 0.8rem 1.25rem; border-top: 1px solid var(--cv-border); }
.header-search-form.is-open { display: block; }
.header-search-form form { display: flex; max-width: var(--cv-max-width); margin: 0 auto; }
.header-search-form input[type="search"] {
  flex: 1; padding: 0.7em 1em; border: 1px solid var(--cv-border);
  border-radius: 999px 0 0 999px; font-size: 1rem;
}
.header-search-form button {
  border: 1px solid var(--cv-text); background: var(--cv-text); color: #fff;
  border-radius: 0 999px 999px 0; padding: 0 1.2em; cursor: pointer;
}
.menu-toggle { display: flex; }
.mobile-nav {
  display: none; border-top: 1px solid var(--cv-border);
  background: #fff; padding: 0.5rem 1.25rem 1.25rem;
}
.mobile-nav.is-open { display: block; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav li { border-bottom: 1px solid var(--cv-border); }
.mobile-nav a { display: block; padding: 0.85em 0; color: var(--cv-text); font-weight: 500; }

@media (min-width: 900px) {
  .main-nav { display: block; }
  .menu-toggle { display: none; }
  .mobile-nav { display: none !important; }
}

/* ==========================================================================
   4. HERO
   ========================================================================== */
.hero {
  padding: 4rem 0 3rem;
  background: linear-gradient(180deg, var(--cv-bg-soft) 0%, #fff 100%);
}
.hero__grid {
  display: grid; gap: 2.5rem; align-items: center;
  grid-template-columns: 1fr;
}
.hero__trust {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: 0.85rem; color: var(--cv-text-muted);
  background: var(--cv-bg-soft-2); padding: 0.4em 1em; border-radius: 999px;
  margin-bottom: 1.2rem;
}
.hero h1 { margin-bottom: 0.5em; }
.hero__lead { font-size: 1.15rem; color: var(--cv-text-muted); max-width: 540px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.6rem; }
.hero__visual {
  border-radius: var(--cv-radius); overflow: hidden;
  box-shadow: var(--cv-shadow-lg);
  aspect-ratio: 4/3; background: var(--cv-bg-soft-2);
  display: flex; align-items: center; justify-content: center;
}
.hero__visual img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.05fr 0.95fr; }
}

/* Trust / value points */
.trust-points {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 700px) { .trust-points { grid-template-columns: repeat(4, 1fr); } }
.trust-point {
  background: #fff; border: 1px solid var(--cv-border); border-radius: var(--cv-radius);
  padding: 1.5rem 1.25rem; text-align: center; box-shadow: var(--cv-shadow);
}
.trust-point__icon {
  width: 40px; height: 40px; margin: 0 auto 0.7em;
  color: var(--cv-accent);
}
.trust-point h3 { font-size: 1.02rem; margin-bottom: 0.3em; }
.trust-point p { font-size: 0.92rem; color: var(--cv-text-muted); margin: 0; }

/* ==========================================================================
   5. PRODUCT CARDS
   ========================================================================== */
.products-grid {
  display: grid; gap: 1.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) { .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
  background: #fff; border: 1px solid var(--cv-border);
  border-radius: var(--cv-radius); overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--cv-shadow); transition: box-shadow .15s ease, transform .15s ease;
}
.product-card:hover { box-shadow: var(--cv-shadow-lg); transform: translateY(-2px); }
.product-card__image {
  aspect-ratio: 4/3; background: var(--cv-bg-soft-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.product-card__image img { width: 100%; height: 100%; object-fit: cover; }
.product-card__placeholder { color: var(--cv-text-muted); font-size: 0.8rem; text-align: center; padding: 1em; }
.product-card__body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; gap: 0.55em; }
.product-card__best-for {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--cv-accent-dark); font-weight: 700;
}
.product-card__title { font-size: 1.1rem; margin: 0; }
.product-card__title a { color: var(--cv-text); }
.product-card__rating { display: flex; align-items: center; gap: 0.4em; font-size: 0.9rem; }
.product-card__rating .stars { color: var(--cv-star); letter-spacing: 1px; }
.product-card__desc { font-size: 0.92rem; color: var(--cv-text-muted); margin: 0; }
.product-card__features { font-size: 0.86rem; margin: 0.2em 0; padding-left: 1.1em; }
.product-card__features li { margin-bottom: 0.2em; }
.product-card__pros-cons {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75em;
  font-size: 0.82rem; background: var(--cv-bg-soft); border-radius: var(--cv-radius-sm);
  padding: 0.75em;
}
.product-card__pros-cons strong { display: block; margin-bottom: 0.2em; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; }
.product-card__pros { color: var(--cv-success); }
.product-card__cons { color: var(--cv-danger); }
.product-card__pros ul, .product-card__cons ul { margin: 0; padding-left: 1em; }
.product-card__price { font-weight: 700; font-size: 1.05rem; margin-top: 0.2em; }
.product-card__footer { padding: 0 1.25rem 1.25rem; margin-top: auto; }
.product-card__disclosure { font-size: 0.72rem; color: var(--cv-text-muted); margin-top: 0.5em; text-align: center; }

/* Single product page */
.single-product-hero { display: grid; gap: 2rem; grid-template-columns: 1fr; margin-bottom: 2rem; }
@media (min-width: 900px) { .single-product-hero { grid-template-columns: 0.9fr 1.1fr; } }
.product-verdict {
  background: var(--cv-accent-soft); border-radius: var(--cv-radius);
  padding: 1.5rem; margin: 1.5rem 0;
}
.product-verdict h3 { margin-top: 0; }

/* Comparison table */
.comparison-table-wrap { overflow-x: auto; margin: 2rem 0; border: 1px solid var(--cv-border); border-radius: var(--cv-radius); }
table.comparison-table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 0.92rem; }
table.comparison-table th, table.comparison-table td {
  padding: 0.9em 1em; text-align: left; border-bottom: 1px solid var(--cv-border);
}
table.comparison-table th { background: var(--cv-bg-soft); font-weight: 700; }
table.comparison-table tr:last-child td { border-bottom: none; }

/* ==========================================================================
   6. AFFILIATE DISCLOSURE BOX
   ========================================================================== */
.affiliate-disclosure-box {
  background: var(--cv-bg-soft); border: 1px solid var(--cv-border);
  border-radius: var(--cv-radius-sm); padding: 1rem 1.25rem;
  font-size: 0.88rem; color: var(--cv-text-muted); margin: 1.5rem 0;
}
.affiliate-disclosure-box strong { color: var(--cv-text); }

/* ==========================================================================
   7. BLOG / ARTICLE
   ========================================================================== */
.breadcrumbs { font-size: 0.85rem; color: var(--cv-text-muted); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--cv-text-muted); }
.breadcrumbs a:hover { color: var(--cv-accent-dark); }

.article-header { max-width: 780px; margin: 0 auto 2rem; text-align: left; }
.article-category-tag {
  display: inline-block; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: .06em; font-weight: 700; color: var(--cv-accent-dark);
  background: var(--cv-accent-soft); padding: 0.3em 0.9em; border-radius: 999px;
  margin-bottom: 0.9em;
}
.article-meta { display: flex; flex-wrap: wrap; gap: 1em; font-size: 0.85rem; color: var(--cv-text-muted); margin: 0.8em 0; }
.article-featured-image { border-radius: var(--cv-radius); overflow: hidden; margin: 1.5rem 0 2rem; box-shadow: var(--cv-shadow); }

.article-layout { display: grid; gap: 3rem; grid-template-columns: 1fr; max-width: 900px; margin: 0 auto; }
.article-content { max-width: 780px; }
.article-content h2 { margin-top: 1.8em; }
.article-content h3 { margin-top: 1.4em; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.95rem; }
.article-content table th, .article-content table td { padding: 0.7em 0.9em; border: 1px solid var(--cv-border); text-align: left; }
.article-content table th { background: var(--cv-bg-soft); }
.article-content blockquote {
  border-left: 3px solid var(--cv-accent); margin: 1.5em 0; padding: 0.2em 1.2em;
  color: var(--cv-text-muted); font-style: italic;
}
.article-content ul li, .article-content ol li { margin-bottom: 0.4em; }

.toc { background: var(--cv-bg-soft); border-radius: var(--cv-radius); padding: 1.25rem 1.5rem; margin: 1.5rem 0 2rem; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ol { margin: 0.8em 0 0; padding-left: 1.2em; }
.toc a { color: var(--cv-text); }

.author-box {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--cv-bg-soft); border-radius: var(--cv-radius);
  padding: 1.5rem; margin: 2.5rem 0;
}
.author-box img { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; }
.author-box h4 { margin: 0 0 0.3em; }
.author-box p { margin: 0; font-size: 0.9rem; color: var(--cv-text-muted); }

.faq-item { border-bottom: 1px solid var(--cv-border); padding: 1em 0; }
.faq-item summary { font-weight: 600; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+ "; color: var(--cv-accent); font-weight: 700; }
.faq-item[open] summary::before { content: "\2212 "; }
.faq-item p { margin-top: 0.7em; color: var(--cv-text-muted); }

.social-share { display: flex; gap: 0.6em; margin: 2rem 0; }
.social-share a {
  width: 40px; height: 40px; border: 1px solid var(--cv-border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--cv-text);
}
.social-share a:hover { border-color: var(--cv-accent); color: var(--cv-accent-dark); }

.related-posts { margin: 3rem 0; }
.post-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }
.post-card { border-radius: var(--cv-radius); overflow: hidden; border: 1px solid var(--cv-border); background: #fff; }
.post-card__img { aspect-ratio: 16/10; background: var(--cv-bg-soft-2); overflow: hidden; }
.post-card__img img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 1.1rem; }
.post-card__cat { font-size: 0.72rem; text-transform: uppercase; color: var(--cv-accent-dark); font-weight: 700; }
.post-card__title { font-size: 1.02rem; margin: 0.3em 0; }
.post-card__title a { color: var(--cv-text); }
.post-card__excerpt { font-size: 0.88rem; color: var(--cv-text-muted); }

/* Pagination */
.pagination { display: flex; gap: 0.5em; justify-content: center; margin: 2.5rem 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 0.6em;
  border: 1px solid var(--cv-border); border-radius: var(--cv-radius-sm);
  color: var(--cv-text);
}
.pagination .current { background: var(--cv-text); color: #fff; border-color: var(--cv-text); }
.pagination a:hover { border-color: var(--cv-accent); text-decoration: none; }

/* Comments */
.comments-area { margin: 3rem 0; max-width: 780px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 2.2rem; }
.comment-body { border-bottom: 1px solid var(--cv-border); padding: 1.2rem 0; }
.comment-author { font-weight: 700; font-size: 0.95rem; }
.comment-metadata { font-size: 0.8rem; color: var(--cv-text-muted); }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 0.7em 0.9em; border: 1px solid var(--cv-border);
  border-radius: var(--cv-radius-sm); font-family: inherit; font-size: 1rem; margin-bottom: 1em;
}
.comment-form label { display: block; font-size: 0.85rem; margin-bottom: 0.3em; font-weight: 600; }

/* Category page */
.category-intro { max-width: 780px; margin: 0 auto 2.5rem; text-align: center; }

/* Contact form */
.contact-form-wrap { max-width: 640px; margin: 0 auto; }
.contact-form-wrap .form-row { margin-bottom: 1.2rem; }
.contact-form-wrap label { display: block; font-weight: 600; margin-bottom: 0.4em; font-size: 0.92rem; }
.contact-form-wrap input, .contact-form-wrap textarea {
  width: 100%; padding: 0.8em 1em; border: 1px solid var(--cv-border);
  border-radius: var(--cv-radius-sm); font-family: inherit; font-size: 1rem;
}
.contact-form-notice { padding: 1em 1.25rem; border-radius: var(--cv-radius-sm); margin-bottom: 1.5rem; font-size: 0.92rem; }
.contact-form-notice--success { background: #e9f4ee; color: var(--cv-success); }
.contact-form-notice--error { background: #fbebeb; color: var(--cv-danger); }

/* How we choose */
.how-we-choose { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .how-we-choose { grid-template-columns: repeat(3,1fr); } }
.how-we-choose__item { padding: 1.25rem; }
.how-we-choose__item h3 { font-size: 1rem; }

/* ==========================================================================
   8. FOOTER
   ========================================================================== */
.site-footer { background: var(--cv-text); color: #d9d6cf; margin-top: 4rem; }
.footer-top { padding: 3.5rem 0 2rem; }
.footer-grid { display: grid; gap: 2.2rem; grid-template-columns: 1fr; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1.3fr; } }
.footer-col h4 { color: #fff; font-size: 0.9rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1em; font-family: var(--cv-font-body); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.6em; }
.footer-col a { color: #d9d6cf; font-size: 0.92rem; }
.footer-col a:hover { color: #fff; }
.footer-brand p { font-size: 0.9rem; color: #b9b6ae; }
.footer-newsletter form { display: flex; margin-top: 0.8em; }
.footer-newsletter input[type="email"] {
  flex: 1; padding: 0.7em 1em; border-radius: 999px 0 0 999px; border: none; font-size: 0.9rem;
}
.footer-newsletter button {
  border: none; background: var(--cv-accent); color: #fff; padding: 0 1.2em;
  border-radius: 0 999px 999px 0; cursor: pointer; font-weight: 600;
}
.footer-social { display: flex; gap: 0.6em; margin-top: 1em; }
.footer-social a {
  width: 36px; height: 36px; border: 1px solid #4a463e; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.footer-bottom {
  border-top: 1px solid #38352e; padding: 1.25rem 0;
  font-size: 0.82rem; color: #a8a59c; text-align: center;
}

/* ==========================================================================
   9. UTILITIES
   ========================================================================== */
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100%; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Lazy load fade-in */
img[loading="lazy"] { opacity: 0; transition: opacity .3s ease; }
img[loading="lazy"].loaded, img[loading="lazy"][data-loaded="1"] { opacity: 1; }
