/*
Theme Name:  UltraValue Base
Theme URI:   https://ultravalue.club
Author:      UltraValue Web Design
Author URI:  https://ultravalue.club
Description: Minimal, fast, no-pagebuilder base theme. Raw and Full-Width page templates included. Drop in your HTML/CSS/JS and go.
Version:     1.0.0
License:     GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ultravalue-base
Tags:        custom-logo, full-width-template, custom-menu
*/

/* ============================================================
   CSS RESET + ROOT VARIABLES
   ============================================================ */

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

:root {
  /* --- Typography --- */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  /* --- Type Scale --- */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.125rem;
  --text-lg:   1.25rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;
  --text-3xl:  2.75rem;
  --text-4xl:  3.75rem;

  /* --- Colours (override per page or child theme) --- */
  --color-bg:       #ffffff;
  --color-surface:  #f8f8f8;
  --color-border:   #e5e5e5;
  --color-text:     #1a1a1a;
  --color-muted:    #666666;
  --color-accent:   #0d1b3e;
  --color-accent-2: #c8191e;

  /* --- Spacing --- */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* --- Layout --- */
  --container-max:   1200px;
  --container-wide:  1440px;
  --container-prose: 720px;
  --nav-height:      72px;

  /* --- Transitions --- */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: 150ms var(--ease);
  --transition-base: 300ms var(--ease);
}

/* ============================================================
   BASE STYLES
   ============================================================ */

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-accent);
  text-decoration: underline;
  transition: opacity var(--transition-fast);
}
a:hover { opacity: 0.7; }

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}
li { margin-bottom: var(--space-xs); }

strong { font-weight: 700; }
em     { font-style: italic; }

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-surface);
  border-radius: 4px;
}
code { padding: 2px 6px; }
pre  { padding: var(--space-md); overflow-x: auto; }

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-xl) 0;
}

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

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

.container--wide  { max-width: var(--container-wide); }
.container--prose { max-width: var(--container-prose); }
.container--flush { padding-left: 0; padding-right: 0; }

.section {
  padding-top:    var(--space-3xl);
  padding-bottom: var(--space-3xl);
}
.section--sm { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.section--lg { padding-top: calc(var(--space-3xl) * 1.5); padding-bottom: calc(var(--space-3xl) * 1.5); }

/* Flex helpers */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.gap-sm      { gap: var(--space-sm); }
.gap-md      { gap: var(--space-md); }
.gap-lg      { gap: var(--space-lg); }
.gap-xl      { gap: var(--space-xl); }

/* Grid helpers */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Visibility */
.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;
}

/* ============================================================
   SITE NAV (minimal, override freely)
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo a {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--space-xl);
}

.site-nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color var(--transition-fast);
}
.site-nav a:hover { color: var(--color-accent-2); }

/* Mobile nav toggle (JS-driven) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  color: var(--color-text);
}

/* ============================================================
   SITE FOOTER
   ============================================================ */

.site-footer {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75em 1.75em;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn--primary:hover {
  background: var(--color-accent-2);
  border-color: var(--color-accent-2);
  color: #fff;
  opacity: 1;
}

.btn--outline {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn--outline:hover {
  background: var(--color-accent);
  color: #fff;
  opacity: 1;
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: transparent;
  padding-left: 0; padding-right: 0;
}
.btn--ghost:hover { color: var(--color-accent-2); opacity: 1; }

.btn--lg { font-size: var(--text-md); padding: 0.9em 2.25em; }
.btn--sm { font-size: var(--text-sm); padding: 0.6em 1.25em; }

/* ============================================================
   FORMS
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.7em 1em;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 15%, transparent);
}

textarea { min-height: 140px; resize: vertical; }

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.form-error {
  font-size: var(--text-xs);
  color: var(--color-accent-2);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.card__image { aspect-ratio: 16 / 9; overflow: hidden; }
.card__image img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: var(--space-lg); }
.card__title { font-size: var(--text-xl); margin-bottom: var(--space-sm); }
.card__text  { color: var(--color-muted); font-size: var(--text-sm); }
.card__footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   HERO COMPONENT
   ============================================================ */

.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: var(--space-3xl) 0;
  position: relative;
  overflow: hidden;
}
.hero--full { min-height: 100vh; }
.hero__content { position: relative; z-index: 1; }
.hero__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-2);
  margin-bottom: var(--space-lg);
}
.hero__title { font-size: clamp(2.5rem, 6vw, 5rem); margin-bottom: var(--space-lg); }
.hero__sub   { font-size: var(--text-lg); color: var(--color-muted); max-width: 540px; margin-bottom: var(--space-xl); }
.hero__ctas  { display: flex; gap: var(--space-md); flex-wrap: wrap; }

/* ============================================================
   SECTIONS / COMPONENTS STUB
   ============================================================ */

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-xl);
}
.feature__icon {
  width: 48px; height: 48px;
  background: var(--color-surface);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-md);
  font-size: 1.5rem;
}
.feature__title { font-size: var(--text-lg); margin-bottom: var(--space-sm); }
.feature__text  { color: var(--color-muted); font-size: var(--text-sm); }

/* Testimonial */
.testimonial {
  padding: var(--space-xl);
  background: var(--color-surface);
  border-radius: 8px;
  position: relative;
}
.testimonial__quote {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.4;
  margin-bottom: var(--space-lg);
}
.testimonial__author {
  display: flex; align-items: center; gap: var(--space-md);
}
.testimonial__avatar {
  width: 48px; height: 48px;
  border-radius: 50%; object-fit: cover;
}
.testimonial__name { font-weight: 700; font-size: var(--text-sm); }
.testimonial__role { color: var(--color-muted); font-size: var(--text-xs); }

/* ============================================================
   FULL-WIDTH PAGE OVERRIDES  (applied via body class)
   ============================================================ */

.template-full-width .site-header,
.template-full-width .site-footer {
  /* still constrained, nav + footer stay readable */
}

.template-full-width #content,
.template-full-width .entry-content,
.template-full-width .page-content {
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* ============================================================
   WORDPRESS BLOCK EDITOR (Gutenberg) RESETS
   -- ensures WP adds no extra spacing
   ============================================================ */

.wp-block-group { margin: 0; padding: 0; }
.wp-block-spacer { display: none; } /* use CSS margin/padding instead */
.entry-content > * + * { margin-top: 0; } /* kill WP default stacking */

.alignfull {
  margin-left:  calc(-1 * var(--space-xl));
  margin-right: calc(-1 * var(--space-xl));
  max-width: none;
  width: auto;
}
.alignwide {
  max-width: calc(var(--container-max) + 120px);
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --space-xl:  1.5rem;
    --space-2xl: 2.5rem;
    --space-3xl: 4rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }

  .site-nav { display: none; }
  .nav-toggle { display: flex; }

  .site-nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: var(--nav-height) 0 0 0;
    background: var(--color-bg);
    z-index: 99;
    padding: var(--space-xl);
  }
  .site-nav.is-open ul { flex-direction: column; gap: var(--space-lg); }

  .container { padding-left: var(--space-lg); padding-right: var(--space-lg); }
}

@media (max-width: 480px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }

  .hero__ctas { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}
