/**
 * INAIS Theme - Main Styles
 * Complementary styles for Tailwind CSS
 */

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #1e5a7e;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #164560;
}

/* Animation classes */
.animate-fade-in-up {
    animation: fadeInUp 0.7s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Disable animations on first section (Hero) of each page */
main>section:first-of-type .animate-fade-in,
main>section:first-of-type .animate-fade-in-up,
main>section:first-of-type .animate-fade-in-left,
main>section:first-of-type .animate-fade-in-right,
.bg-white>section:first-of-type .animate-fade-in,
.bg-white>section:first-of-type .animate-fade-in-up,
.bg-white>section:first-of-type .animate-fade-in-left,
.bg-white>section:first-of-type .animate-fade-in-right {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Line clamp utilities */
.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;
}

/* Mobile menu active state */
body.mobile-menu-open {
    overflow: hidden;
}

/* Header scroll state */
#site-header.scrolled {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(200, 200, 200, 0.5);
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #1e5a7e;
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    width: auto;
    height: auto;
    padding: 15px 20px;
    background: #1e5a7e;
    color: white;
    z-index: 9999;
    border-radius: 8px;
}

/* WordPress alignment classes */
.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
}

/* Pagination styles */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-links a,
.nav-links .current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-links a {
    background: #f3f4f6;
    color: #374151;
}

.nav-links a:hover {
    background: #1e5a7e;
    color: white;
}

.nav-links .current {
    background: #1e5a7e;
    color: white;
}

/* Mobile menu styles */
.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-list li {
    border-bottom: 1px solid #e5e7eb;
}

.mobile-menu-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    font-weight: 500;
    color: #374151;
    transition: all 0.3s ease;
}

.mobile-menu-list a:hover {
    background: #f3f4f6;
    color: #1e5a7e;
}

/* =================================
   Contact Form 7 - Newsletter Styles
   Using site's original colors
   ================================= */

#newsletter .wpcf7 {
    width: 100%;
}

#newsletter .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 640px) {
    #newsletter .wpcf7-form {
        flex-direction: row;
        align-items: stretch;
        gap: 12px;
    }
}

/* Default flex behavior for all fields */
#newsletter .wpcf7-form>div,
#newsletter .wpcf7-form>p {
    flex: 1;
    margin: 0;
}

/* Button container should not flex */
#newsletter .wpcf7-form>p:last-of-type,
#newsletter .wpcf7-form>div:last-of-type {
    flex: 0 0 auto;
}

/* Input fields styling */
#newsletter .wpcf7-form-control:not([type="submit"]):not(button) {
    width: 100%;
    padding: 16px 24px;
    border-radius: 9999px;
    background-color: #fff;
    color: #1f2937;
    font-size: 15px;
    font-weight: 500;
    border: none;
    outline: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

#newsletter .wpcf7-form-control:not([type="submit"]):not(button)::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

#newsletter .wpcf7-form-control:not([type="submit"]):not(button):focus {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Submit button styling */
#newsletter .wpcf7-form button[type="submit"],
#newsletter .wpcf7-form input[type="submit"],
#newsletter .wpcf7-submit {
    background-color: #f1c40f;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 16px;
    padding: 16px 32px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.4);
    transition: all 0.3s ease;

    /* Prevent line break - CRITICAL */
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    flex-shrink: 0;
    min-width: auto;
    width: auto;
}

#newsletter .wpcf7-form button[type="submit"]:hover,
#newsletter .wpcf7-form input[type="submit"]:hover,
#newsletter .wpcf7-submit:hover {
    background-color: #e6b800;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 196, 15, 0.5);
}

/* SVG icon inside button - force inline behavior */
#newsletter .wpcf7-form button[type="submit"] svg,
#newsletter .wpcf7-submit svg {
    display: inline-block !important;
    flex-shrink: 0 !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

/* WordPress Pagination */
.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    font-weight: 600;
    color: var(--color-foreground);
    background-color: white;
    border: 1px solid var(--color-border);
    transition: all 0.2s;
}

.pagination .page-numbers.current {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.pagination .page-numbers:hover:not(.current) {
    background-color: var(--color-secondary);
    color: white;
    border-color: var(--color-secondary);
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    width: auto;
    padding: 0 1rem;
}

/* Hide unwanted <br> tags inserted by WordPress autop */
#newsletter .wpcf7-form button[type="submit"] br,
#newsletter .wpcf7-submit br {
    display: none !important;
}

/* Response message styling */
#newsletter .wpcf7-response-output {
    margin-top: 16px !important;
    padding: 14px 20px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center;
    border: none !important;
}

#newsletter .wpcf7-response-output.wpcf7-mail-sent-ok,
#newsletter .wpcf7 form.sent .wpcf7-response-output {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

#newsletter .wpcf7-response-output.wpcf7-validation-errors,
#newsletter .wpcf7 form.invalid .wpcf7-response-output {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fff !important;
}

#newsletter .wpcf7-not-valid-tip {
    color: #fef2f2;
    font-size: 13px;
    margin-top: 6px;
    padding-left: 8px;
    font-weight: 500;
}

/* Spinner loading */
#newsletter .wpcf7-spinner {
    margin: 0 0 0 12px;
}

/* =================================
   ODS Content Formatting (Gutenberg)
   ================================= */

.ods-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #4b5563;
    /* text-muted-foreground approximation */
}

.ods-content p {
    margin-bottom: 1rem;
}

