/* ==========================================================
   Hua Hin Paws Hub — Modernization layer
   Loads AFTER style.css. Overrides only, doesn't define base.
   ========================================================== */

/* ---------- Palette ---------- */
:root {
  --green: #15803d;
  --green-dark: #115e2c;
  --orange: #f59e0b;
  --softcream: #fafaf8;
  --darkbrown: #1a1a1a;
  --border-card: #e5e7eb;
  --blue: #2563eb;
  --red: #dc2626;
  --muted: #6b7280;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius-btn: 8px;
  --radius-card: 12px;
}

/* ---------- Typography ---------- */
body,
input, button, select, textarea {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 17px;
  line-height: 1.65;
  color: var(--darkbrown);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.title-big, .title-small,
.section-title, .dashboard-title,
.page-hero h1, .mkt-shop-cta h3,
.contact-point strong {
  font-family: 'Fraunces', Georgia, serif !important;
  letter-spacing: -0.02em;
  font-feature-settings: "ss01";
}

[style*="font-family:Georgia"],
[style*="font-family: Georgia"] {
  font-family: 'Fraunces', Georgia, serif !important;
}

/* ---------- Links ---------- */
a {
  color: var(--green);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Header nav — larger, more legible ---------- */
header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 1rem 0;
}
header nav a {
  font-family: 'Inter', sans-serif !important;
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  padding: 0.55rem 0.95rem !important;
  border-radius: 8px;
  color: var(--darkbrown) !important;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
  line-height: 1.2;
}
header nav a:hover {
  background: var(--softcream);
  color: var(--green) !important;
  text-decoration: none !important;
}
header nav a.active {
  background: var(--green);
  color: #ffffff !important;
}

/* ---------- Unified button system ---------- */
.btn-outline,
.btn-blue,
.home-cta,
.sitters-cta,
.shop-cta-btn,
.btn-add,
.btn-logout,
.cb-btn,
.brush {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-btn) !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, color 0.15s ease;
  line-height: 1.2;
  box-shadow: none;
}
.btn-outline:hover,
.btn-blue:hover,
.home-cta:hover,
.sitters-cta:hover,
.shop-cta-btn:hover,
.btn-add:hover,
.btn-logout:hover,
.cb-btn:hover,
.brush:hover {
  transform: translateY(-1px);
}

.shop-cta-btn,
.sitters-cta,
.btn-add,
.cb-btn-primary,
.brush {
  background: var(--green) !important;
  color: #ffffff !important;
}
.shop-cta-btn:hover,
.sitters-cta:hover,
.btn-add:hover,
.cb-btn-primary:hover,
.brush:hover {
  background: var(--green-dark) !important;
  color: #ffffff !important;
}

.home-cta,
.btn-outline,
.btn-logout,
.cb-btn {
  background: #ffffff !important;
  color: var(--green) !important;
  border: 1px solid var(--border-card) !important;
}
.home-cta:hover,
.btn-outline:hover,
.btn-logout:hover,
.cb-btn:hover {
  background: var(--softcream) !important;
  color: var(--green-dark) !important;
  border-color: var(--green) !important;
}

.home-cta.active,
.sitters-cta.active {
  background: var(--green) !important;
  color: #ffffff !important;
  border-color: var(--green) !important;
}

.brush[style*="background"] {
  background: var(--green) !important;
  color: #ffffff !important;
}

/* ---------- Language switcher — slightly larger ---------- */
.lang-switcher {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.3rem;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 24px;
}
.lang-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted) !important;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.lang-btn:hover {
  background: var(--softcream);
  color: var(--darkbrown) !important;
  text-decoration: none !important;
}
.lang-btn.active {
  background: var(--green);
  color: #ffffff !important;
}

/* ---------- Cards: unified ---------- */
.dashboard-card,
.mkt-card-prod,
.find-link,
.donation-notice,
.mkt-shop-cta,
.mkt-banner,
.section-block.section-about,
.section-block.section-involved,
.section-block.section-find {
  border-radius: var(--radius-card) !important;
  border: 1px solid var(--border-card);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.dashboard-card:hover,
.mkt-card-prod:hover,
.find-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--green);
}

