/*
Theme Name: Online British Homes
Theme URI: https://onlinebritishhomes.co.uk
Author: William Gourley
Description: Custom theme for Online British Homes - cosy heritage boutique home decor. WooCommerce ready.
Version: 1.0
Requires PHP: 7.4
Text Domain: onlinebritishhomes
*/

:root {
  --color-bg: #F9F7F2;
  --color-sage: #9BB0A5;
  --color-sage-dark: #82988C;
  --color-oak: #8C6D51;
  --color-oak-dark: #705640;
  --color-cream-card: #FFFFFF;
  --color-border: #E5E0D5;
  --color-text: #333333;
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-body: Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  margin: 0;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-oak-dark);
  margin: 0 0 0.5em;
}

button, input, select, textarea, optgroup {
  font-family: var(--font-body);
  font-size: 1rem;
}

a { color: inherit; text-decoration: none; }

.btn {
  display: inline-block;
  background: var(--color-oak);
  color: #fff;
  padding: 0.85em 1.8em;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--color-oak-dark); }

.btn-sage {
  background: var(--color-sage);
}
.btn-sage:hover { background: var(--color-sage-dark); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

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

/* -----------------------------------------------------------
   Header
----------------------------------------------------------- */

.site-header {
  background: var(--color-cream-card);
  border-bottom: 1px solid var(--color-border);
}

.site-header-top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 24px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.menu-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-oak-dark);
}

.site-branding {
  flex: 0 0 auto;
}
.site-branding .custom-logo {
  max-height: 64px;
  width: auto;
}
.site-logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  line-height: 1.25;
  color: var(--color-oak-dark);
  font-weight: 700;
}
.site-logo .site-logo-line-1 {
  display: block;
  font-weight: 400;
  color: var(--color-sage-dark);
  font-size: 0.7em;
  letter-spacing: 0.15em;
}

.header-search-form {
  flex: 1 1 auto;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 18px;
  color: var(--color-text);
}
.header-search-form svg { flex: 0 0 auto; color: var(--color-oak); }
.header-search-form input[type="search"] {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  color: var(--color-text);
  outline: none;
}
.header-search-form input[type="search"]::placeholder {
  color: #8a8a8a;
}

.header-icons {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.header-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--color-oak-dark);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.header-icon-btn:hover { background: var(--color-bg); }
.cart-icon-btn .cart-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--color-oak);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.primary-nav {
  background: var(--color-sage);
}
.primary-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.primary-menu li a {
  display: block;
  padding: 14px 18px;
  color: #fff;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
}
.primary-menu li a:hover { color: var(--color-oak-dark); }

/* -----------------------------------------------------------
   Hero
----------------------------------------------------------- */

.hero { padding: 64px 0 88px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-content-order { order: 2; }
.hero-grid-order { order: 1; }

.hero-eyebrow {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-sage-dark);
  margin: 0 0 14px;
}
.hero-headline {
  font-size: 2.9rem;
  line-height: 1.18;
  margin: 0 0 20px;
}
.hero-text {
  font-size: 1.08rem;
  color: var(--color-text);
  margin: 0 0 32px;
  max-width: 46ch;
}

.hero-image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.hero-image-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-cream-card);
  border: 1px solid var(--color-border);
}
.hero-image-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-sage-dark);
  background: var(--color-bg);
  text-align: center;
  padding: 12px;
}
.image-placeholder span { font-size: 0.72rem; line-height: 1.4; }

/* -----------------------------------------------------------
   Browse by Category
----------------------------------------------------------- */

.category-section { padding: 80px 0; }
.section-heading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}
.section-heading h2 { margin-bottom: 12px; }
.section-heading p { margin: 0; color: var(--color-text); }

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.category-card {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--color-cream-card);
  border: 1px solid var(--color-border);
}
.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.category-card .image-placeholder { border-radius: 12px; }
.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(51, 51, 51, 0) 40%, rgba(51, 51, 51, 0.75) 100%);
}
.category-card-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

