/*
 * style.css — Tamil Calendar 2026 Custom Styles
 * ================================================
 * Color palette:
 *   --maroon : #7B1E2B  (header, buttons, accents)
 *   --cream  : #FBF0D9  (page background)
 *   --gold   : #D99A2B  (logo, active nav, CTA)
 *   --dark   : #3B0A12  (headings)
 *
 * Layout: mobile-first, Bootstrap 5 grid.
 */

/* ============================================================
   CSS CUSTOM PROPERTIES (variables)
   ============================================================ */
:root {
  --maroon      : #7B1E2B;
  --maroon-dark : #5A1420;
  --maroon-light: #9E2E3E;
  --cream       : #FBF0D9;
  --cream-light : #FDF6EA;
  --gold        : #D99A2B;
  --gold-light  : #EDB84A;
  --gold-dark   : #B07A1A;
  --dark        : #3B0A12;
  --text-muted  : #7A5A60;
  --shadow-sm   : 0 2px 8px rgba(123,30,43,0.10);
  --shadow-md   : 0 4px 20px rgba(123,30,43,0.15);
  --radius-card : 14px;
  --radius-btn  : 8px;
}

/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', 'Noto Sans Tamil', sans-serif;
  background-color: var(--cream);
  color: var(--dark);
  line-height: 1.7;
  font-size: 16px;
}

/* Tamil text uses Noto Sans Tamil */
:lang(ta), .ta, .tamil {
  font-family: 'Noto Sans Tamil', 'Roboto', sans-serif;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--maroon);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--gold-dark);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Noto Sans Tamil', 'Roboto', sans-serif;
  color: var(--dark);
  font-weight: 700;
}

h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); }

/* Dotted section divider */
.divider-dotted {
  border: none;
  border-top: 2px dotted var(--gold);
  margin: 1.5rem 0;
  opacity: 0.5;
}

/* ============================================================
   SITE HEADER & NAVIGATION
   ============================================================ */
.site-header {
  background-color: var(--maroon);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  z-index: 1030;
}

/* Logo tile — the gold square with "TC" */
.logo-tile {
  background-color: var(--gold);
  color: var(--dark);
  font-weight: 900;
  font-size: 1.1rem;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -1px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.20);
}

.logo-tile-sm {
  width: 34px;
  height: 34px;
  font-size: 0.9rem;
  border-radius: 8px;
}

/* Temple/gopuram icon shown before the site title — placeholder using a
   Bootstrap Icon until a real logo image is supplied; swap the <i> tag in
   includes/header.php and includes/footer.php for an <img> at that point. */
