
/*
Theme Name: All Terrain Action
Theme URI: https://example.com/themes/all-terrain-action
Author: Chris Baker
Author URI: https://example.com
Description: WooCommerce-ready theme with fullscreen hero and panels. Clean header, Inter font, and Customizer controls.
Version: 1.4.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: all-terrain-action
Tags: e-commerce, woocommerce, customizer, full-screen, responsive
*/

:root {
  --bg: #080808;
  --text: #e5e7eb;
  --muted: #9aa0a6;
  --accent: #0ea5e9;
  --accent-contrast: #ffffff;
  --border: #1f2937;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; height: 100%; }
body {
  height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100dvh;          /* full viewport */
  display: flex;
  flex-direction: column;
}

.container { width: min(1200px, 92vw); margin: 0 auto; padding: 1.25rem; }

/* Header */
.site-header {
  position: fixed; top: 0; width: 100%;
  z-index: 1000;
  background: transparent; border: 0;
}
.site-header .inner { position: relative; }

body.admin-bar .site-header { top: 32px; }
@media (max-width:782px){ body.admin-bar .site-header { top: 46px; } }

.site-header .inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: .5rem 1.25rem;
}
.branding { display: flex; align-items: center; gap: .75rem; }
.site-title { margin: 0; font-weight: 800; }
.site-title a { color: #fff; text-decoration: none; }
.primary-nav, .secondary-nav { display: flex; gap: .75rem; }
.primary-nav li, .secondary-nav li { list-style: none; }
.primary-nav a, .secondary-nav a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
  padding: .5rem .6rem;
  color: #fff;
  opacity: .95;
}
.primary-nav a:hover, .secondary-nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.site-header.scrolled {
  background: rgba(8, 8, 8, 0.85);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header.scrolled .primary-nav a, .site-header.scrolled .secondary-nav a, .site-header.scrolled .site-title a { color: var(--text); }

/* Compact header height */
:root { --header-h: 56px; }  /* tweak to 52–60px to taste */

/* Make the header reliably that tall */
.site-header .inner {
  min-height: var(--header-h);
  padding: 0 1.25rem; /* remove vertical padding so height is consistent */
}

/* Offset the page content by the header height */
.site-main { flex: 1 0 auto; padding-top: var(--header-h); }

/* Full-viewport sections */
.ata-screen { min-height: 100dvh; position: relative; margin: 0; }
.ata-bg, .ata-bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ata-bg img { object-fit: cover; object-position: center; display: block; }
.ata-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.10) 0%, rgba(0,0,0,.55) 70%, rgba(0,0,0,.70) 100%); }
.ata-inner { position: relative; z-index: 1; width: min(1100px, 92vw); margin: 0 auto; padding: clamp(2rem, 6vw, 6rem) 1.25rem; display: grid; grid-template-rows: auto auto 1fr auto; align-content: start; min-height: 100dvh; }

