/*
Theme Name: Sanctuary
Theme URI: https://example.com/sanctuary
Author: Your Parish
Author URI: https://example.com
Description: A warm, reverent WordPress theme for Catholic parish websites. Features an arch-framed image carousel, a liturgical-season accent bar, a Mass times strip, and clean editorial layouts for homilies, bulletins, and news. Built to be lightweight, accessible, and easy for volunteer staff to update.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sanctuary
Tags: church, nonprofit, custom-menu, custom-logo, featured-images, translation-ready, threaded-comments, footer-widgets
*/

/* ==========================================================================
   0. DESIGN TOKENS
   Palette
     --color-parchment : #F1E9D8  page background, warm limestone
     --color-ink        : #2A241C  primary text, near-black umber
     --color-wine        : #5B1A2B  primary accent, vestment red-violet
     --color-wine-dark    : #3E1220  hover/active state of wine
     --color-gold        : #A9812E  secondary accent, worn gilt
     --color-sage        : #6E7856  tertiary accent, olive-sage
     --color-stone        : #C9BFA8  borders, rules, quiet dividers
     --color-paper        : #FAF6EC  card / surface background, lighter than page
   Type
     Display : "Cormorant Garamond" - illuminated-manuscript character, used with restraint
     Body    : "Source Serif 4" - readable long-form serif
     Utility : "Jost" - humanist sans, small-caps + tracked, for nav/labels/meta
   ========================================================================== */

:root {
  --color-parchment: #F1E9D8;
  --color-ink: #2A241C;
  --color-wine: #5B1A2B;
  --color-wine-dark: #3E1220;
  --color-gold: #A9812E;
  --color-sage: #6E7856;
  --color-stone: #C9BFA8;
  --color-paper: #FAF6EC;

  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --font-utility: "Jost", "Trebuchet MS", sans-serif;

  --liturgical-color: var(--color-sage); /* overridden inline by Customizer */

  --rule: 1px solid var(--color-stone);
  --radius-arch: 220px 220px 8px 8px;
  --container: 1180px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.75rem;
  --space-4: 3rem;
  --space-5: 5rem;
}

/* ==========================================================================
   1. RESET & BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--color-parchment);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-wine);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--color-wine-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--color-ink);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1.2em; }

.eyebrow {
  font-family: var(--font-utility);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-wine);
  display: inline-block;
  margin-bottom: 0.6em;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-wine);
  color: #fff;
  padding: 0.75em 1.25em;
  z-index: 10000;
  font-family: var(--font-utility);
}
.skip-link:focus { left: var(--space-2); top: var(--space-2); }

:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

button { font-family: inherit; }

.btn {
  display: inline-block;
  font-family: var(--font-utility);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85em 1.7em;
  border: 1px solid var(--color-wine);
  color: var(--color-wine);
  background: transparent;
  border-radius: 2px;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn:hover { background: var(--color-wine); color: var(--color-paper); }
.btn-solid { background: var(--color-wine); color: var(--color-paper); }
.btn-solid:hover { background: var(--color-wine-dark); color: var(--color-paper); }

/* ==========================================================================
   2. LITURGICAL ACCENT BAR
   A thin rule beneath the header whose color follows the current
   liturgical season, set via Customizer > Site Identity > Liturgical Season.
   ========================================================================== */

.liturgical-bar {
  height: 6px;
  width: 100%;
  background: var(--liturgical-color);
}

/* ==========================================================================
   3. SITE HEADER & NAVIGATION
   ========================================================================== */

.site-header {
  background: var(--color-paper);
  border-bottom: var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  gap: var(--space-3);
}

.site-branding { display: flex; align-items: center; gap: 0.9rem; }
.site-branding img.custom-logo { max-height: 58px; width: auto; }

.site-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin: 0;
  letter-spacing: 0.01em;
}
.site-title a { color: var(--color-ink); text-decoration: none; }

.site-description {
  font-family: var(--font-utility);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-sage);
  margin-top: 0.15em;
}

