/*
 * Theme Name:  Reload Personal Training
 * Theme URI:   https://www.reload-personal-training.at
 * Author:      NetriX GmbH
 * Author URI:  https://www.netrix.ch
 * Description: Custom WordPress theme for Reload Personal Training — BGM & Personal Training
 * Version:     1.0.0
 * License:     Proprietary
 * License URI: https://www.reload-personal-training.at
 * Text Domain: reload-pt
 * Requires PHP: 8.0
 * Requires at least: 6.5
 * Tested up to: 7.0
 * Tags: personal-training, bgm, fitness, custom-theme
 */

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Reference)
   ==========================================================================
   Mobile-first approach — default styles target mobile.

   --bp-sm:  480px   — Small phones → larger phones
   --bp-md:  768px   — Phones → tablets
   --bp-lg:  1024px  — Tablets → desktops
   --bp-xl:  1280px  — Desktops → large desktops
   --bp-2xl: 1536px  — Large desktops → ultra-wide
   ========================================================================== */

/* ==========================================================================
   CSS CUSTOM PROPERTIES
   ========================================================================== */

:root {
    /* ── Colors ─────────────────────────────────────────────────────────── */
    --color-primary: #65AF02;
    --color-primary-hover: #559402;
    --color-primary-light: #AAD76E;
    --color-accent: #4B02AF;
    --color-accent-hover: #3a028a;

    /* Neutrals */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-600: #4b5563;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    --color-white: #ffffff;
    --color-black: #000000;

    /* Semantic */
    --color-success: #16a34a;
    --color-warning: #f59e0b;
    --color-error: #dc2626;

    /* ── Typography ─────────────────────────────────────────────────────── */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;

    --fs-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --fs-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
    --fs-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --fs-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
    --fs-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --fs-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
    --fs-3xl: clamp(1.875rem, 1.4rem + 2.4vw, 2.5rem);
    --fs-4xl: clamp(2.25rem, 1.5rem + 3.75vw, 3.5rem);
    --fs-5xl: clamp(3rem, 2rem + 5vw, 4.5rem);

    --lh-tight: 1.2;
    --lh-normal: 1.6;
    --lh-relaxed: 1.8;

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* ── Spacing ────────────────────────────────────────────────────────── */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    --section-padding: clamp(4rem, 8vw, 8rem);
    --container-max: 1280px;

    /* ── Borders & Radii ────────────────────────────────────────────────── */
    --radius-sm: 0.75rem;
    --radius-md: 1.5rem;
    --radius-lg: 2rem;
    --radius-xl: 2.5rem;
    --radius-full: 9999px;

    /* ── Glassmorphism ──────────────────────────────────────────────────── */
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-blur: 12px;

    /* ── Shadows ─────────────────────────────────────────────────────────── */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.08);

    /* ── Z-Index Scale ──────────────────────────────────────────────────── */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-header: 300;
    --z-overlay: 400;
    --z-modal: 500;
    --z-toast: 600;

    /* ── Transitions ────────────────────────────────────────────────────── */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ==========================================================================
   CSS RESET (Modern Minimal)
   ========================================================================== */

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

/* Prevent font size inflation on mobile */
html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    scroll-behavior: smooth;
}

/* Remove default margin in favour of better control in authored CSS */
body,
h1, h2, h3, h4, h5, h6,
p,
figure,
blockquote,
dl, dd {
    margin-block-end: 0;
}

/* Remove list styles on ul, ol elements with a list role (keeps default for nav/etc.) */
ul[role='list'],
ol[role='list'] {
    list-style: none;
}

/* Set core body defaults */
body {
    min-height: 100vh;
    line-height: var(--lh-normal);
}

/* Balance headings across multiple lines */
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
    text-decoration-skip-ink: auto;
    color: currentColor;
}

/* Make images easier to work with */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
    min-height: 10em;
}

/* Anything with an anchor target should have scroll margin */
:target {
    scroll-margin-block: 5ex;
}

/* Remove all animations and transitions for people who prefer not to see them */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   SELECTION COLOR
   ========================================================================== */

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

::-moz-selection {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* ==========================================================================
   BASE TYPOGRAPHY
   ========================================================================== */

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);
    color: var(--color-gray-800);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* ── Full-width resets — override any WP core block styles ─────────── */
.site-main,
.home-page,
.page-content {
    width: 100%;
    max-width: 100% !important;
    margin: 0;
    padding: 0;
}

/* Force hero to break out of any constrained parent */
.hero {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
}

/* Override WordPress block-library max-width on all our sections */
.home-page > section,
.page-content > section,
.site-main > section,
.site-main > .home-page,
.site-main > .page-content {
    max-width: 100% !important;
}

/* ── Headings ───────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--color-gray-900);
}

h1 {
    font-size: var(--fs-5xl);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--fs-4xl);
    letter-spacing: -0.015em;
}

h3 {
    font-size: var(--fs-3xl);
}

h4 {
    font-size: var(--fs-2xl);
}

h5 {
    font-size: var(--fs-xl);
}

h6 {
    font-size: var(--fs-lg);
}

/* ── Paragraphs ─────────────────────────────────────────────────────── */

p {
    margin-block-end: var(--space-md);
    max-width: 75ch; /* Optimal reading width */
}

p:last-child {
    margin-block-end: 0;
}

/* ── Links ──────────────────────────────────────────────────────────── */

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover,
a:focus-visible {
    color: var(--color-primary-hover);
}

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── Lists ──────────────────────────────────────────────────────────── */

ul, ol {
    padding-inline-start: var(--space-lg);
    margin-block-end: var(--space-md);
}

ul:last-child,
ol:last-child {
    margin-block-end: 0;
}

li {
    margin-block-end: var(--space-xs);
}

li::marker {
    color: var(--color-primary);
}

/* ── Strong, em, small ──────────────────────────────────────────────── */

strong, b {
    font-weight: var(--fw-bold);
}

small {
    font-size: var(--fs-sm);
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

/* ── Container ──────────────────────────────────────────────────────── */

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

@media (min-width: 768px) {
    .container {
        padding-inline: var(--space-xl);
    }
}

/* ── Section Padding ────────────────────────────────────────────────── */

.section {
    padding-block: var(--section-padding);
}
.section--white {
    background-color: #ffffff;
}
.section--gray {
    background-color: var(--color-bg-alt, #f5f6f8);
}

/* Stats bar */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xl, 3rem);
    text-align: center;
}
.stats-bar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.stats-bar--left {
    justify-content: flex-start;
    text-align: left;
}
.stats-bar--left .stats-bar__item {
    text-align: left;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.875rem 2rem;
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

.btn:active {
    transform: scale(0.98);
}

/* ── Primary Button ─────────────────────────────────────────────────── */

.btn--primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn--primary:hover,
.btn--primary:focus-visible {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--color-white);
}

/* ── Secondary Button ───────────────────────────────────────────────── */

.btn--secondary {
    background-color: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* ── Ghost Button ───────────────────────────────────────────────────── */

.btn--ghost {
    background-color: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
    background-color: var(--color-white);
    color: var(--color-gray-900);
}

/* ── Accent Button ──────────────────────────────────────────────────── */

.btn--accent {
    background-color: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}

.btn--accent:hover,
.btn--accent:focus-visible {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: var(--color-white);
}

/* ==========================================================================
   GLASSMORPHISM CARD
   ========================================================================== */

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--shadow-glass);
    padding: var(--space-xl);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Screen-reader only: visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip to main content link (used in header) */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    z-index: var(--z-toast);
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-primary);
    color: var(--color-white);
    font-weight: var(--fw-semibold);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    transition: top var(--transition-fast);
}

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