/*
Theme Name: Maple Shopper
Theme URI: https://bagoftoronto.ca
Author: Bag of Toronto
Description: Toronto neighbourhood shopping guide and local gift culture theme.
Version: 1.0
Text Domain: maple-shopper
*/

/* === Variables === */
:root {
  --clr-main: #B7352E;
  --clr-main-dark: #8E2923;
  --clr-main-light: #D4544D;
  --clr-sand: #FAF5F0;
  --clr-cream: #F5EDE3;
  --clr-ink: #2C2C2C;
  --clr-ink-light: #5A5A5A;
  --clr-white: #FFFFFF;
  --clr-border: #E0D6CC;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Lato', Helvetica, Arial, sans-serif;
  --wrap: 1140px;
  --gap: 1.5rem;
  --radius-sm: 4px;
  --radius-md: 6px;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--clr-ink);
  background: var(--clr-sand);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--clr-main); text-decoration: none; transition: color .2s; }
a:hover { color: var(--clr-main-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--clr-ink);
  line-height: 1.25;
  margin-bottom: .6em;
}
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
p { margin-bottom: 1rem; }

/* === Layout === */
.wrap {
  max-width: var(--wrap);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

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

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

/* === Header / Masthead === */
.masthead {
  background: var(--clr-white);
  border-bottom: 3px solid var(--clr-main);
  position: sticky;
  top: 0;
  z-index: 100;
}
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.brand img {
  height: 52px;
  width: auto;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--clr-ink);
  font-weight: 700;
}
.brand-name span { color: var(--clr-main); }

/* Navigation */
.topnav ul {
  list-style: none;
  display: flex;
  gap: 1.6rem;
  align-items: center;
}
.topnav a {
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 600;
  color: var(--clr-ink);
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color .2s, color .2s;
}
.topnav a:hover,
.topnav .current-menu-item > a,
.topnav .current_page_item > a {
  color: var(--clr-main);
  border-bottom-color: var(--clr-main);
}

/* Hamburger */
.ham-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}
.ham-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--clr-ink);
  margin: 5px 0;
  transition: transform .3s, opacity .3s;
}

@media (max-width: 768px) {
  .ham-btn { display: block; }
  .topnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--clr-white);
    border-bottom: 3px solid var(--clr-main);
    padding: 1rem;
  }
  .topnav.is-open { display: block; }
  .topnav ul { flex-direction: column; gap: .5rem; }
  .topnav a { display: block; padding: .6rem 0; }
}

/* === Cards === */
.card {
  background: var(--clr-white);
  border-bottom: 3px solid var(--clr-border);
  padding: 1.4rem;
  transition: border-color .25s;
}
.card:hover {
  border-bottom-color: var(--clr-main);
}
.card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  margin-bottom: 1rem;
}
.card h3 { font-size: 1.15rem; }
.card p { color: var(--clr-ink-light); font-size: .92rem; }

/* === Buttons === */
.btn {
  display: inline-block;
  padding: .7rem 1.6rem;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background .2s;
}
.btn--primary {
  background: var(--clr-main);
  color: var(--clr-white);
}
.btn--primary:hover {
  background: var(--clr-main-dark);
  color: var(--clr-white);
}
.btn--outline {
  background: transparent;
  color: var(--clr-main);
  border: 2px solid var(--clr-main);
}
.btn--outline:hover {
  background: var(--clr-main);
  color: var(--clr-white);
}

/* === Footer === */
.colophon {
  background: var(--clr-ink);
  color: var(--clr-cream);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}