.main-navigation { font-family: var(--font-utility); }
.main-navigation ul {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
}
.main-navigation a {
  color: var(--color-ink);
  text-decoration: none;
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.4em 0.1em;
  border-bottom: 2px solid transparent;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  border-bottom-color: var(--color-gold);
  color: var(--color-wine);
}
.main-navigation ul ul {
  display: none;
  position: absolute;
  flex-direction: column;
  background: var(--color-paper);
  border: var(--rule);
  padding: 0.5em 0;
  min-width: 200px;
  z-index: 50;
  gap: 0;
}
.main-navigation li { position: relative; }
.main-navigation li:hover > ul,
.main-navigation li:focus-within > ul { display: flex; }
.main-navigation ul ul a { padding: 0.6em 1em; display: block; }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-ink);
  padding: 0.5em 0.8em;
  font-family: var(--font-utility);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ==========================================================================
   4. HERO ARCH CAROUSEL
   Signature element: the carousel is framed inside a pointed (gothic) arch,
   echoing a church window. Slides crossfade; captions sit on a scroll-like
   gradient plinth at the foot of the arch.
   ========================================================================== */

.hero-arch-wrap {
  background: var(--color-ink);
  padding: var(--space-4) 0 var(--space-3);
  text-align: center;
}

.hero-arch {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-arch);
  overflow: hidden;
  border: 6px solid var(--color-gold);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  background: var(--color-wine-dark);
}

@media (min-width: 700px) {
  .hero-arch { aspect-ratio: 16 / 9; border-radius: 320px 320px 8px 8px; }
}

.carousel { position: relative; width: 100%; height: 100%; }

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease;
}
.carousel-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.03);
}

.carousel-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: var(--space-4) var(--space-3) var(--space-3);
  background: linear-gradient(to top, rgba(20,14,10,0.88), rgba(20,14,10,0));
  color: var(--color-paper);
  text-align: left;
}
.carousel-caption .eyebrow { color: var(--color-gold); }
.carousel-caption h2 { color: #fff; margin-bottom: 0.2em; }
.carousel-caption p { color: rgba(250,246,236,0.85); max-width: 34em; margin-bottom: 0; }

.carousel-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-2);
  pointer-events: none;
  z-index: 2;
}
.carousel-arrow {
  pointer-events: auto;
  background: rgba(250,246,236,0.15);
  border: 1px solid rgba(250,246,236,0.5);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.carousel-arrow:hover { background: rgba(250,246,236,0.35); }

.carousel-dots {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-3);
  display: flex;
  gap: 0.5em;
  z-index: 2;
}
.carousel-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(250,246,236,0.4);
  border: none;
  cursor: pointer;
  padding: 0;
}
.carousel-dot.is-active { background: var(--color-gold); }

.hero-verse {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-stone);
  max-width: 40em;
  margin: var(--space-3) auto 0;
  font-size: 1.15rem;
}

/* ==========================================================================
   5. MASS TIMES STRIP
   Styled like a processional banner: a wine band with gold rules,
   columns for each Mass type.
   ========================================================================== */

.mass-times {
  background: var(--color-wine);
  color: var(--color-paper);
  padding: var(--space-4) 0;
}
.mass-times-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}
.mass-times h2 { color: #fff; text-align: center; margin-bottom: var(--space-3); }
.mass-times .eyebrow { color: var(--color-gold); text-align: center; display: block; }
.mass-block {
  border-left: 2px solid var(--color-gold);
  padding-left: var(--space-2);
}
.mass-block h3 {
  font-family: var(--font-utility);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  color: var(--color-gold);
  margin-bottom: 0.5em;
}
.mass-block ul { list-style: none; margin: 0; padding: 0; }
.mass-block li {
  padding: 0.35em 0;
  border-bottom: 1px solid rgba(250,246,236,0.15);
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.mass-block li span { float: right; color: var(--color-stone); font-family: var(--font-utility); font-size: 0.85rem; }

/* ==========================================================================
   6. CONTENT SECTIONS
   ========================================================================== */

.section { padding: var(--space-5) 0; }
.section-tight { padding: var(--space-4) 0; }
.section-alt { background: var(--color-paper); border-top: var(--rule); border-bottom: var(--rule); }

.welcome-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start; /* default: image top aligns with heading; overridden inline from the Customizer */
  gap: var(--space-4);
}
.welcome-grid > div:first-child {
  flex: 1 1 380px;
}
.welcome-grid > div:last-child {
  flex: 0 0 auto;
}
.welcome-image-frame {
  position: relative;
  overflow: hidden;
  border: 7px solid var(--color-gold);
  border-radius: 130px 130px 6px 6px;
  box-shadow: 0 24px 44px -20px rgba(42,36,28,0.4);
  background: var(--color-wine-dark);
}
/* 3:4 ratio via padding-top, more consistent across browsers/customizer previews than aspect-ratio */
.welcome-image-frame::before {
  content: "";
  display: block;
  padding-top: 133.333%;
}
.welcome-image-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 880px) {
  .welcome-grid > div:last-child { margin: 0 auto; }
}
.welcome-grid .drop-cap::first-letter {
  font-family: var(--font-display);
  font-size: 3.4em;
  float: left;
  line-height: 0.8;
  padding: 0.05em 0.08em 0 0;
  color: var(--color-wine);
}

