/**
 * piimarket — global styles (loaded on every page).
 */

/*--------------------------------------------------------------
  Design tokens
--------------------------------------------------------------*/
:root {
    --color-text: #14142b;
    --color-accent: #2f6bff;
    --color-muted: #6b7280;
    --color-border: #ececf2;
    --color-footer-bg: #2b2b2b;
    --color-footer-text: #d6d6d6;
    --color-footer-muted: #9a9a9a;
    --color-footer-border: rgba(255, 255, 255, 0.16);
    --container-max: 1280px;
    --header-height: 88px;
    --font-base: "Ubuntu", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    margin: 0;
    font-family: var(--font-base);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: #fff;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

/*--------------------------------------------------------------
  Layout
--------------------------------------------------------------*/
.container {
    width: 92%;
    max-width: var(--container-max);
    margin: 0 auto;
}

/* Main wrapper has no padding so templates can render full-bleed sections.
   Standard content templates add their own spacing via .content-area. */
.content-area {
    width: 92%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2.5rem 0;
}

/*--------------------------------------------------------------
  Header
--------------------------------------------------------------*/
.site-header {
    position: relative;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
}

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

/* Brand / logo */
.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand:hover,
.brand:focus {
    text-decoration: none;
}

.brand-logo {
    display: block;
    height: 40px;
    width: auto;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Collapsible group (nav + cta) */
.header-collapse {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 2rem;
}

/* Navigation */
.main-navigation {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: inline-block;
    color: var(--color-text);
    text-transform: uppercase;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
    color: var(--color-accent);
    text-decoration: none;
}

/* Sub-menus */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    display: none;
    min-width: 200px;
    margin: 0;
    padding: 0.5rem 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 30px rgba(20, 20, 43, 0.08);
}

.nav-menu li:hover > .sub-menu {
    display: block;
}

.nav-menu .sub-menu a {
    display: block;
    padding: 0.5rem 1.25rem;
}

/* CTA (right) */
.header-cta {
    flex: 0 0 auto;
}

.cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-accent);
    text-transform: uppercase;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: none;
    white-space: nowrap;
}

.cta-link::after {
    content: "\2197"; /* ↗ */
    font-size: 1.05em;
    line-height: 1;
}

.cta-link:hover,
.cta-link:focus {
    text-decoration: none;
    opacity: 0.75;
}

/* Mobile toggle */
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.menu-toggle-icon,
.menu-toggle-icon::before,
.menu-toggle-icon::after {
    content: "";
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle-icon::before {
    transform: translateY(-7px);
}

.menu-toggle-icon::after {
    transform: translateY(5px);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon::before {
    transform: translateY(0) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon::after {
    transform: translateY(-2px) rotate(-45deg);
}

/*--------------------------------------------------------------
  Footer
--------------------------------------------------------------*/
.site-footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    font-size: 0.95rem;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.4fr;
    gap: 2.5rem 3rem;
    padding: 4rem 0 3rem;
}

/* Brand column */
.footer-brand {
    display: inline-block;
    margin-bottom: 1.75rem;
}

.footer-brand img {
    display: block;
    height: 44px;
    width: auto;
}

.footer-address {
    max-width: 26rem;
    color: var(--color-footer-text);
    line-height: 1.7;
}

/* Column headings */
.footer-heading {
    margin: 0 0 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-footer-border);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Link lists (Forms / Links) */
.footer-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-list li {
    margin-bottom: 2rem;
}

.footer-list li:last-child {
    margin-bottom: 0;
}

.footer-list a {
    color: var(--color-footer-text);
    text-decoration: none;
}

.footer-list a:hover,
.footer-list a:focus {
    color: #fff;
    text-decoration: none;
}

/* Contact column */
.footer-contact {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.75rem;
}

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

.footer-contact-icon {
    flex: 0 0 auto;
    display: inline-flex;
    margin-top: 0.2rem;
}

.footer-contact-icon img {
    display: block;
    width: 18px;
    height: auto;
}

.footer-contact-label {
    color: var(--color-footer-text);
    line-height: 1.6;
}

/* Base bar — full-width divider, inset content */
.footer-base-bar {
    border-top: 1px solid var(--color-footer-border);
}

.footer-base {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 0;
    color: var(--color-footer-muted);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.footer-base-right {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-base-right a {
    color: var(--color-footer-muted);
    text-decoration: none;
}

.footer-base-right a:hover,
.footer-base-right a:focus {
    color: #fff;
    text-decoration: none;
}

/*--------------------------------------------------------------
  Accessibility
--------------------------------------------------------------*/
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    word-wrap: normal !important;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100000;
    padding: 0.5rem 1rem;
    background: #fff;
}

.skip-link:focus {
    left: 0;
}

/*--------------------------------------------------------------
  Scroll reveal (applied globally via js/scripts.js)
--------------------------------------------------------------*/
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/*--------------------------------------------------------------
  Responsive
--------------------------------------------------------------*/
@media (max-width: 900px) {
    .menu-toggle {
        display: inline-flex;
    }

    .header-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 99;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        padding: 1.5rem 4%;
        background: #fff;
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 10px 30px rgba(20, 20, 43, 0.08);
    }

    .header-collapse.is-open {
        display: flex;
    }

    .main-navigation {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        width: 100%;
    }

    .nav-menu .sub-menu {
        position: static;
        display: block;
        border: 0;
        box-shadow: none;
        padding: 0.25rem 0 0 1rem;
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 600px) {
    .footer-top {
        grid-template-columns: 1fr;
    }

    .footer-base {
        flex-direction: column;
        align-items: flex-start;
    }
}
