/*
 * CEPC Modern Website Styling
 * Version 1.0
 * Non-destructive overrides for Industrial theme
 */

:root {
    --cepc-red: #d50028;
    --cepc-red-dark: #ac0020;
    --cepc-text: #27303a;
    --cepc-muted: #626b76;
    --cepc-border: #e6e9ed;
    --cepc-light: #f6f7f9;
}

/* Global typography */
body {
    color: var(--cepc-text);
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 15px;
    line-height: 1.7;
    background: #fff;
}

body p,
body li,
body td,
body blockquote {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
    color: #202833;
    font-family: Arial, Helvetica, sans-serif !important;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.025em;
}

h1 { font-size: clamp(28px, 3vw, 38px); }
h2 { font-size: clamp(23px, 2.5vw, 30px); }
h3 { font-size: 21px; }
h4 { font-size: 18px; }

/* Links */
a {
    transition: color .2s ease, background-color .2s ease;
}

#middle a:not(.button):not(.cmsms_button) {
    color: var(--cepc-red);
}

#middle a:not(.button):not(.cmsms_button):hover {
    color: var(--cepc-red-dark);
}

/* Header refinement */
#header {
    background: #fff;
}

#header nav {
    font-family: Arial, Helvetica, sans-serif;
}

#navigation > li > a {
    font-family: Arial, Helvetica, sans-serif !important;
    letter-spacing: .01em;
}

/* Slider */
.cepc-slider {
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(20, 30, 45, .10);
}

.cepc-slider .cepc-prev,
.cepc-slider .cepc-next {
    border-radius: 5px;
    background: rgba(20, 27, 36, .55);
    transition: background .2s ease;
}

.cepc-slider .cepc-prev:hover,
.cepc-slider .cepc-next:hover {
    background: var(--cepc-red);
}

.cepc-slider .cepc-dots button {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,.65);
}

.cepc-slider .cepc-dots button.active {
    background: var(--cepc-red);
}

/* Main content */
#middle {
    background: #fff;
}

#middle p {
    margin-bottom: 18px;
}

#middle h1,
#middle h2,
#middle h3 {
    margin-bottom: 18px;
}

/* Horizontal separators */
#middle hr {
    border: 0;
    border-top: 1px solid var(--cepc-border);
    margin: 28px 0;
}

/* Images */
#middle img {
    max-width: 100%;
    height: auto;
}

/* Buttons */
#middle .button,
#middle .cmsms_button,
#middle input[type="submit"],
#middle button[type="submit"] {
    display: inline-block;
    padding: 11px 22px;
    border: 0;
    border-radius: 5px;
    background: var(--cepc-red);
    color: #fff !important;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

#middle .button:hover,
#middle .cmsms_button:hover,
#middle input[type="submit"]:hover,
#middle button[type="submit"]:hover {
    background: var(--cepc-red-dark);
    transform: translateY(-1px);
}

/* Forms */
#middle input[type="text"],
#middle input[type="email"],
#middle input[type="tel"],
#middle input[type="search"],
#middle textarea,
#middle select {
    max-width: 100%;
    border: 1px solid #d9dee5;
    border-radius: 5px;
    padding: 11px 13px;
    background: #fff;
    color: var(--cepc-text);
    font-family: Arial, Helvetica, sans-serif;
}

#middle input:focus,
#middle textarea:focus,
#middle select:focus {
    outline: 2px solid rgba(213, 0, 40, .20);
    outline-offset: 1px;
}

/* Tables */
#middle table {
    border-collapse: collapse;
    width: 100%;
}

#middle th {
    background: var(--cepc-light);
    font-weight: 700;
}

#middle th,
#middle td {
    padding: 12px;
    border-bottom: 1px solid var(--cepc-border);
}

/* Footer */
#footer {
    font-family: Arial, Helvetica, sans-serif;
}

#footer a:hover {
    color: var(--cepc-red);
}

