/* assets/css/style.css */

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

:root {
  /* ── Reference palette ── */
  --mustard-hi:  #EAB53A;
  --mustard:     #DFA123;
  --mustard-lo:  #C88A12;
  --maroon:      #7C1523;
  --maroon-deep: #5A0D18;
  --gold:        #C9962F;
  --gold-lt:     #F0D488;
  --ink:         #3A2205;
  --ink-soft:    #5C3E12;
  --cream:       #FBF1D8;

  /* ── Semantic roles used across the stylesheet ── */
  --primary:          var(--mustard);      /* header, hero, primary buttons */
  --primary-light:    var(--gold-lt);      /* subtle tints, hovers */
  --primary-dark:     var(--maroon);       /* footer bg, headings, text links */
  --primary-hover:    var(--mustard-lo);   /* primary button hover */
  --accent:           var(--maroon);       /* search button */
  --accent-dark:      var(--maroon-deep);  /* search button hover */
  --on-primary:       var(--ink);          /* text on mustard surfaces */
  --on-primary-muted: var(--ink-soft);     /* muted text on mustard surfaces */
  --text:             #1a1a1a;
  --text-muted:       #666;
  --border:           #e0e0e0;
  --bg:               var(--cream);
  --card-bg:          #ffffff;
  --radius:           10px;
  --radius-sm:        6px;
}

body {
  font-family: 'Inter', 'Noto Sans Tamil', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Content grows to push the footer to the bottom on short pages */
main { flex: 1 0 auto; }

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header ── */
.site-header {
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.site-logo .logo-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--on-primary);
  white-space: nowrap;
}
.site-nav {
  display: flex;
  gap: 1.5rem;
  flex: 1;
}
.site-nav a {
  color: var(--on-primary-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--on-primary); }
.lang-switcher {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--on-primary-muted);
}
.lang-switcher a { color: var(--on-primary-muted); }
.lang-switcher a.active { color: var(--on-primary); font-weight: 600; }
.lang-switcher a:hover { color: var(--on-primary); }

/* ── Hero ── */
.hero {
  background: var(--primary);
  color: var(--on-primary);
  padding: 3rem 0 2.5rem;
  text-align: center;
}
.hero h1 { font-size: 2rem; font-weight: 600; color: var(--on-primary); margin-bottom: 0.5rem; }
.hero p   { color: var(--on-primary-muted); margin-bottom: 0.5rem; }
.hero-count { font-size: 0.9rem; color: var(--on-primary-muted); margin-bottom: 1.5rem !important; }
.hero-search {
  display: flex;
  max-width: 540px;
  margin: 0 auto;
  gap: 0;
}
.hero-search input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 0.95rem;
  outline: none;
}
.hero-search button {
  padding: 0.7rem 1.25rem;
  background: var(--accent);
  color: var(--cream);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.hero-search button:hover { background: var(--accent-dark); }

/* ── Page heading (directory) ── */
.page-heading {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0.25rem 0 1rem;
}

/* ── Search bar ── */
.search-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}
.search-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.search-input {
  flex: 2;
  min-width: 180px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.search-row select {
  flex: 1;
  min-width: 130px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: #fff;
  cursor: pointer;
}
.search-row button {
  padding: 0.55rem 1.25rem;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.search-row button:hover { background: var(--primary-hover); }

/* ── Result count ── */
.result-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.no-results {
  color: var(--text-muted);
  padding: 2rem 0;
  text-align: center;
}

/* ── Temple grid ── */
.temple-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.temple-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s;
}
.temple-card:hover {
  box-shadow: 0 4px 16px rgba(90,13,24,0.18);
  transform: translateY(-2px);
}
.card-photo {
  position: relative;
  height: 150px;
  overflow: hidden;
  background: var(--primary-light);
}
.card-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.card-photo-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--gold-lt), var(--mustard));
}
.type-badge {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
}
.type-hindu       { background: var(--gold-lt);    color: var(--maroon); }
.type-tamil       { background: var(--maroon);     color: var(--gold-lt); }
.type-shaivite    { background: var(--mustard);    color: var(--ink); }
.type-vaishnavite { background: var(--mustard-hi); color: var(--maroon); }
.type-other       { background: var(--gold);       color: var(--ink); }
.card-body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.card-meta    { font-size: 0.8rem; color: var(--text-muted); }
.card-address { font-size: 0.78rem; color: var(--text-muted); }
.card-link {
  font-size: 0.82rem;
  color: var(--primary-dark);
  font-weight: 500;
  margin-top: auto;
  padding-top: 6px;
}

/* ── Featured section ── */
.featured-section { padding: 2.5rem 0; }
.featured-section h2 { font-size: 1.3rem; margin-bottom: 1.25rem; color: var(--primary-dark); }
.btn-all {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.btn-all:hover { background: var(--primary-hover); }

/* ── Detail page ── */
.detail-page { padding: 1.5rem 0 3rem; }
.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--primary-dark);
  margin-bottom: 1.25rem;
}
.back-link:hover { text-decoration: underline; }
.detail-hero { margin-bottom: 1.5rem; }
.hero-img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: var(--radius);
}
.hero-placeholder {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, var(--gold-lt), var(--mustard));
  border-radius: var(--radius);
}
.photo-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.photo-thumb {
  width: 76px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: none;
  transition: border-color 0.15s;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb:hover  { border-color: var(--mustard); }
.photo-thumb.active { border-color: var(--primary-dark); }
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}
.detail-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--primary-dark);
}
.detail-title-alt {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.detail-main .type-badge {
  position: static;
  display: inline-block;
  margin-bottom: 1.25rem;
}
.detail-section { margin-bottom: 1.5rem; }
.detail-section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.detail-section p { font-size: 0.95rem; line-height: 1.7; }

/* ── Sidebar ── */
.sidebar-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.info-list { font-size: 0.88rem; }
.info-list dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 0.75rem;
}
.info-list dt:first-child { margin-top: 0; }
.info-list dd { color: var(--text); }
.info-list dd a { color: var(--primary-dark); }
.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 1rem;
}
.btn-directions, .btn-social {
  display: block;
  text-align: center;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
}
.btn-directions {
  background: var(--primary);
  color: var(--on-primary);
}
.btn-directions:hover { background: var(--primary-hover); }
.btn-social {
  border: 1px solid var(--border);
  color: var(--primary-dark);
}
.btn-social:hover { background: var(--primary-light); }
.map-embed {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-embed iframe { border: 0; display: block; }

/* Layout helpers (kept out of inline style= so the strict CSP allows them) */
.about-box    { max-width: 720px; margin: 2rem auto; }
.featured-cta { text-align: center; margin-top: 2rem; }

/* ── Footer ── */
.site-footer {
  background: var(--primary-dark);
  color: var(--gold-lt);
  text-align: center;
  padding: 1.25rem 0;
  font-size: 0.85rem;
  margin-top: 3rem;
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .detail-layout { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .hero h1 { font-size: 1.5rem; }
  .hero-search { flex-direction: column; border-radius: var(--radius); }
  .hero-search input  { border-radius: var(--radius) var(--radius) 0 0; }
  .hero-search button { border-radius: 0 0 var(--radius) var(--radius); }
}