.tc-temple-icon {
  color: var(--gold);
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.logo-tile-sm ~ .tc-temple-icon,
.tc-temple-icon.tc-temple-icon-sm {
  font-size: 1.5rem;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-ta {
  color: rgba(255,255,255,0.85);
  font-family: 'Noto Sans Tamil', sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  line-height: 1.2;
}

.logo-en {
  color: var(--gold);
  font-family: 'Roboto', sans-serif;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0.5px;
  line-height: 1.2;
}
@media (max-width: 991px) {
  .logo-en { font-size: 24px; }
}
@media (max-width: 576px) {
  .logo-en { font-size: 19px; }
  .logo-ta { font-size: 0.65rem; }
}

/* Navbar item list — evenly spaced across the full navbar width.
   justify-content:center (not space-evenly) so that when the items
   wrap onto two lines, each line hugs its own items with the same
   gap instead of stretching a half-empty last row across the full
   width (which is what made an uneven 7/4 split look lopsided). */
.site-header .navbar-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  row-gap: 6px;
  column-gap: 4px;
}

.site-header .nav-item {
  display: flex;
}

/* Invisible full-width spacer injected by assets/js/nav-balance.js to
   force an even item split between rows (e.g. 7/6 instead of a
   naturally-occurring 7/4) — see that file for the measurement logic. */
.site-header .nav-row-break {
  flex-basis: 100%;
  width: 100%;
  height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Navbar links */
.site-header .nav-link {
  color: rgba(255,255,255,0.88) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 48px;
  padding: 6px 12px;
  border-radius: var(--radius-btn);
  transition: background 0.2s, color 0.2s;
}

.site-header .nav-link:hover,
.site-header .nav-link.active {
  background-color: var(--gold);
  color: var(--dark) !important;
}

.nav-en {
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Roboto', sans-serif;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.nav-ta {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 0.86rem;
  opacity: 0.85;
  margin-top: 1px;
  white-space: nowrap;
}

/* Mobile nav styles */
@media (max-width: 991px) {
  .site-header .navbar-nav {
    justify-content: flex-start;
    row-gap: 2px;
    column-gap: 0;
  }
  .site-header .nav-link {
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
    text-align: left;
    border-radius: var(--radius-btn);
    margin: 2px 0;
  }
  .nav-en, .nav-ta { white-space: normal; }
  .nav-ta { margin-top: 0; }
  #mainNav { background: var(--maroon-dark); border-radius: 0 0 12px 12px; padding: 8px; }
}

/* Hamburger icon color */
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}
.navbar-toggler { border-color: rgba(255,255,255,0.4); }

/* ============================================================
   IST CLOCK BAR
   ============================================================ */
.ist-bar {
  background-color: var(--maroon-dark);
  color: rgba(255,255,255,0.80);
  font-size: 0.82rem;
}

.ist-label { color: var(--gold); font-weight: 600; }
.ist-time  { font-family: 'Roboto', monospace; font-weight: 700; color: #fff; letter-spacing: 1px; }
.ist-date  { color: rgba(255,255,255,0.75); }
.ist-separator { color: var(--gold); }

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
main {
  min-height: 60vh;
  padding-bottom: 2rem;
}

/* Page hero banner (used on inner pages) */
.page-hero {
  background: linear-gradient(135deg, var(--maroon) 60%, var(--maroon-light));
  color: #fff;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.page-hero h1 {
  color: var(--gold);
  margin: 0;
  font-size: 3.1rem;
}
@media (max-width: 576px) {
  .page-hero h1 { font-size: 2.1rem; }
}

.page-hero .breadcrumb-item,
.page-hero .breadcrumb-item a {
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
}

.page-hero .breadcrumb-item.active { color: var(--gold-light); }
.page-hero .breadcrumb-item + .page-hero .breadcrumb-item::before { color: rgba(255,255,255,0.5); }

/* ============================================================
   CARDS
   ============================================================ */
.tc-card {
  background: var(--cream-light);
  border: 1px solid rgba(123,30,43,0.10);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.tc-card:hover { box-shadow: var(--shadow-md); }

.tc-card-header {
  background: var(--maroon);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.tc-card-header h2,
.tc-card-header h3 {
  color: var(--gold);
  margin: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  line-height: 1.3;
}

.tc-card-body {
  padding: 1.25rem;
}

/* ============================================================
   DATE PICKER SECTION (Home / Daily page)
   ============================================================ */
.date-picker-section {
  background: var(--maroon);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.date-picker-section form {
  justify-content: center;
}

.date-picker-section label {
  color: var(--gold);
  font-weight: 600;
  font-size: 1.2rem;
}

.date-picker-section .form-control {
  border: 2px solid var(--gold);
  border-radius: var(--radius-btn);
  background: var(--cream);
  color: var(--dark);
  font-size: 1.15rem;
}

.date-picker-section .form-control:focus {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(217,154,43,0.25);
}

/* Date navigation quick links */
.date-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 0.75rem;
}

.date-nav a,
.date-nav button {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.date-nav a:hover,
.date-nav button:hover {
  background: var(--gold);
  color: var(--dark);
  border-color: var(--gold);
}

/* ============================================================
   CALENDAR IMAGE DISPLAY
   ============================================================ */
.calendar-image-wrap {
  position: relative;
  text-align: center;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.calendar-image-wrap img {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.image-caption {
  background: var(--maroon);
  color: var(--gold);
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Placeholder when image not yet uploaded */
.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  background: var(--cream-light);
  color: var(--text-muted);
  min-height: 200px;
}

.image-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--gold);
}

/* ============================================================
   SHARE BUTTONS
   ============================================================ */
.share-section {
  background: var(--cream-light);
  border: 1px solid rgba(123,30,43,0.12);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.share-section h3 {
  font-size: 0.95rem;
  color: var(--maroon);
  margin-bottom: 0.75rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.share-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.share-btn:active { transform: translateY(0); }

.share-btn.whatsapp  { background: #25D366; color: #fff; }
.share-btn.facebook  { background: #1877F2; color: #fff; }
.share-btn.telegram  { background: #229ED9; color: #fff; }
.share-btn.twitter   { background: #000;    color: #fff; }
.share-btn.linkedin  { background: #0A66C2; color: #fff; }
.share-btn.copylink  { background: var(--maroon); color: #fff; }

/* "Copied!" toast */
#copy-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--maroon);
  color: var(--gold);
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 9999;
  display: none;
  box-shadow: var(--shadow-md);
}

/* ============================================================
   TABLES (Muhurtham, Festival, Auspicious)
   ============================================================ */
.tc-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.tc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
}

.tc-table thead th {
  background: var(--maroon);
  color: var(--gold);
  padding: 10px 8px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  text-align: left;
  white-space: nowrap;
  border: none;
}

.tc-table tbody tr:nth-child(even) { background: var(--cream); }
.tc-table tbody tr:hover           { background: rgba(217,154,43,0.08); }

.tc-table tbody td {
  padding: 9px 8px;
  border-bottom: 1px solid rgba(123,30,43,0.07);
  color: var(--dark);
  vertical-align: middle;
}

/* Month heading rows inside tables */
.tc-month-heading {
  background: linear-gradient(90deg, var(--maroon) 0%, var(--maroon-light) 100%);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  margin-bottom: 0;
  font-size: 1.15rem;
}
.tc-month-heading h1,
.tc-month-heading h2,
.tc-month-heading h3,
.tc-month-heading h4,
.tc-month-heading h5,
.tc-month-heading h6 {
  color: #fff;
}

.tc-month-heading span.ta {
  color: var(--gold);
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 0.9rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-maroon {
  background-color: var(--maroon);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 9px 22px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-maroon:hover {
  background-color: var(--maroon-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(123,30,43,0.30);
}

.btn-gold {
  background-color: var(--gold);
  color: var(--dark);
  border: none;
  border-radius: var(--radius-btn);
  padding: 9px 22px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: background 0.2s;
}

.btn-gold:hover { background-color: var(--gold-dark); color: var(--dark); }

/* ============================================================
   FORMS (Contact page)
   ============================================================ */
.tc-form .form-label {
  font-weight: 600;
  color: var(--dark);
  font-size: 0.9rem;
}

.tc-form .form-control,
.tc-form .form-select {
  border: 1.5px solid rgba(123,30,43,0.20);
  border-radius: var(--radius-btn);
  background: var(--cream-light);
  color: var(--dark);
  font-size: 0.95rem;
  padding: 9px 14px;
}

.tc-form .form-control:focus,
.tc-form .form-select:focus {
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px rgba(123,30,43,0.12);
  background: #fff;
}

/* ============================================================
   ALERT / SUCCESS MESSAGES
   ============================================================ */
.tc-alert {
  border-radius: var(--radius-card);
  padding: 14px 18px;
  font-weight: 500;
}

.tc-alert-success {
  background: rgba(25,135,84,0.10);
  border: 1px solid rgba(25,135,84,0.25);
  color: #0d6832;
}

.tc-alert-error {
  background: rgba(220,53,69,0.10);
  border: 1px solid rgba(220,53,69,0.25);
  color: #842029;
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background-color: var(--maroon-dark);
  color: rgba(255,255,255,0.80);
  margin-top: 3rem;
}

.footer-heading {
  color: var(--gold);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-desc { font-size: 0.88rem; }

.footer-links,
.footer-contact {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li,
.footer-contact li {
  padding: 3px 0;
  font-size: 0.88rem;
}

.footer-links a,
.footer-contact a {
  color: rgba(255,255,255,0.75);
  transition: color 0.2s;
}

.footer-links a:hover,
.footer-contact a:hover { color: var(--gold); }

.footer-contact li { display: flex; align-items: flex-start; gap: 8px; }
.footer-contact i  { color: var(--gold); margin-top: 3px; flex-shrink: 0; }

.footer-social { display: flex; gap: 10px; }

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}

.social-icon:hover { background: var(--gold); color: var(--dark); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 1rem 0;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.60);
}

.footer-link-sm {
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
  transition: color 0.2s;
}

.footer-link-sm:hover { color: var(--gold); }

.footer-credit-line {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.60);
  text-align: center;
}

.footer-credit-line a {
  color: #4FC3F7;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s;
}

.footer-credit-line a:hover { color: var(--gold-light); }

.text-gold       { color: var(--gold) !important; }
.text-gold-light { color: var(--gold-light) !important; }
.text-cream-light{ color: rgba(255,255,255,0.75) !important; }

/* ============================================================
   ADMIN — shared utility (applies only inside /admin pages)
   ============================================================ */
.admin-body {
  background: #f1e8d4;
}

.admin-sidebar {
  background: var(--maroon-dark);
  min-height: 100vh;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  padding-top: 1rem;
}

.admin-sidebar .nav-link {
  color: rgba(255,255,255,0.80);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  background: var(--gold);
  color: var(--dark);
}

.admin-sidebar .nav-link i { font-size: 1.05rem; }

.admin-main { padding: 1.5rem; }

.badge-unread {
  background: var(--gold);
  color: var(--dark);
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 20px;
  padding: 2px 8px;
}

/* Upload progress / status list */
.upload-result-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.upload-result-list li {
  padding: 6px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 0.88rem;
}

.upload-result-list .success { background: rgba(25,135,84,0.12); color: #0d6832; }
.upload-result-list .error   { background: rgba(220,53,69,0.12); color: #842029; }

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.gallery-item {
  position: relative;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

.gallery-item-label {
  background: var(--maroon);
  color: var(--gold);
  font-size: 0.7rem;
  padding: 4px 8px;
  text-align: center;
  font-weight: 600;
}

.gallery-item-actions {
  position: absolute;
  top: 6px;
  right: 6px;
}

.btn-delete-img {
  background: rgba(220,53,69,0.85);
  border: none;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-delete-img:hover { background: #dc3545; }

/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */
@media (max-width: 576px) {
  .date-picker-section { padding: 1rem; }
  .share-btn { font-size: 0.78rem; padding: 6px 10px; }
  .tc-table thead th, .tc-table tbody td { padding: 7px 10px; font-size: 0.82rem; }
}

@media (max-width: 768px) {
  .admin-sidebar { min-height: auto; }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Skip to content link (keyboard accessibility) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--gold);
  color: var(--dark);
  padding: 8px 16px;
  font-weight: 700;
  z-index: 9999;
  border-radius: 0 0 8px 0;
}

.skip-link:focus { top: 0; }

/* ============================================================
   GOOGLE ADSENSE SLOTS
   To activate: paste AdSense code inside .ad-slot div.
   Empty slots are hidden automatically via :empty rule.
   ============================================================ */
.ad-slot {
  width: 100%;
  text-align: center;
  padding: 6px 0;
  overflow: hidden;
  background: var(--cream-light);
}
.ad-slot:empty { display: none; }

/* Left/right skyscraper ad rails (like w3schools) — fixed in the side
   gutters outside .container-xl (which tops out at 1140px), so they
   never push or overlap the centered page content. */
.ad-slot-side {
  position: fixed;
  top: 140px;
  width: 300px; /* standard AdSense "medium rectangle" width */
  min-height: 250px;
  background: var(--cream-light);
  border-radius: var(--radius-card);
  overflow: hidden;
  z-index: 1020;
}
.ad-slot-left  { left: 12px; }
.ad-slot-right { right: 12px; }
.ad-slot-side:empty { display: none; }

/* Only show when the viewport is wide enough that the rails can't
   overlap the container/content (matches w3schools hiding side ads
   on laptops/tablets/mobile). Container tops out at 1140px; two
   300px rails + gaps need roughly 1140 + 2*(300+24) ≈ 1790px. */
@media (max-width: 1800px) {
  .ad-slot-side { display: none; }
}

/* ============================================================
   ADMIN-MANAGED AD BOXES
   Rendered by render_ad_box() only when a slot is enabled and has
   an image — otherwise nothing is printed, same as an empty .ad-slot.
   ============================================================ */
.tc-ad-box {
  display: block;
  max-width: 468px;
  margin: 20px auto;
  text-align: center;
}
.tc-ad-box img { width: 100%; height: auto; border-radius: var(--radius-card); }

/* Left/right banner variant — fixed skyscraper rails, same behavior as
   .ad-slot-side (hidden on narrower viewports so they never overlap content). */
.tc-ad-banner-left,
.tc-ad-banner-right {
  position: fixed;
  top: 140px;
  width: 300px;
  max-width: 300px;
  margin: 0;
  z-index: 1020;
}
.tc-ad-banner-left  { left: 12px; }
.tc-ad-banner-right { right: 12px; }
@media (max-width: 1800px) {
  .tc-ad-banner-left,
  .tc-ad-banner-right { display: none; }
}

/* ============================================================
   REUSABLE UTILITY CLASSES
   Shared centering / title-sizing / compact-image / compact-table
   rules used across Home, Monthly, Muhurtham, Festival, Auspicious,
   Rasi Palan, Baby Names, and Age Calculator instead of one-off
   per-page fixes.
   ============================================================ */
.tc-center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.tc-center .form-select,
.tc-center .btn,
.tc-center .input-group {
  margin-left: auto;
  margin-right: auto;
}

.tc-title-en-lg {
  font-size: 2.4rem;
  font-weight: 700;
}
.tc-title-ta-sm {
  font-size: 1rem;
  font-weight: 500;
}
@media (max-width: 768px) {
  .tc-title-en-lg { font-size: 1.7rem; }
  .tc-title-ta-sm { font-size: 0.85rem; }
}

.tc-img-compact {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.tc-table-compact th,
.tc-table-compact td {
  padding: 6px 8px;
}

.tc-page-logo {
  height: 48px;
  width: auto;
  vertical-align: middle;
  margin-right: 10px;
}
@media (max-width: 576px) {
  .tc-page-logo { height: 36px; }
}

/* ============================================================
   SITEWIDE FLOATING WHATSAPP BUTTON
   Fixed to the right edge of the viewport on every page.
   ============================================================ */
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1050;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  font-size: 1.8rem;
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transition: transform 0.2s ease;
}
.whatsapp-float:hover,
.whatsapp-float:focus {
  color: #fff;
  transform: scale(1.08);
}
@media (max-width: 576px) {
  .whatsapp-float {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    right: 14px;
    bottom: 14px;
  }
}

/* ============================================================
   AGE CALCULATOR RESULT DISPLAY
   ============================================================ */
.age-result {
  background: var(--cream-light);
  border: 1px solid rgba(123,30,43,0.12);
  border-radius: var(--radius-card);
  padding: 18px 20px;
}
.age-result-title {
  color: var(--maroon);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
}

/* ============================================================
   DATE CALCULATOR RESULT DISPLAY
   ============================================================ */
.date-calc-result .result-unit {
  background: var(--cream-light);
  border: 1px solid rgba(123,30,43,0.12);
  border-radius: var(--radius-card);
  padding: 12px 4px;
}
.date-calc-result .result-unit span {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--maroon);
}
.date-calc-result .result-unit small {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   A-Z ALPHABET STRIP — Baby Names page
   ============================================================ */
.alphabet-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.alphabet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--cream-light);
  border: 1px solid rgba(123,30,43,0.15);
  color: var(--maroon);
  font-weight: 600;
  text-decoration: none;
}
.alphabet-btn:hover {
  background: var(--gold-light);
  color: var(--dark);
}
.alphabet-btn.active {
  background: var(--maroon);
  color: #fff;
  border-color: var(--maroon);
}

/* ============================================================
   RASI TABS — Rasi Palan page category tabs (gradient pill style)
   ============================================================ */
.rasi-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  justify-content: center;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
  scrollbar-width: none;
}
.rasi-tabs::-webkit-scrollbar { display: none; }
.rasi-tabs li { flex: 0 0 auto; }

.rasi-tab-link {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--cream-light);
  color: var(--maroon-dark);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  border: 2px solid transparent;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.1s;
}
.rasi-tab-link:hover {
  background: var(--gold-light);
  color: #fff;
  transform: translateY(-1px);
}
.rasi-tab-link.active {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--gold) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 576px) {
  .rasi-tabs { flex-wrap: wrap; overflow-x: visible; }
}

/* ============================================================
   RASI CARD GRID — Rasi Palan page rasi picker (Dinamalar-style
   image cards, not a text list — every card renders at the same
   fixed size regardless of the uploaded image's aspect ratio).
   ============================================================ */
.rasi-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}
.rasi-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-decoration: none;
  color: var(--maroon-dark);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  border: 2px solid transparent;
  transition: box-shadow 0.18s, transform 0.15s, border-color 0.15s;
}
.rasi-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
}
.rasi-card span {
  padding: 10px 6px;
}
.rasi-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}
.rasi-card.active {
  border-color: var(--maroon);
  color: var(--dark);
}

/* Detail-page content image — fixed box so every admin upload
   (any aspect ratio) renders at the same size, cropped to fill. */
.rasi-content-img {
  width: 100%;
  max-width: 320px;
  height: 320px;
  object-fit: cover;
  border-radius: var(--radius-card);
}

/* ============================================================
   BLOG CARDS — listing grid
   ============================================================ */
.blog-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(123,30,43,0.16);
}
.blog-card-img {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.blog-card:hover .blog-card-img img {
  transform: scale(1.05);
}
.blog-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.blog-card-title {
  font-size: 1.1rem;
  margin-bottom: 6px;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card-title a {
  color: var(--dark);
  text-decoration: none;
}
.blog-card-title a:hover {
  color: var(--maroon);
}
.blog-card-meta,
.blog-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 10px;
}
.blog-card-meta .dot-sep,
.blog-meta .dot-sep {
  margin: 0 6px;
}
.blog-card-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-grow: 1;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Home page — Daily Panchangam / Monthly Panchangam / Horai image cards */
.home-media-frame {
  width: 100%;
  max-width: 480px;
  height: 240px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.home-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}
@media (max-width: 991px) {
  .home-media-frame { height: 200px; }
}
@media (max-width: 576px) {
  .home-media-frame { height: 180px; }
}

/* Baby Names page — gender tabs with banner image above each button */
.gender-tabs {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.gender-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.gender-banner-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--gold);
  box-shadow: var(--shadow-sm);
}
.gender-tabs .nav-link {
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--maroon);
  background-color: rgba(123, 30, 43, 0.08);
  transition: background-color 0.2s, color 0.2s;
}
.gender-tabs .nav-link:hover {
  background-color: rgba(123, 30, 43, 0.15);
}
.gender-tabs .nav-link.active {
  background-color: var(--maroon);
  color: #fff;
}
@media (max-width: 576px) {
  .gender-banner-img { width: 90px; height: 90px; }
  .gender-tabs { gap: 16px; }
}

/* Blog single-article hero image */
.blog-hero-img {
  width: 98%;
  max-width: 1100px;
  height: 320px;
  margin: 20px auto 25px;
  overflow: hidden;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.blog-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}
@media (max-width: 991px) {
  .blog-hero-img {
    width: 90%;
    height: 260px;
  }
}
@media (max-width: 576px) {
  .blog-hero-img {
    width: 100%;
    height: 220px;
  }
}
.blog-content {
  max-width: 100%;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--dark);
}

/* Cap the article width so long paragraphs stay readable instead of
   stretching edge-to-edge on wide screens */
.blog-article-compact {
  max-width: 820px;
}
.blog-content p {
  margin: 0 0 1.3em;
}
.blog-content p:last-child {
  margin-bottom: 0;
}
.blog-content h2,
.blog-content h3,
.blog-content h4 {
  margin: 1.4em 0 0.6em;
}
.blog-content h2:first-child,
.blog-content h3:first-child,
.blog-content h4:first-child {
  margin-top: 0;
}
.blog-content strong {
  font-weight: 700;
}

/* ============================================================
   SHOP GRID — 3 columns per row
   ============================================================ */
.shop-card {
  background: #fff;
  border: 1px solid rgba(123,30,43,0.12);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.shop-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(123,30,43,0.16);
}
.shop-card-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid rgba(123,30,43,0.12);
}
.shop-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.shop-card:hover .shop-card-img img {
  transform: scale(1.05);
}
.shop-card-body {
  padding: 14px;
  text-align: center;
}
