/*
Theme Name: D5 Auto Magazine
Theme URI: https://shirobyte.com/
Author: shirobyte Solutions
Author URI: https://shirobyte.com
Description: A lightweight, ACF-powered automotive magazine theme optimized for editorial control, ad revenue, SEO, and performance.
Version: 2.1.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: d4
*/

:root {
  --color-primary: #d72638;
  --color-secondary: #0f172a;
  --color-accent: #f59e0b;
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-border: #d9e0e8;
  --color-text: #172033;
  --color-muted: #5b6474;
  --font-heading: "Montserrat", sans-serif;
  --font-text: "Geist", Arial, sans-serif;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --container: 1240px;
  --gutter: clamp(18px, 4vw, 40px);
  --section-space: clamp(40px, 7vw, 88px);
  --section-space-tight: clamp(28px, 4vw, 48px);
  --card-padding: clamp(18px, 2vw, 28px);
  --transition: 180ms ease;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-text);
  color: var(--color-text);
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 22%),
    linear-gradient(180deg, #fbfcfe 0%, var(--color-bg) 100%);
  line-height: 1.6;
}

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

iframe,
embed,
object,
video {
  max-width: 100%;
}

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

a:hover,
a:focus {
  color: var(--color-primary);
}

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

h1,
h2,
h3,
h4,
h5,
h6,
.page-title,
.entry-title,
.site-branding,
.section-heading,
.post-card__title,
.feature-card__title,
.category-card__title,
.widget-title,
.footer-menu-title,
.button,
.search-submit,
button,
input[type="submit"] {
  font-family: var(--font-heading);
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

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

.site-main {
  flex: 1;
  padding-top: clamp(20px, 3vw, 36px);
}

.container {
  width: min(100% - (var(--gutter) * 2), var(--container));
  margin: 0 auto;
}

.entry-content,
.post-card__title,
.feature-card__title,
.category-card__title,
.page-title,
.entry-title,
.widget {
  overflow-wrap: anywhere;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: clamp(24px, 3vw, 36px);
}

.section-heading h2,
.page-title,
.entry-title {
  margin: 0;
  line-height: 1.1;
}

.section-heading h2,
.page-title {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.eyebrow {
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(217, 224, 232, 0.85);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.admin-bar .site-header {
  top: 32px;
}

.header-ad {
  padding: 14px 0 0;
}

.header-ad .ad-slot {
  margin-bottom: 12px;
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  min-height: clamp(70px, 7vw, 84px);
}

.site-branding img {
  max-height: 46px;
  width: auto;
}

.site-navigation {
  display: none;
  justify-self: center;
  min-width: 0;
}

.menu,
.sub-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.menu a {
  display: block;
  font-weight: 600;
  color: var(--color-secondary);
}

.site-navigation .menu {
  align-items: center;
  justify-content: center;
}

.site-navigation .menu > li {
  position: relative;
}

.site-navigation .menu > li > a {
  padding: 24px 0;
}

.site-navigation .menu-item-has-children > a {
  padding-right: 16px;
  position: relative;
}

.site-navigation .menu-item-has-children > a::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
}

.site-navigation .sub-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 1001;
  display: none;
  min-width: 210px;
  padding: 10px;
  border: 1px solid rgba(217, 224, 232, 0.95);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.site-navigation .sub-menu .sub-menu {
  top: -10px;
  left: calc(100% + 10px);
  transform: translate(0, 10px);
}

.site-navigation li:hover > .sub-menu,
.site-navigation li:focus-within > .sub-menu {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.site-navigation .sub-menu li:hover > .sub-menu,
.site-navigation .sub-menu li:focus-within > .sub-menu {
  display: block;
  transform: translate(0, 0);
}

.site-navigation .sub-menu a {
  padding: 9px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.site-navigation .sub-menu a:hover,
.site-navigation .sub-menu a:focus {
  background: #eef2f7;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-cta,
.mobile-cta {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

.header-cta,
.header-cta:hover,
.header-cta:focus,
.header-cta:active,
.mobile-cta,
.mobile-cta:hover,
.mobile-cta:focus,
.mobile-cta:active {
  background: var(--color-primary);
  color: #fff;
}

.button.mobile-cta {
  display: none;
  margin-top: 16px;
}

.search-toggle,
.menu-toggle {
  border: 0;
  background: var(--color-secondary);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  cursor: pointer;
}

.search-toggle {
  position: relative;
}

.search-toggle__icon {
  position: relative;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.search-toggle__icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: center;
}

.header-search {
  display: none;
  padding: 0 0 20px;
}

.header-search.is-open {
  display: block;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.search-form label {
  min-width: 0;
}

.search-field,
.search-submit,
.contact-form-shortcode input,
.contact-form-shortcode textarea {
  border: 1px solid var(--color-border);
  border-radius: 999px;
  min-height: 48px;
  padding: 0 18px;
  background: #fff;
  width: 100%;
}

.search-submit,
.button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition);
}

.search-submit:hover,
.button:hover,
button:hover,
input[type="submit"]:hover {
  transform: translateY(-1px);
}

.mobile-panel {
  display: none;
  padding-bottom: 24px;
}

.mobile-panel.is-open {
  display: block;
}

.hero-section,
.content-section,
.archive-shell,
.page-shell,
.single-shell {
  padding: var(--section-space-tight) 0 var(--section-space);
}

.content-section + .content-section,
.hero-section + .content-section {
  padding-top: clamp(8px, 1.5vw, 18px);
}

.card-grid {
  display: grid;
  gap: clamp(18px, 2.4vw, 28px);
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.post-card,
.feature-card,
.category-card,
.info-card,
.cta-banner,
.ad-slot,
.sidebar-area .widget {
  background: var(--color-surface);
  border: 1px solid rgba(217, 224, 232, 0.85);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.post-card__media,
.feature-card__media {
  position: relative;
  overflow: hidden;
}

.post-card__media img,
.feature-card__media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.feature-card--hero .feature-card__media img {
  aspect-ratio: 16 / 9;
}

.post-card__body,
.feature-card__body,
.info-card,
.cta-banner,
.ad-slot,
.sidebar-area .widget {
  padding: var(--card-padding);
}

.post-card__category,
.entry-meta,
.card-meta,
.post-date {
  color: var(--color-muted);
  font-size: 0.92rem;
}

.post-card__title,
.feature-card__title,
.category-card__title {
  margin: 10px 0 12px;
  font-size: 1.2rem;
  line-height: 1.2;
}

.feature-card__title {
  font-size: clamp(1.4rem, 2vw, 2.25rem);
}

.post-card__excerpt {
  color: var(--color-muted);
  margin: 0;
}

.feature-cluster {
  display: grid;
  gap: clamp(22px, 3vw, 36px);
}

.feature-card--hero {
  display: grid;
  gap: 0;
}

.feature-rail {
  display: grid;
  gap: clamp(18px, 2vw, 24px);
}

.cta-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, var(--color-secondary), #1e293b);
  color: #fff;
}

.cta-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.post-subscribe-cta {
  margin-top: clamp(28px, 4vw, 40px);
  align-items: stretch;
  gap: 22px;
}

.post-subscribe-cta__content {
  flex: 1 1 320px;
}

.post-subscribe-cta__content h2 {
  margin: 8px 0 12px;
  color: #fff;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.post-subscribe-cta__text p + p {
  margin-top: 10px;
}

.post-subscribe-cta__form {
  flex: 1 1 320px;
  min-width: min(100%, 360px);
}

.post-subscribe-cta__form .wpcf7 form {
  display: grid;
  gap: 12px;
}

.post-subscribe-cta__form input[type="email"],
.post-subscribe-cta__form input[type="text"],
.post-subscribe-cta__form input[type="tel"],
.post-subscribe-cta__form textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  padding: 14px 16px;
  color: var(--color-text);
  font: inherit;
}

.post-subscribe-cta__form .wpcf7-submit,
.post-subscribe-cta__form input[type="submit"] {
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--color-secondary);
  padding: 13px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.post-subscribe-cta__form .wpcf7-spinner {
  margin: 10px 0 0;
}

.button--ghost {
  background: #fff;
  color: var(--color-secondary);
  padding: 12px 20px;
  border-radius: 999px;
}

.archive-intro,
.page-intro {
  max-width: 820px;
  margin: 0 auto clamp(28px, 4vw, 44px);
  text-align: center;
}

.legal-page-intro {
  text-align: center;
}

.legal-page-content {
  max-width: var(--container);
  margin: 0 auto;
}

.page-shell--legal .entry-content,
.page-shell .entry-content {
  max-width: 880px;
  margin: 0 auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.page-shell--legal .legal-page-content {
  max-width: var(--container);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content > *:last-child {
  margin-bottom: 0;
}

.entry-content > * + * {
  margin-top: clamp(16px, 2.2vw, 24px);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  line-height: 1.2;
  scroll-margin-top: 132px;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.2rem;
}

.entry-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.single-layout,
.contact-grid,
.about-story,
.about-dual {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
}

.single-content {
  min-width: 0;
}

.single-layout > *,
.single-content > *,
.article-header,
.article-header > * {
  min-width: 0;
  max-width: 100%;
}

.article-header {
  margin-bottom: clamp(24px, 3vw, 36px);
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.featured-image {
  margin-bottom: clamp(24px, 3vw, 36px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.featured-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.single-panel {
  margin-bottom: 24px;
  padding: clamp(20px, 2vw, 28px);
  background: var(--color-surface);
  border: 1px solid rgba(217, 224, 232, 0.85);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  color: var(--color-text);
}

.single-panel h2 {
  margin: 0 0 18px;
  font-size: 1.25rem;
  line-height: 1.25;
}

.comments-area {
  margin-top: clamp(32px, 4vw, 48px);
}

.comments-heading {
  margin-bottom: 22px;
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.comment-list .children {
  list-style: none;
  margin: 18px 0 0;
  padding-left: 20px;
  border-left: 2px solid var(--color-border);
}

.comment-body {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.comment-author {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.comment-author img {
  border-radius: 50%;
}

.comment-metadata,
.comment-metadata a {
  color: var(--color-muted);
}

.comment-content p {
  margin: 0;
}

.comment-respond {
  margin-top: 28px;
}

.comment-reply-title {
  margin-bottom: 12px;
}

.comment-login-cta {
  margin: 0 0 16px;
}

.comment-login-cta__button {
  min-height: 40px;
}

.comment-notes,
.logged-in-as,
.comments-closed {
  color: var(--color-muted);
}

.comment-form {
  display: grid;
  gap: 16px;
}

.comment-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: #fff;
  padding: 14px 16px;
  font: inherit;
  color: var(--color-text);
}

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

.comment-form-cookies-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comment-form-cookies-consent label {
  margin: 0;
  font-weight: 500;
}

.post-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.post-tags__link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #eef2f7;
  color: var(--color-secondary);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.post-tags__link:hover,
.post-tags__link:focus {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-1px);
}

.ads-cta {
  display: block;
}

.ads-cta h2 {
  margin-bottom: 10px;
}

.ads-cta p {
  margin: 0;
  color: var(--color-muted);
}

.ads-cta .button {
  margin-top: 18px;
  padding: 12px 20px;
  border-radius: 999px;
}

.sidebar-area {
  min-width: 0;
}

.sidebar-area > * + * {
  margin-top: 24px;
}

.sidebar-area .widget {
  margin-bottom: 0;
}

.sidebar-area .single-panel + .widget,
.sidebar-area .single-panel + .ad-slot {
  margin-top: 0;
}

.single-post .sidebar-area .widget_recent_entries {
  display: none;
}

.recent-posts-panel__header {
  margin-bottom: 18px;
}

.recent-posts-panel__header h2 {
  margin: 6px 0 0;
  font-size: 1.15rem;
}

.recent-posts-list {
  display: grid;
  gap: 14px;
}

.recent-post-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.03);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.recent-post-card:hover {
  transform: translateY(-2px);
  background: rgba(15, 23, 42, 0.05);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.recent-post-card__media {
  width: 82px;
  height: 68px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.08);
  display: block;
  flex-shrink: 0;
}

.recent-post-card__media img,
.recent-post-card__placeholder {
  width: 100%;
  height: 100%;
  display: block;
}

.recent-post-card__media img {
  object-fit: cover;
}

.recent-post-card__placeholder {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.04));
}

.recent-post-card__body {
  min-width: 0;
}

.recent-post-card__title {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.45;
}

.recent-post-card__title a {
  color: var(--color-secondary);
}

.recent-post-card__meta {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--color-muted);
}

.widget-title {
  margin-top: 0;
  margin-bottom: 16px;
}

.widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget li + li {
  margin-top: 10px;
}

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

.ad-slot p {
  margin: 0 0 10px;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--color-muted);
}

.breadcrumbs {
  margin-bottom: 20px;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.breadcrumbs a {
  color: var(--color-muted);
}

.related-posts {
  margin-top: clamp(40px, 5vw, 64px);
  margin-bottom: clamp(28px, 4vw, 40px);
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: clamp(28px, 4vw, 40px);
}

.page-numbers {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 42px;
  height: 42px;
  margin: 0 4px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
}

.page-numbers.current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.footer-ad {
  padding: 0 0 clamp(28px, 4vw, 40px);
}

.site-footer {
  background: var(--color-secondary);
  color: #fff;
  padding: clamp(44px, 6vw, 72px) 0 24px;
  margin-top: clamp(32px, 5vw, 56px);
}

.footer-main {
  display: grid;
  gap: clamp(32px, 5vw, 64px);
}

.footer-branding-block {
  display: grid;
  gap: 22px;
}

.footer-branding {
  margin-bottom: 0;
}

.footer-nav {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
}

.footer-branding img {
  max-height: 50px;
  margin-bottom: 14px;
}

.footer-menu-title {
  margin: 0 0 14px;
  font-size: 1rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.86);
}

.site-footer .menu {
  display: block;
}

.site-footer .menu li + li {
  margin-top: 10px;
}

.site-footer .sub-menu {
  display: block;
  margin-top: 8px;
  padding-left: 14px;
}

.footer-contact {
  display: grid;
  gap: 10px;
}

.footer-contact p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.footer-contact span {
  color: #fff;
  font-weight: 600;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-social a {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.footer-social a:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.site-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}

.site-info__powered {
  text-align: right;
}

.about-page {
  padding-top: clamp(4px, 1vw, 12px);
}

.auth-page__lead {
  max-width: 720px;
  margin: 14px auto 0;
  color: var(--color-muted);
}

.auth-layout {
  display: grid;
  gap: clamp(22px, 3vw, 32px);
}

.auth-layout--single {
  max-width: 720px;
  margin: 0 auto;
}

.auth-card {
  background: var(--color-surface);
  border: 1px solid rgba(217, 224, 232, 0.85);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: clamp(22px, 3vw, 30px);
}

.auth-card h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.auth-card p {
  color: var(--color-muted);
}

.auth-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.auth-form p {
  margin: 0;
}

.auth-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--color-secondary);
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: #fff;
  padding: 14px 16px;
  font: inherit;
  color: var(--color-text);
}

.auth-form__remember {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-form__remember label {
  margin: 0;
  font-weight: 500;
}

.auth-notice {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #eef2f7;
  color: var(--color-secondary);
}

.auth-notice--error {
  background: rgba(215, 38, 56, 0.08);
  color: #a61b2a;
}

.auth-notice--success {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.about-hero {
  padding: clamp(48px, 8vw, 92px) 0;
  background:
    radial-gradient(circle at 70% 90%, rgba(215, 38, 56, 0.12), transparent 28%),
    linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.about-hero__grid {
  display: grid;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

.about-hero__content {
  max-width: 620px;
}

.about-hero__title {
  margin: 0;
  color: var(--color-secondary);
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 1.08;
}

.about-hero__text {
  margin-top: 24px;
  color: var(--color-muted);
  font-size: 1.05rem;
}

.about-hero__text > *:first-child {
  margin-top: 0;
}

.about-hero__text > *:last-child {
  margin-bottom: 0;
}

.about-hero__button {
  margin-top: 30px;
  min-width: 180px;
  padding: 14px 22px;
  border-radius: 999px;
}

.about-hero__media {
  overflow: hidden;
  border: 6px solid #fff;
  border-radius: var(--radius-lg);
  background: var(--color-secondary);
  box-shadow: var(--shadow-soft);
}

.about-hero__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.about-stats {
  padding: clamp(44px, 6vw, 72px) 0;
  background: #fff;
}

.about-stats__grid {
  display: grid;
  gap: clamp(24px, 3vw, 36px);
}

.about-stat {
  text-align: center;
}

.about-stat__value {
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 5vw, 4.1rem);
  font-weight: 800;
  line-height: 1;
}

.about-stat__label {
  margin: 18px 0 12px;
  color: var(--color-secondary);
  font-size: 1.2rem;
}

.about-stat p {
  max-width: 360px;
  margin: 0 auto;
  color: var(--color-muted);
}

.mission-card,
.vision-card,
.contact-panel {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: clamp(22px, 2.4vw, 30px);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.social-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(28px, 4vw, 40px);
}

.social-share a {
  padding: 10px 14px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--color-secondary);
  font-size: 0.92rem;
}

@media (min-width: 768px) {
  .feature-cluster {
    grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.95fr);
  }

  .about-hero__grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1fr);
  }

  .about-stats__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .about-stat + .about-stat {
    border-left: 1px solid var(--color-border);
  }

  .about-story {
    grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.05fr);
    align-items: center;
  }

  .auth-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .about-dual,
  .contact-grid,
  .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .site-navigation {
    display: block;
  }

  .menu-toggle,
  .mobile-panel {
    display: none !important;
  }

  .single-layout {
    grid-template-columns: minmax(0, 1.9fr) minmax(300px, 0.85fr);
    align-items: start;
  }

  .footer-main {
    grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.45fr);
    align-items: start;
  }

  .footer-nav {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (min-width: 1200px) {
  .single-layout {
    grid-template-columns: minmax(0, 820px) minmax(300px, 336px);
    justify-content: space-between;
  }
}

@media (max-width: 991px) {
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-panel .menu {
    display: grid;
    gap: 12px;
  }

  .mobile-panel .sub-menu {
    display: grid;
    gap: 8px;
    padding: 8px 0 0 16px;
  }

  .mobile-panel .menu a {
    padding: 4px 0;
  }

  .header-cta {
    display: none;
  }

  .button.mobile-cta {
    display: inline-flex;
  }

  .single-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-area {
    position: static;
  }
}

@media (max-width: 767px) {
  .admin-bar .site-header {
    top: 46px;
  }

  :root {
    --gutter: 16px;
    --section-space: 52px;
    --section-space-tight: 24px;
  }

  .breadcrumbs {
    display: none;
  }

  .about-page {
    padding-top: 0;
  }

  .about-hero {
    padding: 40px 0 48px;
  }

  .about-hero__grid {
    gap: 28px;
  }

  .about-hero__title {
    font-size: 2.25rem;
  }

  .about-hero__text {
    margin-top: 18px;
    font-size: 1rem;
  }

  .about-hero__button {
    margin-top: 24px;
    width: 100%;
  }

  .about-hero__media {
    border-width: 4px;
    border-radius: var(--radius-md);
  }

  .about-stats {
    padding: 40px 0;
  }

  .entry-content h2,
  .entry-content h3,
  .entry-content h4 {
    scroll-margin-top: 104px;
  }

  .about-stat {
    padding: 22px 0;
  }

  .about-stat + .about-stat {
    border-top: 1px solid var(--color-border);
  }

  .toc-widget--sticky {
    position: static;
  }

  .hero-section,
  .content-section,
  .archive-shell,
  .page-shell,
  .single-shell {
    padding: var(--section-space-tight) 0 var(--section-space);
  }

  .header-inner {
    grid-template-columns: auto auto;
    gap: 12px;
    min-height: 64px;
  }

  .site-branding {
    grid-column: 1 / 2;
  }

  .header-actions {
    grid-column: 2 / 3;
    justify-content: end;
  }

  .search-toggle,
  .menu-toggle {
    width: 40px;
    height: 40px;
  }
  .section-heading {
    display: block;
  }

  .section-heading h2,
  .page-title,
  .entry-title {
    font-size: 1.85rem;
    line-height: 1.15;
  }

  .archive-intro,
  .page-intro {
    margin-bottom: 24px;
    text-align: left;
  }

  .article-header {
    margin-bottom: 20px;
  }

  .entry-meta {
    gap: 8px 12px;
  }

  .featured-image,
  .featured-image img {
    border-radius: var(--radius-md);
  }

  .single-panel,
  .mission-card,
  .vision-card,
  .contact-panel {
    padding: 20px;
    border-radius: var(--radius-md);
  }

  .ads-cta {
    align-items: flex-start;
  }

  .ads-cta .button {
    width: 100%;
    text-align: center;
  }

  .post-subscribe-cta__form {
    min-width: 100%;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .about-dual,
  .contact-grid,
  .footer-nav {
    grid-template-columns: 1fr;
  }

  .site-info {
    align-items: flex-start;
  }

  .site-info__powered {
    text-align: left;
  }

  .post-card__body,
  .feature-card__body,
  .page-shell .entry-content {
    padding: 18px;
  }
}

@media (max-width: 480px) {
  :root {
    --gutter: 12px;
    --section-space: 44px;
    --section-space-tight: 20px;
  }

  .recent-post-card {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 8px;
  }

  .recent-post-card__media {
    width: 72px;
    height: 60px;
  }

  .site-branding img {
    max-height: 38px;
  }

  .section-heading h2,
  .page-title,
  .entry-title {
    font-size: 1.55rem;
  }

  .eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
  }

  .post-card,
  .feature-card,
  .category-card,
  .info-card,
  .single-panel,
  .cta-banner,
  .ad-slot,
  .sidebar-area .widget {
    border-radius: var(--radius-sm);
  }

  .social-share a {
    width: 100%;
    justify-content: center;
  }

  .page-numbers {
    width: 36px;
    height: 36px;
    margin: 0 2px;
  }
}

/* ===========================================================
   READING PROGRESS BAR
   =========================================================== */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), #ff6b81);
  transition: width 80ms linear;
  pointer-events: none;
}

/* ===========================================================
   AUTOMOTIVE THEME — CARD MODERNIZATION
   =========================================================== */

body {
  background: #ffffff;
}

/* Racing-stripe top accent on all cards */
.post-card,
.feature-card {
  border-top: 3px solid var(--color-primary);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.post-card:hover,
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.13);
}

/* Image zoom on hover */
.post-card__media,
.feature-card__media {
  background: var(--color-secondary);
  overflow: hidden;
}

.post-card__media img,
.feature-card__media img {
  transition: transform 420ms ease, opacity 300ms ease;
}

.post-card:hover .post-card__media img,
.feature-card:hover .feature-card__media img {
  transform: scale(1.05);
  opacity: 0.9;
}

/* Category badge — pill style */
.post-card__category {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  margin-bottom: 10px;
  background: rgba(215, 38, 56, 0.09);
  color: var(--color-primary);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Read more indicator */
.post-card__body::after {
  content: 'Read More →';
  display: block;
  margin-top: 14px;
  color: var(--color-primary);
  font-size: 0.82rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Eyebrow with speed line */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 999px;
  flex-shrink: 0;
}

/* Nav active state */
.site-navigation .current-menu-item > a,
.site-navigation .current_page_item > a,
.site-navigation .menu > li > a:hover {
  color: var(--color-primary);
}

/* Social share buttons */
.social-share {
  gap: 8px;
}

.social-share a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--color-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.social-share a:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
}

/* Article entry-title */
.entry-title {
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  line-height: 1.12;
}

/* Entry content typography */
.entry-content {
  font-size: 1.02rem;
  line-height: 1.8;
}

.entry-content h2 {
  margin-top: clamp(32px, 4vw, 48px);
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  color: var(--color-secondary);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-border);
}

