/*
Theme Name: Proinspekt
Theme URI: https://proinspekt.hr
Author: Amidal
Description: Custom WordPress tema za Proinspekt – ispitivanje zavara i NDT.
Version: 1.0
Text Domain: proinspekt
*/

:root {
    --blue-primary: #004a80;
    --blue-primary-light: #005b96;
    --blue-primary-hover: #00395f;

    --gray-dark: #4a4a4a;
    --gray: #6b6b6b;
    --gray-light: #f5f7fa;

    --cta: #f28c00;
    --cta-hover: #cf7200;

    --white: #ffffff;
}

/* Global */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--white);
    color: var(--gray-dark);
    line-height: 1.6;
}

a {
    color: var(--blue-primary);
    text-decoration: none;
}
a:hover {
    color: var(--blue-primary-hover);
}

/* Layout */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Header */
.site-header {
    background: var(--blue-primary);
    color: var(--white);
    padding: 18px 0;
}
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-branding {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Prevent the logo from shrinking out on narrow widths */
    flex: 0 0 auto;
}

/* Logo */
.site-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-logo {
    display: block;
    height: 34px;
    width: auto;
    max-width: 100%;
}

.logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--blue-primary), var(--cta));
}
.site-title a {
    color: var(--white);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.12em;
}
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
}
.main-nav .menu {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
    align-items: center;
}
.main-nav .menu > li > a {
    display: block;
    padding: 10px 0;
}
.main-nav a {
    color: var(--white);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.main-nav a:hover {
    color: var(--cta);
}

/* Current/active menu item highlight */
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
    color: var(--cta);
    position: relative;
}
.main-nav .current-menu-item > a::after,
.main-nav .current_page_item > a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    background: var(--cta);
    opacity: 0.9;
}