.colophon a { color: var(--clr-cream); }
.colophon a:hover { color: var(--clr-main-light); }
.colophon-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.colophon h4 {
  color: var(--clr-white);
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: .8rem;
}
.colophon ul { list-style: none; }
.colophon li { margin-bottom: .4rem; }
.colophon li a { font-size: .9rem; }
.colophon-about p { font-size: .9rem; line-height: 1.6; color: #bbb; }
.colophon-bottom {
  border-top: 1px solid #444;
  padding-top: 1rem;
  text-align: center;
  font-size: .85rem;
  color: #888;
}

@media (max-width: 768px) {
  .colophon-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .colophon-grid { grid-template-columns: 1fr; }
}

/* === Content === */
.page-banner {
  background: var(--clr-main);
  color: var(--clr-white);
  padding: 2.5rem 0;
  text-align: center;
}
.page-banner h1 { color: var(--clr-white); font-size: 2.2rem; }

.entry-content {
  max-width: 780px;
  margin: 2rem auto;
  padding: 0 var(--gap);
}
.entry-content p { margin-bottom: 1.2rem; }
.entry-content ul, .entry-content ol { margin: 0 0 1.2rem 1.5rem; }
.entry-content li { margin-bottom: .4rem; }
.entry-content img { margin: 1.5rem 0; border-radius: var(--radius-md); }

/* === WooCommerce overrides === */
.woocommerce .products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}
.woocommerce ul.products li.product {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 1.2rem;
  background: var(--clr-white);
  border-bottom: 3px solid var(--clr-border);
  transition: border-color .25s;
}
.woocommerce ul.products li.product:hover {
  border-bottom-color: var(--clr-main);
}
.woocommerce ul.products li.product a img {
  margin-bottom: .8rem;
}
.woocommerce ul.products li.product .price {
  color: var(--clr-main);
  font-weight: 700;
}

/* === Utility === */
/* === Front Page === */

/* Hero */
.fp-hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  color: var(--clr-white);
}
.fp-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 40%;
  z-index: 0;
}
.fp-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(44,44,44,.72) 0%, rgba(183,53,46,.55) 100%);
  z-index: 1;
}
.fp-hero-content {
  position: relative;
  z-index: 2;
  padding: 4rem 1.5rem 3.5rem;
}
.fp-hero-logo {
  margin: 0 auto 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,.15);
  padding: 8px;
}
.fp-hero-tagline {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: .8rem;
  color: var(--clr-cream);
}
.fp-hero h1 {
  color: var(--clr-white);
  font-size: 2.4rem;
  max-width: 720px;
  margin: 0 auto .8rem;
}
.fp-hero-sub {
  max-width: 600px;
  margin: 0 auto 1.6rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255,255,255,.88);
}
.fp-hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn--lg { padding: .85rem 2rem; font-size: 1rem; }
.fp-hero .btn--outline {
  border-color: rgba(255,255,255,.6);
  color: var(--clr-white);
}
.fp-hero .btn--outline:hover {
  background: var(--clr-white);
  color: var(--clr-main);
  border-color: var(--clr-white);
}

/* Sections */
.fp-section { padding: 3.5rem 0; }
.fp-section:nth-child(even) { background: var(--clr-white); }
.fp-heading {
  text-align: center;
  font-size: 2rem;
  margin-bottom: .4rem;
}
.fp-subheading {
  text-align: center;
  color: var(--clr-ink-light);
  max-width: 640px;
  margin: 0 auto;
  font-size: 1rem;
}

/* Product Cards */
.fp-product-card {
  text-align: center;
  display: block;
  color: var(--clr-ink);
}
.fp-product-card:hover { color: var(--clr-ink); }
.fp-product-card h3 { margin-top: .4rem; font-size: 1.05rem; }
.fp-price {
  color: var(--clr-main);
  font-weight: 700;
  font-size: .95rem;
}
.fp-placeholder-img {
  width: 100%;
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, var(--clr-cream) 0%, var(--clr-sand) 100%);
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
}

/* Neighbourhood Cards */
.fp-hood-card {
  display: block;
  text-align: left;
  color: var(--clr-ink);
  padding: 1.6rem;
  position: relative;
}
.fp-hood-card:hover { color: var(--clr-ink); }
.fp-hood-pin {
  font-size: 1.4rem;
  display: block;
  margin-bottom: .4rem;
}
.fp-hood-card h3 { font-size: 1.1rem; margin-bottom: .3rem; }
.fp-hood-card p { font-size: .88rem; color: var(--clr-ink-light); margin-bottom: .6rem; }
.fp-hood-link {
  font-size: .85rem;
  font-weight: 700;
  color: var(--clr-main);
}