/* Responsive adjustments */
@media (max-width: 767px) {
    body {
        font-size: 14px;
    }

    h1 { font-size: 28px; }
    h2 { font-size: 23px; }
    h3 { font-size: 19px; }

    .cepc-slider {
        border-radius: 4px;
    }

    .cepc-slider .cepc-prev,
    .cepc-slider .cepc-next {
        padding: 8px;
        font-size: 17px;
    }

    #middle p {
        margin-bottom: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* =========================================================
   CEPC HOMEPAGE REDESIGN
   ========================================================= */

/* Wider, responsive content containers */
.content_wrap {
    width: 1100px;
    max-width: calc(100% - 48px);
}

/* Homepage content */
body.home #middle .content_wrap,
body.page-id-7 #middle .content_wrap {
    box-sizing: border-box;
}

/* Modern homepage typography */
body.page-id-7 #middle_content {
    font-size: 16px;
    line-height: 1.8;
}

body.page-id-7 #middle_content p {
    color: #48515c;
    line-height: 1.8;
}

/* Middle sidebar: four-card layout */
body.page-id-7 #sidebar_middle {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 20px;
    padding: 30px 0 45px;
    box-sizing: border-box;
}

/* Widget cards */
body.page-id-7 #sidebar_middle .widget {
    box-sizing: border-box;
    flex: 1 1 220px;
    min-width: 0;
    width: auto;
    margin: 0 !important;
    padding: 28px 24px;
    background: #f8f9fb;
    border: 1px solid #e6e9ed;
    border-top: 4px solid #d50028;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(20, 30, 45, .04);
    transition: box-shadow .2s ease, transform .2s ease;
}

body.page-id-7 #sidebar_middle .widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(20, 30, 45, .10);
}

/* Card headings */
body.page-id-7 #sidebar_middle .widgettitle,
body.page-id-7 #sidebar_middle .widget_title,
body.page-id-7 #sidebar_middle h3 {
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    color: #202833 !important;
    margin: 0 0 20px !important;
    padding-bottom: 12px;
    border-bottom: 1px solid #e1e5ea;
}

/* Card body */
body.page-id-7 #sidebar_middle .widget p,
body.page-id-7 #sidebar_middle .widget,
body.page-id-7 #sidebar_middle .textwidget {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.75;
    color: #515b67;
}

/* Card links */
body.page-id-7 #sidebar_middle a {
    color: #c90026;
    font-weight: 600;
    text-decoration: none;
}

body.page-id-7 #sidebar_middle a:hover {
    color: #96001c;
    text-decoration: underline;
}

/* Contact map */
body.page-id-7 #sidebar_middle img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-top: 12px;
}

/* Tablet */
@media (max-width: 900px) {
    .content_wrap {
        width: auto;
        max-width: calc(100% - 36px);
    }

    body.page-id-7 #sidebar_middle .widget {
        flex-basis: calc(50% - 10px);
    }
}

/* Mobile */
@media (max-width: 600px) {
    .content_wrap {
        max-width: calc(100% - 28px);
    }

    body.page-id-7 #sidebar_middle {
        display: block;
    }

    body.page-id-7 #sidebar_middle .widget {
        width: 100%;
        margin-bottom: 18px !important;
        padding: 24px 20px;
    }
}


/* =========================================================
   CEPC HOMEPAGE CARDS — CORRECTED
   Preserve Industrial theme's existing four-column layout
   ========================================================= */

body .middle_sidebar {
    width: 1100px;
    max-width: calc(100% - 48px);
    box-sizing: border-box;
    padding-top: 35px;
    padding-bottom: 55px;
    overflow: visible;
}

/* Restore the original theme's column positioning */
body .middle_sidebar_inner {
    display: block !important;
    margin: 0 -2%;
}

body .middle_sidebar_inner > .one_fourth {
    float: left !important;
    display: block !important;
    width: 21% !important;
    min-width: 0 !important;
    margin: 0 2% 20px !important;
    box-sizing: border-box;
}

/* Apply card appearance to the actual widget */
body .middle_sidebar_inner > .one_fourth > .widget {
    display: block !important;
    float: none !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100%;
    margin: 0 !important;
    padding: 24px 20px !important;
    box-sizing: border-box !important;

    background: #f8f9fb;
    border: 1px solid #e6e9ed;
    border-top: 4px solid #d50028;
    border-radius: 8px;

    box-shadow: 0 5px 18px rgba(20, 30, 45, .06);
    transition: box-shadow .2s ease, transform .2s ease;
}

