/*
 Theme Name: Habits
 Description: A clean health and wellness blog theme built for AI-generated content.
 Version: 2.0.0
 Requires at least: 6.5
 Tested up to: 6.7
 Requires PHP: 8.0
 License: GNU General Public License v2 or later
 License URI: https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain: habits
*/

/* ============================================================
   CSS RESET
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ol,
ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ============================================================
   BASE BODY STYLES
   ============================================================ */

body {
  background-color: var(--wp--preset--color--bg);
  color: var(--wp--preset--color--text);
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--normal);
  line-height: 1.7;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.site-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-main {
  flex: 1;
  padding-top: 24px;
  padding-bottom: 40px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* Content + Sidebar wrapper — column on mobile */
.content-sidebar-wrap {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.content-area {
  min-width: 0;
  flex: 1;
}

.sidebar {
  width: 100%;
  flex-shrink: 0;
}

/* Desktop: side-by-side at 1024px */
@media (min-width: 1024px) {
  .content-sidebar-wrap {
    flex-direction: row;
    align-items: flex-start;
  }

  .sidebar {
    width: 300px;
  }
}

/* ============================================================
   DESKTOP BREAKPOINT ENHANCEMENTS (768px)
   ============================================================ */

@media (min-width: 768px) {
  .container {
    padding-inline: 24px;
  }

  .site-main {
    padding-top: 40px;
    padding-bottom: 60px;
  }
}

/* ============================================================
   CONTENT TYPOGRAPHY — .entry-content
   ============================================================ */

.entry-content {
  font-size: var(--wp--preset--font-size--normal);
  line-height: 1.8;
  color: var(--wp--preset--color--text);
}

/* Paragraphs */
.entry-content p {
  margin-bottom: 1.25em;
}

/* Headings */
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--wp--preset--color--text);
  margin-top: 2em;
  margin-bottom: 0.6em;
  letter-spacing: -0.02em;
}

.entry-content h2 {
  font-size: var(--wp--preset--font-size--xx-large);
}

.entry-content h3 {
  font-size: var(--wp--preset--font-size--x-large);
}

.entry-content h4 {
  font-size: var(--wp--preset--font-size--large);
}

/* Links */
.entry-content a {
  color: var(--wp--preset--color--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.entry-content a:hover {
  color: var(--wp--preset--color--primary-dark);
}

/* Lists */
.entry-content ul,
.entry-content ol {
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

.entry-content ul {
  list-style: disc;
}

.entry-content ol {
  list-style: decimal;
}

.entry-content li {
  margin-bottom: 0.4em;
}

.entry-content li::marker {
  color: var(--wp--preset--color--primary);
}

/* Nested lists */
.entry-content ul ul,
.entry-content ol ol,
.entry-content ul ol,
.entry-content ol ul {
  margin-top: 0.4em;
  margin-bottom: 0;
}

/* Blockquote — green left border + light green background */
.entry-content blockquote {
  margin: 1.75em 0;
  padding: 1em 1.25em;
  border-left: 4px solid var(--wp--preset--color--primary);
  background-color: var(--wp--preset--color--primary-light);
  border-radius: 0 6px 6px 0;
  color: var(--wp--preset--color--text-secondary);
  font-style: italic;
}

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

.entry-content blockquote cite {
  display: block;
  margin-top: 0.5em;
  font-size: var(--wp--preset--font-size--small);
  font-style: normal;
  color: var(--wp--preset--color--text-muted);
}

/* Images */
.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin-top: 0.5em;
  margin-bottom: 1.5em;
}

.entry-content figure {
  margin: 1.5em 0;
}

.entry-content figcaption {
  text-align: center;
  font-size: var(--wp--preset--font-size--small);
  color: var(--wp--preset--color--text-muted);
  margin-top: 0.4em;
}

/* Inline code */
.entry-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  background-color: var(--wp--preset--color--primary-light);
  color: var(--wp--preset--color--primary-dark);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--wp--preset--color--border);
}

/* Code blocks */
.entry-content pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: var(--wp--preset--font-size--small);
  background-color: var(--wp--preset--color--text);
  color: var(--wp--preset--color--bg);
  padding: 1.25em 1.5em;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5em 0;
  line-height: 1.6;
}

.entry-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
  border-radius: 0;
}

/* Tables — striped, responsive */
.entry-content .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5em 0;
  border-radius: 6px;
  border: 1px solid var(--wp--preset--color--border);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--wp--preset--font-size--small);
  min-width: 500px;
}

