/**
 * Flavor Theme - Custom Styles
 * Minimal CSS for optimal performance
 *
 * @package kairo
 * @since 1.0.0
 */

/* ========== IMAGE STYLES ========== */
.wp-block-image.is-style-circle-mask img {
  border-radius: 50%;
}

.wp-block-image.is-style-rounded img {
  border-radius: 12px;
}

/* ========== SOCIAL ICONS ========== */
.wp-block-social-links .wp-social-link {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.wp-block-social-links .wp-social-link:hover {
  transform: translateY(-2px);
  opacity: 0.8;
}

/* Social icons accent color on hover. */
.wp-block-social-links.is-style-logos-only .wp-social-link:hover {
  color: var(--wp--preset--color--accent);
}

.wp-block-social-links.is-style-logos-only .wp-social-link svg {
  transition: fill 0.2s ease;
}

.wp-block-social-links.is-style-logos-only .wp-social-link:hover svg {
  fill: var(--wp--preset--color--accent);
}

/* ========== TRANSITIONS ========== */

.wp-block-button__link {
  transition: all 0.2s ease;
}

.wp-block-button__link:hover {
  transform: translateY(-1px);
}

/* Featured image hover */
.wp-block-post-featured-image img {
  transition: transform 0.3s ease;
}

.wp-block-post-featured-image a:hover img {
  transform: scale(1.02);
}

/* ========== POST LIST ITEMS ========== */

.kairo-post-item {
  transition: background-color 0.2s ease;
}

.kairo-post-item:hover {
  background-color: var(--wp--preset--color--surface);
  margin-inline: -1rem;
  padding-inline: 1rem !important;
  border-radius: 12px;
}

.kairo-post-item:last-child {
  border-bottom: none !important;
}

/* Thumbnail container - fixed size */
.kairo-post-item .wp-block-post-featured-image,
.kairo-post-thumbnail {
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 8px;
  background-color: var(--wp--preset--color--surface);
}

/* Placeholder for posts without featured image */
.kairo-post-item .wp-block-post-featured-image:empty,
.kairo-post-thumbnail:empty {
  display: block !important;
  width: 220px;
  height: 160px;
  background: linear-gradient(135deg, var(--wp--preset--color--surface) 0%, var(--wp--preset--color--subtle) 100%);
  position: relative;
}

.kairo-post-item .wp-block-post-featured-image:empty::after,
.kairo-post-thumbnail:empty::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.4;
}

/* Post title link styling */
.wp-block-post-title a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.wp-block-post-title a:hover {
  color: var(--wp--preset--color--accent);
}

/* Category tags link styling. */
.wp-block-post-terms a {
  text-decoration: none;
  color: var(--wp--preset--color--accent);
  transition: opacity 0.2s ease;
}

.wp-block-post-terms a:hover {
  opacity: 0.7;
}

/* Read more link styling */
.wp-block-read-more {
  text-decoration: none;
  color: var(--wp--preset--color--accent);
  transition: opacity 0.2s ease;
}

.wp-block-read-more:hover {
  text-decoration: underline;
}

/* Excerpt styling */
.wp-block-post-excerpt__more-link {
  display: none;
}

/* ========== STICKY POST INDICATOR ========== */

/* Sticky post container styling */
.post.sticky .kairo-post-item,
.wp-block-post.is-sticky .kairo-post-item {
  position: relative;
  background: linear-gradient(135deg, var(--wp--preset--color--surface) 0%, transparent 100%);
  margin-inline: -1rem;
  padding-inline: 1rem !important;
  border-radius: 12px;
  border-left: 3px solid var(--wp--preset--color--accent);
}

/* Featured badge */
.post.sticky .kairo-post-item::before,
.wp-block-post.is-sticky .kairo-post-item::before {
  content: "Featured";
  position: absolute;
  top: var(--wp--preset--spacing--40);
  right: 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wp--preset--color--base);
  background: var(--wp--preset--color--accent);
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
}

