/*
Theme Name: ArchiWise Blog
Theme URI: https://archiwise.ai/blog
Author: ArchiWise
Description: Custom blog theme for ArchiWise - AI Zoning and Property Intelligence
Version: 1.0
Text Domain: archiwise-blog
*/

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Brand: hsl(238 74% 63%) = #5e63e5 */
    --color-primary: #5e63e5;
    --color-primary-dark: #4a4fd4;
    --color-primary-light: #7a7eeb;
    /* Foreground: hsl(226 78% 10%) = #07082c */
    --color-dark: #07082c;
    --color-navy-light: #1a2347;
    --color-footer-bg: #07082c;
    /* Muted foreground: hsl(226 20% 40%) */
    --color-text: #525a6e;
    --color-text-light: #525a6e;
    /* hsl(220 14% 70%) */
    --color-text-muted: #a3a9b5;
    /* Border: hsl(220 13% 91%) */
    --color-border: #e4e6eb;
    --color-bg: #ffffff;
    /* Secondary: hsl(220 14% 96%) */
    --color-bg-light: #f3f4f6;
    --font-sans: 'Inter', system-ui, sans-serif;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
}

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

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

/* Announcement Bar: py-2 text-sm font-medium */
.announcement-bar {
    background: var(--color-primary);
    color: #ffffff;
    text-align: center;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    transition: background 0.2s;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 102;
}

body {
    padding-top: 104px;
}

.announcement-bar a {
    color: #ffffff;
    display: block;
}

.announcement-bar:hover {
    background: rgba(94, 99, 229, 0.9);
}

.announcement-bar span {
    margin-left: 8px;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    z-index: 101;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.site-logo {
    display: flex;
    align-items: center;
}

.site-logo .logo-img {
    height: 32px;
    width: auto;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header-nav a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    transition: color 0.2s;
}

.header-nav a:hover {
    color: var(--color-dark);
}

.nav-dropdown {
    position: relative;
}

.header-nav .has-dropdown {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    transition: color 0.2s;
}

.header-nav .has-dropdown:hover {
    color: var(--color-dark);
}

.header-nav .has-dropdown::after {
    content: '';
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    display: inline-block;
    transition: transform 0.2s;
}

.nav-dropdown:hover .has-dropdown::after {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 240px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 200;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-dark);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    color: var(--color-primary);
    background: rgba(94, 99, 229, 0.1);
}

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

.header-actions .header-login {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    transition: color 0.2s;
}

.header-actions .header-login:hover {
    color: var(--color-dark);
}

.header-actions .header-signup {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-dark);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 8px 16px;
    transition: background 0.2s;
}

.header-actions .header-signup:hover {
    background: var(--color-bg-light);
}

.btn-demo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: var(--color-primary);
    color: #ffffff !important;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease-out;
    box-shadow: 0 8px 30px -4px rgba(94, 99, 229, 0.35);
}

.btn-demo:hover {
    opacity: 0.9;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    color: #ffffff !important;
}

/* Blog Header */
.blog-header {
    text-align: center;
    padding: 48px 24px 40px;
}

.blog-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.blog-header p {
    font-size: 1rem;
    color: var(--color-text-light);
    font-weight: 400;
}

/* Blog Grid */
.blog-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

/* Post Card */
.post-card {
    display: flex;
    flex-direction: column;
}

.post-card-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 16px;
    background: var(--color-bg-light);
}

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

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

.post-card-date {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.post-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--color-dark);
    line-height: 1.4;
    margin-bottom: 8px;
}

.post-card-title a {
    color: var(--color-dark);
}

.post-card-title a:hover {
    color: var(--color-primary);
}

.post-card-excerpt {
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 40px 24px 60px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    transition: all 0.2s;
}

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

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

/* Single Post - Container: max-w-[800px] px-4 sm:px-6 lg:px-8 my-12 */
.single-post-container {
    max-width: 800px;
    margin: 48px auto;
    padding: 0 16px;
}

@media (min-width: 640px) {
    .single-post-container {
        padding: 0 24px;
    }
}

@media (min-width: 1024px) {
    .single-post-container {
        padding: 0 32px;
    }
}

