/* ==========================================================================
   GLOBAL LAYOUT & STYLE - GARAGE DOOR REPAIRS BEECROFT
   ========================================================================== */

/* --- CSS Reset & Global Elements --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  color: var(--color-primary);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: var(--space-sm);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-muted);
}

a {
  color: var(--color-accent-dark);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

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

/* --- Layout Structure --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}

.section-bg {
  background-color: var(--color-bg-white);
  border-bottom: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
}

.section-bg-alt {
  background-color: var(--color-bg-alt);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-3xl) auto;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: var(--space-xs);
  color: var(--color-primary);
}

.section-header p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

/* --- Global Spacing Utilities --- */
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }
.mt-5 { margin-top: var(--space-2xl); }

.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }
.mb-5 { margin-bottom: var(--space-2xl); }

/* --- Grid & Flex Utilities --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

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

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: var(--space-lg); }
  .section { padding: var(--space-2xl) 0; }
}

/* --- Alignment & Helpers --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-accent { color: var(--color-accent) !important; }
.text-primary { color: var(--color-primary) !important; }
.text-white { color: var(--color-bg-white) !important; }

.font-bold { font-weight: 700; }
.font-black { font-weight: 800; }

.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* --- Layout Splits for Detailed Pages --- */
.split-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: var(--space-2xl);
  align-items: start;
}

.main-content article {
  background-color: var(--color-bg-white);
  border-radius: var(--radius-md);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  position: sticky;
  top: 100px;
}

@media (max-width: 992px) {
  .split-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}

/* Detailed Page Elements */
.content-block {
  margin-bottom: var(--space-2xl);
}

.content-block h2 {
  font-size: 1.6rem;
  border-left: 4px solid var(--color-accent);
  padding-left: var(--space-sm);
  margin-bottom: var(--space-md);
}

.content-block ul, .content-block ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}

.content-block li {
  margin-bottom: var(--space-xs);
}

/* Sidebar Widget */
.sidebar-widget {
  background-color: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.sidebar-widget-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-bg-alt);
  padding-bottom: var(--space-xs);
}

/* Quick links in sidebar */
.quick-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.quick-links-list a {
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.quick-links-list a:hover {
  background-color: var(--color-primary) !important;
  color: var(--color-bg-white) !important;
}

/* Screen reader only utility class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
