/*
 * Public site styles.
 *
 * Color tokens and the layout rhythm come from docs/design-conventions.md,
 * which extracts them from the reference site (infowellmanpower.com) — the
 * palette and shapes are matched, not invented.
 *
 * Self-hosted only: no CDN, no webfont service (docs/dependency-policy.md).
 * Lato and Orbitron are named first in the stacks below so they take effect
 * as soon as the .woff2 files land in /assets/fonts and an @font-face block
 * is added here; until then the system UI font is used rather than linking
 * fonts.googleapis.com, which the CSP would block anyway.
 *
 * The navigation, the header/footer content and the footer's legal line are
 * admin-managed data (Phases 15-17); this file styles whatever the Menus and
 * Appearance screens produce, and knows nothing about what is in it.
 */

:root {
    --color-accent: #FFC107;
    --color-accent-secondary: #0089F7;
    --color-overlay-dark: #090B14;
    --color-bg: #FFFFFF;
    --color-text: #000000;
    --color-text-muted: #626262;
    --color-border: #D9D9D9;
    --color-surface: #F5F5F5;
    --color-header-bg: #000000;
    --color-header-text: #FFFFFF;

    --radius-button: 15px;
    --space: 1rem;
    --container: 72rem;
    --header-height: 90px;
}

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--space);
}

a {
    color: var(--color-accent-secondary);
}

/* Header — logo left, nav right, dark background, full width. */

.site-header {
    background: var(--color-header-bg);
    border-bottom: 1px solid #333;
}

.site-header-inner {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space);
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
}

.site-brand {
    font-family: "Orbitron", "Lato", system-ui, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-header-text);
    text-decoration: none;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    margin-right: auto;
}

.site-logo {
    display: block;
    max-height: 56px;
    width: auto;
}

/*
 * Main navigation.
 *
 * A node with no destination renders as a <span> rather than an <a> — that is
 * how a section whose own page is not published in this language keeps its
 * sub-items without offering a link that 404s (App\Services\MenuService).
 *
 * The sub-menu is shown on hover AND on keyboard focus inside the item, so it
 * is reachable without a pointer. No JavaScript: nothing here needs it, and
 * the CSP has no 'unsafe-inline' for an inline handler anyway.
 */

.site-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--color-header-bg);
    border-bottom: 1px solid #333;
    display: none;
    z-index: 15;
}

.site-nav.is-open {
    display: block;
}

.site-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav-list > li {
    border-bottom: 1px solid #333;
}

