/**
 * Glossary System Styles
 *
 * Story 01 — Marker only (tooltip styles added in Story 02).
 *
 * @package CLANSAY
 * @since   1.1.0
 */

.glossary-term {
    border-bottom: 1px dotted var(--accent-1);
    text-decoration: none;
    color: inherit;
    cursor: help;
    display: inline;
    transition: border-bottom-style var(--transition-base);
}

.glossary-term:hover,
.glossary-term:focus {
    border-bottom-style: solid;
    outline: none;
}

.glossary-term:focus-visible {
    outline: 2px solid var(--accent-1);
    outline-offset: 2px;
    border-radius: 2px;
}

.glossary-term__label {
    color: inherit;
}

.glossary-term__icon {
    font-size: 0.65em;
    margin-left: 3px;
    color: var(--accent-1);
    vertical-align: super;
    opacity: 0.85;
}

.glossary-term:hover .glossary-term__icon,
.glossary-term:focus .glossary-term__icon {
    opacity: 1;
}

/* ================================================
   TOOLTIP (Story 02)
   ================================================ */

.glossary-tooltip {
    position: absolute;
    top: -9999px;
    left: -9999px;
    max-width: 320px;
    padding: var(--space-4) var(--space-5);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
}

.glossary-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .glossary-tooltip {
        transition: none;
    }
}

.glossary-tooltip__title {
    display: block;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.glossary-tooltip__def {
    margin: 0 0 var(--space-3);
    color: var(--text-secondary);
}

.glossary-tooltip__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--accent-1);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    font-size: var(--font-size-sm);
}

.glossary-tooltip__link:hover,
.glossary-tooltip__link:focus {
    text-decoration: underline;
}

.glossary-tooltip__link i {
    font-size: 0.85em;
}

/* Mobile: pin to bottom of viewport */
@media (max-width: 640px) {
    .glossary-tooltip {
        position: fixed !important;
        left: var(--space-4) !important;
        right: var(--space-4) !important;
        top: auto !important;
        bottom: var(--space-4) !important;
        max-width: none;
    }
}

/* ================================================
   DICTIONARY ARCHIVE (Story 03)
   ================================================ */

.dictionary-hero {
    padding: var(--space-8) var(--space-6);
    text-align: center;
}

.dictionary-hero__count {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-top: var(--space-3);
}

.dictionary-section {
    padding-bottom: var(--space-10);
}

.dictionary-filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    max-width: 520px;
    margin: 0 auto var(--space-6);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
}

.dictionary-filter-bar:focus-within {
    border-color: var(--accent-1);
}

.dictionary-filter-label {
    color: var(--text-muted);
    font-size: var(--font-size-md);
}

.dictionary-filter-input {
    flex: 1;
    border: 0;
    background: transparent;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    outline: none;
}

.dictionary-az {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-8);
}

.dictionary-az__link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 32px;
    height: 32px;
    padding: 0 var(--space-2);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: all var(--transition-base);
}

.dictionary-az__link:hover,
.dictionary-az__link:focus {
    background: var(--accent-1);
    color: #fff;
    border-color: var(--accent-1);
}

.dictionary-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.dictionary-letter-group__heading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--accent-1);
    color: #fff;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-4);
}

.dictionary-letter-group__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

@media (min-width: 768px) {
    .dictionary-letter-group__list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.dictionary-entry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.dictionary-entry-card:hover {
    border-color: var(--accent-1);
    box-shadow: var(--shadow-md);
}

.dictionary-entry-card__link {
    display: block;
    padding: var(--space-4) var(--space-5);
    text-decoration: none;
    color: inherit;
}

.dictionary-entry-card__title {
    display: block;
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.dictionary-entry-card__aliases {
    color: var(--text-muted);
    font-weight: var(--font-weight-normal);
    margin-left: var(--space-1);
}

.dictionary-entry-card__excerpt {
    display: block;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
}

.dictionary-empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-8) 0;
}

/* ================================================
   DICTIONARY SINGLE (Story 03)
   ================================================ */

.dictionary-entry {
    max-width: 100%;
    margin: 0;
    padding: var(--space-6) var(--space-6) var(--space-10);
}

.dictionary-entry__header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-light);
}

.dictionary-entry__kicker {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 4px 12px;
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid var(--accent-1);
    border-radius: var(--radius-full);
    color: var(--accent-1);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

.dictionary-entry__title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-snug);
    margin-bottom: var(--space-3);
}

.dictionary-entry__aliases {
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

.dictionary-entry__lead {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

.dictionary-entry__content {
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-8);
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.dictionary-entry__content p {
    margin-bottom: var(--space-4);
}

.dictionary-entry__related,
.dictionary-entry__uses {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-6);
    margin-bottom: var(--space-4);
}

.dictionary-entry__related h2,
.dictionary-entry__uses h2 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.dictionary-entry__uses-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dictionary-entry__uses-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-light);
}

.dictionary-entry__uses-list li:last-child {
    border-bottom: 0;
}

.dictionary-entry__uses-list time {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

.dictionary-entry__footer {
    margin-top: var(--space-8);
    text-align: center;
}

.breadcrumb {
    padding: var(--space-4) var(--space-6);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent-1);
}

.breadcrumb__sep {
    margin: 0 var(--space-2);
    color: var(--text-muted);
}

.breadcrumb__current {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
}