/* -----------------------------------------------------------
   Stats / Mission band
----------------------------------------------------------- */

.mission-band {
  background: var(--color-oak-dark);
  color: #fff;
  padding: 72px 0;
}
.mission-inner {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}
.mission-inner h2 { color: #fff; margin-bottom: 16px; }
.mission-inner p { color: rgba(255, 255, 255, 0.88); margin: 0; font-size: 1.05rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: center;
}
.stat-item { padding: 0 12px; }
.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-sage);
  margin-bottom: 14px;
}
.stat-item h3 { color: #fff; font-size: 1.1rem; margin-bottom: 8px; }
.stat-item p { color: rgba(255, 255, 255, 0.78); font-size: 0.92rem; margin: 0; }

/* -----------------------------------------------------------
   Newsletter
----------------------------------------------------------- */

.newsletter {
  background: var(--color-bg);
  padding: 72px 0;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.newsletter-inner { max-width: 560px; margin: 0 auto; }
.newsletter p { margin: 0 0 28px; }
.newsletter-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.newsletter-form input[type="email"] {
  flex: 1 1 260px;
  padding: 0.85em 1.2em;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-cream-card);
}
.newsletter-message {
  border-radius: 8px;
  padding: 10px 16px;
  margin: 0 0 20px;
  font-size: 0.9rem;
  display: inline-block;
}
.newsletter-message-success { background: rgba(155, 176, 165, 0.25); color: var(--color-sage-dark); }
.newsletter-message-error { background: rgba(179, 58, 58, 0.1); color: #a33; }

/* -----------------------------------------------------------
   Footer
----------------------------------------------------------- */

.site-footer {
  background: var(--color-oak-dark);
  color: rgba(255, 255, 255, 0.75);
  padding-top: 56px;
}
.footer-top { text-align: center; margin-bottom: 40px; }
.footer-brand .custom-logo { max-height: 60px; width: auto; margin-bottom: 12px; filter: brightness(0) invert(1); }
.footer-brand .site-logo { color: #fff; font-size: 1.3rem; }
.footer-brand .site-logo .site-logo-line-1 { color: rgba(255, 255, 255, 0.7); }
.footer-tagline {
  font-family: var(--font-heading);
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  margin: 0;
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.footer-col-title {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 16px;
}
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { margin-bottom: 10px; }
.footer-list a { color: rgba(255, 255, 255, 0.75); transition: color 0.15s ease; }
.footer-list a:hover { color: var(--color-sage); }
.footer-bottom {
  padding: 20px 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

/* -----------------------------------------------------------
   Generic pages / WooCommerce wrapper
----------------------------------------------------------- */

.page-wrap { padding: 56px 0; }
.page-title { font-size: 2rem; }
.page-header { margin-bottom: 24px; }
.page-body :is(h2, h3) { margin-top: 1.5em; }
.page-body ul, .page-body ol { padding-left: 1.4em; }
.woocommerce-page-wrap { padding: 48px 0; }

/* -----------------------------------------------------------
   Responsive
----------------------------------------------------------- */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-content-order { order: 1; }
  .hero-grid-order { order: 2; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid, .footer-columns { grid-template-columns: repeat(2, 1fr); }
  .hero-headline { font-size: 2.2rem; }
}

@media (max-width: 782px) {
  .menu-toggle { display: flex; }
  .site-header-top { flex-wrap: wrap; column-gap: 12px; }
  .site-branding .custom-logo {
    max-width: 130px;
    max-height: 48px;
    width: auto;
    height: auto;
  }
  .header-search-form { order: 3; flex: 1 1 100%; max-width: none; }
  .primary-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
  }
  .primary-nav.is-open { max-height: 400px; }
  .primary-menu { flex-direction: column; }
  .category-grid { grid-template-columns: 1fr; }
  .stats-grid, .footer-columns { grid-template-columns: 1fr; }
}