.entry-content h3 {
  margin-top: clamp(24px, 3vw, 36px);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--color-secondary);
}

.entry-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.entry-content blockquote {
  margin: 32px 0;
  padding: 20px 24px;
  border-left: 4px solid var(--color-primary);
  background: rgba(215, 38, 56, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  font-size: 1.08rem;
  color: var(--color-secondary);
}

/* ===========================================================
   POST SUMMARY BOX
   =========================================================== */

.post-summary {
  position: relative;
  margin-bottom: clamp(24px, 3vw, 36px);
  padding: clamp(20px, 2.5vw, 28px);
  background: linear-gradient(135deg, rgba(215, 38, 56, 0.04) 0%, #fff 60%);
  border: 1px solid rgba(215, 38, 56, 0.2);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: 0 4px 18px rgba(215, 38, 56, 0.07);
}

.post-summary__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.post-summary__label svg {
  flex-shrink: 0;
}

.post-summary__text {
  margin: 0;
  color: var(--color-text);
  font-size: 1.01rem;
  line-height: 1.78;
}

/* ===========================================================
   FAQ SECTION
   =========================================================== */

.post-faq {
  margin-top: clamp(32px, 4vw, 52px);
  padding-top: clamp(28px, 3.5vw, 40px);
  border-top: 2px solid var(--color-border);
}

.post-faq__header {
  margin-bottom: clamp(20px, 2.5vw, 28px);
}

.post-faq__header h2 {
  margin: 8px 0 0;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.faq-item.is-open {
  border-color: rgba(215, 38, 56, 0.4);
  box-shadow: 0 4px 18px rgba(215, 38, 56, 0.08);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  transition: background 180ms ease, color 180ms ease;
  min-height: unset;
  transform: none;
  box-shadow: none;
}

.faq-question:hover {
  background: rgba(215, 38, 56, 0.04);
  color: var(--color-primary);
  transform: none;
}

.faq-item.is-open .faq-question {
  color: var(--color-primary);
  background: rgba(215, 38, 56, 0.04);
}

/* Plus / X toggle icon */
.faq-toggle-icon {
  position: relative;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  transition: background 180ms ease, border-color 180ms ease;
}

.faq-toggle-icon::before,
.faq-toggle-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--color-muted);
  border-radius: 999px;
  transition: background 180ms ease, transform 260ms ease;
}

.faq-toggle-icon::before {
  width: 10px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.faq-toggle-icon::after {
  width: 2px;
  height: 10px;
  transform: translate(-50%, -50%);
}

.faq-item.is-open .faq-toggle-icon {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.faq-item.is-open .faq-toggle-icon::before,
.faq-item.is-open .faq-toggle-icon::after {
  background: #fff;
}

.faq-item.is-open .faq-toggle-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

/* Smooth height animation via grid */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 280ms ease;
}

.faq-item.is-open .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer__inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 22px;
  transition: padding-bottom 280ms ease;
}

.faq-item.is-open .faq-answer__inner {
  padding-bottom: 20px;
}

.faq-answer__inner p {
  margin: 0 0 10px;
  color: var(--color-muted);
  line-height: 1.75;
  font-size: 0.96rem;
}

.faq-answer__inner p:last-child {
  margin-bottom: 0;
}

/* ===========================================================
   TABLE OF CONTENTS
   =========================================================== */

.toc-widget {
  margin-bottom: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.toc-widget__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
}

.toc-widget__header svg {
  flex-shrink: 0;
  color: var(--color-primary);
}

.toc-widget__header span {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.toc-list::-webkit-scrollbar {
  width: 4px;
}

.toc-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 999px;
}

.toc-item {
  border: 0;
  margin: 0;
  padding: 0;
}

.toc-link {
  display: block;
  padding: 7px 20px;
  font-size: 0.86rem;
  color: var(--color-muted);
  line-height: 1.4;
  border-left: 3px solid transparent;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.toc-link:hover {
  color: var(--color-primary);
  background: rgba(215, 38, 56, 0.04);
  border-left-color: rgba(215, 38, 56, 0.35);
}

.toc-link.is-active {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  background: rgba(215, 38, 56, 0.05);
  font-weight: 600;
}

.toc-item--h3 > .toc-link {
  padding-left: 36px;
  font-size: 0.81rem;
}

.toc-item--h4 > .toc-link {
  padding-left: 52px;
  font-size: 0.78rem;
}

.toc-widget--sticky {
  position: sticky;
  top: 110px;
}

/* ===========================================================
   MODERN COMMENTS
   =========================================================== */

.comments-area {
  margin-top: clamp(36px, 5vw, 56px);
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.comments-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: clamp(24px, 3vw, 36px);
  padding-bottom: 20px;
  border-bottom: 2px solid var(--color-border);
}

.comments-count {
  margin: 0;
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
}

.comment-list {
  gap: 0;
}

/* Comment card */
.comment-body {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(217, 224, 232, 0.7);
  background: transparent;
}

.comment-avatar {
  padding-top: 2px;
}

.comment-avatar img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  display: block;
}

.comment-inner {
  min-width: 0;
}

.comment-author-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-bottom: 10px;
}

