/*
Theme Name:   NEC OnePress Child
Theme URI:    https://nec.gov.ss/
Description:  Child theme for the National Elections Commission of South Sudan. Restores the two custom front-page sections (Civic & Voter Education, FAQ) and the hero slider position that existed on the pre-outage site, reconstructed from Internet Archive captures.
Author:       NEC Website Restoration
Template:     onepress
.9.0
Text Domain:  nec-onepress-child
*/

/* ============================================================
   CIVIC EDUCATION SECTION
   (recovered verbatim from the archived live stylesheet)
   ============================================================ */

.section-civic-education .section-title-area { text-align: center; margin-bottom: 60px; }

.section-civic-education .section-title {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: #333;
    text-transform: uppercase;
}

.section-civic-education .section-desc {
    max-width: 800px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.8;
    color: #666;
}

.resources-section {
    background: #ebf7fe;
    padding: 50px 40px;
    border-radius: 12px;
    margin: 40px 0 50px;
}

.resources-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    color: #333;
    text-align: center;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.resource-item {
    background: #fff;
    padding: 30px 25px;
    border-radius: 8px;
    border-left: 5px solid #00bcd4;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.resource-item:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,.12);
    transform: translateY(-5px);
    border-left-color: #667eea;
    text-decoration: none;
}