/* Hero */
.ata-title { color: #fff; font-size: clamp(2.4rem, 6vw, 4.2rem); margin: 0; font-weight: 900; text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,.55), 0 6px 24px rgba(0,0,0,.35); letter-spacing: .01em; }
.ata-subtitle { color: #e5e7eb; text-align: center; max-width: 70ch; margin: .75rem auto 1.5rem; font-size: clamp(1rem, 2.2vw, 1.25rem); text-shadow: 0 2px 10px rgba(0,0,0,.45); }

/* Tiles */
.ata-tiles {
  margin-top: clamp(1.25rem, 2vh, 2rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 1rem;
  align-self: end;
}
@media (max-width: 900px) { .ata-tiles { grid-template-columns: 1fr; } }

.tile-card {
  background: rgba(0,0,0,.62);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 1rem;
  padding: 1.25rem;
  color: #fff;
  box-shadow: 0 20px 40px rgba(0,0,0,.35), 0 4px 12px rgba(0,0,0,.25);
  backdrop-filter: blur(4px);
}
.tile-title { margin: 0 0 .35rem; font-size: 1.25rem; font-weight: 900; letter-spacing: .02em; }
.tile-text { margin: 0 0 .5rem; color: #e3e5e8; }
.tile-note { margin: 0 0 .75rem; font-weight: 800; }
.tile-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .85rem; border-radius: .6rem; background: var(--accent); color: var(--accent-contrast); text-decoration: none; border: 1px solid rgba(255,255,255,.18); font-weight: 800; }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,.45); color: #fff; }
.btn-compact { padding: .5rem .8rem; }

/* Panels */
.ata-panel .ata-panel-title { color: #fff; font-size: clamp(1.6rem, 3vw, 2.4rem); margin: 0 0 .5rem; font-weight: 900; text-shadow: 0 2px 8px rgba(0,0,0,.95); }
.ata-panel .ata-panel-text { color: #e5e7eb; max-width: 70ch; text-shadow: 0 2px 6px rgba(0,0,0,.95); }

/* Utilities */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}


/* ===== Panel alignment controls (Customizer) ===== */
.ata-panel { display: grid; }
.ata-panel .ata-inner { width: min(1100px, 92vw); }
.ata-panel.pos-left  .ata-inner { justify-self: start; text-align: left; }
.ata-panel.pos-right .ata-inner { justify-self: end;   text-align: right; }
.ata-panel.valign-top    .ata-inner { align-self: start;  }
.ata-panel.valign-middle .ata-inner { align-self: center; }
.ata-panel.valign-bottom .ata-inner { align-self: end;    }

/* Keep paragraph block flush with the chosen side */
.ata-panel .ata-panel-text {
  max-width: 70ch;
  margin-inline: 0;           /* reset any default centering */
}

.ata-panel.pos-left  .ata-panel-text { margin-right: auto; }
.ata-panel.pos-right .ata-panel-text { margin-left:  auto; }

/* Optional: match title width to text width */
.ata-panel .ata-panel-title { max-width: 70ch; }
.ata-panel.pos-left  .ata-panel-title { margin-right: auto; }
.ata-panel.pos-right .ata-panel-title { margin-left:  auto; }



/* === v1.4.3: Panel alignment fixes === */
/* Make the panel content box shrink to fit so align-self works */
.ata-panel .ata-inner {
  min-height: auto !important;
  height: auto !important;
  display: block; /* use block layout in panels; hero keeps grid */
  width: min(1100px, 92vw);
  padding: clamp(2rem, 6vw, 6rem) 1.25rem;
}

/* Ensure the panel itself is a full-height grid so we can place the .ata-inner */
.ata-panel {
  min-height: 100dvh;
  display: grid;
  align-content: stretch;
}

/* Apply the chosen alignment */
.ata-panel.pos-left  .ata-inner { justify-self: start; text-align: left; }
.ata-panel.pos-right .ata-inner { justify-self: end;   text-align: right; }
.ata-panel.valign-top    .ata-inner { align-self: start; }
.ata-panel.valign-middle .ata-inner { align-self: center; }
.ata-panel.valign-bottom .ata-inner { align-self: end; }

/* ===== Page template ===== */
.page-card{
  background: var(--card);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  margin: clamp(1rem, 3vw, 2rem) auto;
  max-width: 1200px;        /* was 1000px — widen the content */
}

.page-card .entry-content p{ max-width: none; }

.page-header{ margin-bottom: .75rem; }
.page-title{
  margin: 0 0 .25rem;
  line-height: 1.2;
  color: #fff;
}

/* ===== Per-page full background via Featured Image ===== */
.page-bg{
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--page-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
}

.page-bg-overlay{
  position: fixed;
  inset: 0;
  z-index: -1;
  /* Gentle darkening for legibility over bright images */
  background: linear-gradient(
          to bottom,
          rgba(0,0,0,.35) 0%,
          rgba(0,0,0,.35) 100%
  );
}

.page-card{ background: rgba(17,22,29,.85); backdrop-filter: blur(4px); }

/* Readable, classy content defaults */
.entry-content > * + * { margin-top: 1rem; }
.entry-content p{ max-width: 70ch; color: var(--text); }
.entry-content h2, .entry-content h3 { margin-top: 1.5rem; }
.entry-content a{ color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.entry-content img{ max-width: 100%; height: auto; border-radius: .75rem; }
.entry-content ul, .entry-content ol{ padding-left: 1.25rem; }

/* ===== Footer ===== */
.site-footer{
  border-top: 1px solid rgba(255,255,255,.08);
  background: #080808;
  padding: 1rem 0 2rem;
  flex: 0 0 auto;
}

.site-footer .container{ width: min(1200px, 92vw); margin: 0 auto; }

.footer-nav{
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin: .25rem 0 1rem;
  padding: 0;
}
.footer-nav li{ list-style: none; }
.footer-nav a{
  text-decoration: none;
  text-transform: none;     /* matches screenshot (not uppercase) */
  font-weight: 700;
  font-size: .95rem;
  color: #e5e7eb;
  opacity: .9;
}
.footer-nav a:hover{ opacity: 1; text-decoration: underline; text-underline-offset: 3px; }

.footer-meta{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  color: #cbd5e1;
  font-size: .9rem;
  opacity: .85;
}
.footer-brand{ color: #fff; }
.footer-copy{}
.footer-note a{ color: #cbd5e1; text-decoration: underline; text-underline-offset: 3px; }

/* small screens */
@media (max-width: 640px){
  .footer-nav{ gap: .75rem 1.25rem; }
  .footer-nav a{ font-size: .9rem; }
}
@supports (height: 100svh){
  body{ min-height: 100svh; }
}

/* Toggle only shows on small screens */
.nav-toggle{
  display: none;
  appearance: none;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(8,8,8,.6);
  color: #fff;
  font-weight: 800;
  border-radius: .5rem;
  padding: .35rem .6rem;
  line-height: 1;
}

/* Primary/secondary menus default desktop layout (your existing styles apply) */
.primary-nav .menu, .secondary-nav .menu{
  display: contents; /* keep desktop inline items */
}

/* Mobile layout */
@media (max-width: 900px){
  /* pin the toggle to the right edge of the header */
  .nav-toggle{
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;                 /* ignore grid margins */
    z-index: 1100;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    padding: .4rem .7rem;
    background: rgba(11,15,20,.85);
    border-radius: .4rem;
    border: 1px solid rgba(255,255,255,.2);
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
  }

  /* keep dropdown anchored to the right under the header */
  .primary-nav .menu{
    position: absolute;
    top: var(--header-h);
    right: 1rem;
    width: 70vw;
    max-width: 280px;
    display: none;
    background: rgba(11,15,20,.95);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: .75rem;
    box-shadow: 0 12px 30px rgba(0,0,0,.55);
    padding: .5rem 0;
    list-style: none;
    z-index: 1200;
    animation: fadeIn .25s ease;
  }
  .site-header.nav-open .primary-nav .menu{ display: block; }

  /* optional: hide secondary nav on mobile */
  .secondary-nav{ display: none; }
}

@media (max-width: 900px){
  .primary-nav .menu > li > a{
    display: block;
    padding: 1.1rem 1.5rem;   /* more vertical and horizontal space */
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
    border-radius: .5rem;
  }

  .primary-nav .menu > li + li > a{
    border-top: 1px solid rgba(255,255,255,.08); /* subtle divider between items */
  }
}


/* if admin bar is visible */
body.admin-bar .site-header .primary-nav .menu{ top: calc(var(--header-h) + 32px); }
@media (max-width:782px){
  body.admin-bar .site-header .primary-nav .menu{ top: calc(var(--header-h) + 46px); }
}

/* Optional: prevent page scroll when menu open */
html.no-scroll, html.no-scroll body{ overflow: hidden; }

/* Simple fade */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Optional: prevent page scroll when menu open */
html.no-scroll, html.no-scroll body{ overflow: hidden; }

/* Page card: store padding so we can offset embeds to edge */
.page-card{ --card-pad: clamp(1.25rem, 2.5vw, 2rem); padding: var(--card-pad); }

/* Responsive video/YouTube embeds */
.entry-content .wp-block-embed__wrapper,
.entry-content .wp-block-embed.is-type-video iframe,
.entry-content iframe[src*="youtube.com"],
.entry-content iframe[src*="youtu.be"]{
  width: 100%;
  max-width: 100%;
  display: block;
  aspect-ratio: 16 / 9;   /* keeps shape; modern browsers */
  height: auto;           /* fallback behavior */
  border: 0;
  border-radius: .75rem;
}

/* WIDE: keep inside the card but use full card width */
/* Global wide-width styling */
.page-card .entry-content .alignwide{
  margin-left: auto;
  margin-right: auto;
  max-width: 1200px;            /* keep it comfortably wide */
  padding-left: 0rem;           /* spacing from viewport edge */
  padding-right: 0rem;
  width: 100%;                  /* take full available width inside that max */
}

/* FULL: bleed to the viewport edges (true full-bleed) */
.page-card .entry-content .alignfull{
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
  border-radius: 0; /* typically full-bleed is square */
}

/* Tidy spacing */
.entry-content .wp-block-embed{ margin: 1rem 0; }

.trustindex-wrap {
  display: flex;
  justify-content: center;  /* centers horizontally */
  align-items: center;      /* optional vertical centering if you set a height */
  text-align: center;
  width: 100%;
}

.trustindex-wrap iframe,
.trustindex-wrap div {
  margin: 0 auto !important; /* force any injected iframe/widget to auto center */
}