.entry-content th {
  background-color: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--bg-card);
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 700;
  font-size: var(--wp--preset--font-size--small);
  text-align: left;
  padding: 10px 14px;
  letter-spacing: 0.03em;
}

.entry-content td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--wp--preset--color--border);
  vertical-align: top;
  color: var(--wp--preset--color--text-secondary);
}

/* Striped rows */
.entry-content tr:nth-child(even) td {
  background-color: var(--wp--preset--color--primary-light);
}

.entry-content tr:last-child td {
  border-bottom: none;
}

/* Horizontal rule */
.entry-content hr {
  border: none;
  border-top: 2px solid var(--wp--preset--color--border);
  margin: 2em 0;
}

/* Desktop typography enhancements */
@media (min-width: 768px) {
  .entry-content {
    font-size: var(--wp--preset--font-size--medium);
  }

  .entry-content h2 {
    font-size: calc(var(--wp--preset--font-size--xx-large) * 1.15);
  }

  .entry-content h3 {
    font-size: var(--wp--preset--font-size--xx-large);
  }
}

/* ============================================================
   SITE HEADER
   ============================================================ */

.site-header {
  background-color: var(--wp--preset--color--bg-card);
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

/* ============================================================
   HEADER INNER — Single row, minimal
   ============================================================ */

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

@media (min-width: 768px) {
  .header-inner {
    height: 60px;
  }
}

/* ============================================================
   SITE LOGO — "h" green + "abits" black, sans-serif
   ============================================================ */

.site-logo {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--wp--preset--color--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--wp--preset--font-family--body);
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  margin-right: 8px;
}

.logo-h {
  font-family: var(--wp--preset--font-family--body);
  font-size: 20px;
  font-weight: 800;
  color: var(--wp--preset--color--primary);
  line-height: 1;
  letter-spacing: -0.5px;
}

.logo-text {
  font-family: var(--wp--preset--font-family--body);
  font-size: 20px;
  font-weight: 800;
  color: var(--wp--preset--color--text);
  line-height: 1;
  letter-spacing: -0.5px;
}

@media (min-width: 768px) {
  .logo-h,
  .logo-text {
    font-size: 22px;
  }
}

/* ============================================================
   DESKTOP NAVIGATION — Clean, minimal
   ============================================================ */

.desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
}

@media (min-width: 1024px) {
  .desktop-nav {
    display: flex;
  }
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li a {
  display: flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 400;
  color: var(--wp--preset--color--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.nav-menu li a:hover {
  color: var(--wp--preset--color--text);
  background-color: rgba(0, 0, 0, 0.03);
}

.nav-menu li.current-menu-item > a,
.nav-menu li.current_page_item > a {
  color: var(--wp--preset--color--text);
  font-weight: 600;
}

/* Search Toggle */
.search-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--wp--preset--color--text-muted);
  transition: border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.search-toggle:hover {
  border-color: var(--wp--preset--color--text-muted);
  color: var(--wp--preset--color--text);
}

/* Search Overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s;
}

.search-overlay.open {
  visibility: visible;
  opacity: 1;
}

.search-overlay-inner {
  background: var(--wp--preset--color--bg-card);
  border-radius: 16px;
  padding: 16px;
  width: 92%;
  max-width: 520px;
  position: relative;
  transform: translateY(-20px);
  transition: transform 0.2s ease;
}

.search-overlay.open .search-overlay-inner {
  transform: translateY(0);
}

.search-overlay-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--wp--preset--color--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}

.search-overlay-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.search-overlay .search-form {
  max-width: 100%;
}

/* Mobile Right */
.header-mobile-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (min-width: 1024px) {
  .header-mobile-right {
    display: none;
  }
}

/* ============================================================
   MOBILE MENU TOGGLE
   ============================================================ */

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 1024px) {
  .mobile-menu-toggle {
    display: none;
  }
}

.hamburger-line {
  display: block;
  width: 18px;
  height: 1.5px;
  background-color: var(--wp--preset--color--text);
  border-radius: 1px;
}

/* ============================================================
   MOBILE MENU OVERLAY
   ============================================================ */

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-menu-overlay.open {
  visibility: visible;
  opacity: 1;
}

.mobile-menu-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
}

/* ============================================================
   MOBILE MENU PANEL
   ============================================================ */

.mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80%;
  max-width: 320px;
  background-color: var(--wp--preset--color--bg-card);
  padding: 24px 20px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-menu-overlay.open .mobile-menu-panel {
  transform: translateX(0);
}

