/*
Theme Name: Team Sapphire Blog
Theme URI: https://teamsapphire.ca
Author: Team Sapphire Real Estate
Author URI: https://teamsapphire.ca
Description: A refined, editorial real estate blog theme inspired by modern real estate publications. Features a category navigation bar, a featured-post hero, a chronological post feed (newest first), category-grouped showcases, single-post layouts with author bio and related posts, and full category archive support. Built for Team Sapphire Real Estate.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
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: team-sapphire-blog
Tags: blog, real-estate, editorial, custom-logo, featured-images, two-columns, translation-ready
*/

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  --gold: #a58c53;
  --gold-dark: #8a7340;
  --dark: #100c0b;
  --brown: #695937;
  --cream: #faf7f2;
  --white: #ffffff;
  --ink: #1c1715;
  --muted: #6f655b;
  --line: #e7ded1;
  --line-soft: #f0e9df;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1180px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(16,12,11,.04), 0 12px 30px -18px rgba(16,12,11,.22);
  --shadow-hover: 0 1px 2px rgba(16,12,11,.05), 0 22px 50px -24px rgba(16,12,11,.32);
  --transition: .35s cubic-bezier(.22,.61,.36,1);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brown); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--dark); letter-spacing: -.01em; margin: 0 0 .5em; }
p { margin: 0 0 1.2em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 13px 26px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: all var(--transition); letter-spacing: .01em;
}
.btn--primary { background: var(--gold); color: #fff; }
.btn--primary:hover { background: var(--gold-dark); color: #fff; transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--dark); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ============================================================
   3. SITE HEADER
   ============================================================ */
.site-header { background: var(--dark); color: var(--cream); position: relative; z-index: 50; }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 0; }
.site-branding { display: flex; align-items: center; gap: 14px; }
.custom-logo-link img, .custom-logo { max-height: 44px; width: auto; }
.site-title { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 0; line-height: 1; }
.site-title a { color: var(--cream); }
.site-title a:hover { color: var(--gold); }
.site-title .accent { color: var(--gold); }
.site-description { font-size: 13px; color: #b7ac9d; margin: 4px 0 0; letter-spacing: .02em; }

.header-actions { display: flex; align-items: center; gap: 18px; }
.header-search { display: flex; align-items: center; }
.header-search input[type="search"] {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16);
  color: var(--cream); border-radius: 999px; padding: 9px 16px; font-family: var(--sans);
  font-size: 14px; width: 200px; transition: all var(--transition);
}
.header-search input[type="search"]::placeholder { color: #9a8f80; }
.header-search input[type="search"]:focus { outline: none; border-color: var(--gold); background: rgba(255,255,255,.12); }

/* Category navigation bar */
.category-bar { background: var(--dark); border-top: 1px solid rgba(255,255,255,.08); }
.category-nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
.category-nav::-webkit-scrollbar { display: none; }
.category-nav a {
  display: inline-block; white-space: nowrap; color: #cabfb0; font-size: 14px; font-weight: 500;
  padding: 12px 16px; border-bottom: 2px solid transparent; transition: all var(--transition);
}
.category-nav a:hover, .category-nav a.is-active { color: var(--gold); border-bottom-color: var(--gold); }
.category-nav .home-link { color: var(--cream); font-weight: 600; }

/* ============================================================
   4. PAGE INTRO / HERO BANNER
   ============================================================ */
.page-intro { padding: 56px 0 12px; text-align: center; }
.page-intro .eyebrow { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.page-intro h1 { font-size: clamp(34px, 5vw, 54px); margin-bottom: 14px; }
.page-intro p { color: var(--muted); max-width: 620px; margin: 0 auto; font-size: 18px; }

/* ============================================================
   5. FEATURED HERO POST
   ============================================================ */
.featured-hero { margin: 36px 0 12px; }
.featured-card {
  display: grid; grid-template-columns: 1.15fr 1fr; background: var(--white);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--line-soft); transition: box-shadow var(--transition);
}
.featured-card:hover { box-shadow: var(--shadow-hover); }
.featured-card__media { position: relative; min-height: 360px; overflow: hidden; }
.featured-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.featured-card:hover .featured-card__media img { transform: scale(1.04); }
.featured-card__media .placeholder { width:100%; height:100%; min-height:360px; background:linear-gradient(135deg,var(--brown),var(--dark)); }
.featured-card__body { padding: 44px 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.featured-card__body h2 { font-size: clamp(26px, 3vw, 38px); margin-bottom: 16px; }
.featured-card__body h2 a { color: var(--dark); }
.featured-card__body h2 a:hover { color: var(--gold); }
.featured-card__excerpt { color: var(--muted); font-size: 17px; margin-bottom: 22px; }

/* ============================================================
   6. SHARED CARD META & BADGES
   ============================================================ */
.cat-badge {
  display: inline-flex; align-items: center; font-family: var(--sans); font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--gold-dark);
  background: rgba(165,140,83,.1); padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}
.cat-badge:hover { background: rgba(165,140,83,.18); color: var(--gold-dark); }
.post-meta { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-top: 18px; }
.post-meta .author { color: var(--dark); font-weight: 600; }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }

/* ============================================================
   7. POST GRID (FEED)
   ============================================================ */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 56px 0 26px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); margin: 0; }
