/*
Theme Name: AlwaysInMemory
Theme URI: https://alwaysinmemory.com
Author: William Gourley
Description: Custom theme for AlwaysInMemory, personalised sympathy & bereavement support. WooCommerce ready.
Version: 1.0
Requires PHP: 7.4
Text Domain: alwaysinmemory
*/

:root {
  --color-bg: #FBF7F0;
  --color-navy: #1B2A41;
  --color-navy-soft: #2D3F5C;
  --color-accent: #D98547;
  --color-accent-dark: #BC6D34;
  --color-blush: #F5E2D3;
  --color-cream-card: #FFFFFF;
  --color-border: #E6DCCB;
  --color-text: #333333;
  --font-primary: Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

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

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

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

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

.btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 0.85em 1.8em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--color-accent-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-navy);
}

.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: #fff;
}

.site-branding {
  flex: 0 0 auto;
}
.site-branding .custom-logo {
  max-height: 64px;
  width: auto;
}
.site-logo {
  font-family: var(--font-primary);
  font-size: 1.4rem;
  color: #fff;
  font-weight: 600;
}

.header-search-form {
  flex: 1 1 auto;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 8px 18px;
  color: #fff;
}
.header-search-form svg { flex: 0 0 auto; color: rgba(255, 255, 255, 0.7); }
.header-search-form input[type="search"] {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  color: #fff;
  outline: none;
}
.header-search-form input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.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: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.header-icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.cart-icon-btn .cart-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--color-accent);
  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 {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.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-accent); }

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

.hero {
  position: relative;
  background: var(--color-blush) center/cover no-repeat;
  padding: 110px 0;
  overflow: hidden;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(27, 42, 65, 0.35), rgba(27, 42, 65, 0.55));
}
.hero-media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--color-navy-soft);
  background: var(--color-blush);
}
.hero-media-placeholder span { font-size: 0.85rem; max-width: 260px; text-align: center; }

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  color: #fff;
}
.hero-caption {
  letter-spacing: 0.25em;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.85);
}
.hero-headline {
  font-size: 2.75rem;
  line-height: 1.2;
  color: #fff;
  margin: 0 0 20px;
}
.hero-headline-accent {
  display: inline-block;
  font-family: var(--font-primary);
  font-style: italic;
  color: var(--color-accent);
  font-weight: 500;
}
.hero-text {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 32px;
}

/* -----------------------------------------------------------
   Testimonials
----------------------------------------------------------- */

.testimonials {
  background: var(--color-navy);
  padding: 80px 0;
  text-align: center;
}
.testimonials-title {
  color: #fff;
  margin-bottom: 48px;
}
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.testimonial {
  margin: 0;
  padding: 0 12px;
}
.testimonial-quote {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 16px;
}
.testimonial-author {
  color: var(--color-accent);
  font-style: normal;
  font-weight: 600;
  font-size: 0.9rem;
}

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

.newsletter {
  background: var(--color-blush);
  padding: 72px 0;
  text-align: center;
}
.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(217, 133, 71, 0.15); color: var(--color-accent-dark); }
.newsletter-message-error { background: rgba(179, 58, 58, 0.1); color: #a33; }

/* -----------------------------------------------------------
   Feature row
----------------------------------------------------------- */

.feature-row { padding: 80px 0; }
.feature-row-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  margin-bottom: 14px;
}
.feature-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-item p { font-size: 0.9rem; color: var(--color-text); margin: 0; }

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

.site-footer {
  background: var(--color-navy);
  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; }
.footer-brand .site-logo { color: #fff; font-size: 1.3rem; }
.footer-tagline {
  font-family: var(--font-primary);
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  margin: 0;
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.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-accent); }
.footer-bottom {
  padding: 20px 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
}

/* -----------------------------------------------------------
   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; }
.woocommerce-page-wrap { padding: 48px 0; }

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

@media (max-width: 900px) {
  .testimonials-grid,
  .feature-row-inner,
  .footer-columns {
    grid-template-columns: 1fr;
  }
  .hero-headline { font-size: 2.1rem; }
}

@media (max-width: 782px) {
  .menu-toggle { display: flex; }
  .site-header-top { flex-wrap: wrap; column-gap: 8px; padding-left: 14px; padding-right: 14px; }
  .site-branding .custom-logo {
    max-width: 205px;
    max-height: 50px;
    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; }
}