.ods-content p:last-child {
    margin-bottom: 0;
}

.ods-content ul,
.ods-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.ods-content ul {
    list-style-type: disc;
}

.ods-content ol {
    list-style-type: decimal;
}

.ods-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

/* Fix marker color */
.ods-content li::marker {
    color: #1e5a7e;
    /* Primary color */
    font-weight: bold;
}

.ods-content h1,
.ods-content h2,
.ods-content h3,
.ods-content h4,
.ods-content h5,
.ods-content h6 {
    color: #1a1a1a;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.ods-content h3 {
    font-size: 1.25rem;
}

.ods-content strong {
    color: #1a1a1a;
    font-weight: 700;
}

.ods-content a {
    color: #1e5a7e;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ods-content a:hover {
    color: #2d8a5e;
}

.ods-content blockquote {
    border-left: 4px solid #1e5a7e;
    padding-left: 1rem;
    font-style: italic;
    color: #4b5563;
    margin-bottom: 1rem;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

/* =================================
   Post Content Formatting (Blog)
   ================================= */

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #4b5563;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content p:last-child {
    margin-bottom: 0;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.75rem;
}

.post-content ul {
    list-style-type: disc;
}

.post-content ol {
    list-style-type: decimal;
}

.post-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.post-content li::marker {
    color: #1e5a7e;
    font-weight: bold;
}

.post-content h1 {
    font-size: 2.25rem;
    color: #1a1a1a;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-content h2 {
    font-size: 1.875rem;
    color: #1a1a1a;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-content h3 {
    font-size: 1.5rem;
    color: #1a1a1a;
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-content h4,
.post-content h5,
.post-content h6 {
    color: #1a1a1a;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.post-content strong {
    color: #1a1a1a;
    font-weight: 700;
}

.post-content a {
    color: #1e5a7e;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.post-content a:hover {
    color: #2d8a5e;
}

.post-content blockquote {
    border-left: 4px solid #2d8a5e;
    padding: 1.25rem 1.5rem;
    font-style: italic;
    color: #4b5563;
    margin: 1.5rem 0;
    background: #f0fdf4;
    border-radius: 0 0.75rem 0.75rem 0;
}

.post-content blockquote p {
    margin-bottom: 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.post-content figure {
    margin: 2rem 0;
}

.post-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.75rem;
}

.post-content hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 2rem 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-content th,
.post-content td {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.post-content th {
    background: #f9fafb;
    font-weight: 600;
    color: #1a1a1a;
}

.post-content code {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #1e5a7e;
}

.post-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1.25rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* =================================
   Project Content Formatting
   (Single Projeto Page)
   ================================= */

.project-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #4b5563;
}

.project-content p {
    margin-bottom: 1.5rem;
}

.project-content p:last-child {
    margin-bottom: 0;
}

.project-content ul,
.project-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.75rem;
}

.project-content ul {
    list-style-type: disc;
}

.project-content ol {
    list-style-type: decimal;
}

.project-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.project-content li::marker {
    color: #1e5a7e;
    font-weight: bold;
}

.project-content h1 {
    font-size: 2.25rem;
    color: #1a1a1a;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.project-content h2 {
    font-size: 1.875rem;
    color: #1a1a1a;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.project-content h3 {
    font-size: 1.5rem;
    color: #1a1a1a;
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.project-content h4,
.project-content h5,
.project-content h6 {
    color: #1a1a1a;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.project-content strong {
    color: #1a1a1a;
    font-weight: 700;
}

.project-content a {
    color: #1e5a7e;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.project-content a:hover {
    color: #2d8a5e;
}

.project-content blockquote {
    border-left: 4px solid #2d8a5e;
    padding: 1.25rem 1.5rem;
    font-style: italic;
    color: #4b5563;
    margin: 1.5rem 0;
    background: #f0fdf4;
    border-radius: 0 0.75rem 0.75rem 0;
}

.project-content blockquote p {
    margin-bottom: 0;
}

.project-content img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.project-content figure {
    margin: 2rem 0;
}

.project-content figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.75rem;
}

.project-content hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 2rem 0;
}

.project-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.project-content th,
.project-content td {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.project-content th {
    background: #f9fafb;
    font-weight: 600;
    color: #1a1a1a;
}

.project-content code {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: #1e5a7e;
}

.project-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1.25rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.project-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Gallery Grid for Projects */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .project-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .project-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

.project-gallery-item {
    aspect-ratio: 1;
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.project-gallery-item:hover {
    transform: scale(1.02);
}

.project-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-gallery-item:hover img {
    transform: scale(1.1);
}

/* Lightbox */
.project-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.project-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.project-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 0.5rem;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.project-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    background: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.project-lightbox-close:hover {
    transform: scale(1.1);
}

/* WordPress Pagination */
.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-weight: 600;
    color: #4b5563;
    /* text-gray-600 */
    background-color: white;
    border: 1px solid #e5e7eb;
    /* border-gray-200 */
    transition: all 0.2s;
    text-decoration: none;
}

.pagination .page-numbers.current {
    background-color: #1e5a7e;
    /* primary */
    color: white;
    border-color: #1e5a7e;
}

.pagination .page-numbers:hover:not(.current) {
    background-color: #2d8a5e;
    /* secondary */
    color: white;
    border-color: #2d8a5e;
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    width: auto;
    padding: 0 1rem;
    border-radius: 9999px;
}