.site-nav-list a,
.site-nav-list span {
    display: block;
    padding: 1rem var(--space);
    color: var(--color-header-text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.site-nav-list a:hover,
.site-nav-list a:focus-visible {
    color: var(--color-accent);
}

.site-nav-lang,
.site-nav-cta {
    padding: 1.5rem var(--space);
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #333;
}

.site-nav-cta .site-cta-link {
    color: var(--color-header-text);
}

.site-nav-list .submenu {
    position: static;
    display: block;
    border: none;
    padding-left: var(--space);
}

.site-header-aside {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.site-header-contact {
    display: flex;
    gap: 0.75rem;
    margin: 0;
    font-size: 0.875rem;
}

.site-header-contact a {
    color: #AAA;
    text-decoration: none;
}

.site-cta {
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

.site-cta-link {
    color: var(--color-header-text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.site-cta-link:hover,
.site-cta-link:focus-visible {
    color: var(--color-accent);
}

.site-nav-toggle {
    display: block;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 20;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-header-text);
    position: relative;
    transition: background 0.2s ease;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--color-header-text);
    left: 0;
    transition: all 0.2s ease;
}

.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

.site-nav-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.site-nav-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.site-nav-toggle[aria-expanded="true"] .hamburger::after {
    bottom: 0;
    transform: rotate(-45deg);
}

.site-language-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.language-switcher ul {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0.25rem;
    list-style: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.language-switcher a {
    display: block;
    padding: 0.25rem 1rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    border-radius: 15px;
    transition: all 0.2s ease;
}

.language-switcher a[aria-current="true"] {
    background: var(--color-bg);
    color: var(--color-text);
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.language-switcher a:hover,
.language-switcher a:focus-visible {
    color: var(--color-text);
}

/* Content */

.site-main {
    flex: 1 0 auto;
    padding-top: 2.5rem;
    padding-bottom: 3.5rem;
}

.page h1 {
    margin: 0 0 1.5rem;
    font-size: 2rem;
    line-height: 1.25;
}

/*
 * Rich content.
 *
 * These are the only elements App\Content\Renderer can emit — the block and
 * inline types App\Content\Document allows, and nothing else. A selector here
 * that matches nothing in that list is a selector for markup this site cannot
 * produce.
 *
 * Alignment arrives as .align-center / .align-right rather than as a style
 * attribute: the CSP has no 'unsafe-inline', which covers style attributes
 * too.
 */

.page-featured {
    margin: 0 0 1.5rem;
}

.page-featured img {
    display: block;
    width: 100%;
    height: auto;
}

.page-body > * {
    max-width: 44rem;
}

.page-body p {
    margin: 0 0 1.25rem;
}

.page-body h2,
.page-body h3,
.page-body h4 {
    margin: 2rem 0 0.75rem;
    line-height: 1.3;
}

.page-body h2 {
    font-size: 1.5rem;
}

.page-body h3 {
    font-size: 1.1875rem;
}

.page-body h4 {
    font-size: 1rem;
}

.page-body ul,
.page-body ol {
    margin: 0 0 1.25rem;
    padding-left: 1.5rem;
}

.page-body li {
    margin-bottom: 0.375rem;
}

.page-body blockquote {
    margin: 0 0 1.25rem;
    padding-left: 1.25rem;
    border-left: 3px solid var(--color-accent);
    color: var(--color-text-muted);
}

.page-body blockquote p:last-child {
    margin-bottom: 0;
}

.page-body a {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.page-body a:hover,
.page-body a:focus-visible {
    color: var(--color-accent-secondary);
}

.page-body hr {
    max-width: 44rem;
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid var(--color-border);
}

.page-body .content-image,
.page-body .content-video,
.page-body .content-facebook,
.page-body .content-map {
    margin: 0 0 1.5rem;
}

.page-body .content-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.page-body figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.page-body .content-image.align-center {
    margin-inline: auto;
}

.page-body .content-image.align-center figcaption {
    text-align: center;
}

/*
 * Image/video positioning (App\Content\Document::MEDIA_ALIGNMENTS).
 *
 * "left"/"right" float the figure so the surrounding text wraps beside it —
 * a forum/blog-editor style inline placement, not just an alignment of the
 * block itself. "full" breaks out of the 44rem reading column (.page-body >
 * * above) up to the width of the page's own container, for a piece that
 * should span the page. "center" (the default for anything newly inserted)
 * stays an ordinary centred block, unfloated.
 *
 * Clearing: a floated figure must not let a following heading run up
 * alongside it, and .page-body itself needs a clearfix so a float as the
 * last thing in the body is still contained (otherwise the page's own
 * height would stop short of it).
 */
.page-body .content-image.align-left,
.page-body .content-image.align-right,
.page-body .content-video.align-left,
.page-body .content-video.align-right,
.page-body .content-facebook.align-left,
.page-body .content-facebook.align-right,
.page-body .content-map.align-left,
.page-body .content-map.align-right {
    max-width: 45%;
}

.page-body .content-image.align-left,
.page-body .content-video.align-left,
.page-body .content-facebook.align-left,
.page-body .content-map.align-left {
    float: left;
    margin-right: 1.5rem;
}

.page-body .content-image.align-right,
.page-body .content-video.align-right,
.page-body .content-facebook.align-right,
.page-body .content-map.align-right {
    float: right;
    margin-left: 1.5rem;
}

.page-body > .content-image.align-full,
.page-body > .content-video.align-full,
.page-body > .content-facebook.align-full,
.page-body > .content-map.align-full {
    max-width: 100%;
}

.page-body h2,
.page-body h3,
.page-body h4 {
    clear: both;
}

.page-body::after {
    content: "";
    display: table;
    clear: both;
}

/* Below this width a floated figure no longer has room to sit beside text —
   it stacks full-width, in the same place in the flow it was inserted (i.e.
   directly above or below the paragraph it was floated against). */
@media (max-width: 40rem) {
    .page-body .content-image.align-left,
    .page-body .content-image.align-right,
    .page-body .content-video.align-left,
    .page-body .content-video.align-right,
    .page-body .content-facebook.align-left,
    .page-body .content-facebook.align-right,
    .page-body .content-map.align-left,
    .page-body .content-map.align-right {
        float: none;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

.page-body .content-video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000000;
}

/* Google's key-free embed renders fine at any box shape, so this stays a
   simple aspect ratio like video rather than a fixed height. */
.page-body .content-map-frame {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--color-border);
}

/*
 * The Facebook Page plugin is not an aspect-ratio-friendly embed — it lays
 * itself out to a fixed pixel height (passed in the plugin URL, App\Content\
 * Document's stored embed_url) rather than scaling to fill a box, so its
 * frame gets that same fixed height instead of the video/map aspect-ratio
 * trick.
 */
.page-body .content-facebook-frame {
    position: relative;
    height: 500px;
    overflow: hidden;
    background: var(--color-border);
}

.page-body .content-video-frame iframe,
.page-body .content-map-frame iframe,
.page-body .content-facebook-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* A wide table scrolls inside its own box rather than widening the page. */
.page-body .table-scroll {
    max-width: 100%;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.page-body table {
    border-collapse: collapse;
    min-width: 100%;
}

.page-body th,
.page-body td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
    border: 1px solid var(--color-border);
}

.page-body th {
    background: var(--color-surface);
    font-weight: 700;
}

.page-body .align-center {
    text-align: center;
}

.page-body .align-right {
    text-align: right;
}

/*
 * The admin preview banner. Never shown on a public request — SiteView only
 * receives a notice from PageAdminController::preview.
 */
.site-notice {
    margin: 0;
    padding: 0.625rem 1rem;
    text-align: center;
    background: var(--color-accent);
    font-size: 0.9375rem;
}

/* Footer — navigation repeated, contact details, and legal line. */

.site-footer {
    padding: 3rem 0;
    background: var(--color-header-bg);
    color: #AAA;
    font-size: 0.9375rem;
}

.site-footer p {
    margin: 0 0 0.5rem;
}

.site-footer-inner {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 3rem;
    align-items: flex-start;
}

.site-footer-column {
    flex: 0 1 auto;
}

@media (max-width: 40rem) {
    .site-footer-inner {
        flex-direction: column;
        text-align: start;
        gap: 2rem;
    }
}

.site-footer-nav {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-social {
    margin: 0 auto;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: center;
    gap: var(--space);
    flex-wrap: wrap;
}

.site-footer-social {
    margin-top: var(--space);
}

.site-footer-nav a,
.site-social a {
    color: #FFF;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.site-footer-nav a:hover,
.site-footer-nav a:focus-visible,
.site-social a:hover,
.site-social a:focus-visible {
    color: var(--color-accent);
}

.site-footer-nav .submenu {
    margin: 0.25rem 0 0.5rem 1rem;
    padding: 0;
    list-style: none;
}

.site-footer-contact {
    text-align: left;
}

.site-footer-company {
    font-weight: 700;
    color: #FFF;
    margin-bottom: 0.5rem;
}

.site-footer-contact p {
    margin: 0 0 0.25rem;
}

.site-footer-contact a {
    color: #FFF;
    text-decoration: none;
}

.site-footer-copyright {
    padding-top: 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid #333;
    font-size: 0.875rem;
    text-align: center;
}

/* Buttons — "stroke button": 1px border, 15px radius, tracked label. */

.button {
    display: inline-block;
    padding: 0.625rem 1.5rem;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: transparent;
    border: 1px solid var(--color-text);
    border-radius: var(--radius-button);
}

.button-primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

@media (min-width: 40rem) {
    .site-nav-toggle {
        display: none;
    }

    .site-nav {
        position: static;
        display: flex;
        align-items: center;
        background: transparent;
        border-bottom: none;
        width: auto;
        z-index: auto;
    }

    .site-nav-list {
        flex-direction: row;
        gap: var(--space);
    }

    .site-nav-list > li {
        border-bottom: none;
    }

    .site-nav-list a,
    .site-nav-list span {
        padding: 0;
        color: var(--color-header-text);
    }

    .site-nav-lang {
        display: none;
    }

    .site-header-lang {
        display: block;
    }
}

@media (max-width: 40rem) {
    .site-header-lang {
        display: none;
    }

    .site-nav-lang {
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 40rem) {
    :root {
        --header-height: 64px;
    }

    .site-logo {
        max-height: 40px;
    }

    .page h1 {
        font-size: 1.5rem;
    }
}