.mobile-menu-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--wp--preset--color--text);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.mobile-menu-close:hover {
  background-color: var(--wp--preset--color--primary-light);
}

/* ============================================================
   MOBILE NAV MENU
   ============================================================ */

.mobile-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-menu li {
  border-bottom: 1px solid var(--wp--preset--color--border);
  min-height: 48px;
  display: flex;
  align-items: center;
}

.mobile-nav-menu li a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0 4px;
  font-size: 15px;
  color: var(--wp--preset--color--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.mobile-nav-menu li a:hover,
.mobile-nav-menu li.current-menu-item > a {
  color: var(--wp--preset--color--primary);
}

/* ============================================================
   SITE FOOTER
   ============================================================ */

.site-footer {
  margin-top: auto;
}

/* ============================================================
   FOOTER MAIN
   ============================================================ */

.footer-main {
  background-color: var(--wp--preset--color--footer);
  color: #A5D6A7;
  padding: 32px 0;
}

.footer-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (min-width: 768px) {
  .footer-grid {
    flex-direction: row;
    gap: 40px;
  }

  .footer-col {
    flex: 1;
  }
}

/* ============================================================
   FOOTER TITLES, DESC, LINKS, RECENT
   ============================================================ */

.footer-title {
  font-size: 14px;
  color: #FFFFFF;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 13px;
  line-height: 1.6;
  color: #A5D6A7;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: #A5D6A7;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #FFFFFF;
}

.footer-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-recent a {
  color: #A5D6A7;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.45;
  transition: color 0.15s ease;
  display: block;
}

.footer-recent a:hover {
  color: #FFFFFF;
}

/* ============================================================
   FOOTER BOTTOM
   ============================================================ */

.footer-bottom {
  background-color: var(--wp--preset--color--footer-bottom);
  color: #81C784;
  padding: 12px 0;
  font-size: 12px;
}

.footer-bottom-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

@media (min-width: 768px) {
  .footer-bottom-inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-bottom p {
  margin: 0;
}

.footer-legal {
  display: flex;
  gap: 16px;
}

.footer-legal a {
  color: #81C784;
  text-decoration: none;
  font-size: 11px;
}

.footer-legal a:hover {
  color: #FFFFFF;
}

/* ============================================================
   STICKY MOBILE AD
   ============================================================ */

.sticky-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background-color: var(--wp--preset--color--bg-card);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
  padding-top: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

@media (min-width: 768px) {
  .sticky-ad {
    display: none !important;
  }
}

.sticky-ad-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wp--preset--color--text-muted);
  border-radius: 4px;
  padding: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sticky-ad-close:hover {
  background-color: var(--wp--preset--color--primary-light);
  color: var(--wp--preset--color--text);
}

.sticky-ad-content {
  display: flex;
  justify-content: center;
  min-height: 100px;
}

/* AdSense: ensure real ads fill properly */
.sticky-ad-content ins.adsbygoogle {
  display: block !important;
  width: 320px;
  height: 100px;
}

body.has-sticky-ad {
  padding-bottom: 120px;
}

@media (min-width: 768px) {
  body.has-sticky-ad {
    padding-bottom: 0;
  }
}

/* ============================================================
   SIDEBAR WIDGETS
   ============================================================ */

@media (min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
  }
}

.widget {
  background-color: var(--wp--preset--color--bg-card);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 16px;
  margin-bottom: 16px;
}

.widget-ad {
  background: none;
  box-shadow: none;
  padding: 0;
}

.widget-title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--wp--preset--color--text);
  border-bottom: 2px solid var(--wp--preset--color--primary);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

/* Popular Posts */
.popular-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popular-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.popular-rank {
  width: 24px;
  height: 24px;
  background: var(--wp--preset--color--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.popular-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--wp--preset--color--text);
  line-height: 1.45;
  transition: color 0.15s ease;
}

.popular-link:hover {
  color: var(--wp--preset--color--primary);
}

/* Categories */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--wp--preset--color--text);
  transition: color 0.15s ease;
}

.category-item a:hover {
  color: var(--wp--preset--color--primary);
}

.cat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-name {
  flex: 1;
}

.cat-count {
  font-size: 10px;
  color: var(--wp--preset--color--text-muted);
  background-color: var(--wp--preset--color--primary-light);
  padding: 1px 6px;
  border-radius: 10px;
}

