/* The grahan page (templates/grahan/page.html), on top of page.css and panchang.css. Text never moves. */
.gr { --sun: #F4B53F; --umbra: #7A2E1E; --care: #8C5A2B; --good: #2F6B4F; }

/* 1. Hero card: the next grahan here */
.gr-card-date { font-family: var(--serif); font-size: 1.9rem; line-height: 1.15; margin: 8px 0 2px; }
.gr-card-name { margin: 0 0 12px; color: #4d4a44; }
.gr-card-name span { color: var(--rust); }
.gr-card-none { margin: 10px 0 0; font-family: var(--serif); font-size: 1.4rem; line-height: 1.3; }
.gr-card-link { display: inline-flex; align-items: center; min-height: 44px; }

/* 2. The next grahan: four moments, the picture, the sutak */
.gr-next { background: linear-gradient(180deg, #f6efe2 0%, #f1e4d3 100%); }
.gr-next-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.gr-h2-date { display: block; font-size: .5em; color: var(--rust); margin-top: 8px; letter-spacing: 0; }
.gr-times { list-style: none; margin: 18px 0 22px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.gr-times li { background: #fffaf1; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.gr-times span { display: block; font-size: .85rem; color: #6d665a; }
.gr-times b { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.15; margin-top: 4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.gr-times .gr-t-sutak { background: #f3e2cf; }
.gr-times .gr-t-sutak b { color: var(--rust); }
.gr-facts { margin: 0 0 18px; }
.gr-sutak { background: #fffaf1; border: 1px solid rgba(154, 68, 38, .25); border-radius: 10px; padding: 16px 18px; margin: 0 0 16px; }
.gr-sutak h3 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin: 0 0 4px; color: var(--rust); }
.gr-sutak p { margin: 0; }
.gr-small { font-size: .92rem; color: #6d665a; margin-top: 6px !important; }
.gr-note { margin: 0 0 10px; color: #4d4a44; }
.gr-safe { font-weight: 600; color: #3b3a40; }
.gr-disc { margin: 0; position: sticky; top: 24px; }
.gr-disc svg { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: 0 24px 60px rgba(21, 26, 44, .25); }
.gr-disc figcaption { margin-top: 12px; font-size: .92rem; color: #5d574c; line-height: 1.5; }
.gr-sky { fill: #151A2C; }
.gr-sun-glow { fill: rgba(244, 181, 63, .18); }
.gr-sun { fill: var(--sun); }
.gr-moon-dark { fill: #151A2C; stroke: rgba(242, 236, 224, .25); stroke-width: .8; }
.gr-pen { fill: rgba(120, 110, 150, .22); stroke: rgba(242, 236, 224, .25); stroke-width: .6; }
.gr-umb { fill: rgba(60, 20, 20, .55); stroke: rgba(242, 236, 224, .3); stroke-width: .6; }
.gr-moon { fill: #E9E3D3; }
.gr-moon-shade { fill: #9A4426; opacity: .85; }

/* 3. The city table */
.gr-table td, .gr-table th { white-space: nowrap; }
.gr-table tr.gr-off td { color: #8a8478; }

/* 4. Each rashi */
.gr-rashis { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gr-rashis a { display: flex; flex-direction: column; gap: 4px; min-height: 44px; padding: 16px 18px; border-radius: 12px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); }
.gr-rashis .good a { background: linear-gradient(135deg, #e6f1e8, #f3f7ee); }
.gr-rashis .care a { background: linear-gradient(135deg, #f6eadb, #fbf3e8); }
.gr-rashis b { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; }
.gr-rashis span { font-size: .92rem; color: #5d574c; }
.gr-rashis em { font-style: normal; font-weight: 700; font-size: .9rem; }
.gr-rashis .good em { color: var(--good); }
.gr-rashis .care em { color: var(--care); }
.gr-rashis a:hover b { color: var(--rust); }

/* 5. Every eclipse */
.gr-year { font-family: var(--serif); font-weight: 400; font-size: 2rem; margin: 28px 0 6px; color: var(--rust); }
.gr-list { list-style: none; margin: 0; padding: 0; }
.gr-item { padding: 18px 0; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.gr-item h4 { margin: 0 0 2px; font-family: var(--serif); font-weight: 500; font-size: 1.55rem; line-height: 1.2; }
.gr-item p { margin: 0 0 6px; color: #3b3a40; }
.gr-item-type { color: #6d665a !important; }
.gr-chip { display: inline-block; font-size: .85rem !important; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.st-counted .gr-chip { background: #9A4426; color: #fff; }
.st-penumbral .gr-chip { background: #e4dccb; color: #4d4a44; }
.st-unseen .gr-chip, .st-visible .gr-chip { background: #ece6da; color: #5d574c; }
.gr-item-times { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.gr-item-times b { font-variant-numeric: tabular-nums; }
/* What the city itself sees: a contact below its horizon, the visible part (grahan_page._view) */
.gr-below { font-style: normal; font-size: .8rem; color: #8a5a2b; white-space: nowrap; }
.gr-times .gr-below { display: block; margin-top: 2px; }
.gr-times .gr-t-view { background: #eef3f6; }
.gr-times .gr-t-view b { font-size: clamp(1.15rem, 1.8vw, 1.4rem); }
.gr-view { color: #2f4f63; }
.gr-view-note { color: #4d4a44; font-size: .95rem; }
.gr-check td, .gr-check th { font-variant-numeric: tabular-nums; }
.gr-small a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.gr-item-sky { font-size: .92rem; color: #6d665a !important; }
.gr-past { margin-top: 30px; }

@media (max-width: 900px) {
  .gr-next-grid { grid-template-columns: minmax(0, 1fr); }
  .gr-disc { position: static; max-width: 420px; }
  .gr-rashis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .gr-table { min-width: 0; }
  .gr-table thead { display: none; }
  .gr-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .gr-table th, .gr-table td { display: block; padding: 0; border: 0; white-space: normal; }
  .gr-table tbody th { grid-column: 1 / -1; font-family: var(--serif); font-size: 1.25rem; font-weight: 500; }
  .gr-table td::before { content: attr(data-label); display: block; font-size: .75rem; color: #6d665a; }
  .gr-table td[colspan] { grid-column: 1 / -1; }
  .gr-times { grid-template-columns: 1fr 1fr; }
  .gr-rashis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .gr-rashis a { padding: 12px 10px; }
  .gr-rashis b { font-size: 1.15rem; }
  .gr-rashis span, .gr-rashis em { font-size: .82rem; }
}

/* The moving card: the Moon on its real path; the dot on the time bar runs in step. Text stays still. */
.gr-live .ed-mono { margin: 0 0 10px; }
.gr-corona { fill: rgba(255, 194, 61, .16); animation: gr-pulse 4s ease-in-out infinite; transform-origin: 120px 120px; transform-box: view-box; }
@keyframes gr-pulse { 50% { transform: scale(1.06); opacity: .7; } }
.gr-tl { position: relative; height: 58px; margin: 14px 4px 0; border-top: 2px solid rgba(154, 68, 38, .35); }
.gr-tl-dot { position: absolute; top: -7px; left: 0; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--rust);
  box-shadow: 0 0 0 4px rgba(154, 68, 38, .18); animation: gr-run 12s linear infinite; }
@keyframes gr-run { to { left: 100%; } }
.gr-tl span { position: absolute; top: 8px; transform: translateX(-50%); font-size: .8rem; line-height: 1.3; color: #3b3a40; text-align: center; white-space: nowrap; }
.gr-tl span:first-of-type { transform: none; text-align: left; }
.gr-tl span:last-of-type { transform: translateX(-100%); text-align: right; }
.gr-tl b { display: block; font-weight: 600; color: #6d665a; font-size: .74rem; }

/* Why a grahan happens: a twilight band with the moving Sun-Earth-Moon scene */
.gr-why { background: radial-gradient(800px 360px at 80% 30%, rgba(201, 164, 92, .16), transparent 70%), linear-gradient(180deg, #1f2a52, #2b3a6e); color: #f2ece0; }
.gr-why .ed-h2 { color: #f5efe3; }
.gr-why .ed-p { color: #ddd5c4; }
.gr-why-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.gr-why-list { margin: 0 0 18px; }
.gr-why-list div { border-top: 1px solid rgba(242, 236, 224, .18); padding: 12px 0; }
.gr-why-list dt { font-family: var(--serif); font-size: 1.35rem; color: #FFD98A; }
.gr-why-list dd { margin: 4px 0 0; color: #ddd5c4; line-height: 1.55; }
.gr-why-data { margin: 0; padding: 14px 16px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #f5efe3; line-height: 1.55; }
.gr-orbit { width: 100%; height: auto; display: block; }
.gr-o-path { stroke: rgba(242, 236, 224, .28); stroke-width: 1.2; stroke-dasharray: 4 6; }
.gr-o-orbit { fill: none; stroke: rgba(237, 231, 217, .5); stroke-width: 1.4; stroke-dasharray: 3 5; }
.gr-o-glow { fill: rgba(255, 194, 61, .2); animation: gr-pulse 5s ease-in-out infinite; transform-origin: 70px 150px; transform-box: view-box; }
.gr-o-cone { fill: rgba(0, 0, 0, .75); }
.gr-o-land path { fill: #6FCF7A; }
.gr-o-land { animation: gr-spin 20s linear infinite; transform-origin: 430px 150px; transform-box: view-box; }
@keyframes gr-spin { to { transform: rotate(360deg); } }
.gr-o-node { fill: #C9A45C; }
.gr-o-t, .gr-o-n, .gr-o-s { text-anchor: middle; font-family: var(--serif); }
.gr-o-t { fill: #EDE7D9; font-size: 17px; }
.gr-o-n { fill: #FFD98A; font-size: 16px; }
.gr-o-s { fill: #ddd5c4; font-size: 15px; }

/* India-wide bars */
.gr-h3 { font-family: var(--serif); font-weight: 500; font-size: 1.6rem; margin: 40px 0 6px; }
.gr-bars { list-style: none; margin: 14px 0 10px; padding: 0; display: grid; gap: 6px; max-width: 760px; }
.gr-bars li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 56px; gap: 12px; align-items: center; font-size: .95rem; }
.gr-bars i { display: block; height: 12px; width: var(--w); min-width: 3px; border-radius: 6px; background: linear-gradient(90deg, #F4B53F, #9A4426); }
.gr-bars b { font-variant-numeric: tabular-nums; text-align: right; }

/* Rashi sign on every card, coloured by element */
.gr-glyph { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; font-style: normal; font-size: 1.7rem; line-height: 1; margin-bottom: 8px; }
.gr-glyph.el-fire { background: #fde3d6; color: #b4461f; }
.gr-glyph.el-earth { background: #e2f1e0; color: #3f7a3a; }
.gr-glyph.el-air { background: #e0eefb; color: #2c6aa5; }
.gr-glyph.el-water { background: #dbf3f1; color: #20807a; }
.gr-node { color: var(--rust); font-weight: 600; }

@media (max-width: 900px) {
  .gr-why-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .gr-bars li { grid-template-columns: 112px minmax(0, 1fr) 48px; font-size: .88rem; }
}
@media (prefers-reduced-motion: reduce) {
  .gr-tl-dot, .gr-corona, .gr-o-glow, .gr-o-land { animation: none; }
}

/* Grahan in numbers: big serif numerals on soft colour cards */
.gr-nums { background: linear-gradient(180deg, #f6efe2, #efe4d2); }
.gr-num-grid { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gr-num-grid li { border-radius: 14px; padding: 20px 22px 18px; border: 1px solid var(--line); }
.gr-num-grid li:nth-child(6n+1) { background: linear-gradient(135deg, #fde9d6, #fbf3e8); }
.gr-num-grid li:nth-child(6n+2) { background: linear-gradient(135deg, #e3eefb, #f3f7fc); }
.gr-num-grid li:nth-child(6n+3) { background: linear-gradient(135deg, #f3e2f0, #fbf2f9); }
.gr-num-grid li:nth-child(6n+4) { background: linear-gradient(135deg, #e2f1e3, #f3f8f0); }
.gr-num-grid li:nth-child(6n+5) { background: linear-gradient(135deg, #fbf0cf, #fdf8e8); }
.gr-num-grid li:nth-child(6n+6) { background: linear-gradient(135deg, #e7e3f7, #f5f3fc); }
.gr-num-grid b { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1.05; color: var(--rust); font-variant-numeric: tabular-nums; }
.gr-num-grid p { margin: 8px 0 10px; color: #3b3a40; line-height: 1.5; }
.gr-num-grid small { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #6d665a; }
@media (max-width: 900px) { .gr-num-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gr-num-grid { grid-template-columns: minmax(0, 1fr); } }

/* The ruling planet on every rashi card: the site's living planet icons, on a small night sky */
.gr-rashi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.gr-rashi-top .gr-glyph { margin-bottom: 0; }
.gr-lord { display: block; width: 48px; height: 48px; box-sizing: border-box; padding: 4px; border-radius: 50%; background: #151A2C;
  box-shadow: 0 6px 16px rgba(21, 26, 44, .25); }
.gr-lord-name { display: block; margin-top: 2px; font-size: .82rem; color: #5d574c; }
@media (max-width: 560px) {
  .gr-lord, .gr-rashis .gr-glyph { width: 36px; height: 36px; }
  .gr-rashis .gr-glyph { font-size: 1.25rem; }
  .gr-lord { padding: 3px; }
}