body .middle_sidebar_inner > .one_fourth > .widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(20, 30, 45, .10);
}

body .middle_sidebar_inner .widgettitle {
    font-size: 18px !important;
    line-height: 1.35;
    margin: 0 0 18px !important;
    padding-bottom: 12px;
    border-bottom: 1px solid #e1e5ea;
}

body .middle_sidebar_inner .textwidget {
    overflow-wrap: anywhere;
    line-height: 1.7;
}

/* Tablet: two columns */
@media (max-width: 900px) {
    body .middle_sidebar {
        max-width: calc(100% - 36px);
    }

    body .middle_sidebar_inner > .one_fourth {
        width: 46% !important;
    }
}

/* Mobile: one column */
@media (max-width: 600px) {
    body .middle_sidebar {
        max-width: calc(100% - 28px);
    }

    body .middle_sidebar_inner > .one_fourth {
        float: none !important;
        width: 96% !important;
    }
}

/* Equal-height homepage cards */

body .middle_sidebar_inner {
    display: flex !important;
    flex-wrap: wrap;
    align-items: stretch;
}

body .middle_sidebar_inner > .one_fourth {
    float: none !important;
    display: flex !important;
    flex-direction: column;
}

body .middle_sidebar_inner > .one_fourth > .widget {
    flex: 1;
    height: auto;
}

/* =========================================================
   CEPC Contact Form 7 — Modern Contact Form
   ========================================================= */

.cepc-contact-form {
    width: 100%;
    max-width: 900px;
    margin: 0;
    padding: 0;
}

.cepc-form-intro {
    margin-bottom: 28px;
}

.cepc-form-intro h3 {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 600;
    color: #252525;
}

.cepc-form-intro p {
    margin: 0;
    color: #666;
    font-size: 15px;
    line-height: 1.7;
}

.cepc-contact-form .cepc-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 24px;
}

.cepc-contact-form .cepc-form-field {
    min-width: 0;
}

.cepc-contact-form .cepc-form-full {
    grid-column: 1 / -1;
}

.cepc-contact-form .cepc-form-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.cepc-contact-form .cepc-required {
    color: #b51f2b;
}

.cepc-contact-form .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

.cepc-contact-form input[type="text"],
.cepc-contact-form input[type="email"],
.cepc-contact-form input[type="tel"],
.cepc-contact-form textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 13px 15px;
    border: 1px solid #d7d7d7;
    border-radius: 5px;
    background: #fff;
    color: #333;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cepc-contact-form textarea {
    min-height: 160px;
    resize: vertical;
}

.cepc-contact-form input:focus,
.cepc-contact-form textarea:focus {
    outline: none;
    border-color: #b51f2b;
    box-shadow: 0 0 0 3px rgba(181, 31, 43, 0.10);
}

.cepc-contact-form input::placeholder,
.cepc-contact-form textarea::placeholder {
    color: #999;
}

.cepc-contact-form .cepc-form-actions {
    margin-top: 4px;
}

.cepc-contact-form input[type="submit"] {
    display: inline-block;
    width: auto;
    min-width: 170px;
    padding: 14px 28px;
    border: 0;
    border-radius: 5px;
    background: #b51f2b;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.cepc-contact-form input[type="submit"]:hover {
    background: #921923;
}

.cepc-contact-form .wpcf7-not-valid-tip {
    margin-top: 6px;
    font-size: 13px;
    color: #b51f2b;
}

@media (max-width: 650px) {
    .cepc-contact-form .cepc-form-grid {
        grid-template-columns: 1fr;
    }

    .cepc-contact-form .cepc-form-full {
        grid-column: 1;
    }
}


/* CEPC Contact Form — Width Adjustment */

.cepc-contact-form {
    max-width: 100%;
}


/* =========================================================
   CEPC Contact Information and Map
   ========================================================= */