.find-us-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: var(--space-4);
  align-items: stretch;
}
.map-embed {
  min-height: 340px;
  border-radius: 4px;
  overflow: hidden;
  border: var(--rule);
  background: var(--color-stone);
}
.map-embed iframe { width: 100%; height: 100%; min-height: 340px; display: block; }
.find-us-details address {
  font-style: normal;
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: var(--space-2);
}
.find-us-details .mass-block { border-left-color: var(--color-wine); margin-top: var(--space-3); }
.find-us-details .mass-block h3 { color: var(--color-wine); }
.find-us-details .mass-block li { color: var(--color-ink); border-bottom-color: var(--color-stone); }
.find-us-details .mass-block li span { color: #7a7157; }

@media (max-width: 880px) {
  .find-us-grid { grid-template-columns: 1fr; }
  .map-embed { min-height: 280px; }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}
.card {
  background: var(--color-paper);
  border: var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
.card img { aspect-ratio: 3/2; object-fit: cover; }
.card-body { padding: var(--space-3); }
.card time {
  font-family: var(--font-utility);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-sage);
}
.card h3 { margin: 0.3em 0 0.4em; font-size: 1.25rem; }
.card h3 a { color: var(--color-ink); text-decoration: none; }
.card p { color: #52493a; font-size: 0.97rem; margin-bottom: 0; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-3);
  border-bottom: var(--rule);
  padding-bottom: var(--space-2);
}
.section-heading h2 { margin: 0; }

/* ==========================================================================
   7. SINGLE / PAGE CONTENT
   ========================================================================== */

.content-area { padding: var(--space-5) 0; }
.entry-header { text-align: center; max-width: 46em; margin: 0 auto var(--space-4); }
.entry-meta {
  font-family: var(--font-utility);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-sage);
}
.entry-content {
  max-width: 42em;
  margin: 0 auto;
  font-size: 1.1rem;
}
.entry-content h2 { margin-top: 1.4em; }
.entry-content blockquote {
  margin: 1.6em 0;
  padding-left: 1.2em;
  border-left: 3px solid var(--color-gold);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--color-wine);
}
.entry-content img { border-radius: 4px; margin: 1.5em 0; }
.entry-featured-image { margin-bottom: var(--space-4); }
.entry-featured-image img { width: 100%; border-radius: 4px; max-height: 480px; object-fit: cover; }

.page-links, .post-navigation {
  max-width: 42em;
  margin: var(--space-4) auto 0;
  font-family: var(--font-utility);
  font-size: 0.85rem;
}

/* ==========================================================================
   8. SIDEBAR & WIDGETS
   ========================================================================== */

.content-with-sidebar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
}
.widget { margin-bottom: var(--space-4); }
.widget-title {
  font-family: var(--font-utility);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--color-wine);
  border-bottom: var(--rule);
  padding-bottom: 0.5em;
  margin-bottom: 0.8em;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 0.4em 0; border-bottom: 1px solid var(--color-stone); font-size: 0.95rem; }

/* ==========================================================================
   9. FORMS / COMMENTS / SEARCH
   ========================================================================== */

input[type=text], input[type=email], input[type=url], input[type=search], textarea, select {
  width: 100%;
  padding: 0.7em 0.9em;
  border: 1px solid var(--color-stone);
  background: var(--color-paper);
  font-family: var(--font-body);
  border-radius: 2px;
}
.comment-form p { margin-bottom: 1em; }
.search-form { display: flex; gap: 0.5em; }

