/*
Theme Name: Blue Logic
Theme URI: https://example.com/blue-logic
Author: Antigravity
Author URI: https://example.com
Description: A premium, high-end WordPress theme based on the Precision Artisan design system. Features tonal layering, glassmorphism, and editorial typography.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blue-logic
Tags: elegant, modern, clean, calculation, blue, premium
*/

/* 
  The theme handles most styling via Tailwind CSS injected in functions.php.
  Add any custom CSS that cannot be handled by Tailwind here.
*/

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
}

/* =============================================
   Material Design 3 — Outlined Form Fields
   Targets CF7, WPForms, Gravity, and native WP
   ============================================= */

/* Base input/textarea/select */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="url"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 textarea,
.wpcf7 select,
.wpforms-form input[type="text"],
.wpforms-form input[type="email"],
.wpforms-form textarea,
.wpforms-form select,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 16px 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1a1c1e;
    background: transparent;
    border: 1.5px solid #c3c7cf;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    -webkit-appearance: none;
}

.wpcf7 input:focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus,
.wpforms-form input:focus,
.wpforms-form textarea:focus,
.comment-form input:focus,
.comment-form textarea:focus {
    border-color: #004f95;
    box-shadow: 0 0 0 3px rgba(0, 79, 149, 0.1);
}

.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
    color: #73777f;
    opacity: 1;
}

/* Textarea */
.wpcf7 textarea,
.wpforms-form textarea,
.comment-form textarea {
    min-height: 160px;
    resize: vertical;
}

/* Labels */
.wpcf7 label,
.wpcf7-form p > label,
.wpforms-field-label,
.comment-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #43474e;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

/* Form spacing */
.wpcf7-form p,
.wpcf7-form .wpcf7-form-control-wrap {
    margin-bottom: 1.25rem;
}

/* Checkbox / acceptance */
.wpcf7 input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid #73777f;
    border-radius: 6px;
    cursor: pointer;
    accent-color: #004f95;
    vertical-align: middle;
    margin-right: 8px;
}

.wpcf7 .wpcf7-list-item label,
.wpcf7 .wpcf7-acceptance label {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    color: #43474e;
    cursor: pointer;
}

/* Submit button — M3 Filled Button */
.wpcf7 input[type="submit"],
.wpcf7 button[type="submit"],
.wpforms-submit,
.comment-form .submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    background-color: #004f95;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 79, 149, 0.2);
    letter-spacing: 0.01em;
    min-width: 160px;
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 button[type="submit"]:hover,
.wpforms-submit:hover,
.comment-form .submit:hover {
    background-color: #003d75;
    box-shadow: 0 4px 16px rgba(0, 79, 149, 0.3);
    transform: translateY(-1px);
}

.wpcf7 input[type="submit"]:active,
.wpcf7 button[type="submit"]:active,
.wpforms-submit:active,
.comment-form .submit:active {
    transform: translateY(0) scale(0.98);
}

/* Validation states */
.wpcf7-not-valid {
    border-color: #ba1a1a !important;
}

.wpcf7-not-valid-tip {
    color: #ba1a1a;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
    display: block;
}

/* Response messages */
.wpcf7-response-output {
    border-radius: 12px !important;
    padding: 14px 20px !important;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1.5px solid #c3c7cf !important;
    margin-top: 1.5rem !important;
}

.wpcf7-mail-sent-ok,
.wpcf7 form.sent .wpcf7-response-output {
    border-color: #2e7d32 !important;
    background: #e8f5e9;
    color: #1b5e20;
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output {
    border-color: #ba1a1a !important;
    background: #fdecea;
    color: #ba1a1a;
}

/* Select dropdown arrow */
.wpcf7 select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2373777f' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Tool card links inside prose — remove underline */
.prose .tool-card,
.prose .tool-card * {
    text-decoration: none !important;
}

/* File upload */
.wpcf7 input[type="file"] {
    padding: 12px;
    border: 1.5px dashed #c3c7cf;
    border-radius: 12px;
    width: 100%;
    cursor: pointer;
    font-size: 0.85rem;
    color: #43474e;
}

.wpcf7 input[type="file"]:hover {
    border-color: #004f95;
    background: rgba(0, 79, 149, 0.02);
}

/* Spinner */
.wpcf7-spinner {
    margin-left: 12px;
}

/* =============================================
   Pagination — Material Design 3 Style
   ============================================= */
.blue-logic-pagination .nav-links,
.navigation.pagination .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.blue-logic-pagination .nav-links a,
.blue-logic-pagination .nav-links span,
.navigation.pagination .nav-links a,
.navigation.pagination .nav-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
}

/* Regular page numbers */
.blue-logic-pagination .nav-links a.page-numbers,
.navigation.pagination .nav-links a.page-numbers {
    color: #43474e;
    background: #f7f9fc;
    border-color: #e0e0e0;
}

.blue-logic-pagination .nav-links a.page-numbers:hover,
.navigation.pagination .nav-links a.page-numbers:hover {
    background: #ebeef2;
    border-color: #004f95;
    color: #004f95;
}