/* Tags Cloud */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  font-size: 11px;
  color: var(--wp--preset--color--text-secondary);
  background-color: var(--wp--preset--color--primary-light);
  padding: 3px 8px;
  border-radius: 12px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tag-pill:hover {
  background-color: var(--wp--preset--color--primary-light);
  color: var(--wp--preset--color--primary);
}

/* ============================================================
   AD SLOTS — empty slots are not rendered (hidden automatically)
   ============================================================ */

.ad-slot {
  text-align: center;
  overflow: hidden;
}

.ad-slot:empty {
  display: none;
}

.ad-slot--sidebar {
  min-height: 250px;
  margin-bottom: 16px;
}

.ad-slot--content {
  max-width: 336px;
  margin: 24px auto;
}

.ad-slot--leaderboard {
  margin-bottom: 20px;
}

@media (max-width: 767px) {
  .ad-slot--leaderboard {
    display: none;
  }
}

.ad-slot--sticky {
  min-height: 100px;
}

/* ============================================================
   CATEGORY LABEL
   ============================================================ */

.cat-label {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wp--preset--color--primary);
  background-color: var(--wp--preset--color--primary-light);
  padding: 3px 8px;
  border-radius: 12px;
  margin-bottom: 8px;
}

/* ============================================================
   HERO CARD
   ============================================================ */

.hero-card {
  margin: 16px 0;
  border-radius: 12px;
  background-color: var(--wp--preset--color--bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.hero-link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

@media (min-width: 768px) {
  .hero-link {
    flex-direction: row;
  }
}

.hero-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  margin: 0;
}

@media (min-width: 768px) {
  .hero-image {
    aspect-ratio: unset;
    flex: 1;
    min-height: 280px;
  }
}

.hero-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 768px) {
  .hero-content {
    padding: 32px;
    flex: 1;
  }
}

.hero-title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--wp--preset--color--text);
  letter-spacing: -0.3px;
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 28px;
  }
}

