/* ==========================================================================
   Global Styles — Tree of Life Wellness Theme
   ========================================================================== */

/* ---- Box‑sizing Reset ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ---- Root Font Size (62.5 % → 1 rem = 10 px) ---- */
html {
    font-size: 62.5%;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);
    color: var(--color-text-dark);
    background-color: var(--color-white);
    overflow-x: hidden;
}

/* ---- Focus Visible ---- */
:focus-visible {
    outline: 2px solid var(--color-sage);
    outline-offset: 2px;
}

/* ---- Skip Link ---- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1.6rem;
    z-index: 10000;
    padding: 0.8rem 1.6rem;
    background: var(--color-sage);
    color: var(--color-white);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    text-decoration: none;
    border-radius: var(--border-radius);
}

.skip-link:focus {
    top: 0.8rem;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-medium);
    line-height: var(--lh-tight);
    color: var(--color-text-dark);
    margin-top: 0;
    margin-bottom: var(--space-md);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl);  }
h5 { font-size: var(--fs-lg);  }
h6 { font-size: var(--fs-md);  }

p {
    margin-top: 0;
    margin-bottom: var(--space-md);
}

a {
    color: var(--color-sage);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover,
a:focus {
    color: var(--color-sage-hover);
}

ul, ol {
    margin-top: 0;
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}

.container--sm {
    max-width: var(--container-sm);
}

.container--lg {
    max-width: var(--container-lg);
}

/* ---- Main Content Offset for Fixed Header ---- */
main {
    padding-top: var(--header-height);
}

/* Compensate for WP admin bar when logged in (32px desktop, 46px mobile) */
.admin-bar main {
    padding-top: calc(var(--header-height) + 32px);
}

@media (max-width: 782px) {
    .admin-bar main {
        padding-top: calc(var(--header-height) + 46px);
    }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
    padding-top: var(--space-5xl);
    padding-bottom: var(--space-5xl);
}

.section--sm {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
}

/* Color Schemes */
.scheme-1,
.section--scheme-1 { background-color: var(--color-white); }

.scheme-2,
.section--scheme-2 { background-color: var(--color-background-light); }

.scheme-3,
.section--scheme-3 { background-color: var(--color-background-warm); }

.scheme-4,
.section--scheme-4 {
    background-color: var(--color-dark);
    color: var(--color-white);
}
.scheme-4 h1, .scheme-4 h2, .scheme-4 h3,
.scheme-4 h4, .scheme-4 h5, .scheme-4 h6,
.section--scheme-4 h1, .section--scheme-4 h2, .section--scheme-4 h3,
.section--scheme-4 h4, .section--scheme-4 h5, .section--scheme-4 h6 {
    color: var(--color-white);
}

/* ---- Section Header ---- */
.section__label {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-sage);
    margin-bottom: var(--space-sm);
}

.section__title {
    margin-bottom: var(--space-md);
}

/* Subtitle — complements section__title inside section headers. */
.section__subtitle {
    font-family: var(--font-body);
    font-size: var(--fs-lg);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);
    color: var(--color-text-dark);
    margin: 0;
}

/* Inherit text color on dark schemes so subtitle is visible. */
.section--scheme-4 .section__subtitle {
    color: rgba(255, 255, 255, 0.80);
}

.section__header--center .section__subtitle {
    text-align: center;
}

.section__description {
    font-size: var(--fs-md);
    line-height: var(--lh-relaxed);
    color: var(--color-text-muted);
    max-width: 72rem;
}

.section__header {
    margin-bottom: var(--space-3xl);
}

.section__header--center {
    text-align: center;
}

.section__header--center .section__description {
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Grid Utilities
   ========================================================================== */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid--2 { grid-template-columns: repeat(1, 1fr); }
.grid--3 { grid-template-columns: repeat(1, 1fr); }
.grid--4 { grid-template-columns: repeat(1, 1fr); }

@media (min-width: 640px) {
    .grid--2 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
    .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.text-center   { text-align: center; }
.text-left     { text-align: left; }
.text-right    { text-align: right; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   WordPress Core Alignment
   ========================================================================== */
.alignwide {
    max-width: var(--container-lg);
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignleft {
    float: left;
    margin-right: var(--space-md);
    margin-bottom: var(--space-md);
}

.alignright {
    float: right;
    margin-left: var(--space-md);
    margin-bottom: var(--space-md);
}

/* ---- WP Classes ---- */
.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

/* ==========================================================================
   Content Styles
   ========================================================================== */
.entry-content > * + * {
    margin-top: var(--space-md);
}

.entry-content h2 {
    margin-top: var(--space-3xl);
}

.entry-content h3 {
    margin-top: var(--space-2xl);
}

.entry-content blockquote {
    border-left: 4px solid var(--color-sage);
    padding-left: var(--space-lg);
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
    color: var(--color-text-muted);
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-lg);
}

.entry-content th,
.entry-content td {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    text-align: left;
}

.entry-content th {
    background-color: var(--color-background-light);
    font-weight: var(--fw-semibold);
}

/* ==========================================================================
   Responsive Typography
   ========================================================================== */
@media (min-width: 768px) {
    h1 { font-size: var(--fs-5xl); }
    h2 { font-size: var(--fs-4xl); }
    h3 { font-size: var(--fs-3xl); }

    .container {
        padding-left: var(--space-xl);
        padding-right: var(--space-xl);
    }
}

@media (min-width: 1024px) {
    h1 { font-size: var(--fs-hero); }
    h2 { font-size: var(--fs-5xl); }
}
