/*
 * Palette sampled from Theme/Hithi/demo.png:
 *   #fd3c3d  – coral/red nav bar, headline accent, CTA buttons
 *   #20232a  – charcoal utility bar / footer
 *   #ffffff  – headline + nav text on dark backgrounds
 * Hero uses a near-black backdrop with a subtle red glow, mirroring
 * the moody gym photography in the reference screenshot.
 *
 * These are fallback values only. _header.php reads the real values from
 * Admin > Design > Theme options (ipGetThemeOption) and re-declares this
 * same :root block in an inline <style> after this file loads, so editors
 * can restyle the theme without touching CSS. The Google Font(s) picked
 * there are also loaded dynamically from _header.php instead of a fixed
 * @import here. The --nav-* variables default to the same colors as the
 * rest of the palette (nav-bg matches primaryColor, nav-text/nav-link-hover
 * are white) so an unconfigured site keeps its original look, but the
 * Navbar options group lets editors move the navbar's colors and sticky
 * behavior independently of --primary.
 */
:root {
    --bg: #f5f5f6;
    --surface: #ffffff;
    --text: #1a1a1a;
    --muted: #6b7280;
    --primary: #fd3c3d;
    --primary-dark: #d81f22;
    --primary-rgb: 253, 60, 61;
    --dark: #14161b;
    --dark-alt: #20232a;
    --border: #e7e7ea;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
    --font-heading: "Poppins", "Segoe UI", Arial, sans-serif;
    --font-body: "Segoe UI", Arial, sans-serif;
    --nav-bg: #fd3c3d;
    --nav-text: #ffffff;
    --nav-link-hover: #ffffff;
    --nav-position: sticky;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

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

::selection {
    background: var(--primary);
    color: #fff;
}

.container {
    width: min(1160px, calc(100% - 2rem));
    margin: 0 auto;
}

/* ---------- Header / nav ---------- */

.site-header {
    position: var(--nav-position, sticky);
    top: 0;
    z-index: 30;
    background: var(--nav-bg);
    color: var(--nav-text);
    padding: 1rem 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--nav-text);
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.brand:hover {
    color: var(--nav-text);
    opacity: 0.9;
}

/* Logo is an image slot (see main.php/home.php) so it can be replaced with
   the client's real logo file through the CMS; this sizes whatever image
   is uploaded to fit the header bar while keeping its own aspect ratio. */
.brand-logo {
    display: block;
    height: 40px;
    width: auto;
    max-width: 220px;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.85rem;
    flex-wrap: wrap;
}

.main-nav li a {
    display: inline-block;
    color: var(--nav-text);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.4rem 0.05rem;
    border-bottom: 2px solid transparent;
}

.main-nav li a:hover,
.main-nav li.active > a,
.main-nav li.currentPage > a {
    color: var(--nav-link-hover);
    border-bottom-color: var(--nav-link-hover);
}

/* Hamburger button: hidden on desktop, shown at the mobile breakpoint below.
   Sits after .main-nav in the header markup but is pinned to the right via
   header-inner's flex layout either way. */
.nav-toggle {
    display: none;
    flex-shrink: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle:focus {
    background: transparent;
    border: 0;
    transform: none;
}

.nav-toggle-bar {
    display: block;
    width: 26px;
    height: 3px;
    border-radius: 2px;
    background: var(--nav-text);
    transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Turns the three bars into an "X" once the drawer is open. */
.nav-toggle.is-active .nav-toggle-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Dimmed backdrop behind the mobile drawer; only shown/positioned once the
   nav breakpoint kicks in. */
.nav-overlay {
    display: none;
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    background: var(--dark);
    color: #fff;
    text-align: center;
    padding: 6rem 0 5rem;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(var(--primary-rgb), 0.16), transparent 60%),
        linear-gradient(160deg, #1c1f26 0%, #0a0b0e 65%, #000 100%);
    z-index: 0;
}

/* Home/Main layouts only: the Page Image plugin lets each page assign its
   own hero photo (see the inline background-image style in home.php/
   main.php); this just positions and crops whatever URL lands there,
   falling back to the theme's own dark background if none is set. The
   scrim keeps the heading/paragraph readable over any photo. */
.hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(var(--primary-rgb), 0.14), transparent 60%),
        linear-gradient(160deg, rgba(10, 11, 14, 0.55) 0%, rgba(0, 0, 0, 0.72) 65%, rgba(0, 0, 0, 0.88) 100%);
}

.hero .container {
    position: relative;
    z-index: 1;
    /* Block layout (not flex) so h1/p shrink to the viewport instead of
       overflowing it — a flex row + align-items:center would size these
       to their unwrapped max-content width on narrow screens. */
}

.hero h1 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.01em;
    font-size: clamp(2.1rem, 4.4vw, 3.6rem);
    line-height: 1.12;
    margin: 0 auto;
    max-width: 820px;
    color: #fff;
}