/* Accessible hidden text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hamburger button */
.menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: background-color 0.2s ease;
}
.menu-toggle:hover,
.menu-toggle.is-active { background: rgba(255,255,255,0.08); }
.menu-toggle i { font-size: 22px; line-height: 1; pointer-events: none; }
.menu-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.35);
}
.menu-toggle .bar {
    --burger-width: 24px;
    --burger-thickness: 2px;
    --burger-gap: 5px;
    display: block;
    width: var(--burger-width);
    height: var(--burger-thickness);
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: center;
    box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.menu-toggle .bar + .bar { margin-top: var(--burger-gap); }
/* Using Font Awesome icon; bar-based animation not needed */

/* Hero */
.hero {
    background: var(--gray-light);
    padding: 80px 0 60px;
}
.hero h1 {
    font-size: 36px;
    margin-bottom: 15px;
    color: var(--blue-primary);
}
.hero p {
    max-width: 600px;
    color: var(--gray);
}

/* Hero with background image */
.hero.hero-image {
    position: relative;
    color: var(--white);
    padding: 120px 0 100px;
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), var(--hero-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.hero.hero-image h1 {
    color: var(--white);
    text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.hero.hero-image p {
    color: #e5e7eb;
}

/* CTA gumb */
.cta-btn {
    display: inline-block;
    margin-top: 20px;
    background: var(--cta);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 500;
}
.cta-btn:hover {
    background: var(--cta-hover);
}

/* Sekcije */
.section {
    padding: 50px 0;
}
.section h2 {
    color: var(--blue-primary);
    font-size: 26px;
    margin-bottom: 25px;
}
.section-gray {
    background: var(--gray-light);
}

.contact-form-wrapper {
    margin-top: 20px;
}

/* CF7 base wrapper (apply the same card everywhere) */
.wpcf7 {
    margin-top: 20px;
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
/* Avoid double spacing when inside .contact-form-wrapper on front page */
.contact-form-wrapper .wpcf7 { margin-top: 0; }

.contact-details h3 {
    margin-top: 30px;
    color: var(--blue-primary);
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.service-box {
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s, transform 0.2s;
}
.service-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.service-box h3 {
    color: var(--blue-primary);
}

/* Footer */
.site-footer {
    background: var(--blue-primary);
    color: #d1d5db;
    padding: 20px 0;
    text-align: center;
}

/* Footer links (e.g., Amidal credit) */
.site-footer a {
    color: var(--cta);
    font-weight: 600;
}
.site-footer a:hover {
    color: var(--white);
    text-decoration: underline;
}

/* Pages */
.page-content {
    padding: 50px 0;
}
.page-title {
    font-size: 32px;
    color: var(--blue-primary);
    margin-bottom: 20px;
}

/* Content images (modern, rounded, responsive) */
.entry-content img,
.page-content img,
.wp-block-image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.entry-content a:hover img,
.page-content a:hover img,
.wp-block-image a:hover img {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

/* Figures and captions */
.entry-content figure,
.wp-block-image {
    margin: 16px 0 22px;
}
.wp-caption,
.wp-block-image figcaption {
    color: var(--gray);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    margin-top: 8px;
}

/* Alignment helpers */
.entry-content .aligncenter,
.wp-block-image.aligncenter,
.wp-caption.aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.entry-content .alignleft,
.wp-block-image.alignleft,
.wp-caption.alignleft { float: left; margin: 0 1rem 1rem 0; }
.entry-content .alignright,
.wp-block-image.alignright,
.wp-caption.alignright { float: right; margin: 0 0 1rem 1rem; }

/* Mobile: remove floats and use full width */
@media (max-width: 768px) {
    .entry-content .alignleft,
    .entry-content .alignright,
    .wp-block-image.alignleft,
    .wp-block-image.alignright,
    .wp-caption.alignleft,
    .wp-caption.alignright {
        float: none;
        margin: 0 0 14px 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle { display: inline-flex; }
    .site-header { position: relative; }

    /* Collapse nav into a dropdown panel */
    .main-nav {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: var(--blue-primary);
        display: none;
        padding: 12px 0 18px;
        box-shadow: 0 6px 16px rgba(0,0,0,0.15);
        z-index: 50;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul,
    .main-nav .menu {
        flex-direction: column;
        gap: 0;
    }
    .main-nav li { border-top: 1px solid rgba(255,255,255,0.12); }
    .main-nav li:first-child { border-top: 0; }
    .main-nav a {
        display: block;
        padding: 12px 20px;
        font-size: 16px;
    }
    body.nav-open { overflow: hidden; }

    /* Typographic tweaks on small screens */
    .hero h1 { font-size: 28px; }
    .hero.hero-image { padding: 80px 0 70px; }
    .page-title { font-size: 26px; }
    .cta-btn { padding: 12px 18px; }
}

/* Contact Form 7 – modern style */
.wpcf7-form {
    display: grid;
    gap: 16px;
}
.wpcf7-form p {
    margin: 0;
}

/* Labels */
.wpcf7-form label {
    display: block;
    font-size: 14px;
    color: var(--gray-dark);
    margin-bottom: 6px;
}

/* Inputs, selects, textareas */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 select,
.wpcf7 textarea {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 16px;
    color: var(--gray-dark);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.wpcf7 textarea {
    min-height: 160px;
    resize: vertical;
}
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
    color: #9ca3af;
}
.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(0, 74, 128, 0.15);
}

/* File input */
.wpcf7 input[type="file"] {
    padding: 10px;
    background: #fafafa;
}

/* Checkboxes and radios */
.wpcf7 .wpcf7-list-item { margin: 0 16px 0 0; }
.wpcf7 .wpcf7-list-item label { display: inline-flex; align-items: center; gap: 8px; }
.wpcf7 input[type="checkbox"],
.wpcf7 input[type="radio"] {
    accent-color: var(--blue-primary);
}

/* Submit button */
.wpcf7 input[type="submit"],
.wpcf7 .wpcf7-submit {
    display: inline-block;
    background: var(--cta);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 22px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
}
.wpcf7 input[type="submit"]:hover,
.wpcf7 .wpcf7-submit:hover {
    background: var(--cta-hover);
}
.wpcf7 input[type="submit"]:active,
.wpcf7 .wpcf7-submit:active {
    transform: translateY(1px);
}

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

/* Validation and response messages */
.wpcf7 .wpcf7-not-valid {
    border-color: #ef4444 !important;
}
.wpcf7 .wpcf7-not-valid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.wpcf7 .wpcf7-not-valid-tip {
    font-size: 13px;
    color: #b91c1c;
    margin-top: 6px;
}
.wpcf7 .wpcf7-response-output {
    margin: 6px 0 0 0;
    border-radius: 8px;
    border-width: 1px;
    padding: 12px 14px;
}
.wpcf7 .wpcf7-response-output.wpcf7-mail-sent-ok,
.wpcf7 form.sent .wpcf7-response-output {
    border-color: #16a34a;
    background: #ecfdf5;
    color: #166534;
}
.wpcf7 .wpcf7-response-output.wpcf7-validation-errors,
.wpcf7 form.invalid .wpcf7-response-output {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}
.wpcf7 .wpcf7-response-output.wpcf7-spam-blocked,
.wpcf7 form.spam .wpcf7-response-output {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

/* Optional two-column layout on wider screens if fields are in separate <p> tags */
@media (min-width: 768px) {
    .wpcf7-form {
        grid-template-columns: 1fr 1fr;
    }
    /* Make message and submit full width */
    .wpcf7-form p:has(textarea),
    .wpcf7-form p:has(.wpcf7-submit),
    .wpcf7-form p:has(input[type="submit"]) {
        grid-column: 1 / -1;
    }
}

/* Fallback if :has() is not supported: make all paragraphs full width but keep nice gaps */
@supports not selector(p:has(*)) {
    .wpcf7-form {
        grid-template-columns: 1fr;
    }
}
