/* Kriyasya Devotional — Hub Page (Elite Redesign)
   Immersive hero, premium Panchang strip, richer category cards,
   refined deity rail, cohesive stats band. Data-safe, no empty shells. */

/* ============================================================
   HERO
   ============================================================ */
.hub-hero {
    position: relative;
    padding: 24px 0;
    background:
        radial-gradient(1100px 420px at 82% -8%, rgba(245,166,35,0.18), transparent 60%),
        radial-gradient(760px 360px at 8% 4%, rgba(212,82,10,0.10), transparent 55%),
        linear-gradient(178deg, #fff8ee 0%, #fef3e0 38%, var(--bg-primary) 100%);
    background-color: #fff8ee;
    overflow: hidden;
    isolation: isolate;
}
.hub-hero-grid {
    display: grid;
    grid-template-columns: minmax(330px, 0.82fr) minmax(0, 1.18fr);
    grid-template-areas:
        "copy features"
        "search features";
    column-gap: clamp(24px, 3vw, 44px);
    row-gap: 16px;
    align-items: center;
}
.hub-hero-copy { grid-area: copy; min-width: 0; align-self: end; }
/* subtle dot/mandala texture */
.hub-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(198,153,62,0.12) 1px, transparent 1.4px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(120% 90% at 70% 0%, #000 0%, transparent 68%);
            mask-image: radial-gradient(120% 90% at 70% 0%, #000 0%, transparent 68%);
    opacity: 0.55;
    pointer-events: none;
    z-index: -1;
}
.hub-greeting {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 0.4px;
    padding: 6px 14px 6px 12px;
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
}

.hub-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3vw, 2.35rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.5px;
    margin-bottom: var(--space-sm);
    color: var(--accent-hover); /* fallback if background-clip unsupported */
    background: linear-gradient(118deg, #a63d0a 0%, #d4520a 55%, #b8440a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hub-subtitle {
    font-size: var(--fs-md);
    color: var(--text-secondary);
    max-width: 540px;
    line-height: 1.5;
}

/* === PANCHANG STRIP === */
.panchang-bar {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: var(--glass);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 18px;
    box-shadow: var(--shadow), var(--shadow-gold);
    overflow: hidden;
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
    position: relative;
}
.panchang-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gold-gradient);
}
.panchang-bar > span:not(.dot) {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 12px 16px;
}
.panchang-bar .dot {
    align-self: center;
    width: 1px; height: 20px;
    border-radius: 0;
    background: var(--border-strong);
}
.panchang-bar .pb-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1;
    margin-bottom: 3px;
}
.panchang-bar .pb-val { color: var(--text-primary); line-height: 1; }
.panchang-bar .pb-ico { font-size: 1.05rem; }

/* === HUB SEARCH === */
.hub-search { grid-area: search; margin-top: 0; max-width: 460px; width: 100%; align-self: start; }
.hub-search .search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow), var(--shadow-inner);
    transition: box-shadow var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}
.hub-search .search-bar:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-1px);
}
.hub-search .search-icon { color: var(--accent); flex-shrink: 0; }
.hub-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: var(--fs-base);
    color: var(--text-secondary);
    outline: none;
}

/* Primary devotional choices occupy the hero's previously empty right half. */
.hub-feature-grid {
    grid-area: features;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    min-width: 0;
}
.hub-feature-card {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.88);
    border: 1px solid var(--border-strong);
    border-radius: calc(var(--radius-lg) + 2px);
    color: var(--text-primary);
    text-decoration: none;
    box-shadow: var(--shadow-md), var(--shadow-gold);
    transition: transform var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out);
}
.hub-feature-card:hover,
.hub-feature-card:focus-visible {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.hub-pass { margin-top: var(--space-lg); }
.hfc-image {
    display: block;
    aspect-ratio: 16 / 8.2;
    overflow: hidden;
    background: #ead8bd;
}
.hfc-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hfc-body { display: flex; flex-direction: column; gap: 6px; padding: 14px; min-width: 0; }
.hfc-title { font-family: var(--font-heading); color: var(--accent-hover); font-size: 1.15rem; font-weight: 800; }
.hfc-benefit { color: var(--text-secondary); font-size: 0.8rem; line-height: 1.42; }
.hfc-meta { color: var(--text-muted); font-size: 0.7rem; font-weight: 700; line-height: 1.3; }
.hfc-action { color: var(--accent); font-size: 0.78rem; font-weight: 800; margin-top: auto; padding-top: 2px; }

@media (max-width: 900px) {
    .hub-hero-grid {
        grid-template-columns: 1fr;
        grid-template-areas: "copy" "features" "search";
        gap: 18px;
    }
    .hub-hero-copy { align-self: auto; }
    .hub-feature-grid { max-width: none; }
    .hub-search { max-width: none; }
}
@media (max-width: 600px) {
    .hub-hero { padding: 20px 0 22px; }
    .hub-greeting { margin-bottom: 12px; }
    .hub-subtitle { font-size: var(--fs-base); }
    .panchang-bar { width: 100%; }
    .panchang-bar > span:not(.dot) { flex: 1; min-width: 0; padding: 10px 8px; justify-content: center; }
    .panchang-bar .pb-ico { display: none; }
    .hub-feature-grid { grid-template-columns: 1fr; gap: 10px; }
    .hub-feature-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); min-height: 132px; }
    .hfc-image { aspect-ratio: auto; height: 100%; }
    .hfc-body { padding: 12px; gap: 4px; }
    .hfc-title { font-size: 1rem; }
    .hfc-benefit { font-size: 0.75rem; }
}