/* Current page */
.blue-logic-pagination .nav-links span.page-numbers.current,
.navigation.pagination .nav-links span.page-numbers.current {
    background: #004f95;
    color: #ffffff;
    border-color: #004f95;
    box-shadow: 0 2px 8px rgba(0, 79, 149, 0.25);
}

/* Prev/Next arrows */
.blue-logic-pagination .nav-links a.prev,
.blue-logic-pagination .nav-links a.next,
.navigation.pagination .nav-links a.prev,
.navigation.pagination .nav-links a.next {
    color: #004f95;
    background: transparent;
    border-color: #c3c7cf;
    font-weight: 700;
}

.blue-logic-pagination .nav-links a.prev:hover,
.blue-logic-pagination .nav-links a.next:hover,
.navigation.pagination .nav-links a.prev:hover,
.navigation.pagination .nav-links a.next:hover {
    background: #004f95;
    color: #ffffff;
    border-color: #004f95;
}

/* Dots */
.blue-logic-pagination .nav-links span.page-numbers.dots,
.navigation.pagination .nav-links span.page-numbers.dots {
    color: #73777f;
    background: transparent;
    border: none;
    min-width: 32px;
    padding: 0;
}

/* Screen reader text */
.blue-logic-pagination .screen-reader-text,
.navigation.pagination .screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* =============================================
   Performance — GPU Compositing Hints
   ============================================= */

/* Promote hover-scale elements to GPU layer */
.group:hover img,
.tool-card img,
.group-hover\:scale-105,
.group-hover\:scale-110 {
    will-change: transform;
}

/* Fixed header with backdrop-blur */
header.fixed {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* =============================================
   CLS Reservation — Hero chart container
   Prevents layout shift while ApexCharts renders.
   ============================================= */
#hero-chart {
    contain: layout style;
    aspect-ratio: auto;
}

#hero-sim-container .hero-chart-wrap {
    contain: layout paint;
}

/* Reserve minimum hero card height on mobile to avoid CLS when content
   (numbers, chart) populates after async init. */
@media (max-width: 767px) {
    #hero-sim-container {
        min-height: 340px;
    }
}

/* =============================================
   Print — maximize readability of calculator results
   and article body while stripping UI chrome.
   ============================================= */
@media print {
    /* Reset to black ink on white for crisp printouts. */
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    body {
        font-family: Georgia, "Times New Roman", "Hiragino Mincho ProN", serif !important;
        font-size: 11pt !important;
        line-height: 1.55 !important;
    }
    /* Hide site chrome, navigation, widgets, ads, comments, sharing. */
    header.fixed,
    header.site-header,
    .site-header,
    #primary-menu,
    .mobile-drawer,
    .pill-nav-container,
    #scroll-to-top,
    .scroll-to-top-fab,
    nav[aria-label="Breadcrumb"],
    footer,
    .site-footer,
    .sidebar,
    aside,
    .comments-area,
    .related-tools,
    .post-navigation,
    .social-share,
    [class*="ad-slot"],
    [class*="ads-"],
    [id*="-ad-"],
    .widget_media_image,
    iframe,
    form#commentform,
    .scroll-hint,
    .row-scroll-btn,
    #bl-tool-search,
    .recent-tools,
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    /* Remove hero ornamental blobs & simulation card */
    #hero-sim-container,
    .hero-cta-button {
        display: none !important;
    }
    /* Make printed articles edge-to-edge and avoid wasted margins. */
    .max-w-custom,
    .prose,
    article,
    .entry-content {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    /* Show link URLs after anchor text (exclude tool internals & nav). */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #555 !important;
        word-break: break-all;
    }
    a[href^="#"]:after,
    a.no-print-url:after,
    nav a:after,
    .tool-card a:after {
        content: "" !important;
    }
    /* Avoid breaking content awkwardly. */
    h1, h2, h3, h4 {
        page-break-after: avoid;
        break-after: avoid;
    }
    img, table, pre, blockquote,
    .spc-card, .hrc-tool, .hrc-car {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    /* Ensure calculator output tables and result cards remain visible. */
    .hrc-tool,
    .spc-card,
    .hkc-chart-panel,
    .spc-chart-panel {
        border: 1px solid #999 !important;
        padding: 12px !important;
    }
    /* Force page breaks before major sections (tools with long output). */
    .print-page-break {
        page-break-before: always;
        break-before: page;
    }
}

/* =============================================
   Accessibility — prefers-reduced-motion
   Honors user's OS-level "reduce motion" preference.
   ============================================= */
@media (prefers-reduced-motion: reduce) {

    /* Neutralize every animation & transition app-wide. */
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    /* Force hero sim into final state immediately (bypasses fade/translate). */
    #hero-sim-container {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    /* Disable decorative infinite pulses. */
    .animate-pulse,
    .animate-pulse-subtle,
    .animate-bounce,
    .animate-spin,
    .animate-ping {
        animation: none !important;
    }

    /* Smooth-scroll on horizontal carousels becomes instant. */
    .tool-scroll-row,
    .scroll-smooth {
        scroll-behavior: auto !important;
    }
}