.comment-author-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--color-secondary);
}

.comment-author-name a {
  color: inherit;
}

.comment-author-name,
.comment-author-name a,
.comment-date,
.comment-date a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.comment-date {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.comment-date a {
  color: inherit;
}

.comment-content p {
  margin: 0 0 10px;
  font-size: 0.97rem;
  line-height: 1.72;
  color: var(--color-text);
}

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

.comment-content {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.comment-content > * {
  max-width: 100%;
}

.comment-content img,
.comment-content iframe,
.comment-content video,
.comment-content embed,
.comment-content object {
  display: block;
  max-width: 100%;
  height: auto;
}

.comment-content pre,
.comment-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.comment-content pre {
  margin: 0 0 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  white-space: pre-wrap;
}

.comment-content table {
  border-collapse: collapse;
}

.comment-awaiting-moderation {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-style: italic;
  margin: 0 0 10px;
}

/* Comment actions */
.comment-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.comment-reply-link,
.comment-actions .edit-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--color-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.comment-reply-link:hover,
.comment-actions .edit-link a:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Nested children */
.comment-list .children {
  list-style: none;
  margin: 0;
  padding-left: 24px;
  border-left: 3px solid rgba(215, 38, 56, 0.15);
}

/* Comment form */
.comment-respond {
  margin-top: clamp(32px, 4vw, 48px);
  padding: clamp(24px, 3vw, 36px);
  background: #fff;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.comment-reply-title {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

.comment-notes {
  margin: 0 0 22px;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.comment-form {
  display: grid;
  gap: 0;
}

/* Two-column name/email/website row */
#commentform {
  display: grid;
  gap: 16px;
}

.comment-form-author,
.comment-form-email {
  /* sit side by side via the grid */
}

/* Stack: author + email side by side, url full width, comment full width */
@media (min-width: 600px) {
  #commentform {
    grid-template-columns: 1fr 1fr;
  }

  .comment-form-comment,
  .comment-notes,
  .comment-form-cookies-consent,
  .form-submit {
    grid-column: 1 / -1;
  }
}

.comment-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-muted);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 11px 16px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.comment-form textarea {
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 130px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
  resize: vertical;
}

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

.form-submit .submit {
  padding: 13px 32px;
  border-radius: 999px;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 14px rgba(215, 38, 56, 0.22);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-submit .submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(215, 38, 56, 0.32);
}

/* Override old .comment-meta / .comment-author from earlier rules */
.comment-meta {
  display: block;
  margin-bottom: 0;
  font-size: inherit;
}

.comment-author {
  display: block;
}

/* ===========================================================
   AD SLOT — ONLY RENDER WHEN CODE IS PRESENT
   =========================================================== */

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

/* ===========================================================
   FOOTER MODERNIZATION
   =========================================================== */

.site-footer {
  background: linear-gradient(180deg, #0f172a 0%, #060e1a 100%);
}

.footer-branding p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.92rem;
  max-width: 360px;
  margin: 0;
  line-height: 1.65;
}

/* ===========================================================
   RESPONSIVE ADJUSTMENTS FOR NEW COMPONENTS
   =========================================================== */

@media (max-width: 767px) {
  .post-summary {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 18px 20px;
  }

  .faq-question {
    padding: 15px 18px;
    font-size: 0.93rem;
  }

  .faq-answer__inner {
    padding: 0 18px;
  }

  .faq-item.is-open .faq-answer__inner {
    padding-bottom: 16px;
  }

  .comment-body {
    grid-template-columns: 42px 1fr;
    gap: 12px;
    padding: 18px 0;
  }

  .comment-avatar img {
    width: 42px;
    height: 42px;
  }

  .comment-respond {
    padding: 20px;
  }

  #commentform {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .comment-body {
    grid-template-columns: 38px 1fr;
  }

  .comment-avatar img {
    width: 38px;
    height: 38px;
  }
}