/* Trust Section */
.fp-trust { background: var(--clr-sand); }
.fp-trust-col {
  text-align: center;
  padding: 1.5rem;
}
.fp-trust-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: .6rem;
}
.fp-trust-col h3 {
  font-size: 1.15rem;
  margin-bottom: .5rem;
}
.fp-trust-col p {
  font-size: .92rem;
  color: var(--clr-ink-light);
  line-height: 1.65;
}

/* Blog Section */
.fp-read-more {
  font-size: .88rem;
  font-weight: 700;
}
.fp-upcoming-card {
  border-left: 3px solid var(--clr-main);
}
.fp-coming-soon {
  display: inline-block;
  margin-top: .5rem;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--clr-ink-light);
}

/* Charities Section */
.fp-charities { background: var(--clr-main); color: var(--clr-white); }
.fp-charities h2 { color: var(--clr-white); font-size: 2rem; }
.fp-charities p { color: rgba(255,255,255,.85); font-size: 1.05rem; line-height: 1.7; max-width: 560px; }
.fp-charities .btn--primary {
  background: var(--clr-white);
  color: var(--clr-main);
}
.fp-charities .btn--primary:hover {
  background: var(--clr-cream);
  color: var(--clr-main-dark);
}
.fp-charities-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: center;
}
.fp-charities-stats {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.fp-stat {
  text-align: center;
  padding: 1rem;
  background: rgba(255,255,255,.12);
  border-radius: var(--radius-md);
}
.fp-stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--clr-white);
  line-height: 1.1;
}
.fp-stat-label {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.7);
}

@media (max-width: 768px) {
  .fp-hero { min-height: 420px; }
  .fp-hero h1 { font-size: 1.8rem; }
  .fp-charities-inner { grid-template-columns: 1fr; }
  .fp-charities-stats { flex-direction: row; }
}
@media (max-width: 480px) {
  .fp-hero h1 { font-size: 1.5rem; }
  .fp-charities-stats { flex-direction: column; }
}

/* === Utility === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
/* === Neighbourhood Map === */
.hood-section {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 var(--gap);
}
.hood-section-title {
  font-size: 1.6rem;
  margin-bottom: .3rem;
}
.hood-section-sub {
  color: var(--clr-ink-light);
  font-size: .92rem;
  margin-bottom: 1rem;
}
.hood-loader {
  text-align: center;
  padding: 1.5rem;
  color: var(--clr-ink-light);
  font-style: italic;
}
.hood-map {
  width: 100%;
  height: 420px;
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  z-index: 1;
}
.hood-legend {
  background: var(--clr-white);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  line-height: 1.8;
}
.hood-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
}
.hood-popup-cat {
  display: inline-block;
  margin-top: 2px;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--clr-ink-light);
}