/* ==========================================================================
   10. FOOTER
   ========================================================================== */

.faq-section {
  background: var(--color-paper);
  border-bottom: var(--rule);
  padding: var(--space-5) 0;
}
.faq-section .eyebrow { display: block; text-align: center; }
.faq-section h2 { text-align: center; margin-bottom: var(--space-4); }
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.faq-item {
  border: var(--rule);
  border-radius: 4px;
  background: var(--color-parchment);
  padding: 0;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1em 1.3em;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-utility);
  font-size: 1.3rem;
  color: var(--color-gold);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] summary { border-bottom: 1px solid var(--color-stone); }
.faq-item p {
  margin: 0;
  padding: 1em 1.3em 1.3em;
  color: #52493a;
  font-size: 0.98rem;
}

.site-footer {
  background: var(--color-ink);
  color: var(--color-stone);
  padding: var(--space-5) 0 var(--space-3);
  font-family: var(--font-utility);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.footer-grid h3 {
  font-family: var(--font-utility);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--color-gold);
  margin-bottom: 0.8em;
}
.footer-grid p, .footer-grid address { font-style: normal; font-size: 0.92rem; line-height: 1.7; margin: 0; }
.footer-grid a { color: var(--color-stone); }
.footer-grid a:hover { color: #fff; }
.footer-map {
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(201,191,168,0.3);
  filter: grayscale(0.15) contrast(1.05);
}
.footer-map iframe { width: 100%; height: 100%; display: block; }
.site-footer .widget ul { }
.site-footer .widget li { border-bottom: 1px solid rgba(201,191,168,0.15); }

.footer-bottom {
  border-top: 1px solid rgba(201,191,168,0.2);
  padding-top: var(--space-2);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5em;
  font-size: 0.78rem;
}

/* ==========================================================================
   12. LIVE CHAT ASSISTANT
   ========================================================================== */

.chatbot {
  position: fixed;
  right: var(--space-3);
  bottom: var(--space-3);
  z-index: 200;
  font-family: var(--font-utility);
}

.chatbot-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65em;
  background: var(--color-gold);
  color: var(--color-wine-dark);
  border: none;
  border-radius: 999px;
  padding: 0.75em 1.4em 0.75em 0.75em;
  box-shadow: 0 16px 32px -12px rgba(42,36,28,0.55);
  cursor: pointer;
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  animation: chatbot-float 3.2s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.chatbot-toggle:hover {
  background: #96772a;
  transform: translateY(-3px);
  box-shadow: 0 20px 38px -12px rgba(42,36,28,0.6);
  animation-play-state: paused;
}
@keyframes chatbot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .chatbot-toggle { animation: none; }
}
.chatbot-toggle-icon-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-wine);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chatbot-toggle-icon { width: 18px; height: 18px; }
.chatbot-badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e0473e;
  border: 2px solid var(--color-parchment);
}
.chatbot.chatbot-opened .chatbot-badge-dot { display: none; }

.chatbot-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: min(380px, calc(100vw - 2 * var(--space-3)));
  max-height: min(600px, 78vh);
  background: var(--color-paper);
  border: 1px solid var(--color-stone);
  border-radius: 14px;
  box-shadow: 0 28px 56px -18px rgba(42,36,28,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatbot-panel-in 0.22s ease;
  transform-origin: bottom right;
}
@keyframes chatbot-panel-in {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .chatbot-panel { animation: none; }
}

/* Header --------------------------------------------------------------- */
.chatbot-header {
  background: var(--color-wine);
  color: #fff;
  padding: 0.9em 1em;
  display: flex;
  align-items: center;
  gap: 0.7em;
}
.chatbot-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-gold);
  color: var(--color-wine-dark);
  font-family: var(--font-utility);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chatbot-header-text { flex: 1 1 auto; min-width: 0; }
.chatbot-header-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.2;
}
.chatbot-header-status {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.03em;
}
.chatbot-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4caf6d;
  display: inline-block;
  flex-shrink: 0;
}
.chatbot-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.1em;
  flex-shrink: 0;
}

