/**
 * Nexayi Blog Custom Styles
 * Tailwind CSS v4 compatible
 */

/* ================================
   Typography
   ================================ */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================
   Focus States (Accessibility)
   ================================ */
*:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ================================
   Utility Classes
   ================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ================================
   Prose/Content Styles
   ================================ */
.prose {
    max-width: 65ch;
    color: #374151;
    line-height: 1.75;
}

.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3;
    color: #111827;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    line-height: 1.4;
    color: #111827;
}

.prose a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.prose a:hover {
    text-decoration: underline;
}

.prose blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 1.5rem;
    font-style: italic;
    color: #6b7280;
    margin: 1.6em 0;
}

.prose ul,
.prose ol {
    padding-left: 1.5rem;
    margin: 1.25em 0;
}

.prose li {
    margin: 0.5em 0;
}

.prose code {
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.prose pre {
    background-color: #1f2937;
    color: #e5e7eb;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.6em 0;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
    font-size: 0.875em;
}

.prose img {
    border-radius: 0.75rem;
    margin: 2em auto;
}

.prose figure {
    margin: 2em 0;
}

.prose figcaption {
    text-align: center;
    font-size: 0.875em;
    color: #6b7280;
    margin-top: 0.75em;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
}

.prose th,
.prose td {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.prose th {
    background-color: #f9fafb;
    font-weight: 600;
}

/* ================================
   Animations
   ================================ */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fade-up 0.5s ease-out forwards;
}

/* ================================
   WordPress Specific
   ================================ */

/* Gutenberg Alignment */
.alignwide {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

/* WordPress blocks */
.wp-block-image img {
    max-width: 100%;
    height: auto;
}

.wp-block-gallery {
    display: grid;
    gap: 1rem;
}

.wp-block-separator {
    border-color: #e5e7eb;
    margin: 2em 0;
}

/* ================================
   Mobile Menu
   ================================ */
#mobile-menu.open {
    max-height: 100vh;
}

/* ================================
   Scrollbar Styling
   ================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ================================
   Selection
   ================================ */
::selection {
    background-color: #bfdbfe;
    color: #1e3a8a;
}

/* ================================
   Print Styles
   ================================ */
@media print {
    header,
    footer,
    nav,
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a {
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
    }
}