.hero h1::before {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background: var(--primary);
    margin: 0 auto 1.75rem;
}

.hero p {
    margin: 1.1rem auto 0;
    font-size: 1.05rem;
    max-width: 680px;
    color: rgba(255, 255, 255, 0.78);
}

.hero .btn {
    margin-top: 1.6rem;
}

/* ---------- Buttons ---------- */

.btn,
button,
input[type="submit"],
input[type="button"] {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    background: var(--primary);
    color: #fff;
    border: 2px solid var(--primary);
    border-radius: 0;
    padding: 0.95rem 2.1rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

.btn-outline:hover {
    background: #fff;
    border-color: #fff;
    color: var(--primary);
}

/* ---------- Main content ---------- */

.content-section {
    padding: 2.75rem 0 3.25rem;
}

.content-section .container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
    padding: 2rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col-12, .col-8, .col-4 {
    padding: 0 0.75rem;
    width: 100%;
}

.col-8 {
    width: 66.666%;
}

.col-4 {
    width: 33.333%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.25;
    margin-top: 0;
    font-weight: 700;
    color: #111318;
}

.content-section h2 {
    position: relative;
    padding-top: 1.25rem;
}

.content-section h2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 48px;
    height: 4px;
    background: var(--primary);
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
    background: var(--dark-alt);
    color: #d7d9dd;
    padding: 2.6rem 0 1.5rem;
    border-top: 3px solid var(--primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.footer-block {
    padding: 1rem 0;
}

.footer-block h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-block h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 32px;
    height: 3px;
    background: var(--primary);
}

.footer-block p,
.footer-block li,
.footer-block a {
    color: rgba(215, 217, 221, 0.85);
}

.footer-block a:hover {
    color: var(--primary);
}

/* Reuses the same menu1 slot as the header nav (see main.php/home.php),
   so it needs its own list layout instead of .main-nav's horizontal row. */
.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer-nav li a {
    display: inline-block;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

.footer-bottom {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(215, 217, 221, 0.6);
}

/* ---------- Responsive ---------- */

/* Desktop is the default (unprefixed) styling above; everything below this
   point is the mobile/tablet layer. Breakpoint matches where the header
   nav switches from an inline row to the hamburger + right-side drawer. */
@media (max-width: 900px) {
    .content-section .container {
        padding: 1.5rem;
    }

    .col-8,
    .col-4 {
        width: 100%;
    }

    .nav-toggle {
        display: inline-flex;
    }

    /* Off-canvas panel: sits above everything, slides in from the right. */
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 26;
        width: min(80%, 320px);
        height: 100vh;
        margin: 0;
        overflow-y: auto;
        background: var(--dark-alt);
        box-shadow: -16px 0 40px rgba(0, 0, 0, 0.35);
        padding: 5.5rem 1.75rem 2rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .main-nav.is-open {
        transform: translateX(0);
    }

    .main-nav ul {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
    }

    .main-nav li a {
        display: block;
        padding: 0.9rem 0;
        font-size: 0.95rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* Backdrop behind the drawer; fades in/out and blocks page scroll. */
    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 25;
        background: rgba(10, 11, 14, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .nav-overlay.is-visible {
        opacity: 1;
        visibility: visible;
    }

    body.nav-open {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 3.6rem 0 3rem;
    }

    .hero h1::before {
        margin-bottom: 1.25rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        width: min(100% - 1.25rem, 1120px);
    }

    .content-section .container {
        padding: 1.1rem;
        border-radius: 4px;
    }

    .main-nav {
        width: 85%;
    }
}
