/* ------------------------
   CSS RESET & NORMALIZE
   ------------------------ */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  box-sizing: border-box;
}
html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }
body {
  font-family: 'Lato', Georgia, serif;
  font-size: 16px;
  line-height: 1.6;
  background: #F1ECE7;
  color: #24304E;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: #24304E;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover, a:focus {
  color: #8E785E;
  text-decoration: underline;
}
ul, ol {
  margin-left: 24px;
  padding-left: 0;
}
li {
  margin-bottom: 10px;
}
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}
button {
  border: none;
  cursor: pointer;
  background: none;
}
hr {
  border: none;
  border-top: 1px solid #D3C8B6;
  margin: 32px 0;
}

/* ------------------------
   TYPOGRAPHY HIERARCHY
   ------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Merriweather', Georgia, Times, serif;
  color: #24304E;
  font-weight: 700;
  letter-spacing: 0.5px;
}
h1 { font-size: 2.5rem; line-height: 1.15; margin-bottom: 16px; }
h2 { font-size: 2rem; line-height: 1.22; margin-bottom: 16px; }
h3 { font-size: 1.5rem; line-height: 1.25; margin-bottom: 12px; }
h4 { font-size: 1.125rem; line-height: 1.3; margin-bottom: 10px; }
.subtitle {
  font-family: 'Lato', serif;
  font-size: 1.15rem;
  color: #4D5977;
  margin-bottom: 24px;
  line-height: 1.5;
}
p {
  margin-bottom: 16px;
  color: #24304E;
}
strong {
  font-weight: 700;
}

/* -----------
   CONTAINER 
   ----------- */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}
.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

/* --------------------
   HEADER & NAVIGATION
   -------------------- */
header {
  background: #fff;
  border-bottom: 1px solid #ece7e2;
}
header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 18px 20px;
}
header nav a img {
  height: 48px;
}
header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  list-style: none;
}
header nav ul li {
  margin: 0;
}
header nav ul li a {
  font-family: 'Lato', serif;
  font-size: 1rem;
  padding: 8px 0 5px 0;
  border-bottom: 2px solid transparent;
  transition: border-color .2s, color .2s;
  color: #24304E;
}
header nav ul li a:hover, header nav ul li a:focus,
header nav ul li a.active {
  color: #8E785E;
  border-bottom: 2px solid #8E785E;
}
.mobile-menu-toggle {
  display: none;
  background: #24304E;
  color: #fff;
  font-size: 2rem;
  border-radius: 7px;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: none;
  transition: background 0.2s, color 0.2s;
  z-index: 100;
}
.mobile-menu-toggle:focus,
.mobile-menu-toggle:hover {
  background: #8E785E;
  color: #fff;
}

/* -----------
   MOBILE MENU
   ----------- */
.mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(36, 48, 78, 0.97);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(.77,0,.175,1);
  padding: 0;
}
.mobile-menu.open {
  transform: translateX(0);
}
.mobile-menu-close {
  align-self: flex-end;
  margin: 26px 22px 8px 0;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.mobile-menu-close:hover, .mobile-menu-close:focus {
  background: #8E785E;
  color: #fff;
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  align-items: flex-start;
  margin-top: 24px;
  padding-left: 32px;
}
.mobile-nav a {
  color: #fff;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.25rem;
  padding: 10px 0;
  transition: color .2s, border .2s;
  border-bottom: 1px solid transparent;
  line-height: 1.3;
}
.mobile-nav a:hover, .mobile-nav a:focus {
  color: #D3C8B6;
  border-bottom: 1px solid #8E785E;
}

@media (max-width: 1024px) {
  header nav ul {
    gap: 16px;
  }
}
@media (max-width: 900px) {
  header nav ul {
    gap: 8px;
  }
}
@media (max-width: 768px) {
  header nav ul {
    display: none;
  }
  .mobile-menu-toggle {
    display: flex;
  }
  header nav a img {
    height: 42px;
  }
}

/* -----------
   LAYOUTS
   ----------- */
.section {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 3px 16px 0 rgba(36,48,78, 0.05);
}
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 32px;
}
.card {
  margin-bottom: 20px;
  position: relative;
  background: #fcfaf8;
  border-radius: 14px;
  box-shadow: 0 2px 8px 0 rgba(36,48,78,0.08);
  transition: box-shadow .18s, transform .18s;
  padding: 22px 22px 18px 22px;
  flex: 1 1 260px;
  min-width: 260px;
  max-width: 340px;
}
.card:hover, .card:focus {
  box-shadow: 0 6px 18px 0 rgba(36,48,78,0.12);
  transform: translateY(-2px) scale(1.018);
}
.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.text-image-section {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}
.testimonial-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: #F8F6F3;
  border-radius: 14px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(36,48,78,0.06);
  border: 1px solid #ECE7E2;
  position: relative;
  flex-direction: row;
  min-width: 0;
  max-width: 680px;
}
.testimonial-card p {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.08rem;
  color: #24304E;
  margin-bottom: 6px;
}
.testimonial-card span {
  color: #8E785E;
  font-family: 'Lato', serif;
  font-size: 0.98rem;
  margin-left: 12px;
  letter-spacing: 0.01em;
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}
.features-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
  margin-bottom: 8px;
}
.features-grid > div {
  background: #FAF8F5;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(36,48,78,0.05);
  padding: 24px 26px 18px;
  flex: 1 1 240px;
  min-width: 240px;
  max-width: 330px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: box-shadow .16s, transform .16s;
}
.features-grid > div img {
  margin-bottom: 14px;
  height: 46px;
}
.features-grid > div h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: #24304E;
}
.features-grid > div:hover {
  box-shadow: 0 5px 18px rgba(36,48,78,0.09);
  transform: translateY(-1px) scale(1.012);
}

@media (max-width: 768px) {
  .features-grid {
    flex-direction: column;
  }
  .content-grid {
    flex-direction: column;
    gap: 12px;
  }
  .testimonial-card {
    flex-direction: column;
    gap: 12px;
    padding: 14px 10px;
  }
  .section {
    padding: 24px 8px;
    margin-bottom: 38px;
  }
  .card-container {
    gap: 12px;
  }
  .card {
    min-width: 80vw;
    padding: 18px 12px 12px 12px;
  }
  .text-image-section {
    flex-direction: column;
    gap: 18px;
  }
}

/* -----------
   BUTTONS & CTAs
   ----------- */
.cta-button {
  display: inline-block;
  font-family: 'Merriweather', Georgia, serif;
  background: #24304E;
  color: #fff;
  font-size: 1.08rem;
  font-weight: 700;
  padding: 13px 32px;
  border-radius: 42px;
  border: 1px solid #24304E;
  margin-top: 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 12px rgba(36,48,78, 0.09);
  transition: background 0.22s, color 0.2s, border-color 0.22s, box-shadow 0.2s;
}
.cta-button:hover, .cta-button:focus {
  background: #8E785E;
  border-color: #8E785E;
  color: #fff;
  box-shadow: 0 6px 22px rgba(142,120,94,0.12);
  text-decoration: none;
  /* micro-interaction */
  transform: translateY(-1px) scale(1.018);
}
button.secondary, .cta-button.secondary {
  background: #8E785E;
  border-color: #8E785E;
  color: #fff;
}
button.secondary:hover, .cta-button.secondary:hover, .cta-button.secondary:focus {
  background: #24304E;
  border-color: #24304E;
  color: #fff;
}

/* -----------
   FOOTER
   ----------- */