.about-item {
  padding: 1.2rem 0.9rem;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  background: #ffffff;
  box-shadow: none;
  text-align: center;
}
.about-item .emoji {
  font-size: 2rem;
  margin-bottom: 0.4rem;
  display: block;
}
.about-item .title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--darkbrown);
  margin: 0.2rem 0;
}
.about-item .desc {
  font-size: 0.85rem;
  opacity: 0.7;
  margin: 0;
}

.find-card {
  border-left: none !important;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 1rem 1.1rem;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* ---------- Section headings ---------- */
.section-title {
  font-size: 1.75rem !important;
  text-align: left !important;
  margin: 0 0 1.25rem !important;
  color: var(--darkbrown) !important;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--green);
  display: inline-block;
}

.section-block {
  margin: 2rem 0 0 !important;
  padding: 1.75rem !important;
  border-radius: var(--radius-card);
}

/* ---------- Structural layout (homepage) ---------- */
.page-wrap {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 2rem;
  box-sizing: border-box;
}

.home-intro p {
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 1rem;
}

.find-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.involved-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

/* ---------- Find pills ---------- */
.find-link {
  padding: 0.85rem 1.1rem !important;
  border-radius: var(--radius-card) !important;
  font-size: 0.9rem !important;
  border: 1px solid var(--border-card) !important;
  box-shadow: none;
  color: var(--darkbrown) !important;
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}
.find-link:hover {
  background: var(--green) !important;
  color: #ffffff !important;
  border-color: var(--green) !important;
  text-decoration: none !important;
}

/* ---------- Involved pills ---------- */
.involved-pills span {
  background: #ffffff;
  border: 1px solid var(--border-card);
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
  color: var(--darkbrown);
  border-radius: var(--radius-btn);
}

/* ---------- Donation notice ---------- */
.donation-notice {
  border-left: none !important;
  padding: 1rem 1.2rem !important;
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  margin-top: 1.5rem;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50% !important;
  background: var(--green);
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, background 0.15s;
  z-index: 999;
  line-height: 1;
}
.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--green-dark) !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

/* ---------- Marketplace ---------- */
.mkt-price,
.mkt-price.free {
  color: var(--green);
}
.mkt-cat-badge {
  background: #f0fdf4 !important;
  color: var(--green) !important;
}
.mkt-shop-cta {
  background: #f0fdf4 !important;
  border: 1px solid var(--green) !important;
}
.mkt-banner {
  border-left: none !important;
  background: #f0fdf4 !important;
  border: 1px solid var(--border-card) !important;
}

/* ---------- Forms ---------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
select,
textarea {
  font-family: 'Inter', sans-serif !important;
  font-size: 0.95rem;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-btn);
  padding: 0.6rem 0.9rem;
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21,128,61,0.1);
}

/* ---------- Header brand ---------- */
header .brand-lockup .title-big {
  color: var(--green) !important;
  letter-spacing: -0.03em;
}
header .brand-lockup .title-small {
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ---------- Modern hero ---------- */
.page-hero-modern {
  background: linear-gradient(135deg, var(--green) 0%, #22a355 100%);
  color: #ffffff;
  padding: 3rem 2rem;
  border-radius: 16px;
  text-align: center;
  margin: 1rem 0 2rem;
}
.page-hero-modern h1 {
  color: #ffffff !important;
  font-size: 2.5rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
}
.page-hero-modern .tagline {
  color: #ffffff;
  opacity: 0.92;
  margin: 0;
  font-size: 1.15rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .page-wrap { padding: 0.5rem 1rem 1.5rem; }
  .page-hero-modern { padding: 2rem 1.25rem; }
  .page-hero-modern h1 { font-size: 1.8rem; }
  .page-hero-modern .tagline { font-size: 1rem; }
  .section-title { font-size: 1.4rem !important; }
  .section-block { padding: 1.25rem !important; }
  .find-links { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.6rem; }
  .find-link { padding: 0.7rem 0.9rem !important; font-size: 0.85rem !important; }
  header nav { gap: 0.3rem; }
  header nav a { font-size: 0.95rem !important; padding: 0.45rem 0.75rem !important; }
  .btn-outline,
  .home-cta,
  .sitters-cta,
  .shop-cta-btn,
  .btn-add,
  .btn-logout,
  .cb-btn,
  .brush {
    padding: 0.6rem 1.1rem;
    font-size: 0.85rem;
  }
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .find-links { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
}