.hero-excerpt {
  font-size: 14px;
  color: var(--wp--preset--color--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.hero-readmore {
  display: inline-block;
  background-color: var(--wp--preset--color--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 16px;
  border-radius: 6px;
  align-self: flex-start;
  transition: background-color 0.2s ease;
}

.hero-link:hover .hero-readmore {
  background-color: var(--wp--preset--color--primary-dark);
}

/* ============================================================
   POST CARD GRID
   ============================================================ */

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

.post-card {
  background-color: var(--wp--preset--color--bg-card);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  }
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card-image {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .card-image {
    aspect-ratio: 16 / 9;
  }
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

@media (hover: hover) {
  .post-card:hover .card-image img {
    transform: scale(1.03);
  }
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--wp--preset--color--text);
  margin-bottom: 10px;
  /* Clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 768px) {
  .card-title {
    font-size: 16px;
  }
}

/* Mobile: horizontal card layout */
@media (max-width: 767px) {
  .post-card .card-link {
    display: flex;
    flex-direction: row;
  }

  .card-image {
    width: 110px;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
  }

  .card-body {
    padding: 10px 12px;
  }

  .card-title {
    font-size: 14px;
  }
}

.card-meta {
  font-size: 11px;
  color: var(--wp--preset--color--text-muted);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 32px;
  margin-bottom: 16px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pagination a {
  color: var(--wp--preset--color--text-secondary);
  background-color: var(--wp--preset--color--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}

.pagination a:hover {
  background-color: var(--wp--preset--color--primary-light);
  color: var(--wp--preset--color--primary);
}

.pagination .current {
  background-color: var(--wp--preset--color--primary);
  color: #ffffff;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */

.breadcrumb {
  font-size: 11px;
  color: var(--wp--preset--color--text-muted);
  padding: 12px 0;
  overflow-x: auto;
  white-space: nowrap;
}

.breadcrumb a {
  color: var(--wp--preset--color--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb a:hover {
  color: var(--wp--preset--color--primary-dark);
}

.breadcrumb-sep {
  margin: 0 6px;
  color: var(--wp--preset--color--border);
}

/* ============================================================
   SINGLE POST — POST HEADER
   ============================================================ */

.post-title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: var(--wp--preset--font-size--x-large);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--wp--preset--color--text);
  margin-top: 8px;
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .post-title {
    font-size: var(--wp--preset--font-size--xx-large);
  }
}

.post-meta {
  font-size: 12px;
  color: var(--wp--preset--color--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.meta-sep {
  color: var(--wp--preset--color--border);
}

/* ============================================================
   SINGLE POST — FEATURED IMAGE
   ============================================================ */

.post-featured-image {
  margin: 0 -16px;
  overflow: hidden;
  margin-bottom: 24px;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
}

@media (min-width: 768px) {
  .post-featured-image {
    margin: 0;
    border-radius: 12px;
  }

  .post-featured-image img {
    border-radius: 12px;
  }
}

/* ============================================================
   SINGLE POST — TAGS
   ============================================================ */

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--wp--preset--color--border);
}

/* ============================================================
   RELATED POSTS
   ============================================================ */

.related-posts {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--wp--preset--color--border);
}

.related-posts__title {
  font-family: var(--wp--preset--font-family--heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--wp--preset--color--text);
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 768px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.related-card {
  background-color: var(--wp--preset--color--bg-card);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  }
}

.related-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.related-card__image {
  height: 180px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .related-card__image {
    height: 120px;
  }
}

.related-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
  border-radius: 0;
  margin: 0;
}

@media (hover: hover) {
  .related-card:hover .related-card__image img {
    transform: scale(1.04);
  }
}

.related-card-body,
.related-card__link > :not(.related-card__image) {
  padding: 10px 14px;
}

.related-card__category {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wp--preset--color--primary);
  padding: 10px 14px 0;
}

.related-card__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--wp--preset--color--text);
  padding: 6px 14px 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   POST NAVIGATION (prev/next)
   ============================================================ */

.post-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--wp--preset--color--border);
}

@media (min-width: 768px) {
  .post-nav {
    flex-direction: row;
    justify-content: space-between;
  }
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
  justify-content: center;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  background-color: var(--wp--preset--color--bg-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  max-width: 100%;
}

@media (min-width: 768px) {
  .post-nav-link {
    max-width: 48%;
  }

  .post-nav-link--next {
    text-align: right;
    align-items: flex-end;
  }
}

.post-nav-link:hover {
  background-color: var(--wp--preset--color--primary-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wp--preset--color--text-muted);
}

.post-nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--wp--preset--color--primary-dark);
  line-height: 1.4;
  transition: color 0.15s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-nav-link:hover .post-nav-title {
  color: var(--wp--preset--color--primary);
}

/* ============================================================
   ARCHIVE & SEARCH HEADER
   ============================================================ */

.archive-header {
  padding: 24px 0 16px;
  border-bottom: 2px solid var(--wp--preset--color--border);
  margin-bottom: 24px;
}

.archive-title span {
  color: var(--wp--preset--color--primary);
}

.archive-desc {
  font-size: 14px;
  color: var(--wp--preset--color--text-secondary);
  margin-top: 8px;
}

.archive-count {
  display: inline-block;
  font-size: 12px;
  color: var(--wp--preset--color--text-muted);
  margin-top: 6px;
}

/* ============================================================
   404 PAGE
   ============================================================ */

.page-404 {
  text-align: center;
  padding: 48px;
  max-width: 500px;
  margin: 0 auto;
}

.error-404-icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 16px;
}

.error-desc {
  color: var(--wp--preset--color--text-secondary);
  margin-bottom: 24px;
}

.error-links {
  margin-top: 32px;
  text-align: left;
}

.error-links ul {
  list-style: none;
  padding: 0;
  margin-top: 12px;
}

.error-links li {
  border-bottom: 1px solid var(--wp--preset--color--border);
  padding: 10px 0;
}

.error-links li:last-child {
  border-bottom: none;
}

.error-links li a {
  color: var(--wp--preset--color--primary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.error-links li a:hover {
  color: var(--wp--preset--color--primary-dark);
}

/* ============================================================
   NO RESULTS
   ============================================================ */

.no-results {
  text-align: center;
  padding: 32px;
  color: var(--wp--preset--color--text-secondary);
}

/* ============================================================
   SEARCH FORM
   ============================================================ */

.search-form {
  display: flex;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
  background: #f5f5f5;
  border-radius: 12px;
  padding: 4px;
  transition: background 0.15s ease;
}

.search-form:focus-within {
  background: #efefef;
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--wp--preset--color--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  min-height: 44px;
}

.search-input::placeholder {
  color: #aaa;
}

.search-submit {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: var(--wp--preset--color--primary);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.search-submit:hover {
  background: var(--wp--preset--color--primary-dark);
}

/* ============================================================
   SCREEN READER TEXT (ACCESSIBILITY)
   ============================================================ */

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  word-wrap: normal;
  white-space: nowrap;
}