/* Controls */
.hood-controls {
  display: flex;
  gap: .6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.hood-controls label {
  font-weight: 700;
  color: var(--clr-ink);
}
.hood-controls select {
  padding: .35rem .6rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .88rem;
  background: var(--clr-white);
}

/* Table */
.hood-table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}
.hood-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.hood-table th {
  background: var(--clr-cream);
  padding: .6rem .8rem;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--clr-ink);
  border-bottom: 2px solid var(--clr-border);
  white-space: nowrap;
}
.hood-th-sort {
  cursor: pointer;
  user-select: none;
}
.hood-th-sort:hover {
  color: var(--clr-main);
}
.hood-table td {
  padding: .55rem .8rem;
  border-bottom: 1px solid var(--clr-border);
  vertical-align: top;
}
.hood-table tr:hover td {
  background: var(--clr-sand);
}
.hood-badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 3px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--clr-white);
}
.hood-badge--red   { background: #B7352E; }
.hood-badge--blue  { background: #2E6DB7; }
.hood-badge--green { background: #2E8B57; }

.hood-credit {
  font-size: .78rem;
  color: var(--clr-ink-light);
  text-align: right;
}

@media (max-width: 600px) {
  .hood-map { height: 300px; }
  .hood-controls { flex-direction: column; align-items: flex-start; }
}

.txt-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.pt-2 { padding-top: 2rem; }
.pb-2 { padding-bottom: 2rem; }

/* === Single Product === */
.sp-hero {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
}
.sp-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(44,44,44,.8) 0%, rgba(44,44,44,.2) 60%);
}
.sp-hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem var(--gap) 2.5rem;
  max-width: var(--wrap);
  margin: 0 auto;
  width: 100%;
}
.sp-hero h1 {
  color: var(--clr-white);
  font-size: 2.2rem;
  margin-bottom: .3rem;
}
.sp-price {
  color: var(--clr-cream);
  font-size: 1.3rem;
  font-weight: 700;
}

.sp-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  max-width: var(--wrap);
  margin: 2rem auto;
  padding: 0 var(--gap);
}
.sp-main { max-width: none; margin: 0; padding: 0; }

.sp-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}
.sp-buy-box {
  background: var(--clr-white);
  padding: 1.5rem;
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-md);
  margin-bottom: 1.2rem;
}
.sp-buy-price {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--clr-main);
  margin-bottom: 1rem;
}
.sp-buy-price span {
  font-size: .9rem;
  font-weight: 400;
  color: var(--clr-ink-light);
}
.sp-buy-btn {
  display: block;
  text-align: center;
  width: 100%;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  padding: .85rem 1rem;
}
.sp-disclosure {
  font-size: .78rem;
  color: var(--clr-ink-light);
  line-height: 1.5;
  border-top: 1px solid var(--clr-border);
  padding-top: .8rem;
  margin-bottom: 0;
}

.sp-hood-link {
  background: var(--clr-cream);
  padding: 1.3rem;
  border-radius: var(--radius-md);
}
.sp-hood-link h4 {
  font-size: 1.05rem;
  margin-bottom: .3rem;
}
.sp-hood-link p {
  font-size: .88rem;
  color: var(--clr-ink-light);
  margin-bottom: .8rem;
}
.sp-hood-link .btn {
  display: block;
  text-align: center;
  font-size: .9rem;
}

.sp-related {
  max-width: var(--wrap);
  margin: 3rem auto;
  padding: 0 var(--gap);
}
.sp-related h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .sp-layout {
    grid-template-columns: 1fr;
  }
  .sp-sidebar {
    position: static;
  }
  .sp-hero { min-height: 260px; }
}

/* === Dropdown Sub-Menu === */
.topnav > ul > li {
  position: relative;
}
.topnav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-top: 3px solid var(--clr-main);
  min-width: 180px;
  padding: .5rem 0;
  z-index: 200;
  list-style: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.topnav > ul > li:hover > .sub-menu,
.topnav > ul > li:focus-within > .sub-menu {
  display: block;
}
.topnav .sub-menu li {
  display: block;
}
.topnav .sub-menu a {
  display: block;
  padding: .45rem 1.2rem;
  font-size: .88rem;
  white-space: nowrap;
  border-bottom: none;
}
.topnav .sub-menu a:hover {
  background: var(--clr-sand);
  color: var(--clr-main);
}
.topnav > ul > li.menu-item-has-children > a::after {
  content: '▾';
  margin-left: .3rem;
  font-size: .7em;
}

@media (max-width: 768px) {
  .topnav .sub-menu {
    position: static;
    border: none;
    box-shadow: none;
    border-top: none;
    padding-left: 1rem;
    display: none;
  }
  .topnav.is-open .sub-menu {
    display: block;
  }
  .topnav > ul > li.menu-item-has-children > a::after {
    content: '▸';
  }
}
