/* ============================================================
   Periodic Table Page Styles
   ============================================================ */

.pt-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: #fff;
    padding: 2.5rem 0 2rem;
}
.pt-hero h1 {
    color: #fff;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin-bottom: .5rem;
}
.pt-hero p {
    color: rgba(255,255,255,.8);
    max-width: 620px;
    font-size: .95rem;
}

/* ── Legend ─────────────────────────────────── */
.pt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .8rem;
    padding: 1rem 0 .5rem;
}
.pt-legend-item {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .72rem;
    color: var(--gray-700);
    font-weight: 500;
}
.pt-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ── Wrapper & scroll ────────────────────────── */
.pt-outer {
    padding: 1.5rem 0 2rem;
}
.pt-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .5rem;
}

/* ── Table grid ──────────────────────────────── */
.pt-grid {
    display: grid;
    grid-template-columns: repeat(18, minmax(44px, 1fr));
    grid-template-rows: repeat(9, auto);
    gap: 3px;
    min-width: 820px;
    margin: 0 auto;
}

/* ── Individual element ───────────────────────── */
.pt-el {
    position: relative;
    border-radius: 5px;
    padding: 4px 3px 3px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    transition: transform .12s ease, box-shadow .12s ease;
    border: 1px solid rgba(0,0,0,.08);
}
.pt-el:hover {
    transform: scale(1.12);
    z-index: 10;
    box-shadow: 0 6px 20px rgba(0,0,0,.22);
    text-decoration: none;
}
.pt-el-num {
    font-size: .6rem;
    font-weight: 600;
    opacity: .75;
    line-height: 1;
    align-self: flex-end;
    width: 100%;
    text-align: right;
}
.pt-el-sym {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
    margin: 1px 0;
}
.pt-el-name {
    font-size: .52rem;
    font-weight: 500;
    opacity: .85;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}
.pt-el-mass {
    font-size: .5rem;
    opacity: .65;
    line-height: 1;
}

/* ── Lanthanide / Actinide placeholder ───────── */
.pt-placeholder {
    background: #e2e8f0 !important;
    color: #64748b !important;
    border: 1px dashed #94a3b8 !important;
    font-size: .6rem;
    font-weight: 600;
    justify-content: center;
    cursor: default;
}
.pt-placeholder:hover {
    transform: none;
    box-shadow: none;
}

/* ── Row separator ───────────────────────────── */
.pt-separator {
    grid-column: 1 / -1;
    height: 6px;
}

/* ── Element type colors (keyed to JS type codes) ── */
.pt-ak { background: #fde68a; color: #78350f; }   /* alkali */
.pt-ae { background: #fed7aa; color: #7c2d12; }   /* alkaline earth */
.pt-tm { background: #bfdbfe; color: #1e3a5f; }   /* transition */
.pt-pt { background: #a7f3d0; color: #064e3b; }   /* post-transition */
.pt-ml { background: #c4b5fd; color: #2e1065; }   /* metalloid */
.pt-nm { background: #bbf7d0; color: #14532d; }   /* nonmetal */
.pt-ha { background: #fecaca; color: #7f1d1d; }   /* halogen */
.pt-ng { background: #e0f2fe; color: #0c4a6e; }   /* noble gas */
.pt-la { background: #fae8ff; color: #581c87; }   /* lanthanide */
.pt-ac { background: #ffe4e6; color: #881337; }   /* actinide */
.pt-uk { background: #f1f5f9; color: #475569; }   /* unknown */

/* ── Info panel ──────────────────────────────── */
.pt-info {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin: 1.5rem 0 0;
    display: none;
    animation: pt-fade-in .15s ease;
}
.pt-info.active { display: flex; gap: 1.5rem; flex-wrap: wrap; }

@keyframes pt-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pt-info-badge {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pt-info-badge .badge-num  { font-size: .8rem; font-weight: 700; opacity: .8; }
.pt-info-badge .badge-sym  { font-size: 2.2rem; font-weight: 900; line-height: 1; }
.pt-info-badge .badge-name { font-size: .72rem; font-weight: 600; }

.pt-info-body { flex: 1; min-width: 200px; }
.pt-info-body h3 { font-size: 1.15rem; margin: 0 0 .3rem; }
.pt-info-body .pt-info-type {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-500);
    margin-bottom: .6rem;
}
.pt-info-props {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: .3rem .8rem;
    font-size: .8rem;
}
.pt-info-props dt { color: var(--gray-500); }
.pt-info-props dd { font-weight: 600; color: var(--gray-900); }
.pt-info-link {
    display: inline-block;
    margin-top: .8rem;
    padding: .35rem .9rem;
    background: var(--blue);
    color: #fff !important;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
}
.pt-info-link:hover { background: var(--navy-mid); text-decoration: none; }

/* ── SEO text section ────────────────────────── */
.pt-about {
    padding: 1.5rem 0 2.5rem;
}
.pt-about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.pt-about-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.6rem;
    box-shadow: var(--shadow-sm);
}
.pt-about-card h3 { margin: 0 0 .6rem; font-size: 1rem; color: var(--navy); }
.pt-about-card p  { font-size: .875rem; color: var(--gray-700); line-height: 1.7; margin: 0; }

@media (max-width: 640px) {
    .pt-about-grid { grid-template-columns: 1fr; }
    .pt-legend { gap: .3rem .5rem; }
    .pt-info.active { flex-direction: column; }
    .pt-info-badge { align-self: flex-start; }
}