footer {
  background: #24304E;
  color: #fff;
  font-family: 'Lato', serif;
  padding: 32px 0 18px 0;
  margin-top: 60px;
}
footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}
footer a {
  color: #FFEFD2;
  font-family: 'Lato', serif;
  font-size: 1rem;
}
footer nav {
  margin: 0 0 16px 0;
  font-size: 0.96rem;
}
footer nav a {
  margin: 0 5px 0 0;
  color: #CEC2AF;
  transition: color 0.2s;
}
footer nav a:hover, footer nav a:focus {
  color: #8E785E;
  text-decoration: underline;
}
footer img {
  height: 40px;
  margin-bottom: 12px;
}
footer .contact-info {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.97rem;
  color: #EADFCF;
  margin-top: 10px;
}
footer .contact-info img {
  height: 22px;
  margin-right: 4px;
}
@media (max-width: 768px) {
  footer .container {
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
    padding-left: 8px;
    padding-right: 8px;
  }
  footer nav {
    margin-bottom: 10px;
  }
}

/* --------------
   LISTS, LINKS
   -------------- */
ul, ol {
  margin-bottom: 20px;
}
ul li, ol li {
  color: #4D5977;
  margin-bottom: 8px;
}
ul li strong {
  color: #24304E;
}

/* -------- TESTIMONIALS -------- */
.testimonial-card {
  border-left: 5px solid #8E785E;
  box-shadow: 0 2px 12px 0 rgba(36,48,78,0.07);
  background: #fff;
}
.testimonial-card p {
  color: #24304E;
}

/* -------- UTILITIES -------- */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }

/* -------------
   COOKIES BANNER
   ------------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fffbe1;
  color: #24304E;
  font-family: 'Lato', serif;
  box-shadow: 0 -2px 16px 0 rgba(36,48,78,0.09);
  padding: 22px 16px 22px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3000;
  gap: 14px;
  transition: transform 0.3s cubic-bezier(.77,0,.175,1);
  transform: translateY(0);
}
.cookie-banner.hide {
  transform: translateY(120%);
}
.cookie-banner p {
  margin-bottom: 0;
  color: #24304E;
  font-size: 1.01rem;
}
.cookie-banner .cookie-btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.cookie-banner button {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.02rem;
  padding: 9px 22px;
  border-radius: 38px;
  box-shadow: 0 1px 2px rgba(36,48,78,0.07);
  border: 1px solid #8E785E;
  color: #fff;
  background: #8E785E;
  margin-top: 0;
  margin-bottom: 0;
  transition: background .17s, box-shadow .18s, color .17s;
}
.cookie-banner button.secondary {
  background: #24304E;
  border-color: #24304E;
}
.cookie-banner button.settings {
  background: transparent;
  color: #8E785E;
  border-color: #8E785E;
}
.cookie-banner button:hover, .cookie-banner button:focus {
  background: #24304E;
  color: #fff;
}
.cookie-banner button.settings:hover, .cookie-banner button.settings:focus {
  background: #8E785E;
  color: #fff;
}

/* --------------
   COOKIES MODAL
   -------------- */
