/* ============================================
   WHAT TO SAY IN A SYMPATHY CARD
   Empathy UX: 18px+ fonts, 44px+ touch targets
   ============================================ */

/* CSS Variables */
:root {
    --color-bg: #faf9f7;
    --color-card-bg: #ffffff;
    --color-text: #2d2d2d;
    --color-text-muted: #666666;
    --color-accent: #5a7d6b;
    --color-accent-hover: #4a6a5a;
    --color-border: #e0ddd8;
    --color-border-light: #f0ede8;
    --color-highlight: #fff8e7;
    --color-star: #d4a03c;
    --color-star-active: #c4902c;
    --font-body: Georgia, 'Times New Roman', serif;
    --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --max-width: 1200px;
    --sidebar-width: 300px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html {
    font-size: 18px;
    scroll-behavior: smooth;
}

html.font-large {
    font-size: 20px;
}

html.font-xlarge {
    font-size: 22px;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-accent);
    color: white;
    padding: 0.5rem 1rem;
    z-index: 1000;
    font-family: var(--font-ui);
}

.skip-link:focus {
    top: 0;
}

/* Header */
header {
    background: var(--color-card-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-title {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
}

.site-title:hover {
    color: var(--color-accent);
}

.header-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-btn {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    min-height: 44px;
    min-width: 44px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-card-bg);
    color: var(--color-text);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: var(--color-border-light);
}

.header-btn:focus {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.support-btn {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.support-btn:hover {
    background: var(--color-accent-hover);
}

/* Main Content */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* Hero */
.hero {
    text-align: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

/* How to Use */
.howto-use {
    max-width: 700px;
    margin: 0 auto 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--color-highlight);
    border: 1px solid #e8dfc8;
    border-radius: 8px;
}

.howto-use-title {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.howto-use-steps {
    margin: 0;
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.howto-use-steps li {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text);
}

.howto-use-steps li strong {
    color: var(--color-accent);
}

/* Two Column Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 2rem;
    align-items: start;
}

.main-column {
    min-width: 0;
}

.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 80px;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.mode-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    min-height: 48px;
    font-family: var(--font-ui);
    font-size: 1rem;
    border: none;
    background: var(--color-card-bg);
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mode-btn:hover {
    background: var(--color-border-light);
}

.mode-btn.active {
    background: var(--color-accent);
    color: white;
}

.mode-btn:focus {
    outline: 3px solid var(--color-accent);
    outline-offset: -3px;
}

.shortlist-badge {
    font-size: 0.8rem;
    background: rgba(255,255,255,0.3);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
}

.mode-btn.active .shortlist-badge {
    background: rgba(255,255,255,0.3);
}

/* Filters */
.filters-section {
    margin-bottom: 2rem;
}

.filter-group {
    margin-bottom: 1rem;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.filter-group summary {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-group summary::-webkit-details-marker {
    display: none;
}

.filter-group summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--color-text-muted);
}

.filter-group[open] summary::after {
    content: '−';
}

.filter-group summary:hover {
    background: var(--color-border-light);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.filter-btn {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
    min-height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-card-bg);
    color: var(--color-text);
    cursor: pointer;
}

.filter-btn:hover {
    background: var(--color-border-light);
}

.filter-btn.active {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.filter-btn:focus {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* Scripts Section */
.scripts-section {
    margin-bottom: 2rem;
}

.scripts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.scripts-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.scripts-count {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.scripts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Script Card */
.script-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
    position: relative;
}

.script-card.saved {
    border-color: var(--color-star);
    background: var(--color-highlight);
}

.script-text {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    padding-right: 2.5rem;
}

.script-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.script-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.script-tag {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-border-light);
    border-radius: 4px;
    color: var(--color-text-muted);
}

.script-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-save {
    width: 44px;
    height: 44px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-card-bg);
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.btn-save:hover {
    background: var(--color-highlight);
    color: var(--color-star);
}

.btn-save.saved {
    background: var(--color-star);
    color: white;
    border-color: var(--color-star);
}

.btn-save:focus {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.btn-copy {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    min-height: 44px;
    border: 1px solid var(--color-accent);
    border-radius: 6px;
    background: var(--color-card-bg);
    color: var(--color-accent);
    cursor: pointer;
}

.btn-copy:hover {
    background: var(--color-accent);
    color: white;
}

.btn-copy.copied {
    background: var(--color-accent);
    color: white;
}

.btn-copy:focus {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* Sidebar Panels */
.sidebar-panel {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
}

.sidebar-title {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shortlist-count {
    font-size: 0.85rem;
    background: var(--color-accent);
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
}

.shortlist-items {
    max-height: 300px;
    overflow-y: auto;
}

.shortlist-empty {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.shortlist-item {
    font-size: 0.9rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 0.5rem;
}

.shortlist-item:last-child {
    border-bottom: none;
}

.shortlist-item-text {
    flex: 1;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
}

.btn-remove:hover {
    color: #c44;
}

.btn-review,
.btn-clear {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.75rem;
    min-height: 44px;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
}

.btn-review {
    background: var(--color-accent);
    color: white;
    border: none;
}

.btn-review:hover {
    background: var(--color-accent-hover);
}

.btn-clear {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.btn-clear:hover {
    background: var(--color-border-light);
}

/* Ad Slots */
.ad-slot {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-border-light);
    border-style: dashed;
}

.ad-placeholder {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Review Mode */
.hidden {
    display: none !important;
}

.review-section {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
}

.review-section h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.review-intro {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.review-list {
    margin-bottom: 2rem;
}

.review-item {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    position: relative;
}

.review-item:hover {
    border-color: var(--color-accent);
}

.review-item.selected {
    border-color: var(--color-accent);
    background: var(--color-highlight);
}

.review-item.selected::before {
    content: '✓';
    position: absolute;
    right: 1rem;
    top: 1rem;
    background: var(--color-accent);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.review-item-text {
    font-size: 1rem;
    line-height: 1.6;
    padding-right: 2rem;
}

.review-item-remove {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
}

.review-item-remove:hover {
    color: #c44;
}

.review-empty {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.btn-primary {
    font-family: var(--font-ui);
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    min-height: 48px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 1rem;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
}

/* Sign-off Section */
.signoff-section {
    margin-bottom: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-light);
}

/* How to Sign Section */
.howto-section {
    margin-bottom: 1.5rem;
}

.howto-details {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.howto-details summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.howto-details summary::-webkit-details-marker {
    display: none;
}

.howto-details summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--color-text-muted);
}

.howto-details[open] summary::after {
    content: '−';
}

.howto-details summary:hover {
    background: var(--color-border-light);
}

.howto-details summary h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.howto-content {
    padding: 0 1.25rem 1.25rem;
}

.howto-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.howto-tips {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.howto-tip {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--color-card-bg);
    border-radius: 6px;
    border-left: 3px solid var(--color-accent);
}

.howto-label {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
}

.howto-example {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.howto-note {
    font-size: 0.9rem;
    padding: 0.75rem;
    background: var(--color-highlight);
    border-radius: 6px;
    margin-bottom: 0;
}

.signoff-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.signoff-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.signoff-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    min-height: 44px;
}

.signoff-option:hover {
    background: var(--color-border-light);
}

.signoff-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-accent);
}

.signoff-option:has(input:checked) {
    border-color: var(--color-accent);
    background: var(--color-highlight);
}

.name-input {
    margin-top: 1.5rem;
}

.name-input label {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-muted);
}

.name-input input {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: var(--font-body);
}

.name-input input:focus {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

/* Final Section */
.final-section {
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-light);
}

.final-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.final-message {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    min-height: 120px;
}

.final-message p {
    line-height: 1.7;
}

.final-placeholder {
    color: var(--color-text-muted);
    font-style: italic;
}

.btn-copy-final {
    font-family: var(--font-ui);
    font-size: 1rem;
    padding: 1rem 2rem;
    min-height: 52px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-copy-final:hover:not(:disabled) {
    background: var(--color-accent-hover);
}

.btn-copy-final:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-copy-final.copied {
    background: #4a8;
}

/* Related Links */
.related-links {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

/* Static Page Content */
.static-page-content {
    max-width: 800px;
    margin: 0 auto;
}

.static-page-content .scripts-count {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    text-align: center;
}

.related-links h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text-muted);
}

.related-links ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.related-links a {
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.95rem;
}

.related-links a:hover {
    text-decoration: underline;
}

/* Empathy Promo */
.empathy-promo {
    margin-top: 3rem;
    padding: 1.5rem;
    background: #f8f6f2;
    border-radius: 8px;
}

.promo-header {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    text-align: center;
}

.promo-boxes {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.promo-box {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 1.25rem;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
}

.promo-box:hover {
    border-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.promo-box:focus {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.promo-label {
    display: block;
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 0.25rem;
}

.promo-desc {
    display: block;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Footer */
footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--color-border);
    margin-top: 3rem;
}

.footer-content {
    text-align: center;
}

.footer-mission {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--color-accent);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-ecosystem {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

.footer-ecosystem a {
    color: var(--color-accent);
    text-decoration: none;
}

.footer-ecosystem a:hover {
    text-decoration: underline;
}

.footer-divider {
    color: var(--color-text-muted);
}

.footer-empathy {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.footer-empathy a {
    color: var(--color-accent);
    text-decoration: none;
}

.footer-empathy a:hover {
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE: Tablet
   ============================================ */
@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar-column {
        position: static;
        order: 2;
    }
    
    .main-column {
        order: 1;
    }
}

/* ============================================
   RESPONSIVE: Mobile
   ============================================ */
@media (max-width: 600px) {
    html {
        font-size: 17px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .filter-group[open] {
        /* Keep open state visible */
    }
    
    .filter-group:not(:first-child) {
        /* Collapse by default on mobile - handled by removing 'open' attr in JS */
    }
    
    .mode-toggle {
        flex-direction: column;
    }
    
    .promo-boxes {
        flex-direction: column;
    }
    
    .promo-box {
        max-width: none;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-ecosystem {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .footer-divider {
        display: none;
    }
    
    .related-links ul {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    header,
    .filters-section,
    .sidebar-column,
    .mode-toggle,
    .empathy-promo,
    .related-links,
    footer,
    .btn-copy,
    .btn-save {
        display: none !important;
    }
    
    .content-grid {
        display: block;
    }
    
    .script-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
