/* Planetary Engine - Transits UI (Table + Chart) */

.pe-transits{
  --pe-bg: #f7efe4;
  --pe-card: #fdf6ea;
  --pe-border: #8b1c1c;
  --pe-border-soft: rgba(139,28,28,0.25);
  --pe-head: #8b1c1c;
  --pe-head2: #9b2a2a;

  --pe-text: #2a1a1a;


  margin: 8px auto;
  

}
.pe-table-link,
.pe-chart-link{
  color: inherit;
  text-decoration: none;
}

.pe-table-link:hover,
.pe-chart-link:hover{
  text-decoration: underline;
}

.pe-signname a,
.pe-col-planet a,
.pe-col-nak a,
.pe-card-sign a,
.pe-ni-items a,
.pe-ni-rashi a{
  color: inherit;
}
/* =========================
   CELEBRITY PAGES
   Ensure CSS variables exist so SVG chart lines render
========================= */
.pe-celeb-wrap{
  --pe-bg: #f7efe4;
  --pe-card: #fdf6ea;
  --pe-border: #8b1c1c;
  --pe-border-soft: rgba(139,28,28,0.25);
  --pe-head: #8b1c1c;
  --pe-head2: #9b2a2a;
  --pe-text: #2a1a1a;
}

/* Left-align charts on celebrity pages */
.pe-celeb-wrap .pe-north-classic{
  margin: 8px 0 !important; /* removes center align */
}


/* =========================
   DASHBOARD (homepage blocks)
   - Uses same colors as transits UI
========================= */

.pe-dashboard{
  background: var(--pe-bg);
  padding: 0;
}

.pe-dash-top{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 8px 0 18px;
}

.pe-dash-card{
  border: 2px solid var(--pe-border);
  background: var(--pe-card);
}

.pe-dash-cardhead{
  background: var(--pe-head);
  color:#fff;
  font-weight: 600;
  padding: 8px 12px;
  font-size: 18px;
}

.pe-dash-cardbody{
  min-height: 120px;
  padding: 12px;
}

.pe-dash-empty{
  color: rgba(42,26,26,0.7);
  font-size: 14px;
}

.pe-dash-list,
.pe-dash-events{
  margin: 0;
  padding-left: 18px;
}

.pe-dash-events{
  list-style: none;
  padding-left: 0;
}

.pe-dash-events li{
  display:flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(139,28,28,0.18);
}
.pe-dash-events li:last-child{ border-bottom: 0; }

.pe-dash-evdate{
  display:inline-flex;
  min-width: 88px;
  font-weight: 600;
  color: var(--pe-head);
}

.pe-dash-evtitle{
  font-weight: 600;
  color: var(--pe-text);
}

@media (max-width: 860px){
  .pe-dash-top{ grid-template-columns: 1fr; }
}

/* =========================
   MOON SECTION
========================= */

.pe-moonwrap{
  border: 2px solid rgba(139,28,28,0.12);
  background: rgba(253,246,234,0.75);
  padding: 16px;
}

.pe-moon-headrow{
  display:flex;
  gap: 16px;
  align-items:flex-start;
}

.pe-moon-ico{
  width: 58px;
  height: 58px;
  border: 2px solid var(--pe-border);
  background: rgba(255,255,255,0.4);
  display:flex;
  align-items:center;
  justify-content:center;
}

.pe-moon-title{
  font-weight: 700;
  font-size: 16px;
  color: var(--pe-head);
  margin-bottom: 8px;
}

.pe-moon-tablewrap{
  margin-top: 10px;
}

.pe-moon-energy{
  margin-top: 14px;
}

.pe-moon-energy-title{
  font-weight: 700;
  color: var(--pe-head);
  margin-bottom: 8px;
}

.pe-moon-energy-text{
  color: var(--pe-text);
  line-height: 1.5;
  font-size: 14px;
}