/* Message thread --------------------------------------------------------- */
.chatbot-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1em;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  background: var(--color-parchment);
}
.chatbot-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5em;
}
.chatbot-msg-row.user { justify-content: flex-end; }
.chatbot-msg-col { max-width: 82%; display: flex; flex-direction: column; }
.chatbot-msg-row.user .chatbot-msg-col { align-items: flex-end; }

.chatbot-avatar-sm {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--color-gold);
  color: var(--color-wine-dark);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chatbot-message {
  padding: 0.7em 0.95em;
  border-radius: 12px;
  font-size: 0.89rem;
  line-height: 1.5;
}
.chatbot-message-bot {
  background: var(--color-paper);
  border: 1px solid var(--color-stone);
  color: var(--color-ink);
  border-bottom-left-radius: 3px;
}
.chatbot-message-user {
  background: var(--color-wine);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.chatbot-hint {
  margin-top: 0.6em;
  padding-top: 0.6em;
  border-top: 1px dashed var(--color-stone);
  font-style: italic;
  font-size: 0.78rem;
  color: #7a7157;
}
.chatbot-msg-time {
  margin-top: 0.25em;
  font-size: 0.68rem;
  color: #9a9074;
  padding: 0 0.2em;
}

.chatbot-call-wrap { padding: 0; }
.chatbot-call-btn { font-size: 0.78rem; padding: 0.7em 1.1em; display: inline-block; }

/* Quick-reply topic grid ------------------------------------------------- */
.chatbot-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5em;
  padding-left: calc(26px + 0.5em); /* align under the bot avatar column */
}
.chatbot-chip {
  background: var(--color-paper);
  border: 1px solid var(--color-gold);
  color: var(--color-wine);
  border-radius: 999px;
  padding: 0.55em 0.8em;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}
.chatbot-chip:hover { background: var(--color-gold); color: var(--color-wine-dark); }

/* Footer status bar + reset ---------------------------------------------- */
.chatbot-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55em 1em;
  background: var(--color-paper);
  border-top: var(--rule);
  font-size: 0.75rem;
  color: #7a7157;
}
.chatbot-online { display: flex; align-items: center; gap: 0.4em; }
.chatbot-reset {
  display: flex;
  align-items: center;
  gap: 0.35em;
  background: none;
  border: none;
  color: var(--color-wine);
  font-family: var(--font-utility);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}
.chatbot-reset svg { width: 13px; height: 13px; }
.chatbot-reset:hover { color: var(--color-wine-dark); }

/* Input row --------------------------------------------------------------- */
.chatbot-form {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7em;
  border-top: var(--rule);
  background: var(--color-paper);
}
.chatbot-input {
  flex: 1 1 auto;
  padding: 0.65em 1em;
  font-size: 0.88rem;
  border-radius: 999px;
  border: 1px solid var(--color-stone);
  background: var(--color-parchment);
}
.chatbot-send {
  width: 38px; height: 38px;
  flex-shrink: 0;
  background: var(--color-wine);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chatbot-send svg { width: 16px; height: 16px; }
.chatbot-send:hover { background: var(--color-wine-dark); }

@media (max-width: 480px) {
  .chatbot { right: var(--space-2); bottom: var(--space-2); }
  .chatbot-toggle-label { display: none; }
  .chatbot-toggle { padding: 0.7em; }
  .chatbot-panel { width: calc(100vw - 2 * var(--space-2)); right: -0.4rem; }
}

/* ==========================================================================
   11. RESPONSIVE
   ========================================================================== */

@media (max-width: 880px) {
  .content-with-sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .main-navigation { display: none; width: 100%; }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { flex-direction: column; gap: 0; }
  .main-navigation ul ul { position: static; border: none; padding-left: 1em; }
  .main-navigation li:hover > ul, .main-navigation li:focus-within > ul { display: none; }
  .main-navigation li.submenu-open > ul { display: flex; }
  .header-inner { flex-wrap: wrap; }
  .menu-toggle { display: block; order: 3; }
  .site-branding { order: 1; }
  .main-navigation { order: 4; }
}

@media (max-width: 600px) {
  .hero-arch { border-radius: 90px 90px 6px 6px; }
  .carousel-caption h2 { font-size: 1.5rem; }
}