/* Dark mode sticky post */
[data-theme="dark"] .post.sticky .kairo-post-item,
[data-theme="dark"] .wp-block-post.is-sticky .kairo-post-item,
html.kairo-theme-dark .post.sticky .kairo-post-item,
html.kairo-theme-dark .wp-block-post.is-sticky .kairo-post-item,
body.kairo-theme-dark .post.sticky .kairo-post-item,
body.kairo-theme-dark .wp-block-post.is-sticky .kairo-post-item {
  background: linear-gradient(135deg, var(--wp--preset--color--surface) 0%, transparent 100%);
}

[data-theme="dark"] .post.sticky .kairo-post-item::before,
[data-theme="dark"] .wp-block-post.is-sticky .kairo-post-item::before,
html.kairo-theme-dark .post.sticky .kairo-post-item::before,
html.kairo-theme-dark .wp-block-post.is-sticky .kairo-post-item::before,
body.kairo-theme-dark .post.sticky .kairo-post-item::before,
body.kairo-theme-dark .wp-block-post.is-sticky .kairo-post-item::before {
  color: #0f172a;
}

/* ========== PAGINATION ========== */
.wp-block-query-pagination {
  gap: 0.5rem;
}

.wp-block-query-pagination-numbers {
  display: flex;
  gap: 0.25rem;
}

.wp-block-query-pagination-numbers .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--wp--preset--color--secondary);
  background: transparent;
  transition: all 0.2s ease;
}

.wp-block-query-pagination-numbers .page-numbers:hover {
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--contrast);
}

.wp-block-query-pagination-numbers .page-numbers.current {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
  font-weight: 600;
}

.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--wp--preset--color--secondary);
  background: var(--wp--preset--color--surface);
  transition: all 0.2s ease;
}

.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

/* ========== POST CARDS ========== */

