/* AMA Page Styles */

.ama-container {
    width: 100%;
}

/* Header Section */
.ama-header {
    text-align: left;
    padding: 2rem 0 1.5rem;
}

.ama-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 0;
}

.ama-avatar {
    display: block;
    width: 120px;
    height: auto;
}

/* Speech bubble uses base .tooltip--speech from styles.css */
.ama-header .ama-speech-bubble {
    top: 50%;
    left: 100%;
    transition: background 0.5s ease, color 0.5s ease;
}

.ama-header .ama-speech-bubble::after {
    transition: border-color 0.5s ease;
}

.ama-header h1 {
    margin: 0 0 0.75rem;
}

.ama-header .subtitle {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    color: var(--gray-600);
    margin: 0;
    line-height: var(--body-line-height);
}

.ama-header .subtitle a {
    color: var(--anthropic-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ama-header .subtitle a:hover {
    color: var(--anthropic-link-hover);
}

/* Form Section */
.ama-form-section {
    margin-bottom: 4rem;
}

.ama-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ama-textarea {
    width: 100%;
    min-height: 80px;
    padding: 1rem;
    border: 1px solid var(--gray-400);
    border-radius: 6px;
    font-family: 'Ivar Text', Georgia, serif;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    background: white;
    color: var(--gray-900);
}

.ama-textarea:focus {
    outline: none;
    border-color: var(--anthropic-link);
}

.ama-textarea::placeholder {
    color: var(--gray-500);
}

.ama-submit-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ama-success-msg {
    font-family: 'Departure Mono', ui-monospace, monospace;
    font-size: 14px;
    color: #6b8f5a;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ama-success-msg.visible {
    opacity: 1;
}

.ama-submit-btn {
    padding: 0.5rem 1rem;
    background: var(--gray-850);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Departure Mono', ui-monospace, monospace;
    font-size: 14px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ama-submit-btn:hover {
    opacity: 0.9;
}

.ama-submit-btn:active {
    transform: scale(0.98);
}

.ama-submit-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
}

.ama-submit-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.ama-submit-btn:focus:not(:focus-visible) {
    outline: none;
}

.ama-submit-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}


/* Q&A Grid Section */
.ama-qa-section h3 {
    margin-bottom: 1.5rem;
}

.ama-grid {
    display: flex;
    flex-direction: column;
}

.ama-qa-item {
    width: 100%;
}

.ama-qa-item:not(:last-child)::after {
    content: '';
    display: block;
    margin: var(--spacer-2half) 0;
    height: 3px;
    background-image: linear-gradient(to right, var(--gray-400) 3px, transparent 3px);
    background-size: 8px 3px;
}

/* Card header - lozenges row */
.ama-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

/* Like lozenge - extends .post-lozenge via HTML */
.ama-like-btn {
    /* Fixed dimensions to prevent layout shift during loading */
    /* Height = (font-size 0.7rem × line-height 1.2) + (padding 0.25rem × 2) */
    min-width: 3rem;
    min-height: calc(0.7rem * 1.2 + 0.5rem);
    position: relative;
    background-color: rgba(156, 163, 175, 0.15);
    color: #6b7280;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.ama-like-btn:hover {
    background-color: rgba(156, 163, 175, 0.25);
}

.ama-like-btn:active {
    transform: scale(0.95);
}

.ama-like-btn.liked {
    background-color: rgba(181, 152, 88, 0.15);
    color: #b59858;
}

.ama-like-heart {
    font-size: 0.7rem;
}

.ama-like-count:empty {
    display: none;
}

.ama-qa-item .ama-question {
    display: block;
    margin-bottom: 0.5rem;
}

.ama-qa-item .ama-answer {
    display: block;
}

.ama-question {
    font-family: 'Ivar Text', Georgia, serif;
    font-size: var(--body-font-size);
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.4;
}

.ama-answer {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    color: var(--gray-900);
    margin: 0;
    line-height: var(--body-line-height);
}

/* Empty State */
.ama-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
    font-family: 'Ivar Text', Georgia, serif;
    font-style: italic;
}

/* Loading State */
.ama-loading {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
    font-family: 'Departure Mono', ui-monospace, monospace;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ama-loading-dots::after {
    content: '';
    animation: loadingDots 1s steps(4, end) infinite;
}

@keyframes loadingDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Error State */
.ama-error {
    text-align: center;
    padding: 1rem;
    background: rgba(230, 50, 14, 0.08);
    border-radius: 6px;
    color: var(--red);
    font-family: 'Ivar Text', Georgia, serif;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

