/**
 * Peugeot Engines Theme - Custom CSS
 * Additional styles for the WordPress theme
 */

/* ==========================================
   Form Styles (Contact Form 7 compatibility)
   ========================================== */

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background-color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: all 0.2s;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
    outline: none;
    ring: 2px;
    ring-color: rgba(30, 64, 175, 0.5);
    border-color: var(--primary);
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select {
    height: 2.75rem;
}

.wpcf7 input[type="submit"] {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
}

.wpcf7 input[type="submit"]:hover {
    background-color: rgba(30, 64, 175, 0.9);
}

.wpcf7-response-output {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
}

.wpcf7-mail-sent-ok {
    background-color: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.wpcf7-validation-errors {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

/* ==========================================
   WordPress Admin Bar Compatibility
   ========================================== */

.admin-bar header.sticky {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar header.sticky {
        top: 46px;
    }
}

/* ==========================================
   Block Editor Styles
   ========================================== */

.wp-block-button__link {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
}

.wp-block-button__link:hover {
    background-color: rgba(30, 64, 175, 0.9);
    transform: translateY(-2px);
}

/* ==========================================
   Navigation Menu WordPress Classes
   ========================================== */

.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.375rem;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
}

.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 200px;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    padding: 0.5rem 0;
    z-index: 100;
}

.menu-item-has-children:hover > .sub-menu {
    display: block;
}

.sub-menu .menu-item a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--foreground);
    transition: background-color 0.2s;
}

.sub-menu .menu-item a:hover {
    background-color: var(--muted);
    color: var(--primary);
}

/* ==========================================
   WordPress Gallery Block
   ========================================== */

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

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

.wp-block-gallery.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wp-block-gallery.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.wp-block-gallery img {
    border-radius: 0.5rem;
}

/* ==========================================
   Accessibility Improvements
   ========================================== */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Focus styles */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ==========================================
   Article Content (prose-like typography)
   ========================================== */

.prose {
    color: var(--foreground);
}
.prose p {
    margin: 1em 0 1.2em;
    line-height: 1.8;
    color: var(--muted-foreground);
}
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    color: var(--foreground);
    line-height: 1.3;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
}
.prose h1 { font-size: 1.875rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }

.prose ul,
.prose ol {
    margin: 0.8em 0 1.2em;
    padding-left: 1.25rem;
}
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 0.4em 0; }

.prose a {
    color: var(--primary);
    text-decoration: underline;
}
.prose strong { color: var(--foreground); }

.prose blockquote {
    margin: 1.25em 0;
    padding: 0.5em 1rem;
    border-left: 4px solid var(--primary);
    background: rgba(241, 245, 249, 0.5); /* muted */
    border-radius: 0 0.5rem 0.5rem 0;
    color: var(--foreground);
}

.prose img,
.prose video {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    margin: 1.25em 0;
}

.prose figure { margin: 1.5em 0; }
.prose figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-top: 0.5em;
}

.prose pre,
.prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
}
.prose pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.25em 0;
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25em 0;
}
.prose th,
.prose td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
}
.prose th {
    background-color: #f8fafc;
    text-align: left;
}

/* ==========================================
   Print Styles
   ========================================== */

@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

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