.cepc-contact-details {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 30px;
    align-items: stretch;
    margin: 12px 0 38px;
    width: 100%;
}

.cepc-contact-info {
    padding: 30px;
    background: #f7f8fa;
    border: 1px solid #e4e6e9;
    border-top: 3px solid #b51f2b;
    border-radius: 6px;
}

.cepc-contact-info h3 {
    margin: 0 0 12px;
    font-size: 23px;
    color: #252b35;
}

.cepc-contact-description {
    margin: 0 0 24px;
    color: #666;
    line-height: 1.7;
}

.cepc-contact-item {
    margin-bottom: 20px;
}

.cepc-contact-item:last-child {
    margin-bottom: 0;
}

.cepc-contact-item strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #252b35;
}

.cepc-contact-item p {
    margin: 0;
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

.cepc-contact-item a {
    color: #b51f2b;
    text-decoration: none;
}

.cepc-contact-item a:hover {
    text-decoration: underline;
}

.cepc-contact-map {
    min-height: 350px;
    overflow: hidden;
    border: 1px solid #e4e6e9;
    border-radius: 6px;
}

.cepc-contact-map iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 350px;
}

@media (max-width: 700px) {
    .cepc-contact-details {
        grid-template-columns: 1fr;
    }
}


/* CEPC Contact Details — Spacing Refinement */

.cepc-contact-details {
    align-items: start;
}

.cepc-contact-info {
    padding: 28px 30px;
}

.cepc-contact-item {
    margin-bottom: 22px;
}

.cepc-contact-item strong {
    margin-bottom: 5px;
}

.cepc-contact-item p {
    margin: 0;
    line-height: 1.6;
}


/* CEPC Contact Details — Final Layout Correction */

.cepc-contact-details {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 30px;
    align-items: stretch;
}

.cepc-contact-details .cepc-contact-info {
    display: block;
    height: auto;
    min-height: 0;
    padding: 25px 30px;
}

.cepc-contact-details .cepc-contact-info h3 {
    margin: 0 0 12px;
}

.cepc-contact-details .cepc-contact-description {
    margin: 0 0 20px;
}

.cepc-contact-details .cepc-contact-item {
    display: block;
    height: auto;
    min-height: 0;
    margin: 0 0 18px;
    padding: 0;
}

.cepc-contact-details .cepc-contact-item:last-child {
    margin-bottom: 0;
}

.cepc-contact-details .cepc-contact-item strong {
    display: block;
    margin: 0 0 5px;
    padding: 0;
}

.cepc-contact-details .cepc-contact-item p {
    display: block;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.cepc-contact-details .cepc-contact-map {
    height: 400px;
    min-height: 400px;
}

.cepc-contact-details .cepc-contact-map iframe {
    height: 400px;
    min-height: 400px;
}


/* CEPC Contact Details — Equal Panel Heights */

.cepc-contact-details {
    align-items: stretch;
}

.cepc-contact-details .cepc-contact-info {
    box-sizing: border-box;
    height: 400px;
    min-height: 0;
    padding: 22px 30px;
}

.cepc-contact-details .cepc-contact-description {
    margin-bottom: 14px;
}

.cepc-contact-details .cepc-contact-item {
    margin-bottom: 12px;
}

.cepc-contact-details .cepc-contact-map {
    box-sizing: border-box;
    height: 400px;
    min-height: 0;
}

.cepc-contact-details .cepc-contact-map iframe {
    height: 100%;
    min-height: 0;
}


/* CEPC Contact Details — Content-Safe Equal Heights */

.cepc-contact-details {
    align-items: stretch;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.cepc-contact-details .cepc-contact-info {
    box-sizing: border-box;
    height: auto;
    min-height: 0;
    padding: 24px 30px;
}

.cepc-contact-details .cepc-contact-item {
    margin-bottom: 14px;
}

.cepc-contact-details .cepc-contact-item strong {
    margin-bottom: 4px;
}

.cepc-contact-details .cepc-contact-map {
    box-sizing: border-box;
    height: auto;
    min-height: 400px;
}

.cepc-contact-details .cepc-contact-map iframe {
    height: 100%;
    min-height: 400px;
}

