/* =========================================================
   AutoTips.ca — Redesign stylesheet
   Mobile-first, responsive layout
   ========================================================= */

:root {
  --navy: #12213a;
  --navy-light: #1c355c;
  --accent: #e0592a;      /* wrench-orange accent */
  --accent-dark: #c1461c;
  --grey-bg: #f4f5f7;
  --grey-line: #e2e4e9;
  --text: #232833;
  --text-muted: #626a7a;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(18, 33, 58, 0.08);
  --shadow-hover: 0 8px 24px rgba(18, 33, 58, 0.16);
  --max-width: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--grey-bg);
  line-height: 1.55;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
}
.skip-link:focus { left: 10px; top: 10px; }

/* -------------------- Header -------------------- */
.site-header {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-top {
  background: var(--navy-light);
  font-size: 0.82rem;
}

.header-top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.contact-line { display: flex; gap: 18px; flex-wrap: wrap; color: #cfd7e6; }
.contact-line a { color: #cfd7e6; }
.auth-line a { color: #fff; font-weight: 600; }
.auth-line .sep { margin: 0 6px; color: #7f8aa3; }

/* hide the top-bar login/signup on small screens; shown in the nav drawer instead */
.auth-line { display: none; }
@media (min-width: 640px) { .auth-line { display: flex; align-items: center; gap: 4px; } }

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 16px;
}

.logo img {
  height: 52px;
  width: auto;
  border-radius: 6px;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 20px;
  margin: 0 auto;
  background: #fff;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav {
  position: fixed;
  inset: 0 0 0 30%;
  background: var(--navy);
  padding: 90px 24px 24px;
  transform: translateX(100%);
  transition: transform .25s ease;
  overflow-y: auto;
}
.primary-nav.is-open { transform: translateX(0); }

.primary-nav ul {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.primary-nav a {
  display: block;
  color: #fff;
  padding: 12px 10px;
  border-radius: 8px;
  font-weight: 600;
}
.primary-nav a:hover,
.primary-nav a.active {
  background: var(--accent);
  color: #fff;
}
.nav-auth {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.nav-auth a { color: #fff; font-weight: 600; }
.nav-auth .sep { color: #7f8aa3; margin: 0 4px; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .primary-nav {
    position: static;
    inset: auto;
    background: transparent;
    padding: 0;
    transform: none;
    overflow: visible;
  }
  .primary-nav ul {
    flex-direction: row;
    gap: 6px;
    margin: 0;
  }
  .primary-nav a { padding: 8px 14px; }
  .primary-nav a.active,
  .primary-nav a:hover { background: rgba(255,255,255,0.12); color: #fff; }
  .nav-auth { display: none; }
}

/* -------------------- Hero -------------------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  text-align: center;
  padding: 48px 20px;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.hero p { margin: 0; color: #cfd7e6; font-size: 1.05rem; }

/* -------------------- Section headings -------------------- */
.section { padding: 40px 0; }
.section-title {
  font-size: 1.5rem;
  margin: 0 0 22px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}
.section-head .see-more { font-weight: 600; white-space: nowrap; }

/* -------------------- Video grid -------------------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.video-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(224, 89, 42, 0.9) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M8 5v14l11-7z'/></svg>") no-repeat center / 20px;
  opacity: 0.92;
  transition: transform .15s ease;
}
.video-card:hover .video-thumb::after { transform: scale(1.1); }

.video-info { padding: 12px 14px 16px; flex: 1; display: flex; flex-direction: column; }
.video-info h3 {
  font-size: 0.98rem;
  margin: 0 0 6px;
  line-height: 1.35;
  color: var(--text);
}
.video-info .video-cat {
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.no-results {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  background: var(--white);
  border-radius: var(--radius);
}

/* -------------------- Pagination -------------------- */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 600;
}
.pagination a:hover { background: var(--accent); color: #fff; }
.pagination .current { background: var(--accent); color: #fff; }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* -------------------- Single video page -------------------- */
.video-page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 960px) {
  .video-page-layout { grid-template-columns: 2.2fr 1fr; align-items: start; }
}

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.player-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-detail h1 { font-size: 1.4rem; margin: 18px 0 8px; }
.video-detail .video-meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 12px; }
.video-detail .video-description {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.related-videos h2 { font-size: 1.1rem; margin: 0 0 14px; }
.related-list { display: flex; flex-direction: column; gap: 12px; }
.related-item {
  display: flex;
  gap: 12px;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.related-item img { width: 120px; aspect-ratio: 16/9; object-fit: cover; flex-shrink: 0; }
.related-item .related-title { padding: 8px 10px; font-size: 0.85rem; line-height: 1.3; color: var(--text); }

/* -------------------- Sponsors -------------------- */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.sponsor-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.sponsor-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.sponsor-card img { max-height: 70px; width: auto; object-fit: contain; }
.sponsor-card .sponsor-name { font-weight: 700; color: var(--text); font-size: 0.95rem; }
.sponsor-card .sponsor-tagline { font-size: 0.82rem; color: var(--text-muted); }

/* -------------------- Businesses / links -------------------- */
.business-list { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .business-list { grid-template-columns: 1fr 1fr; } }
.business-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.business-item a.business-name { font-size: 1.05rem; font-weight: 700; }
.business-item p { margin: 6px 0 0; color: var(--text-muted); font-size: 0.9rem; }

/* -------------------- Forms (login/register) -------------------- */
.form-page { max-width: 440px; margin: 0 auto; }
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.form-card h1 { margin-top: 0; font-size: 1.4rem; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--grey-line);
  border-radius: 8px;
  font-size: 1rem;
}
.field input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 11px 22px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-block { width: 100%; text-align: center; }
.form-alt-link { margin-top: 16px; font-size: 0.9rem; text-align: center; }
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-error { background: #fdeceb; color: #9c2b16; border: 1px solid #f5c2b8; }
.alert-success { background: #eaf7ee; color: #1c6b34; border: 1px solid #bfe6cb; }

/* -------------------- Shop / static page -------------------- */
.shop-intro {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 30px;
}

/* -------------------- Footer -------------------- */
.site-footer {
  background: var(--navy);
  color: #cfd7e6;
  margin-top: 40px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  padding: 40px 20px;
}
@media (min-width: 800px) {
  .footer-top { grid-template-columns: 260px 1fr; }
}
.footer-logo { height: 44px; width: auto; margin-bottom: 12px; border-radius: 6px; }
.footer-about p { font-size: 0.88rem; }
.footer-contact { font-size: 0.85rem; }
.footer-contact a { color: #cfd7e6; }

.footer-services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.service-col h4 {
  color: #fff;
  font-size: 0.92rem;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.service-col ul { list-style: none; margin: 0; padding: 0; }
.service-col li {
  font-size: 0.82rem;
  padding: 3px 0;
  color: #b7c0d4;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
}

/* -------------------- Utility -------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