/* Featured image: mb-8 rounded-lg border shadow-md */
.single-post-featured {
    width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 32px;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    background: var(--color-bg-light);
}

.single-post-featured img {
    width: 100%;
    height: auto;
    display: block;
}

/* Title: text-3xl font-medium tracking-tighter */
.single-post-container h1 {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 500;
    letter-spacing: -0.05em;
    color: var(--color-dark);
    margin: 0 0 16px 0;
}

/* Date: text-sm text-gray-500, space-y-4 = 16px gap */
.single-post-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 16px;
}

/* Author: space-x-3 = 12px gap */
.single-post-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

/* Avatar: w-10 h-10 rounded-full border border-gray-200 */
.single-post-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    flex-shrink: 0;
}

.single-post-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Author name: font-semibold text-gray-700 */
.single-post-author-name {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

/* Blog prose — mirrors the landing's .blog-prose + prose plugin defaults */
.single-post-content {
    font-size: 1rem;
    line-height: 1.75;
    color: #374151;
    margin-top: 16px;
}

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

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

.single-post-content h1,
.single-post-content h2,
.single-post-content h3,
.single-post-content h4,
.single-post-content h5,
.single-post-content h6 {
    color: var(--color-dark);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.single-post-content h2 {
    font-size: 1.5rem;
    margin: 40px 0 16px;
}

.single-post-content h3 {
    font-size: 1.25rem;
    margin: 32px 0 12px;
}

.single-post-content h4 {
    font-size: 1.125rem;
    margin: 24px 0 8px;
}

.single-post-content p {
    margin: 0 0 24px 0;
}

.single-post-content p + p {
    margin-top: 24px;
}

.single-post-content ul,
.single-post-content ol {
    margin: 24px 0;
    padding-left: 1.625em;
}

.single-post-content ul {
    list-style-type: disc;
}

.single-post-content ol {
    list-style-type: decimal;
}

.single-post-content li {
    margin: 0.5em 0;
    padding-left: 0.375em;
}

.single-post-content li::marker {
    color: #9ca3af;
}

.single-post-content li > p {
    margin: 0.5em 0;
}

.single-post-content strong {
    color: var(--color-dark);
    font-weight: 600;
}

.single-post-content em {
    font-style: italic;
}

.single-post-content blockquote {
    border-left: 4px solid var(--color-border);
    padding: 0 0 0 1em;
    margin: 24px 0;
    font-style: italic;
    color: #6b7280;
}

.single-post-content img {
    border-radius: 8px;
    margin: 24px 0;
    max-width: 100%;
    height: auto;
}

.single-post-content a {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 500;
}

.single-post-content a:hover {
    opacity: 0.85;
}

.single-post-content hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 32px 0;
}

.single-post-content code {
    background: var(--color-bg-light);
    padding: 0.125em 0.375em;
    border-radius: 4px;
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--color-dark);
}

.single-post-content pre {
    background: #07082c;
    color: #e5e7eb;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.single-post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Tables */
.single-post-content table {
    width: 100%;
    margin: 32px 0;
    border-collapse: collapse;
    font-size: 0.9375rem;
    line-height: 1.6;
    display: table;
}

.single-post-content thead {
    border-bottom: 1px solid var(--color-border);
}

.single-post-content th {
    text-align: left;
    font-weight: 600;
    color: var(--color-dark);
    padding: 12px 16px;
    vertical-align: middle;
}

.single-post-content th:first-child {
    padding-left: 0;
}

.single-post-content th:last-child {
    padding-right: 0;
}

.single-post-content tbody tr {
    border-bottom: 1px solid var(--color-border);
}

.single-post-content tbody tr:last-child {
    border-bottom: 0;
}

.single-post-content td {
    padding: 16px;
    vertical-align: middle;
    color: #374151;
}

.single-post-content td:first-child {
    padding-left: 0;
}

.single-post-content td:last-child {
    padding-right: 0;
}

/* Fix WordPress block gallery/figure */
.single-post-content figure {
    margin: 24px 0;
}

.single-post-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 8px;
}

/* Pre-footer CTA Block */
.cta-block {
    background: var(--color-primary);
    text-align: center;
    padding: 96px 24px;
}