/* ============================================================
   SECTION HEADER (shared premium treatment)
   ============================================================ */
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: var(--space-xl) 0 var(--space-md);
    position: relative;
    padding-left: 14px;
}
.section-header::before {
    content: '';
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 4px;
    border-radius: var(--radius-full);
    background: var(--gold-gradient);
}
.section-header h2 {
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.section-header .see-all {
    flex-shrink: 0;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    transition: gap var(--duration) var(--ease-out), color var(--duration);
}
.section-header .see-all:hover { color: var(--accent-hover); }

/* ============================================================
   TODAY'S SPECIAL
   ============================================================ */
.todays-special {
    padding: var(--space-lg);
    background:
        radial-gradient(360px 160px at 100% 0%, rgba(245,166,35,0.14), transparent 70%),
        linear-gradient(135deg, #fff9ee, #fef3e0);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-xl);
    margin: var(--space-lg) 0 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.todays-special::before {
    content: '🪔';
    position: absolute;
    top: -6px; right: 2px;
    font-size: 3.4rem;
    opacity: 0.10;
    pointer-events: none;
}
.ts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: 8px;
}
.ts-badge {
    font-size: var(--fs-xs);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
}
.ts-day { font-size: var(--fs-xs); color: var(--text-secondary); font-weight: 700; }
.ts-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ts-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--duration) var(--ease-out);
    box-shadow: var(--shadow-sm);
}
.ts-card:hover { border-color: var(--accent); box-shadow: var(--shadow-glow); transform: translateX(4px); }
.ts-card-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 46px; height: 46px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #fff3df, #ffe9cc);
    border: 1px solid var(--border);
    border-radius: 50%;
}
.ts-card-body { display: flex; flex-direction: column; gap: 3px; }
.ts-card-title { font-weight: 700; font-size: var(--fs-base); }
.ts-card-action { font-size: var(--fs-xs); color: var(--accent); font-weight: 700; }
@media (min-width: 640px) { .ts-cards { grid-template-columns: 1fr 1fr; } }

/* ============================================================
   QUICK ACCESS GRID
   ============================================================ */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: var(--space-lg) 0 0;
}
.quick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--duration) var(--ease-out);
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.quick-card:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.quick-card:active { transform: scale(0.96); }
.qc-icon {
    font-size: 1.35rem;
    line-height: 1;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-secondary), #fff6e9);
    border: 1px solid var(--border);
}
.qc-label { font-size: 0.7rem; font-weight: 700; line-height: 1.2; color: var(--text-secondary); }
.quick-card:hover .qc-label { color: var(--accent); }
@media (max-width: 560px) {
    .quick-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

/* ============================================================
   FEATURED DEITIES
   ============================================================ */
.deity-featured-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(104px, 1fr));
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    padding-bottom: 6px;
}
.deity-feat-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 3/4;
    display: flex;
    align-items: flex-end;
    text-decoration: none;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, #f3e4c8, #e9d3a8);
}
.deity-feat-card img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}
.deity-feat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: inherit;
    transition: border-color 0.3s var(--ease-out);
    z-index: 2;
    pointer-events: none;
}
.deity-feat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 42%, rgba(20,10,0,0.78) 100%);
    pointer-events: none;
    z-index: 1;
}
.deity-feat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.deity-feat-card:hover img { transform: scale(1.09); }
.deity-feat-card:hover::before { border-color: rgba(247,213,107,0.85); }
.dfc-name {
    position: relative;
    z-index: 2;
    padding: 10px 12px;
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 800;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 8px rgba(0,0,0,0.6);
    width: 100%;
}
@media (min-width: 768px) {
    .deity-featured-grid { grid-template-columns: repeat(8, minmax(112px, 1fr)); gap: 16px; }
}

/* ============================================================
   CATEGORY GRID (richer, per-category accent)
   ============================================================ */
.hub-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 14px;
}
.category-card {
    --cat: var(--accent);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    padding: 0;
    background: var(--bg-card);
    border: 1.5px solid var(--border-card);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
    box-shadow: var(--shadow-sm);
    min-height: 238px;
    overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--cat);
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
}
.category-card:hover {
    border-color: var(--cat);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}
.category-card:hover::before { opacity: 1; }
.category-card:active { transform: scale(0.97); }
.category-card:focus-visible {
    border-color: var(--cat);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat) 28%, transparent), var(--shadow-lg);
}
.category-cover {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #ead8bd;
}
.category-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.45s var(--ease-out);
}
.category-card:hover .category-cover img { transform: scale(1.045); }
.category-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px;
}

.category-title {
    font-weight: 700;
    font-size: var(--fs-base);
    line-height: 1.25;
    color: var(--text-primary);
}
.category-count {
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    font-weight: 600;
}
/* Access chip (single, informative — replaces old corner emoji clutter) */
.cat-pass {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    line-height: 1.4;
}
.cat-pass.is-free { color: var(--success); background: var(--success-bg); }
.cat-pass.is-pass { color: var(--accent); background: var(--accent-glow); }

@media (min-width: 768px) {
    .hub-categories { grid-template-columns: repeat(4, 1fr); gap: 18px; }
    .category-card { min-height: 250px; }
}
@media (max-width: 480px) {
    .hub-categories { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .category-card { min-height: 218px; border-radius: var(--radius-lg); }
    .category-body { padding: 11px; }
    .category-title { font-size: var(--fs-sm); }
}
