/*
Theme Name: Sunshine Energy
Author: Sunshine Energy Development
Description: Custom Sunshine Energy WordPress theme with reusable Gutenberg components.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: sunshine-energy
*/
:root {
    --se-navy: #101b35;
    --se-mint: #9ce5c9;
    --se-ink: #17233b;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #fff;
    color: var(--se-ink);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

.se-page-content {
    min-height: 45vh;
}


/* ==========================================
   Sunshine Energy — Reusable Content Grid
   ========================================== */

.se-content-grid {
    width: min(1200px, calc(100% - 48px));
    max-width: 1200px;
    margin-left: auto !important;
    margin-right: auto !important;
    gap: 18px;
    align-items: stretch;
}

/* Ensure cards fill their columns */
.se-content-grid>.wp-block-column {
    min-width: 0;
    display: flex;
}

.se-content-grid>.wp-block-column>* {
    width: 100%;
    min-width: 0;
}

/* Mobile */
@media (max-width: 600px) {
    .se-content-grid {
        width: calc(100% - 36px);
    }
}

/* Reusable spacing between homepage sections */
.se-section-spacing {
    margin-top: 48px !important;
}


/* ============================================================
   Sunshine Energy — Common Outline Back Button
   ============================================================ */

/* Common button container */
.wp-block-buttons.sunshine-back-button-outline {
    box-sizing: border-box;
    width: min(1100px, calc(100% - 48px));
    max-width: 1100px;
    margin: 40px auto 64px;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Blog pages: match the 840px reading column */
body.single-post .se-structured-article>.wp-block-buttons.sunshine-back-button-outline {
    width: min(100%, 840px);
    max-width: 840px;
    margin: 24px auto 48px;
}

/* Button wrapper */
.sunshine-back-button-outline .wp-block-button {
    width: auto;
    flex: 0 0 auto;
}

/* Outline button */
.sunshine-back-button-outline .wp-block-button__link {
    box-sizing: border-box;
    display: inline-block;
    width: auto;
    min-width: 0;
    padding: 12px 24px;
    background-color: #ffffff;
    color: #101b35;
    border: 2px solid #101b35;
    border-radius: 999px;
    font: 500 15px/1.4 Arial, Helvetica, sans-serif;
    text-align: center;
    text-decoration: none;
    transition:
        background-color 0.22s ease,
        border-color 0.22s ease,
        color 0.22s ease,
        transform 0.22s ease;
}

/* Hover */
@media (hover: hover) and (pointer: fine) {
    .sunshine-back-button-outline .wp-block-button__link:hover {
        background-color: #9ce5c9;
        border-color: #9ce5c9;
        color: #101b35;
        transform: translateY(-3px);
    }
}

/* Keyboard accessibility */
.sunshine-back-button-outline .wp-block-button__link:focus-visible {
    outline: 3px solid #101b35;
    outline-offset: 4px;
}

/* Mobile */
@media (max-width: 600px) {
    .wp-block-buttons.sunshine-back-button-outline {
        width: calc(100% - 36px);
        margin-top: 28px;
        margin-bottom: 40px;
    }

    body.single-post .se-structured-article>.wp-block-buttons.sunshine-back-button-outline {
        width: 100%;
        margin-top: 20px;
        margin-bottom: 36px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sunshine-back-button-outline .wp-block-button__link {
        transition: none;
    }

    .sunshine-back-button-outline .wp-block-button__link:hover {
        transform: none;
    }
}


/* ============================================================
   Sunshine Energy — Site Header
   ============================================================ */

.se-site-header {
    position: relative;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid #e2e7e9;
}

.se-site-header__inner {
    box-sizing: border-box;
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

/* Logo */
.se-site-header__brand {
    flex: 0 0 auto;
}

.se-site-header__brand .custom-logo-link {
    display: block;
    line-height: 0;
}

.se-site-header__brand .custom-logo {
    display: block;
    width: auto;
    max-width: 165px;
    max-height: 64px;
    height: auto;
}

.se-brand {
    display: block;
    color: var(--se-navy);
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
}

.se-tagline {
    font-size: 11px;
    color: #536174;
}

/* Desktop navigation */
.se-header-nav {
    margin-left: auto;
}

.se-header-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 26px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.se-header-menu li {
    list-style: none;
}

.se-header-menu a {
    display: inline-block;
    padding: 10px 0;
    color: var(--se-navy);
    font: 600 13px/1.4 Arial, Helvetica, sans-serif;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition:
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

/* Header hover animation */
@media (hover: hover) and (pointer: fine) {
    .se-header-menu a:hover {
        color: #268b72;
        transform: translateY(-3px);
    }
}

/* Active navigation */
.se-header-menu .current-menu-item>a,
.se-header-menu .current_page_item>a,
.se-header-menu .current-menu-ancestor>a {
    border-bottom-color: #268b72;
}

/* Let's talk — outlined navigation button */
.se-header-menu .se-nav-contact>a {
    padding: 11px 18px;
    border: 1px solid var(--se-navy);
    border-radius: 0;
    font-weight: 600;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    .se-header-menu .se-nav-contact>a:hover {
        background: var(--se-mint);
        color: var(--se-navy);
        border-color: var(--se-mint);
        transform: translateY(-3px);
    }
}

/* Mobile menu hidden on desktop */
.se-mobile-nav {
    display: none;
}

/* ============================================================
   Responsive Header Navigation
   ============================================================ */

@media (max-width: 1024px) {
    .se-site-header__inner {
        min-height: 72px;
    }

    .se-header-nav {
        display: none;
    }

    .se-mobile-nav {
        display: block;
        position: relative;
        margin-left: auto;
    }

    .se-mobile-nav__toggle {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px;
        color: var(--se-navy);
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        list-style: none;
    }

    .se-mobile-nav__toggle::-webkit-details-marker {
        display: none;
    }

    .se-mobile-nav__icon {
        display: block;
        width: 22px;
        height: 14px;
        border-top: 2px solid var(--se-navy);
        border-bottom: 2px solid var(--se-navy);
    }

    .se-mobile-nav nav {
        position: absolute;
        top: calc(100% + 12px);
        right: 0;
        width: min(320px, calc(100vw - 36px));
        padding: 12px 20px;
        background: #ffffff;
        border: 1px solid #e2e7e9;
        box-shadow: 0 12px 30px rgba(16, 27, 53, .12);
    }

    .se-mobile-menu {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .se-mobile-menu li {
        list-style: none;
        border-bottom: 1px solid #eef1f2;
    }

    .se-mobile-menu li:last-child {
        border-bottom: 0;
    }

    .se-mobile-menu a {
        display: block;
        padding: 14px 0;
        color: var(--se-navy);
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        transition:
            color 0.25s ease,
            transform 0.25s ease;
    }

    .se-mobile-menu .current-menu-item>a,
    .se-mobile-menu .current_page_item>a {
        color: #268b72;
    }

    @media (hover: hover) and (pointer: fine) {
        .se-mobile-menu a:hover {
            color: #268b72;
            transform: translateX(5px);
        }
    }

    .se-mobile-menu .se-nav-contact>a {
        text-align: center;
        margin: 12px 0;
        padding: 12px 18px;
        border: 1px solid var(--se-navy);
    }
}

@media (max-width: 600px) {
    .se-site-header__inner {
        width: calc(100% - 36px);
        min-height: 68px;
        gap: 16px;
    }

    .se-site-header__brand .custom-logo {
        max-width: 140px;
        max-height: 54px;
    }
}

/* ============================================================
   Sunshine Energy — Site Footer
   ============================================================ */

.se-site-footer {
    background: #19273b;
    color: #ffffff;
}

.se-site-footer__inner {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
}

/* Main footer */
.se-footer-main {
    display: grid;
    grid-template-columns: 1.4fr 1fr .85fr 1.2fr;
    gap: 50px;
    padding: 56px 0 42px;
    align-items: start;
}

/* Brand */
.se-footer-brand__name {
    display: inline-block;
    color: #ffffff;
    font: 700 30px/1.2 Arial, Helvetica, sans-serif;
    text-decoration: none;
    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    .se-footer-brand__name:hover {
        color: #9ce5c9;
        transform: translateY(-2px);
    }
}

.se-footer-brand__tagline {
    color: #9ce5c9;
    font-size: 13px;
    margin-top: 4px;
}

.se-footer-brand p {
    margin: 28px 0 0;
    max-width: 310px;
    color: #d9e0ea;
    font-size: 15px;
    line-height: 1.65;
}

/* Footer column headings */
.se-footer-column h2,
.se-footer-acknowledgement h2 {
    margin: 0 0 22px;
    color: #ffffff;
    font: 700 13px/1.4 Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    letter-spacing: .12em;
}

/* Footer navigation lists */
.se-footer-links,
.se-footer-legal-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.se-footer-links li {
    margin-bottom: 10px;
}

/* Footer links */
.se-footer-links a,
.se-footer-legal-links a {
    display: inline-block;
    color: #d9e0ea;
    font: 400 15px/1.5 Arial, Helvetica, sans-serif;
    text-decoration: none;
    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

/* Footer hover animation */
@media (hover: hover) and (pointer: fine) {

    .se-footer-links a:hover,
    .se-footer-legal-links a:hover {
        color: #9ce5c9;
        transform: translateX(5px);
    }
}

/* Keyboard accessibility */
.se-footer-links a:focus-visible,
.se-footer-legal-links a:focus-visible {
    color: #9ce5c9;
    outline: 2px solid #9ce5c9;
    outline-offset: 4px;
}

/* Acknowledgement */
.se-footer-acknowledgement {
    padding-left: 32px;
    border-left: 1px solid rgba(255, 255, 255, .15);
}

.se-footer-acknowledgement h2::after {
    content: "";
    display: block;
    width: 36px;
    height: 3px;
    margin-top: 12px;
    background: #9ce5c9;
}

.se-footer-acknowledgement p {
    color: #d9e0ea;
    font-size: 15px;
    line-height: 1.7;
    margin: 0;
}

/* Footer bottom */
.se-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 24px 0;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.se-footer-copyright {
    margin: 0;
    color: #d9e0ea;
    font-size: 13px;
}

.se-footer-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.se-footer-legal-links a {
    font-size: 13px;
}

/* ============================================================
   Responsive Footer
   ============================================================ */

@media (max-width: 1024px) {
    .se-footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 36px;
    }

    .se-footer-acknowledgement {
        padding-left: 0;
        border-left: 0;
    }
}

@media (max-width: 600px) {
    .se-site-footer__inner {
        width: calc(100% - 36px);
    }

    .se-footer-main {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 44px 0 32px;
    }

    .se-footer-brand__name {
        font-size: 26px;
    }

    .se-footer-brand p {
        margin-top: 20px;
    }

    .se-footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }

    .se-footer-legal-links {
        gap: 16px;
    }
}

/* ============================================================
   Reduced Motion Accessibility
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    .se-header-menu a,
    .se-header-menu .se-nav-contact>a,
    .se-mobile-menu a,
    .se-footer-brand__name,
    .se-footer-links a,
    .se-footer-legal-links a {
        transition: none;
    }

    .se-header-menu a:hover,
    .se-header-menu .se-nav-contact>a:hover,
    .se-mobile-menu a:hover,
    .se-footer-brand__name:hover,
    .se-footer-links a:hover,
    .se-footer-legal-links a:hover {
        transform: none;
    }
}

/* ============================================================
   Sunshine Energy — Optional Section Spacing
   Adds controlled vertical spacing to selected Gutenberg
   sections when WordPress's default block gaps are removed.

   Apply 'se-section-gap-sm' under:
   Block → Advanced → Additional CSS Class(es)
   ============================================================ */

.se-section-gap-sm {
    margin-top: 28px !important;
    margin-bottom: 8px !important;
}

/* ============================================================
   Sunshine Energy — Header Navigation CTA
   Styles the "Let's talk" menu item as an outlined button.
   Applied only to menu items with the 'se-nav-cta' class.
   ============================================================ */

.se-nav-cta>a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px !important;
    border: 1px solid var(--wp--preset--color--navy, #101b35);
    border-radius: 8px;
    color: var(--wp--preset--color--navy, #101b35);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.se-nav-cta>a:hover,
.se-nav-cta>a:focus-visible {
    background-color: var(--wp--preset--color--navy, #101b35);
    color: #ffffff !important;
}

/* ============================================================
   Sunshine Energy — Mobile Navigation CTA
   Displays the "Let's talk" menu item as a full-width button
   inside the mobile dropdown, while preserving the outlined
   desktop navigation button.
   ============================================================ */

@media (max-width: 768px) {

    /* Ensure the CTA occupies the full menu width */
    .se-nav-cta {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box;
        margin-top: 12px !important;
    }

    /* Mobile CTA button */
    .se-nav-cta>a {
        display: flex !important;
        width: 100% !important;
        box-sizing: border-box;
        padding: 12px 18px !important;
        min-height: 44px;
        justify-content: center;
        text-align: center;

        background-color: var(--wp--preset--color--navy, #101b35);
        color: #ffffff !important;

        border: 1px solid var(--wp--preset--color--navy, #101b35);
        border-radius: 8px;
    }

    /* Hover and keyboard focus */
    .se-nav-cta>a:hover,
    .se-nav-cta>a:focus-visible {
        background-color: var(--wp--preset--color--dark-green, #23745b);
        border-color: var(--wp--preset--color--dark-green, #23745b);
        color: #ffffff !important;
    }
}

/* ============================================================
   Sunshine Energy — Projects CTA Spacing
   Removes unwanted spacing above the shared Call to Action
   on both individual project pages and the main Projects page.
   Does not affect CTA sections on other website pages.
   ============================================================ */

body.single-se_project .se-cta,
body.page .se-projects-listing+.se-cta {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
}

/* Sunshine Energy — Smooth Scrolling */
html {
    scroll-padding-top: 80px;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }
}