.section-head .section-line { flex: 1; height: 1px; background: var(--line); margin-left: 8px; }
.section-head .view-all { font-size: 14px; font-weight: 600; color: var(--brown); white-space: nowrap; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.post-grid--two { grid-template-columns: repeat(2, 1fr); }

.post-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line-soft); box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform var(--transition), box-shadow var(--transition);
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.post-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--line-soft); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post-card:hover .post-card__media img { transform: scale(1.05); }
.post-card__media .placeholder { width:100%; height:100%; background:linear-gradient(135deg,#cdbfa3,var(--brown)); }
.post-card__body { padding: 24px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.post-card__body h3 { font-size: 21px; line-height: 1.25; margin-bottom: 10px; }
.post-card__body h3 a { color: var(--dark); }
.post-card__body h3 a:hover { color: var(--gold); }
.post-card__excerpt { color: var(--muted); font-size: 15px; line-height: 1.6; margin-bottom: 16px; flex: 1; }
.post-card__body .cat-badge { margin-bottom: 14px; }
.post-card .post-meta { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft); }

/* Category showcase blocks */
.cat-showcase { margin-top: 8px; }

/* ============================================================
   8. SINGLE POST
   ============================================================ */
.single-wrap { background: var(--white); }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--brown); margin: 30px 0 0; }
.back-link:hover { color: var(--gold); }

.article-header { max-width: 760px; margin: 0 auto; padding: 30px 0 24px; text-align: center; }
.article-header .cat-badge { margin-bottom: 18px; }
.article-header h1 { font-size: clamp(30px, 4.5vw, 50px); line-height: 1.1; margin-bottom: 20px; }
.article-byline { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 15px; color: var(--muted); flex-wrap: wrap; }
.article-byline .author { color: var(--dark); font-weight: 600; }
.article-byline .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }

.article-hero-image { max-width: 980px; margin: 8px auto 0; }
.article-hero-image img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow); }

.article-body { max-width: 740px; margin: 0 auto; padding: 44px 0 20px; font-size: 18px; line-height: 1.8; }
.article-body p { margin: 0 0 1.4em; }
.article-body h2 { font-size: 30px; margin: 1.6em 0 .6em; }
.article-body h3 { font-size: 23px; margin: 1.4em 0 .5em; }
.article-body ul, .article-body ol { margin: 0 0 1.5em; padding-left: 1.3em; }
.article-body li { margin-bottom: .55em; }
.article-body img { border-radius: var(--radius); margin: 1.8em auto; box-shadow: var(--shadow); }
.article-body a { color: var(--gold-dark); text-decoration: underline; text-decoration-color: rgba(165,140,83,.4); text-underline-offset: 3px; }
.article-body a:hover { color: var(--brown); }
.article-body blockquote {
  margin: 1.8em 0; padding: 8px 0 8px 28px; border-left: 4px solid var(--gold);
  font-family: var(--serif); font-size: 23px; font-style: italic; color: var(--dark); line-height: 1.5;
}
.article-body strong { color: var(--dark); }

