/* ===== Top Hat Tutors Stylesheet ===== */

:root {
  --cream: #fbf3da;
  --paper: #fffdf6;
  --sage: #77906a;
  --sage-dark: #47592f;
  --sage-light: #c3d0ae;
  --brick: #dd4534;
  --brick-dark: #ab2f21;
  --brick-light: #f7c7ba;
  --ink: #2e2a1f;
  --white: #ffffff;
  --gray-700: #5b5646;
  --gray-500: #8c8672;
  --gray-200: #e9decb;
  --shadow: 0 10px 28px rgba(46, 42, 31, 0.14);
  --shadow-soft: 0 4px 14px rgba(46, 42, 31, 0.1);
  --radius: 14px;
  --max-width: 1120px;
  --font-heading: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-accent: 'Baloo 2', 'Fraunces', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--gray-700); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brick);
  font-weight: 700;
  margin-bottom: 0.75em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--sage-dark);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--sage);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-accent {
  background: var(--brick);
  color: var(--white);
}
.btn-accent:hover {
  background: var(--brick-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-outline {
  background: transparent;
  border-color: var(--sage-dark);
  color: var(--sage-dark);
}
.btn-outline:hover {
  background: var(--sage-dark);
  color: var(--white);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 243, 218, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--gray-200);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  position: relative;
  padding: 4px 0;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--brick);
}

.nav-links a.nav-cta {
  margin-left: 8px;
  color: var(--white);
}
.nav-links a.nav-cta:hover {
  color: var(--white);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: 0.2s;
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 20px;
    border-bottom: 2px solid var(--gray-200);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 0; }
  .nav-cta { margin: 12px 0 0; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 72px;
}

.hero-wordmark {
  max-width: 460px;
  width: 100%;
  margin-bottom: 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--sage-dark);
  font-weight: 700;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.hero-card {
  background: var(--sage-dark);
  color: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
  overflow: hidden;
}
.hero-card::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  background: var(--brick);
  opacity: 0.18;
  border-radius: 50%;
  top: -80px;
  right: -80px;
}
.hero-card h3 { color: var(--sage-light); margin-bottom: 16px; }
.hero-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero-card li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.hero-card li:last-child { border-bottom: none; }
.hero-card li svg { flex-shrink: 0; margin-top: 3px; color: var(--brick-light); }

/* ---------- Sections ---------- */
section { padding: 72px 0; }

.section-head {
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
}

.alt-bg { background: var(--paper); }

.section-tag {
  display: inline-flex;
  align-items: center;
  background: var(--sage);
  color: var(--paper);
  border-radius: 999px;
  padding: 7px 18px;
  font-family: var(--font-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ---------- Cards / Grid ---------- */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

.card {
  background: var(--paper);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card .icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--sage-dark);
  color: var(--brick-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--gray-700);
}
.card ul li { margin-bottom: 6px; }

/* ---------- Pushpin + pinned-card motif ---------- */
.pinned {
  position: relative;
}
.pinned::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ff8f7f, var(--brick) 58%, var(--brick-dark));
  box-shadow: 0 2px 5px rgba(46, 42, 31, 0.35);
  z-index: 2;
}

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  counter-reset: step;
}
@media (max-width: 800px) {
  .steps { grid-template-columns: 1fr; }
}
.step {
  position: relative;
  padding-top: 12px;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brick);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: 16px;
}

/* ---------- Testimonials ---------- */
.testimonial {
  background: var(--paper);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--brick);
  border-radius: var(--radius);
  padding: 28px;
  height: 100%;
}
.testimonial:nth-child(odd) { transform: rotate(-0.8deg); }
.testimonial:nth-child(even) { transform: rotate(0.8deg); }

.testimonial p.quote {
  font-style: italic;
  color: var(--ink);
}
.testimonial .who {
  font-family: var(--font-accent);
  font-weight: 700;
  color: var(--sage-dark);
  font-size: 0.9rem;
}