.pe-moon-links{
  margin-top: 12px;
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.pe-moon-link{
  color: var(--pe-head);
  font-weight: 600;
  text-decoration: none;
}
.pe-moon-link:hover{ text-decoration: underline; }

/* Moon SVG styling */
.pe-moon-svg{ width: 42px; height: 42px; }
.pe-moon-base{ fill: #d8dde6; }
.pe-moon-shadow{ fill: #0f0f10; opacity: 0.92; }
.pe-moon-ring{ fill: none; stroke: rgba(0,0,0,0.12); stroke-width: 2; }


.pe-table th,
.pe-table td{
  border-left: none;
  border-right: none;
}



.pe-transits-head{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:14px 16px;
  margin-bottom: 14px;
}

.pe-transits-title{
  font-weight: 500;
  font-size: 16px;
  color: var(--pe-head);
  flex: 1 1 260px;
}

.pe-transits-controls{
  display:flex;
  align-items:center;
  gap:10px;
  flex: 1 1 420px;
}

.pe-navbtn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  background: var(--pe-head);
  color:#fff;
  border:2px solid var(--pe-head);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 500;
  cursor:pointer;
  line-height:1;
}

.pe-navbtn:hover{ filter: brightness(1.03); }
.pe-navbtn:active{ transform: translateY(1px); }

.pe-navicon{ font-size: 18px; line-height: 1; }
.pe-navtxt{ font-size: 14px; }

.pe-datewrap{
  display:inline-flex;
  align-items:center;

  border-radius: 10px;

  background: #fff;
}

.pe-date{
  border:0;
  outline:0;
  font-weight: 500;
  color: var(--pe-head);
  background: transparent;
  padding: 6px 4px;
}

.pe-viewtoggle{
  margin-left:auto;
  display:flex;
  gap:10px;
  padding: 6px;
  border-radius: 12px;
  background: var(--pe-head);
}

.pe-viewbtn{
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 10px;
  cursor:pointer;
}

.pe-viewbtn.is-active{
  background: #fff;
  color: var(--pe-head);
}

.pe-pane{ display:none; }
.pe-pane.is-active{ display:block; }

/* TABLE */

.pe-tablewrap{
  border: 2px solid var(--pe-border);
  overflow:hidden;
  background: var(--pe-card);
}

.pe-table{
  width: 100%;
  border-collapse: collapse;
  color: var(--pe-text);
  font-size: 16px;
}

.pe-table thead th{
  background: var(--pe-head);
  color:#fff;
  text-align:left;
  padding: 6px 10px;
  font-size: 18px;
  letter-spacing: 0.2px;
}


.pe-table tbody tr:nth-child(even) td{
  background: rgba(255,255,255,0.05);
}

.pe-col-status{ text-align:center; width: 80px; }

.pe-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  font-weight: 600;
  color: #2a1a1a;
}

.pe-status-d{ background: rgba(255,255,255,0.5); }
.pe-status-r{ background: rgba(255,255,255,0.5); }

.pe-col-sign{
  font-weight: 600;
}

/* Keep sign name + icon on the same line (no wrapping)
   IMPORTANT: Do NOT change <td> display type, or row borders will look broken */
.pe-table td.pe-col-sign{
  white-space: nowrap;
}

/* Give the icon a little left space while staying inline */
.pe-table td.pe-col-sign .pe-sign-ico,
.pe-table td.pe-col-sign .pe-glyph{
  margin-left: 8px;
  vertical-align: middle;
}
.pe-glyph{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 18px;
  height: 18px;
  border-radius: 8px;
  background: rgba(139,28,28,0.08);
  color: var(--pe-head);
  font-size: 14px;
  line-height: 1;
}

/* Sign PNG icons (table + chart) */
.pe-sign-ico{
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  border-radius: 5px;
  background: transparent;
  padding: 0;
  box-sizing: border-box;
  object-fit: contain;
}

/* optional sign colors like in screenshot */
.pe-sign-aries{ color:#c0392b; }
.pe-sign-taurus{ color:#7f8c8d; }
.pe-sign-gemini{ color:#f39c12; }
.pe-sign-cancer{ color:#8e44ad; }
.pe-sign-leo{ color:#e74c3c; }
.pe-sign-virgo{ color:#27ae60; }
.pe-sign-libra{ color:#9b59b6; }
.pe-sign-scorpio{ color:#000; }
.pe-sign-sagittarius{ color:#d35400; }
.pe-sign-capricorn{ color:#c0392b; }
.pe-sign-aquarius{ color:#2980b9; }
.pe-sign-pisces{ color:#16a085; }

/* CHART (reuse classic north indian look) */

.pe-transit-chart{
  /* smaller chart for transits view */
  width:min(420px, 100%);
  margin: 10px auto 0;
}

.pe-north-classic{
  position:relative;
  aspect-ratio: 1 / 1;
  padding: 10px;
  border-radius: 14px;
  border: 3px solid var(--pe-border);
  background:
    radial-gradient(circle at 50% 50%,
      #fff8ee 0%,
      #f6e4cf 58%,
      #e8c7a3 100%);
  overflow:hidden;
}

.pe-ni-svg{
  position:absolute;
  inset:10px;
  width:calc(100% - 20px);
  height:calc(100% - 20px);
}

.pe-ni-line{
  fill:none;
  stroke: var(--pe-border);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.pe-ni-overlay{
  position:absolute;
  inset:10px;
}

/* each sign block centered, small */
.pe-ni-cell{
  position:absolute;
  transform: translate(-50%, -50%);
  width: 20%;
  max-width: 20%;
  text-align:center;
  pointer-events:none;
}

.pe-ni-text{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
}

.pe-ni-rashi{
  font-weight: 700;
  color: var(--pe-head);
  font-size: 13px;
  line-height: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
}

.pe-ni-sign{
  /* User requested: remove sign PNGs from chart */
  display:none !important;
}

.pe-ni-house{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(139,28,28,0.10);
  font-size: 11px;
  color: var(--pe-head);
}

.pe-ni-items{
  font-weight: 500;
  color:#2a1a1a;
  font-size: 12px;
  line-height: 1.1;
  word-break: break-word;
}

/* MOBILE */
@media (max-width: 760px){
  .pe-transits{ padding: 14px; }
  .pe-transits-title{ font-size: 18px; }
  .pe-table{ font-size: 15px; }
  .pe-table thead th{ font-size: 16px; padding: 6px 6px; }
  .pe-table tbody td{ padding: 12px 12px; }
}

@media (max-width: 520px){
  .pe-transits-controls{ flex: 1 1 100%; }
  .pe-viewtoggle{ width: 100%; justify-content: space-between; }
  .pe-viewbtn{ padding: 10px 12px; flex:1; }

  .pe-ni-cell{ width: 26%; max-width: 26%; }
  .pe-ni-rashi{ font-size: 13px; }
  .pe-ni-items{ font-size: 11px; }
}

/* Back-compat: old class names (if any pages use them) */
.pe-positions{ margin: 1em 0; }
.pe-positions-table{ width:100%; border-collapse: collapse; }





/* =========================
   TABLE FIX (CLEAN + NO BROKEN LINES)
========================= */

/* table cell styling (single source of truth) */
.pe-table tbody td{
  padding: 5px 7px;
  vertical-align: middle;
  line-height: 1.25;
  border-top: 0;
  border-bottom: 1px solid rgba(139,28,28,0.25);
  background: rgba(255,255,255,0.25);
}

.pe-table tbody tr:nth-child(even) td{
  background: rgba(255,255,255,0.05);
}

.pe-table tbody tr:last-child td{
  border-bottom: 0;
}

/* IMPORTANT: keep <td> as table-cell (NO flex on td) */
.pe-table td.pe-col-sign{
  white-space: nowrap;
  font-weight: 600;
}

/* icon small + inline */
.pe-table td.pe-col-sign .pe-sign-ico,
.pe-table td.pe-col-sign .pe-glyph{
  width: 16px;
  height: 16px;
  margin-left: 8px;
  vertical-align: middle;
}

/* kill underline if it’s a link */
.pe-table td.pe-col-sign a{
  text-decoration: none;
}

/* ===== remove tiny top & bottom gaps inside table wrapper ===== */

.pe-table{
  border-spacing: 0;
}

/* tighten first + last row so no visual gap */
.pe-table tbody tr:first-child td{
  border-top: 0;
}

.pe-tablewrap{
  padding: 0;
}

/* make rows touch the wrapper border perfectly */
.pe-table tbody tr:last-child td{
  border-bottom: 0;
}

/* Fix: last row looks taller (restore divider, balance wrapper border) */

/* bring back the last row divider like other rows */
.pe-table tbody tr:last-child td{
  border-bottom: 1px solid rgba(139,28,28,0.25);
}

/* === FIX: remove theme table bottom gap inside bordered wrapper === */
.pe-table{
  margin: 0 !important;       /* <- THIS is the main fix */
  border-spacing: 0 !important;
}

.pe-tablewrap{
  padding: 0 !important;
}

/* optional: make sure no weird last-row spacing from theme */
.pe-table tbody tr:last-child td{
  padding-bottom: 5px !important;
}

/* ===============================
   Planet/Year Transit Pages
   Route: /transits/{planet}/{year}/
   Shortcode: [pe_transit_year]
   =============================== */

.pe-yearwrap{
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 14px;
}

.pe-yearhead{
  margin: 0 0 12px;
}

.pe-yeartitle{
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 800;
  color: #8b1c1c;
  margin: 0;
}

.pe-yearnav{
  display:flex;
  align-items:center;
  justify-content: flex-start;
  gap: 12px;
  margin: 12px 0 18px;
  flex-wrap: wrap;
}

.pe-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #8b1c1c;
  background: #8b1c1c;
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.pe-btn:hover{
  background: #741616;
  border-color: #741616;
  color: #fff;
}
.pe-btn:focus{outline: none; box-shadow: 0 0 0 3px rgba(139,28,28,0.18);}

.pe-yearpill{
  display: inline-flex;
  align-items: center;
  gap: 10px;



  background: #fff;
}

.pe-yearpill-label{
  font-weight: 800;
  color: #8b1c1c;
}

.pe-year-input{
  width: 92px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid rgba(139,28,28,0.35);
  background: #fff;
  font-weight: 900;
  color: #2a1a1a;
}

.pe-yeargrid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 820px){
  .pe-yearnav{ justify-content: center; }
  .pe-yeargrid{ grid-template-columns: 1fr; }
  .pe-btn{ width: 100%; }
  .pe-yearpill{ width: 100%; justify-content: center; }
}

.pe-yearcard{
  border: 2px solid rgba(139,28,28,0.35);
  background: #fdf6ea;
  border-radius: 14px;
  padding: 16px;
}

.pe-yearcard-current{
  border-color: #8b1c1c;
}

.pe-yearcard-top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}

.pe-yearcard-sign{
  display:flex;
  align-items:center;
  gap: 10px;
}

.pe-yearcard-signtext{
  font-size: 22px;
  font-weight: 900;
  color: #b07b00;
}

.pe-yearcard-icon{
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.pe-yearcard-sub{
  margin-top: 10px;
  font-weight: 700;
  color: #2a1a1a;
}

.pe-badge{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
}

.pe-badge-green{
  color: #8b1c1c;
}

.pe-badge-amber{
  background: #b07b00;
  color: #fff;
}

.pe-badge-red{
  background: #8b1c1c;
  color: #fff;
}

/* === Year transit table (sign ranges) === */

.pe-yeartablewrap{
  border: 2px solid rgba(139,28,28,0.35);
  background: #fdf6ea;
  border-radius: 0;
  overflow: hidden;
}

.pe-year-empty{
  padding: 16px;
  font-weight: 700;
  color: #2a1a1a;
}

.pe-yeartable{
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.pe-yeartable thead th{
  text-align: left;
  padding: 12px 14px;
  font-weight: 900;
  color: #fff;
  background: #8b1c1c;
  border-bottom: 2px solid rgba(139,28,28,0.25);
}

.pe-yeartable tbody td{
  padding: 12px 14px;
  border-bottom: 1px solid rgba(139,28,28,0.18);
  vertical-align: top;
  font-weight: 650;
  color: #2a1a1a;
}

.pe-yeartable tbody tr:last-child td{
  border-bottom: 0;
}

.pe-yeartable th,
.pe-yeartable td{
  border-left: 0 !important;
  border-right: 0 !important;
  box-shadow: none !important;
}
.pe-yeartable tbody tr:hover{
  background: rgba(139,28,28,0.06);
}
.pe-yeartable-row-current td{
  background: rgba(139,28,28,0.10);
}


.pe-yeartable-sign{
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.pe-yeartable-signname{
  font-weight: 900;
  color: #b07b00;
}

.pe-yeartable-icon{
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.pe-yeartable-notes{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pe-yearfootnote{
  padding: 12px 14px;
  border-top: 1px solid rgba(139,28,28,0.18);
  color: rgba(42,26,26,0.85);
  font-weight: 650;
  background: #fff;
}

.pe-yearfootnote-dot{
  color: #8b1c1c;
  font-weight: 900;
  margin-right: 6px;
}

@media (max-width: 820px){
  .pe-yeartable thead{ display:none; }
  .pe-yeartable, .pe-yeartable tbody, .pe-yeartable tr, .pe-yeartable td{ display:block; width:100%; }
  .pe-yeartable tbody td{ border-bottom: 0; padding: 10px 14px; }
  .pe-yeartable tr{ border-bottom: 1px solid rgba(139,28,28,0.18); padding: 6px 0; }
  .pe-yeartable tr:last-child{ border-bottom: 0; }
  .pe-yeartable td:nth-child(1)::before{ content: 'Sign'; display:block; font-weight:900; color:#8b1c1c; margin-bottom:4px; }
  .pe-yeartable td:nth-child(2)::before{ content: 'From'; display:block; font-weight:900; color:#8b1c1c; margin-bottom:4px; }
  .pe-yeartable td:nth-child(3)::before{ content: 'To'; display:block; font-weight:900; color:#8b1c1c; margin-bottom:4px; }
  .pe-yeartable td:nth-child(4)::before{ content: 'Notes'; display:block; font-weight:900; color:#8b1c1c; margin-bottom:4px; }
}
.pe-celeb-wrap,
.pe-celeb-wrap *{
  font-family: "Inter", sans-serif !important;
}
.pe-year-current{
  margin-top: 8px;
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}
.pe-year-current-label{font-weight:500;color:#2a1a1a;}
.pe-year-current-sign{display:inline-flex;align-items:center;gap:8px;background:#fff;border:2px solid rgba(139,28,28,0.25);padding:6px 10px;border-radius:12px;}
.pe-year-current-note{font-weight:700;color:rgba(42,26,26,0.65);font-size:12px;}


/* =========================
   RESPONSIVE IMPROVEMENTS
   Style-only changes. No functionality changes.
========================= */
.pe-tablewrap,
.pe-moon-tablewrap,
.pe-yeartablewrap,
.pe-table-wrap{
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.pe-table,
.pe-moon-table,
.pe-report-table{
  min-width: 680px;
}

.pe-yeartable{
  min-width: 720px;
}

.pe-date,
.pe-year-input,
.pe-kui-input,
.pe-kundli-input,
input[type="date"],
input[type="time"],
select,
textarea{
  max-width: 100%;
  box-sizing: border-box;
}

.pe-transits-head,
.pe-moon-headrow,
.pe-yearcard-top{
  min-width: 0;
}

.pe-transits-controls,
.pe-viewtoggle,
.pe-datewrap{
  min-width: 0;
}

@media (max-width: 860px){
  .pe-transits-head{
    align-items: stretch;
  }

  .pe-transits-title{
    flex: 1 1 100%;
  }

  .pe-transits-controls{
    flex: 1 1 100%;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
  }

  .pe-navbtn{
    flex: 0 0 auto;
    width: auto;
    justify-content: center;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .pe-datewrap{
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .pe-date{
    width: 100%;
    min-width: 0;
  }

  .pe-viewtoggle{
    width: 100%;
    margin-left: 0;
  }

  .pe-moon-headrow{
    flex-direction: column;
    align-items: stretch;
  }

  .pe-moon-ico{
    width: 52px;
    height: 52px;
  }

  .pe-dash-events li{
    flex-direction: column;
    gap: 4px;
  }

  .pe-dash-evdate{
    min-width: 0;
  }
}

@media (max-width: 520px){
  .pe-transits-controls{
    gap: 6px;
  }

  .pe-navbtn{
    padding: 8px 10px;
  }

  .pe-navtxt{
    font-size: 13px;
  }

  .pe-navicon{
    font-size: 16px;
  }

  .pe-date{
    font-size: 14px;
  }
}

@media (max-width: 640px){
  .pe-transits{
    padding: 12px;
  }

  .pe-table,
  .pe-moon-table,
  .pe-report-table{
    min-width: 620px;
  }

  .pe-yeartable{
    min-width: 0;
  }

  .pe-yearpill,
  .pe-kui-gender{
    width: 100%;
  }

  .pe-yearpill{
    justify-content: space-between;
  }
}