/* Related-content inline pull (Zolo style) */
.related-pull { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 2em 0; }
.related-pull .label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: 6px; }
.related-pull a { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--dark); text-decoration: none; }
.related-pull a:hover { color: var(--gold); }

/* Tags */
.article-tags { max-width: 740px; margin: 10px auto 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.article-tags .tag { font-size: 13px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.article-tags .tag:hover { border-color: var(--gold); color: var(--gold); }

/* Author bio box */
.author-box { max-width: 740px; margin: 50px auto 0; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px; display: flex; gap: 24px; align-items: flex-start; }
.author-box__avatar img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.author-box__content h3 { font-size: 22px; margin-bottom: 6px; }
.author-box__content h3 a { color: var(--dark); }
.author-box__content .role { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: 10px; }
.author-box__content p { font-size: 15px; color: var(--muted); margin: 0; }

/* Related posts */
.related-posts { padding: 64px 0 20px; }
.related-posts .section-head { margin-top: 0; }

/* ============================================================
   9. ARCHIVE / CATEGORY HEADER
   ============================================================ */
.archive-header { padding: 56px 0 6px; text-align: center; }
.archive-header .eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.archive-header h1 { font-size: clamp(32px, 5vw, 52px); margin-bottom: 12px; }
.archive-header p { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 17px; }

/* ============================================================
   10. PAGINATION
   ============================================================ */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 56px 0 0; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--white); color: var(--dark);
  font-weight: 600; font-size: 15px; transition: all var(--transition);
}
.pagination .page-numbers:hover { border-color: var(--gold); color: var(--gold); }
.pagination .page-numbers.current { background: var(--dark); color: var(--cream); border-color: var(--dark); }
.pagination .page-numbers.dots { border: none; background: transparent; }

/* ============================================================
   11. FOOTER
   ============================================================ */
.site-footer { background: var(--dark); color: #cabfb0; margin-top: 80px; }
.footer-top { padding: 64px 0 48px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; }
.footer-brand .site-title { font-size: 24px; margin-bottom: 12px; }
.footer-brand .site-title a { color: var(--cream); }
.footer-brand p { font-size: 15px; color: #9a8f80; max-width: 320px; }
.footer-col h4 { color: var(--cream); font-family: var(--sans); font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #cabfb0; font-size: 15px; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; color: #8a8073; }
.footer-bottom .socials { display: flex; gap: 16px; }
.footer-bottom .socials a { color: #cabfb0; }
.footer-bottom .socials a:hover { color: var(--gold); }

/* ============================================================
   12. COMMENTS (lightly styled)
   ============================================================ */
.comments-area { max-width: 740px; margin: 60px auto 0; }
.comments-area h2 { font-size: 26px; margin-bottom: 24px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.comment-author { font-weight: 600; color: var(--dark); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-family: var(--sans); font-size: 15px; margin-bottom: 14px; background: var(--white);
}
.comment-form textarea:focus, .comment-form input:focus { outline: none; border-color: var(--gold); }

/* ============================================================
   13. RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-card { grid-template-columns: 1fr; }
  .featured-card__media { min-height: 280px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .header-search input[type="search"] { width: 130px; }
  .post-grid, .post-grid--two { grid-template-columns: 1fr; }
  .featured-card__body { padding: 30px 26px; }
  .author-box { flex-direction: column; align-items: center; text-align: center; }
  .footer-top { grid-template-columns: 1fr; }
  .article-body { font-size: 17px; }
  .page-intro { padding: 40px 0 8px; }
}