/* Ensures consistent card heights within the grid layout. */
.wp-block-post-template.is-layout-grid > .wp-block-group {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.kairo-post-card,
.kairo-popular-card {
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.kairo-post-card:hover {
  background-color: var(--wp--preset--color--surface);
  border-radius: 12px;
}

.kairo-popular-card:hover {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

[data-theme="dark"] .kairo-post-card:hover,
html.kairo-theme-dark .kairo-post-card:hover,
body.kairo-theme-dark .kairo-post-card:hover {
  background-color: var(--wp--preset--color--surface);
}

[data-theme="dark"] .kairo-popular-card:hover,
html.kairo-theme-dark .kairo-popular-card:hover,
body.kairo-theme-dark .kairo-popular-card:hover {
  box-shadow: 0 4px 20px rgba(129, 140, 248, 0.15);
}

/* ========== SMASHING MAGAZINE STYLE THUMBNAIL ========== */

/* Container provides extra space for the rotated thumbnail. */
.wp-block-post-featured-image.kairo-thumbnail {
	flex-shrink: 0 !important;
	width: 160px !important;
	height: 160px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}

/* Link wrapper with rotation effect, mimicking a dice standing on its corner. */
.wp-block-post-featured-image.kairo-thumbnail a {
	display: block !important;
	width: 120px !important;
	height: 120px !important;
	border-radius: 12px !important;
	overflow: hidden !important;
	background: var(--wp--preset--color--accent) !important;
	padding: 4px !important;
	/* Rotated to stand on corner. */
	transform: rotate(-12deg);
	transform-origin: center center;
	/* Shadow creates depth, as if sitting on a surface. */
	box-shadow: 
		4px 6px 12px rgba(0, 0, 0, 0.2),
		2px 3px 6px rgba(0, 0, 0, 0.15);
	/* Smooth transition for the hover interaction. */
	transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

/* Image fills the frame without gaps. */
.wp-block-post-featured-image.kairo-thumbnail img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 8px !important;
}

/* On hover, the thumbnail rotates back to its normal position. */
.kairo-post-card:hover .wp-block-post-featured-image.kairo-thumbnail a,
.kairo-post-list-item:hover .wp-block-post-featured-image.kairo-thumbnail a {
  transform: rotate(0deg);
  box-shadow: 
    2px 4px 8px rgba(0, 0, 0, 0.12),
    1px 2px 4px rgba(0, 0, 0, 0.08);
}

/* ========== DARK MODE ========== */
/* 
 * Dark mode uses multiple selectors for maximum compatibility:
 * 1. [data-theme="dark"] - Standard attribute selector
 * 2. .kairo-theme-dark - Class-based fallback for WordPress.com
 * 3. @media (prefers-color-scheme: dark) - CSS-only system preference fallback
 */

[data-theme="dark"],
html.kairo-theme-dark,
body.kairo-theme-dark {
  --wp--preset--color--base: #0f172a;
  --wp--preset--color--surface: #1e293b;
  --wp--preset--color--contrast: #f8fafc;
  --wp--preset--color--primary: #94a3b8;
  --wp--preset--color--secondary: #64748b;
  --wp--preset--color--muted: #94a3b8;
  --wp--preset--color--subtle: #334155;
  --wp--preset--color--accent: #818cf8;
}

[data-theme="dark"] body,
html.kairo-theme-dark body,
body.kairo-theme-dark {
  background-color: var(--wp--preset--color--base);
  color: var(--wp--preset--color--contrast);
}

[data-theme="dark"] .has-surface-background-color,
html.kairo-theme-dark .has-surface-background-color,
body.kairo-theme-dark .has-surface-background-color {
  background-color: var(--wp--preset--color--surface) !important;
}

[data-theme="dark"] .has-subtle-background-color,
html.kairo-theme-dark .has-subtle-background-color,
body.kairo-theme-dark .has-subtle-background-color {
  background-color: var(--wp--preset--color--subtle) !important;
}

/* Dark mode pagination */
[data-theme="dark"] .wp-block-query-pagination-numbers .page-numbers.current,
html.kairo-theme-dark .wp-block-query-pagination-numbers .page-numbers.current,
body.kairo-theme-dark .wp-block-query-pagination-numbers .page-numbers.current {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

/* System preference fallback - CSS-only dark mode for users with OS dark mode. */
/* Works without JavaScript when user hasn't explicitly chosen light mode. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not(.kairo-theme-light) {
    --wp--preset--color--base: #0f172a;
    --wp--preset--color--surface: #1e293b;
    --wp--preset--color--contrast: #f8fafc;
    --wp--preset--color--primary: #94a3b8;
    --wp--preset--color--secondary: #64748b;
    --wp--preset--color--muted: #94a3b8;
    --wp--preset--color--subtle: #334155;
    --wp--preset--color--accent: #818cf8;
  }
  
  body:not(.kairo-theme-light) {
    background-color: var(--wp--preset--color--base);
    color: var(--wp--preset--color--contrast);
  }
  
  /* Code blocks for system dark mode preference */
  :root:not([data-theme="light"]):not(.kairo-theme-light) .wp-block-code,
  :root:not([data-theme="light"]):not(.kairo-theme-light) pre {
    background: #0f172a !important;
    color: #e2e8f0 !important;
  }
  
  :root:not([data-theme="light"]):not(.kairo-theme-light) .wp-block-code code,
  :root:not([data-theme="light"]):not(.kairo-theme-light) pre code {
    color: #e2e8f0 !important;
    background: transparent !important;
  }
}

/* Smooth transitions for dark mode color changes. */
body,
.wp-block-group {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========== SELECTION ========== */
::selection {
  background-color: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--contrast);
}

[data-theme="dark"] ::selection,
html.kairo-theme-dark ::selection,
body.kairo-theme-dark ::selection {
  color: #0f172a;
}

/* ========== NEWSLETTER FORM ========== */
.kairo-newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.kairo-newsletter-centered {
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
}

.kairo-input {
  flex: 1;
  min-width: 200px;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.kairo-input:focus {
  outline: none;
  border-color: var(--wp--preset--color--accent);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.kairo-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.kairo-submit {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  background: var(--wp--preset--color--accent);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.kairo-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  background: #4f46e5;
}

.kairo-submit:active {
  transform: translateY(0);
}

/* Newsletter section maintains a dark background in both modes. */
.kairo-newsletter-section {
  background-color: #0F172A !important;
  color: #F8FAFC !important;
}

/* Slightly lighter newsletter background in dark mode for distinction. */
[data-theme="dark"] .kairo-newsletter-section,
html.kairo-theme-dark .kairo-newsletter-section,
body.kairo-theme-dark .kairo-newsletter-section {
  background-color: #1E293B !important;
}

/* Single post newsletter - accent border for visual distinction */
.kairo-single-newsletter {
  border-top: 3px solid var(--wp--preset--color--accent) !important;
  border-bottom: 3px solid var(--wp--preset--color--accent) !important;
}

/* In dark mode, use a slightly lighter background than page */
[data-theme="dark"] .kairo-single-newsletter.kairo-newsletter--dark,
html.kairo-theme-dark .kairo-single-newsletter.kairo-newsletter--dark,
body.kairo-theme-dark .kairo-single-newsletter.kairo-newsletter--dark {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
}

.kairo-newsletter-section .has-base-color {
  color: #F8FAFC !important;
}

.kairo-newsletter-section .has-subtle-color,
.kairo-newsletter-section .has-muted-color {
  color: #9CA3AF !important;
}

/* Header navigation hover state with accent color. */
header .wp-block-navigation a,
.wp-block-template-part[data-area="header"] .wp-block-navigation a {
  transition: color 0.2s ease;
}

header .wp-block-navigation a:hover,
.wp-block-template-part[data-area="header"] .wp-block-navigation a:hover {
  color: var(--wp--preset--color--accent) !important;
}

/* Footer navigation hover state. */
footer .wp-block-navigation a,
.wp-block-template-part[data-area="footer"] .wp-block-navigation a {
  transition: color 0.2s ease;
}

footer .wp-block-navigation a:hover,
.wp-block-template-part[data-area="footer"] .wp-block-navigation a:hover {
  color: var(--wp--preset--color--contrast) !important;
}

[data-theme="dark"] footer .wp-block-navigation a:hover,
[data-theme="dark"] .wp-block-template-part[data-area="footer"] .wp-block-navigation a:hover,
html.kairo-theme-dark footer .wp-block-navigation a:hover,
html.kairo-theme-dark .wp-block-template-part[data-area="footer"] .wp-block-navigation a:hover,
body.kairo-theme-dark footer .wp-block-navigation a:hover,
body.kairo-theme-dark .wp-block-template-part[data-area="footer"] .wp-block-navigation a:hover {
  color: var(--wp--preset--color--accent) !important;
}

/* ========== CATEGORIES LIST ========== */

/* Categories list displayed horizontally. */
.wp-block-categories {
  list-style: none !important;
  padding-left: 0 !important;
}

.wp-block-categories li {
  display: inline-block;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.wp-block-categories li a {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: var(--wp--preset--color--surface);
  border-radius: 6px;
  text-decoration: none;
  color: var(--wp--preset--color--secondary);
  transition: all 0.2s ease;
}

.wp-block-categories li a:hover {
  background: var(--wp--preset--color--accent);
  color: #fff;
}

/* Post count styling within category links. */
.wp-block-categories li .wp-block-categories__post-count {
  color: var(--wp--preset--color--muted);
  font-size: 0.85em;
  margin-left: 0.25rem;
}

/* ========== SINGLE POST CONTENT ========== */

.kairo-post-content {
  line-height: 1.8;
}

.kairo-post-content p {
  margin-bottom: 1.5em;
}

.kairo-post-content h2,
.kairo-post-content h3,
.kairo-post-content h4 {
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.kairo-post-content a {
  color: var(--wp--preset--color--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.kairo-post-content a:hover {
  text-decoration: none;
}

.kairo-post-content blockquote {
  border-left: 4px solid var(--wp--preset--color--accent);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--wp--preset--color--secondary);
}

.kairo-post-content blockquote p {
  margin-bottom: 0;
}

.kairo-post-content ul,
.kairo-post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5em;
}

.kairo-post-content li {
  margin-bottom: 0.5em;
}

.kairo-post-content img {
  border-radius: 8px;
}

.kairo-post-content figure {
  margin: 2rem 0;
}

.kairo-post-content figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: var(--wp--preset--color--muted);
  margin-top: 0.75rem;
}

/* ========== CODE BLOCKS ========== */

.wp-block-code {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.6;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.wp-block-code code {
  background: transparent;
  padding: 0;
  font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
}

/* Inline code */
p code,
li code,
td code {
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--accent);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
}

/* Dark mode code */
[data-theme="dark"] .wp-block-code,
html.kairo-theme-dark .wp-block-code,
body.kairo-theme-dark .wp-block-code {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: 1px solid var(--wp--preset--color--subtle);
}

[data-theme="dark"] .wp-block-code code,
html.kairo-theme-dark .wp-block-code code,
body.kairo-theme-dark .wp-block-code code {
  color: #e2e8f0 !important;
  background: transparent !important;
}

[data-theme="dark"] p code,
[data-theme="dark"] li code,
[data-theme="dark"] td code,
html.kairo-theme-dark p code,
html.kairo-theme-dark li code,
html.kairo-theme-dark td code,
body.kairo-theme-dark p code,
body.kairo-theme-dark li code,
body.kairo-theme-dark td code {
  background: #1e293b;
  color: var(--wp--preset--color--accent) !important;
}

/* Syntax Highlighting (Jetpack/WordPress.com compatibility) */
[data-theme="dark"] pre,
html.kairo-theme-dark pre,
body.kairo-theme-dark pre {
  background: #0f172a !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] pre code,
html.kairo-theme-dark pre code,
body.kairo-theme-dark pre code {
  color: #e2e8f0 !important;
  background: transparent !important;
}

/* Jetpack Syntax Highlighter compatibility */
[data-theme="dark"] .wp-block-syntaxhighlighter-code,
html.kairo-theme-dark .wp-block-syntaxhighlighter-code,
body.kairo-theme-dark .wp-block-syntaxhighlighter-code {
  background: #0f172a !important;
}

[data-theme="dark"] .shcb-loc,
[data-theme="dark"] .shcb-loc > span,
html.kairo-theme-dark .shcb-loc,
html.kairo-theme-dark .shcb-loc > span,
body.kairo-theme-dark .shcb-loc,
body.kairo-theme-dark .shcb-loc > span {
  color: #e2e8f0 !important;
}

/* Ensure all code text is visible in dark mode */
[data-theme="dark"] .wp-block-code *,
html.kairo-theme-dark .wp-block-code *,
body.kairo-theme-dark .wp-block-code * {
  color: inherit;
}

/* Preformatted */
.wp-block-preformatted {
  background: var(--wp--preset--color--surface);
  padding: 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  overflow-x: auto;
}

/* ========== SOCIAL SHARE LINKS ========== */

.kairo-share-links .wp-social-link {
  cursor: pointer;
}

.kairo-share-links .wp-social-link:hover {
  color: var(--wp--preset--color--accent) !important;
}

.kairo-share-links .wp-social-link:hover svg {
  fill: var(--wp--preset--color--accent) !important;
}

/* ========== FEATURED IMAGE PLACEHOLDER ========== */

/* Placeholder for posts without featured images - PHP generated */
.kairo-placeholder-image {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--wp--preset--color--surface) 0%, var(--wp--preset--color--subtle) 100%);
  position: relative;
  overflow: hidden;
  min-height: 120px;
}

.kairo-placeholder-image a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.kairo-placeholder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.kairo-placeholder-icon svg {
  width: 48px;
  height: 48px;
  color: var(--wp--preset--color--muted);
  opacity: 0.4;
}

/* Smaller icon for archive thumbnails */
.kairo-post-thumbnail .kairo-placeholder-icon svg,
.kairo-post-item .kairo-placeholder-icon svg {
  width: 36px;
  height: 36px;
}

/* Related posts placeholder */
.kairo-related-thumbnail .kairo-placeholder-icon svg,
.kairo-related-card .kairo-placeholder-icon svg {
  width: 32px;
  height: 32px;
}

/* Single post hero placeholder */
.kairo-single-hero .kairo-placeholder-image {
  aspect-ratio: 4/3;
  border-radius: 12px;
}

.kairo-single-hero .kairo-placeholder-icon svg {
  width: 64px;
  height: 64px;
}

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

.kairo-comments {
  margin-top: var(--wp--preset--spacing--50);
}

.kairo-comment {
  transition: background-color 0.2s ease;
}

.kairo-comment:last-child {
  border-bottom: none !important;
}

/* Author badge for post author comments */
.kairo-comment.bypostauthor {
  background: var(--wp--preset--color--surface);
  margin-inline: -1rem;
  padding-inline: 1rem !important;
  border-radius: 8px;
  position: relative;
}

.kairo-comment.bypostauthor::before {
  content: "Author";
  position: absolute;
  top: var(--wp--preset--spacing--30);
  right: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wp--preset--color--base);
  background: var(--wp--preset--color--accent);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* Comment author name styling */
.wp-block-comment-author-name a {
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
}

.wp-block-comment-author-name a:hover {
  color: var(--wp--preset--color--accent);
}

/* Comment reply link */
.wp-block-comment-reply-link a {
  text-decoration: none;
  color: var(--wp--preset--color--accent);
}

.wp-block-comment-reply-link a:hover {
  text-decoration: underline;
}

/* Comment edit link */
.wp-block-comment-edit-link a {
  text-decoration: none;
  color: var(--wp--preset--color--muted);
}

.wp-block-comment-edit-link a:hover {
  color: var(--wp--preset--color--accent);
}

/* Comment content */
.wp-block-comment-content p {
  margin: 0;
  line-height: 1.7;
}

/* Comment form */
.wp-block-post-comments-form {
  margin-top: var(--wp--preset--spacing--50);
}

.wp-block-post-comments-form .comment-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wp-block-post-comments-form label {
  font-weight: 500;
  margin-bottom: 0.25rem;
  display: block;
}

.wp-block-post-comments-form input[type="text"],
.wp-block-post-comments-form input[type="email"],
.wp-block-post-comments-form input[type="url"],
.wp-block-post-comments-form textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--wp--preset--color--subtle);
  border-radius: 8px;
  background: var(--wp--preset--color--base);
  color: var(--wp--preset--color--contrast);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wp-block-post-comments-form input:focus,
.wp-block-post-comments-form textarea:focus {
  outline: none;
  border-color: var(--wp--preset--color--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.wp-block-post-comments-form textarea {
  min-height: 150px;
  resize: vertical;
}

.wp-block-post-comments-form .submit {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: flex-start;
}

.wp-block-post-comments-form .submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Dark mode comment form */
[data-theme="dark"] .wp-block-post-comments-form input[type="text"],
[data-theme="dark"] .wp-block-post-comments-form input[type="email"],
[data-theme="dark"] .wp-block-post-comments-form input[type="url"],
[data-theme="dark"] .wp-block-post-comments-form textarea,
html.kairo-theme-dark .wp-block-post-comments-form input[type="text"],
html.kairo-theme-dark .wp-block-post-comments-form input[type="email"],
html.kairo-theme-dark .wp-block-post-comments-form input[type="url"],
html.kairo-theme-dark .wp-block-post-comments-form textarea,
body.kairo-theme-dark .wp-block-post-comments-form input[type="text"],
body.kairo-theme-dark .wp-block-post-comments-form input[type="email"],
body.kairo-theme-dark .wp-block-post-comments-form input[type="url"],
body.kairo-theme-dark .wp-block-post-comments-form textarea {
  background: var(--wp--preset--color--surface);
  border-color: var(--wp--preset--color--subtle);
}

/* ========== TABLES ========== */

.wp-block-table {
  margin: 1.5rem 0;
  overflow-x: auto;
}

.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
}

.wp-block-table th,
.wp-block-table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--wp--preset--color--subtle);
  text-align: left;
}

.wp-block-table th {
  background: var(--wp--preset--color--surface);
  font-weight: 600;
}

.wp-block-table tr:nth-child(even) {
  background: var(--wp--preset--color--surface);
}

/* ========== SEPARATOR ========== */

.wp-block-separator {
  border: none;
  border-top: 1px solid var(--wp--preset--color--subtle);
  margin: 2rem 0;
}

.wp-block-separator.is-style-wide {
  border-top-width: 1px;
}

.wp-block-separator.is-style-dots {
  border: none;
  text-align: center;
}

.wp-block-separator.is-style-dots::before {
  content: "···";
  color: var(--wp--preset--color--muted);
  font-size: 1.5rem;
  letter-spacing: 1rem;
}

/* ========== CATEGORY PILLS (MENCA STYLE) ========== */

/* Category pills with background and border like Menca */
.kairo-category-pills a {
  display: inline-block;
  padding: 0.35rem 0.875rem;
  background: transparent;
  border: 1px solid var(--wp--preset--color--subtle);
  border-radius: 999px;
  text-decoration: none;
  color: var(--wp--preset--color--contrast);
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.kairo-category-pills a:hover {
  border-color: var(--wp--preset--color--contrast);
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
}

/* Separator between multiple categories */
.kairo-category-pills .wp-block-post-terms__separator {
  display: none;
}

/* ========== RELATED POSTS (MENCA STYLE) ========== */

.kairo-related-card {
  transition: transform 0.2s ease;
}

.kairo-related-card:hover {
  transform: translateY(-4px);
}

/* Thumbnail container with relative positioning for date badge */
.kairo-related-thumbnail {
  position: relative;
  margin-bottom: var(--wp--preset--spacing--20);
}

.kairo-related-thumbnail .wp-block-post-featured-image {
  margin-bottom: 0;
}

.kairo-related-thumbnail .wp-block-post-featured-image img {
  transition: transform 0.3s ease;
}

.kairo-related-card:hover .kairo-related-thumbnail .wp-block-post-featured-image img {
  transform: scale(1.03);
}

/* Date badge positioned on thumbnail like Menca */
.kairo-date-badge {
  position: absolute !important;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--wp--preset--color--contrast) !important;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem !important;
  font-weight: 500;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .kairo-date-badge,
html.kairo-theme-dark .kairo-date-badge,
body.kairo-theme-dark .kairo-date-badge {
  background: rgba(30, 41, 59, 0.95);
  color: var(--wp--preset--color--contrast) !important;
}

/* ========== GALLERY BLOCK SUPPORT ========== */

.wp-block-gallery {
  margin: 2rem 0;
}

.wp-block-gallery .wp-block-image {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
}

.wp-block-gallery .wp-block-image img {
  border-radius: 0;
  transition: transform 0.3s ease;
}

.wp-block-gallery .wp-block-image:hover img {
  transform: scale(1.03);
}

.wp-block-gallery figcaption {
  padding: 0.5rem 0.75rem;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: #fff;
  font-size: 0.875rem;
}

/* ========== COVER BLOCK ========== */

.wp-block-cover {
  border-radius: 8px;
  overflow: hidden;
}

.wp-block-cover .wp-block-cover__inner-container {
  padding: var(--wp--preset--spacing--50);
}

/* ========== COLUMNS BLOCK ========== */

.wp-block-columns {
  gap: var(--wp--preset--spacing--40);
}

/* ========== FILE BLOCK ========== */

.wp-block-file {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--wp--preset--color--surface);
  border-radius: 8px;
  margin: 1rem 0;
}

.wp-block-file a:not(.wp-block-file__button) {
  color: var(--wp--preset--color--contrast);
  text-decoration: none;
  flex: 1;
}

.wp-block-file a:not(.wp-block-file__button):hover {
  color: var(--wp--preset--color--accent);
}

.wp-block-file__button {
  background: var(--wp--preset--color--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.wp-block-file__button:hover {
  opacity: 0.9;
}

/* ========== VIDEO & AUDIO BLOCKS ========== */

.wp-block-video,
.wp-block-audio {
  margin: 1.5rem 0;
}

.wp-block-video video {
  border-radius: 8px;
}

.wp-block-audio audio {
  width: 100%;
}

/* ========== EMBED BLOCKS ========== */

.wp-block-embed {
  margin: 1.5rem 0;
}

.wp-block-embed__wrapper {
  border-radius: 8px;
  overflow: hidden;
}

/* ========== DETAILS BLOCK ========== */

.wp-block-details {
  border: 1px solid var(--wp--preset--color--subtle);
  border-radius: 8px;
  margin: 1rem 0;
}

.wp-block-details summary {
  padding: 1rem;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.wp-block-details summary:hover {
  background-color: var(--wp--preset--color--surface);
}

.wp-block-details[open] summary {
  border-bottom: 1px solid var(--wp--preset--color--subtle);
}

.wp-block-details > *:not(summary) {
  padding: 0 1rem 1rem;
}

/* ========== FOOTNOTES ========== */

.wp-block-footnotes {
  font-size: 0.875rem;
  border-top: 1px solid var(--wp--preset--color--subtle);
  padding-top: var(--wp--preset--spacing--40);
  margin-top: var(--wp--preset--spacing--50);
}

.wp-block-footnotes li {
  margin-bottom: 0.5rem;
}

/* ========== LIST STYLES ========== */

.wp-block-list {
  padding-left: 1.25rem;
}

.wp-block-list li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.wp-block-list li::marker {
  color: var(--wp--preset--color--secondary);
}

/* Ordered list with accent color numbers */
ol.wp-block-list li::marker {
  color: var(--wp--preset--color--accent);
  font-weight: 600;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 782px) {
	header .wp-block-social-links {
		display: none !important;
	}

	.kairo-newsletter-form {
		flex-direction: column;
	}

	.kairo-input,
	.kairo-submit {
		width: 100%;
	}
	
	/* Stack post items on mobile */
	.kairo-post-item {
		flex-direction: column !important;
		gap: var(--wp--preset--spacing--30) !important;
	}
	
	.kairo-post-item .wp-block-post-featured-image,
	.kairo-post-item .wp-block-post-featured-image:empty {
		width: 100% !important;
		height: 200px !important;
	}
	
	/* Stack post cards on mobile with full-width thumbnails */
	.kairo-post-card {
		flex-direction: column !important;
		gap: var(--wp--preset--spacing--30) !important;
	}
	
	/* Post card thumbnails on mobile - full width, no rotation */
	.kairo-post-card .wp-block-post-featured-image.kairo-thumbnail {
		width: 100% !important;
		height: auto !important;
	}
	
	.kairo-post-card .wp-block-post-featured-image.kairo-thumbnail a {
		width: 100% !important;
		height: auto !important;
		aspect-ratio: 16 / 10;
		transform: none;
		border-radius: 12px !important;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	}
	
	.kairo-post-card .wp-block-post-featured-image.kairo-thumbnail img {
		aspect-ratio: 16 / 10;
	}
	
	/* Pagination on mobile */
	.wp-block-query-pagination {
		flex-direction: column;
		gap: 1rem;
	}
	
	.wp-block-query-pagination-numbers {
		order: -1;
	}
	
	/* Single post hero on mobile */
	.wp-block-columns:has(.wp-block-post-featured-image) {
		flex-direction: column !important;
	}
	
	/* Author badge position on mobile */
	.kairo-comment.bypostauthor::before {
		position: static;
		display: inline-block;
		margin-bottom: 0.5rem;
	}
	
	/* Related posts responsive */
	.wp-block-post-template.is-layout-grid {
		grid-template-columns: 1fr !important;
	}
	
	.kairo-date-badge {
		top: 8px;
		left: 8px;
		font-size: 0.75rem !important;
		padding: 0.25rem 0.5rem;
	}
	
	/* Category pills responsive */
	.kairo-category-pills {
		flex-wrap: wrap;
		gap: 0.5rem;
	}
}