/* ---------- Photo placeholders / gallery ---------- */
.photo-placeholder {
  background: var(--paper);
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--gray-500);
  text-align: center;
  padding: 32px;
  min-height: 200px;
}
.photo-placeholder svg { color: var(--sage); }
.photo-placeholder span {
  font-family: var(--font-accent);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- CTA Band ---------- */
.cta-band {
  background: var(--sage-dark);
  color: var(--white);
  border-radius: var(--radius);
  padding: 56px;
  text-align: center;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: rgba(255,255,255,0.8); }

/* ---------- Forms / Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-info-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}
.contact-info-list li {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-200);
}
.contact-info-list .icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--sage-dark);
  color: var(--brick-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-embed {
  background: var(--paper);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-soft);
}
.form-embed iframe {
  width: 100%;
  min-height: 900px;
  border: 0;
  border-radius: 10px;
}

.form-fallback {
  padding: 32px;
  text-align: center;
}

.notice-box {
  background: var(--sage-light);
  border: 1px dashed var(--sage-dark);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 20px;
}
.notice-box code {
  background: rgba(46, 42, 31, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---------- Pricing (Subjects page rate note) ---------- */
.rate-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.rate-table th, .rate-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}
.rate-table th {
  background: var(--sage-dark);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 600;
}
.rate-table tr:last-child td { border-bottom: none; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  padding: 64px 0 40px;
  text-align: center;
}
.page-hero img.page-badge {
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
}
.page-hero p {
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- About page ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
}
.photo-frame {
  aspect-ratio: 4/5;
}
.photo-frame .photo-placeholder {
  height: 100%;
  min-height: 0;
}

.credentials {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 12px;
}
.credentials li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.credentials svg { color: var(--brick); flex-shrink: 0; margin-top: 3px; }

/* ---------- Tutor Directory ---------- */
.filter-bar {
  background: var(--paper);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 32px;
  box-shadow: var(--shadow-soft);
}
@media (max-width: 800px) {
  .filter-bar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .filter-bar { grid-template-columns: 1fr; }
}

.filter-field label {
  display: block;
  font-family: var(--font-accent);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-field select,
.filter-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--cream);
  color: var(--ink);
}
.filter-field select:focus,
.filter-field input:focus {
  outline: 2px solid var(--brick);
  outline-offset: 1px;
}

.filter-field .btn {
  width: 100%;
  justify-content: center;
}

.filter-results-count {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.tutor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
@media (max-width: 900px) {
  .tutor-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .tutor-grid { grid-template-columns: 1fr; }
}

.tutor-card {
  background: var(--paper);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tutor-card:nth-child(3n+1) { transform: rotate(-1.2deg); }
.tutor-card:nth-child(3n+2) { transform: rotate(0.9deg); }
.tutor-card:nth-child(3n+3) { transform: rotate(-0.6deg); }
.tutor-card:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: var(--shadow);
  z-index: 2;
}

.tutor-photo-wrap {
  background: var(--white);
  padding: 10px 10px 0;
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
  width: 190px;
  margin-bottom: 18px;
}
.tutor-photo,
.tutor-avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 3px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--white);
}

.tutor-card h3 {
  margin-bottom: 2px;
}
.tutor-grades {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.tutor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 14px;
}
.tag {
  background: var(--sage-light);
  color: var(--sage-dark);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: var(--font-accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.tutor-towns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-bottom: 12px;
  text-align: center;
}
.tutor-towns svg { color: var(--brick); flex-shrink: 0; }

.tutor-bio {
  font-size: 0.92rem;
  text-align: center;
  margin-bottom: 0;
}

.bio-toggle {
  margin-top: 4px;
}
.bio-toggle summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-accent);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--sage-dark);
}
.bio-toggle summary::-webkit-details-marker { display: none; }
.bio-toggle summary::marker { content: ""; }
.bio-toggle summary:hover { color: var(--brick); }
.bio-toggle summary .faq-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: transform 0.2s ease;
}
.bio-toggle[open] summary .faq-icon {
  transform: rotate(45deg);
}
.bio-toggle .tutor-bio {
  margin-top: 12px;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
}

/* ---------- FAQ Accordion ---------- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.faq-item {
  background: var(--paper);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 4px 24px;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ""; }

.faq-item summary .faq-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brick);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  transition: transform 0.2s ease;
}
.faq-item[open] summary .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 0 20px;
  color: var(--gray-700);
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--sage-dark);
  color: rgba(255,255,255,0.85);
  padding: 56px 0 28px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.16);
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-grid h4 { color: var(--white); font-size: 1rem; }
.footer-grid p { color: rgba(255,255,255,0.78); }
.footer-grid a {
  text-decoration: none;
  color: rgba(255,255,255,0.78);
}
.footer-grid a:hover { color: var(--brick-light); }
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--white);
  margin-bottom: 12px;
}
.footer-brand .brand-badge {
  width: 38px;
  height: 38px;
  background: var(--paper);
  padding: 3px;
}
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-bottom {
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