.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36,48,78,0.22);
  z-index: 3001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  pointer-events: all;
  animation: fadeIn .26s;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.cookie-modal {
  background: #fff;
  border-radius: 18px;
  padding: 34px 26px 26px 26px;
  width: 98vw;
  max-width: 420px;
  box-shadow: 0 8px 48px 0 rgba(36,48,78,0.16);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
}
.cookie-modal h2 {
  font-size: 1.34rem;
  margin-bottom: 12px;
  color: #24304E;
  font-family: 'Merriweather', Georgia, serif;
}
.cookie-modal .category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cookie-modal .category label {
  font-family: 'Lato', serif;
  font-size: 1.03rem;
  color: #4D5977;
  margin-right: 8px;
}
.cookie-modal .toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.cookie-modal .toggle input {
  display: none;
}
.cookie-modal .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #e2d6c7;
  border-radius: 28px;
  transition: background 0.22s;
}
.cookie-modal .toggle input:checked + .slider {
  background: #8E785E;
}
.cookie-modal .slider:before {
  position: absolute;
  content: '';
  height: 18px; width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.cookie-modal .toggle input:checked + .slider:before {
  transform: translateX(20px);
}
.cookie-modal .category[aria-disabled='true'] {
  opacity: 0.6;
}
.cookie-modal .category[aria-disabled='true'] .toggle .slider {
  background: #cbc2b5;
}
.cookie-modal .close-modal {
  position: absolute;
  top: 12px; right: 14px;
  background: none;
  color: #8E785E;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}
.cookie-modal .close-modal:hover, .cookie-modal .close-modal:focus {
  color: #24304E;
}
.cookie-modal .modal-actions {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  margin-top: 22px;
}
.cookie-modal .modal-actions button {
  padding: 9px 22px;
  border-radius: 38px;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.02rem;
  color: #fff;
  background: #8E785E;
  border: 1px solid #8E785E;
  box-shadow: 0 1px 2px rgba(36,48,78,0.06);
}
.cookie-modal .modal-actions button.secondary {
  background: #24304E;
  border-color: #24304E;
}
.cookie-modal .modal-actions button:hover, .cookie-modal .modal-actions button:focus {
  background: #24304E;
  color: #fff;
}

@media (max-width: 500px) {
  .cookie-modal {
    padding: 16px 5px 14px 10px;
    max-width: 98vw;
  }
  .cookie-modal h2 {
    font-size: 1.16rem;
  }
}

/* ------------
   MEDIA QUERIES
   ------------ */
@media (max-width: 570px) {
  .container, .content-wrapper {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ------------
   BRAND FONTS
   ------------ */
@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 400;
  src: local('Merriweather'), local('Merriweather-Regular'), url('https://fonts.gstatic.com/s/merriweather/v22/u-4n0qyriQwlOrhSvowK_l521wRpX837pvq2.woff2') format('woff2');
  unicode-range: U+000-5FF;
}
@font-face {
  font-family: 'Merriweather';
  font-style: normal;
  font-weight: 700;
  src: local('Merriweather Bold'), local('Merriweather-Bold'), url('https://fonts.gstatic.com/s/merriweather/v22/u-4m0qyriQwlOrhSvowK_l5-eHjGw723pQGh2w.woff2') format('woff2');
  unicode-range: U+000-5FF;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url('https://fonts.gstatic.com/s/lato/v24/S6uyw4BMUTPHjxAwXiWtFCc.woff2') format('woff2');
  unicode-range: U+000-5FF;
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  src: local('Lato Bold'), local('Lato-Bold'), url('https://fonts.gstatic.com/s/lato/v24/S6u9w4BMUTPHh30wWCWtFA.woff2') format('woff2');
  unicode-range: U+000-5FF;
}

/* -------
   MISC.
   ------- */
::-webkit-selection { background: #8E785E; color: #fff; }
::selection { background: #8E785E; color: #fff; }

/* Hide scrollbars for modal overlay */
body.modal-open {
  overflow: hidden;
}

/* Accessibility focus style */
a:focus, button:focus, .cta-button:focus {
  outline: 2px solid #8E785E;
  outline-offset: 2px;
}

/* Loader spinner for modal (if needed) */
.loader {
  border: 4px solid #f3f3f3; 
  border-top: 4px solid #8E785E;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 1s linear infinite;
  margin: auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Ensure adequate margin between ALL content cards (critical for flex) */
.card, .features-grid > div, .testimonial-card {
  margin-right: 0;
  margin-bottom: 20px;
}
/* Responsive last-child fix for flex wrapping */
.card-container > *, .features-grid > *, .content-grid > * {
  flex-basis: calc(33% - 24px);
}
@media (max-width: 900px) {
  .card-container > *, .features-grid > *, .content-grid > * {
    flex-basis: 100%;
    max-width: 100%;
  }
}