.cta-block-inner {
    max-width: 720px;
    margin: 0 auto;
}

.cta-block h2 {
    font-size: 2.1rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.cta-block p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 40px;
    font-weight: 400;
    max-width: 42rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #ffffff;
    color: var(--color-primary);
    background: #ffffff;
}

.cta-btn:hover {
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-1px);
}

.cta-btn-outline {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

.cta-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: #ffffff;
}

.cta-btn svg {
    width: 18px;
    height: 18px;
}

/* Footer — bg-foreground = #07082c */
.site-footer {
    background: var(--color-footer-bg);
    color: rgba(255, 255, 255, 0.6);
    padding: 4rem 0;
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
    gap: 24px;
    padding-bottom: 40px;
}

.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.footer-logo-icon {
    width: 22px;
    height: 28px;
    flex-shrink: 0;
}

.footer-logo-text {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.footer-brand .footer-tagline {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin-bottom: 16px;
}

.footer-brand .footer-location {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.footer-brand .footer-location a {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
}

.footer-brand .footer-location a:hover {
    color: #ffffff;
}

.footer-col h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 14px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
    background: none;
    border: 0;
    padding: 0;
}

.footer-social a:hover {
    color: #ffffff;
}

.footer-social svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    transition-duration: .15s;
}

.text-background\/60 {
    color: hsl(var(--background) / .6);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--color-dark);
    transition: border-color 0.2s;
}

.mobile-menu-toggle svg {
    width: 20px;
    height: 20px;
}

.mobile-menu-toggle .icon-close {
    display: none;
}

.mobile-menu-open .mobile-menu-toggle {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.mobile-menu-open .mobile-menu-toggle .icon-hamburger {
    display: none;
}

.mobile-menu-open .mobile-menu-toggle .icon-close {
    display: block;
}

/* Prevent body scroll when menu open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Mobile Menu Overlay */
.mobile-menu {
    display: none;
    position: fixed;
    top: 104px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 99;
    overflow-y: auto;
    flex-direction: column;
}

.mobile-menu-open .mobile-menu {
    display: flex;
}

.mobile-menu-nav {
    flex: 1;
    padding: 8px 24px 16px;
}

.mobile-menu-link {
    display: block;
    padding: 18px 0;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

/* Mobile Accordion */
.mobile-menu-accordion {
    border-bottom: 1px solid var(--color-border);
}

.mobile-menu-accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 0;
    background: none;
    border: none;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-dark);
    cursor: pointer;
}

.mobile-menu-accordion-toggle svg {
    width: 18px;
    height: 18px;
    color: var(--color-dark);
    transition: transform 0.2s;
}

.mobile-menu-accordion.is-open .mobile-menu-accordion-toggle svg {
    transform: rotate(180deg);
}

.mobile-menu-accordion-panel {
    display: none;
    padding: 0 0 12px 16px;
}

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

.mobile-menu-accordion-panel a {
    display: block;
    padding: 10px 0;
    font-size: 0.9375rem;
    color: var(--color-text);
}

.mobile-menu-accordion-panel a:hover {
    color: var(--color-primary);
}

/* Mobile Menu Actions */
.mobile-menu-actions {
    padding: 20px 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-menu-login {
    text-align: center;
    padding: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text);
}

.mobile-menu-btn {
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.mobile-menu-btn-outline {
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    background: transparent;
}

.mobile-menu-btn-outline:hover {
    background: rgba(94, 99, 229, 0.06);
}

.mobile-menu-btn-filled {
    background: var(--color-primary);
    color: #ffffff;
    border: 1.5px solid var(--color-primary);
}

.mobile-menu-btn-filled:hover {
    background: var(--color-primary-dark);
    color: #ffffff;
}

/* Responsive — below lg (1024px) = mobile */
@media (max-width: 1023px) {
    .header-nav {
        display: none;
    }

    .header-actions {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

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

@media (max-width: 767px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .blog-header h1 {
        font-size: 1.5rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .single-post-container h1 {
        font-size: 1.5rem;
    }

    .cta-block {
        padding: 64px 24px;
    }

    .cta-block h2 {
        font-size: 1.875rem;
    }

    .cta-block p {
        font-size: 0.9375rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}