.resource-item h4 { font-size: 18px; margin: 0 0 12px; color: #333; font-weight: 600; }
.resource-item p  { font-size: 14px; color: #666; line-height: 1.7; margin: 0; }

.cta-section {
    text-align: center;
    margin-top: 60px;
    padding: 60px 40px;
    background: linear-gradient(135deg, #00a8cc 0%, #008ba3 100%);
    border-radius: 12px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%; right: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 70%);
    pointer-events: none;
}

.cta-title { font-size: 36px; font-weight: 700; margin: 0 0 20px; position: relative; z-index: 1; }

.cta-description {
    font-size: 18px;
    margin: 0 auto 35px;
    opacity: .95;
    max-width: 700px;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.cta-btn {
    padding: 16px 45px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s ease;
    text-decoration: none;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-btn-primary { background: #fff; color: #667eea; border: none; }
.cta-btn-primary:hover {
    background: #f0f0f0;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
    text-decoration: none;
    color: #667eea;
}

.cta-btn-secondary { background: transparent; color: #fff; border: 2px solid #fff; }
.cta-btn-secondary:hover {
    background: rgba(255,255,255,.15);
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
    text-decoration: none;
    color: #fff;
}

/* Responsive (as on the original site) */
@media (max-width: 991px) { .section-civic-education .section-title { font-size: 36px; } }
@media (max-width: 767px) {
    .section-civic-education .section-title { font-size: 28px; letter-spacing: 1px; }
    .section-civic-education .section-desc  { font-size: 16px; }
    .resources-section { padding: 35px 20px; }
    .cta-section { padding: 40px 20px; }
    .cta-title { font-size: 26px; }
    .cta-btn { padding: 14px 30px; }
}
@media (max-width: 480px) { .section-civic-education .section-title { font-size: 24px; } }

/* ============================================================
   FAQ SECTION wrapper (accordion itself is the Easy Accordion plugin)
   ============================================================ */
.section-faq .section-title-area { text-align: center; margin-bottom: 40px; }
.section-faq .faq-content { max-width: 900px; margin: 0 auto; }

/* Fallback FAQ markup (used only when no Easy Accordion shortcode is set) */
.nec-faq-item {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}
.nec-faq-item > summary {
    cursor: pointer;
    padding: 18px 22px;
    font-size: 17px;
    font-weight: 600;
    color: #333;
    list-style: none;
    position: relative;
    padding-right: 50px;
}
.nec-faq-item > summary::-webkit-details-marker { display: none; }
.nec-faq-item > summary::after {
    content: '+';
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: 400;
    color: #00a8cc;
}
.nec-faq-item[open] > summary::after { content: '\2013'; }
.nec-faq-item > summary:hover { background: #f7fbfd; }
.nec-faq-answer { padding: 0 22px 20px; color: #666; line-height: 1.8; }

/* ===========================================================
   NEC hero slideshow (replaces the archived Slider Revolution)
   =========================================================== */
.nec-hero {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    background: #1a1a1a;
}
.nec-hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}
.nec-hero-slide.is-active { opacity: 1; }
/* the 30% dark overlay the original hero used */
.nec-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.3);
    pointer-events: none;
}
@media (max-width: 991px) { .nec-hero { height: 420px; } }
@media (max-width: 767px) { .nec-hero { height: 300px; } }
@media (prefers-reduced-motion: reduce) { .nec-hero-slide { transition: none; } }

/* Footer — matches the archived onepress-style-inline-css exactly */
.site-footer .site-info,
.site-footer .btt a { background-color: #444444; }
.site-footer .site-info { color: #ffffff; }
.site-footer .btt a,
.site-footer .site-info a { color: #ffffff; }

/* Menu hover, as on the original */
@media screen and (min-width: 1140px) {
    .onepress-menu > li > a:hover,
    .onepress-menu > li.onepress-current-item > a { background: #03c4eb; color: #ffffff; }
}

/* ===========================================================
   Crest shown for articles with no photograph of their own.
   The image is swapped in functions.php; these rules constrain it
   to the same footprint a real thumbnail would occupy, so the crest
   sits centred at a sensible size instead of scaling to full width.
   TEMPORARY - remove together with the PHP block.
   =========================================================== */
img[src$="nec_logo_final_small.svg"].wp-post-image,
.list-article-thumb img[src$="nec_logo_final_small.svg"],
.entry-thumb img[src$="nec_logo_final_small.svg"],
.news-thumb img[src$="nec_logo_final_small.svg"] {
    display: block;
    width: 100%;
    height: 150px;          /* matches the height of real list thumbnails */
    max-height: 150px;
    object-fit: contain;    /* letterbox the crest, never crop or stretch */
    background-color: #f4fbfe;
    border: 1px solid #e3f1f8;
    padding: 18px;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .list-article-thumb img[src$="nec_logo_final_small.svg"],
    .entry-thumb img[src$="nec_logo_final_small.svg"],
    .news-thumb img[src$="nec_logo_final_small.svg"] {
        height: 150px;
        max-height: 150px;
        padding: 20px;
    }
}
/* ===========================================================
   Mobile header / banner alignment

   On narrow screens the logo rendered unconstrained and the site
   title had no clearance, so the title's first line collided with
   the logo's caption. This makes the branding a clean centred
   stack: logo, then name, with guaranteed separation.
   Desktop layout is untouched (scoped to <= 767px).
   =========================================================== */
@media (max-width: 767px) {

    .site-branding {
        float: none;
        width: 100%;
        max-width: 100%;
        text-align: center;
        padding: 14px 60px 14px 15px;  /* right padding clears the menu toggle */
        box-sizing: border-box;
        overflow: visible;
    }

    /* logo: constrained, centred, never oversized */
    .site-logo-div {
        display: block;
        float: none;
        margin: 0 auto;
        line-height: 0;
    }
    .site-logo-div img,
    .site-header .custom-logo {
        height: auto !important;
        max-height: 68px;
        width: auto;
        max-width: 78%;
        display: block;
        margin: 0 auto;
    }

    /* site name: below the logo, clear of it, sized to fit */
    .site-title {
        display: block;
        float: none;
        position: static;
        clear: both;
        margin: 12px auto 0;
        padding: 0;
        max-width: 100%;
        font-size: 15px;
        line-height: 1.35;
        letter-spacing: 0.3px;
        text-align: center;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: none;
    }
    .site-title a { display: block; }

    .site-description { text-align: center; margin-top: 4px; }

    /* keep the hamburger clear of the stacked branding */
    #header-section .site-header .menu-toggle,
    .site-header .menu-toggle {
        top: 18px;
        right: 12px;
    }
}

/* very narrow phones */
@media (max-width: 400px) {
    .site-title { font-size: 13.5px; }
    .site-logo-div img,
    .site-header .custom-logo { max-height: 58px; }
}

/* ---- nec-mobile-logo-only: banner shows logo only, left aligned ---- */
@media (max-width: 767px) {
    .site-header .container { position: relative; }
    .site-branding,
    .site-branding .site-brand-inner { text-align: left; }
    .site-branding { padding: 14px 70px 14px 0; }
    .site-logo-div img,
    .site-header .custom-logo,
    .site-branding img { margin-left: 0; margin-right: 0; max-width: 70%; max-height: 68px; }
    /* The commission name is carried by the logo alt text, so hide the heading visually only */
    .site-header .site-title {
        position: absolute !important;
        width: 1px; height: 1px;
        margin: -1px; padding: 0; border: 0;
        clip: rect(0 0 0 0); clip-path: inset(50%);
        overflow: hidden; white-space: nowrap;
    }
    /* OnePress uses #nav-toggle, not .menu-toggle: pull it onto the logo row */
    .site-header #nav-toggle {
        position: absolute;
        top: 50%;
        right: 0;
        margin: 0;
        float: none;
        transform: translateY(-50%);
    }
}
@media (max-width: 400px) {
    .site-logo-div img, .site-header .custom-logo { max-height: 58px; }
}

/* ---- nec-brand-colours: palette recovered from the archived nec.gov.ss ---- */
/* The original site carried these in a hand-edited copy of the OnePress parent
   style.css. The current OnePress ships its rules in theme.css instead, so a stock
   reinstall loses them. Kept here in the child theme so a theme update cannot wipe
   them again. Each value below was read off the Wayback capture, not guessed. */

/* Banner: pale NEC cyan, not white */
.site-header,
.is-transparent .site-header { background-color: #def4f5; }
.is-transparent .site-header.header-fixed { background-color: #c7eff1; }

/* Body copy: black. Stock OnePress uses #777 for this same selector. */
body,
button,
input,
select,
textarea { color: #000000; }

/* Primary menu links stay at the theme default #333333. The 16 Apr 2026 home-page
   capture shows #444444, but that comes from OnePress's transparent-header state
   (.is-transparent .no-scroll.site-header), which this site does not use; every inner
   page in the newest 16 May 2026 captures is #333333. */

/* Footer wrapper is unpainted; the .site-info bar inside it carries #444444 */
.site-footer { background-color: transparent; }

/* Contact section panel */
#contact { background-color: #f3f3f3; }


/* ---- nec-faq-heading: FAQ questions carry heading semantics ---- */
/* The archived site rendered each question as a heading, which gives the page a
   proper outline for screen readers and search engines. The disclosure widget
   supplies the visual styling, so the heading itself inherits everything. */
.nec-faq-item > summary > .nec-faq-q {
    display: inline;
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-transform: none;
}

/* ---- contact section: two-column info items, as archived ---- */
#contact .info-item { margin-bottom: 18px; }
#contact .info-item h3 {
    font-size: 16px;
    margin: 0 0 6px;
    color: #333333;
}
#contact .info-item p { margin: 0; }