/* ===========================================================
   INFINITE SCROLL
   =========================================================== */

/* Invisible trigger element — sits below the last card */
.d4-sentinel {
  height: 1px;
  visibility: hidden;
  margin-top: clamp(32px, 4vw, 48px);
}

/* Loading dots */
.d4-loader {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(28px, 4vw, 48px) 0;
}

.d4-loader__dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.d4-loader__dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: d4-pulse 1.2s ease-in-out infinite both;
}

.d4-loader__dots span:nth-child(1) { animation-delay: -0.32s; }
.d4-loader__dots span:nth-child(2) { animation-delay: -0.16s; }
.d4-loader__dots span:nth-child(3) { animation-delay: 0s; }

@keyframes d4-pulse {
  0%, 80%, 100% {
    transform: scale(0.55);
    opacity: 0.35;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* "All caught up" end-of-feed message */
.d4-no-more {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: clamp(24px, 3vw, 40px) 0;
  color: var(--color-muted);
  font-size: 0.9rem;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.d4-no-more::before,
.d4-no-more::after {
  content: '';
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: var(--color-border);
}

/* Appear animation for freshly loaded cards */
@keyframes d4-card-appear {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card.is-appearing {
  animation: d4-card-appear 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Stagger newly loaded cards */
#d4-infinite-grid .post-card.is-appearing:nth-child(3n+2) {
  animation-delay: 60ms;
}
#d4-infinite-grid .post-card.is-appearing:nth-child(3n+3) {
  animation-delay: 120ms;
}
