/* Etiquette.ru - Main Stylesheet */
/* Mobile-first responsive design */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;

    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;

    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-dark: #0f172a;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);

    --radius: 8px;
    --radius-lg: 12px;

    --container: 1200px;
    --container-narrow: 800px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1rem;
}

.container-narrow {
    max-width: var(--container-narrow);
}

/* Header */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: 0.3s;
}

.nav {
    display: none;
    width: 100%;
    order: 3;
}

.nav.active {
    display: block;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nav-list li a {
    display: block;
    padding: 0.75rem 0;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
}

.nav-list li a:hover {
    color: var(--primary);
    text-decoration: none;
}

.nav-more {
    position: relative;
}

.dropdown {
    display: none;
    list-style: none;
    padding-left: 1rem;
}

.dropdown-divider {
    border-top: 1px solid var(--border);
    margin: 0.5rem 0;
}

.nav-more:hover .dropdown {
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    order: 2;
}

.favorites-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text);
    position: relative;
}

.favorites-btn:hover {
    color: var(--primary);
}

.favorites-count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorites-count:empty {
    display: none;
}

.search-form {
    display: flex;
    width: 100%;
    order: 2;
}

.search-form input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 1rem;
}

.search-form button {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
}

/* Desktop Header */
@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }

    .nav {
        display: block;
        width: auto;
        order: 0;
    }

    .nav-list {
        flex-direction: row;
        gap: 0.25rem;
    }

    .nav-list li a {
        padding: 0.5rem 0.75rem;
        border: none;
        border-radius: var(--radius);
    }

    .nav-list li a:hover {
        background: var(--bg-alt);
    }

    .dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 0.5rem 0;
        min-width: 200px;
        box-shadow: var(--shadow-lg);
        z-index: 10;
    }

    .dropdown li a {
        padding: 0.5rem 1rem;
        border-radius: 0;
    }

    .header-actions {
        order: 0;
    }

    .search-form {
        width: auto;
        max-width: 200px;
        order: 0;
    }
}

/* Favorites Sidebar */
.favorites-sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    transition: right 0.3s;
    display: flex;
    flex-direction: column;
}

.favorites-sidebar.active {
    right: 0;
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.favorites-header h3 {
    margin: 0;
}

.favorites-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.favorites-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.favorites-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.favorites-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.favorites-item a {
    flex: 1;
    color: var(--text);
    font-weight: 500;
}

.favorites-item a:hover {
    color: var(--primary);
}

.favorites-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.favorites-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 150;
    display: none;
}

.favorites-overlay.active {
    display: block;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero p {
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.hero-search {
    max-width: 500px;
    margin: 0 auto 1rem;
}

.hero-search form {
    display: flex;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
}

.hero-search input {
    flex: 1;
    padding: 1rem;
    border: none;
    font-size: 1rem;
}

.hero-search button {
    padding: 1rem 1.5rem;
    background: var(--text);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.hero-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-link {
    color: rgba(255,255,255,0.9);
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius);
    transition: background 0.2s;
}

.hero-link:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

@media (min-width: 768px) {
    .hero {
        padding: 4rem 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}

/* Sections */
.section {
    padding: 2rem 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header .section-title {
    margin-bottom: 0;
}

.section-link {
    font-size: 0.875rem;
    font-weight: 500;
}

.subsection-title {
    font-size: 1.25rem;
    margin: 2rem 0 1rem;
}

@media (min-width: 768px) {
    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.category-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.category-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--primary);
}

.category-icon svg {
    width: 100%;
    height: 100%;
}

.category-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.category-card p {
    font-size: 0.875rem;
    color: var(--text-light);
    display: none;
}

@media (min-width: 640px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .category-card p {
        display: block;
    }
}

@media (min-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.article-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.article-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.article-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--bg-alt) 0%, var(--border) 100%);
}

.article-content {
    padding: 1.25rem;
}

.article-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.article-content p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.article-content time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.article-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.article-category-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.reading-time-small {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.article-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.view-count-small, .rating-small {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rating-small svg {
    width: 14px;
    height: 14px;
    color: var(--warning);
}

@media (min-width: 640px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .featured-grid .article-card:first-child {
        grid-column: span 2;
        grid-row: span 2;
    }

    .featured-grid .article-card:first-child img,
    .featured-grid .article-card:first-child .article-placeholder {
        height: 100%;
        min-height: 300px;
    }
}

/* Popular List */
.popular-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.popular-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color 0.2s;
}

.popular-item:hover {
    border-color: var(--primary);
    text-decoration: none;
}

.popular-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 2rem;
}

.popular-content {
    flex: 1;
}

.popular-content h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.popular-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Top Rated */
.top-rated-section {
    margin-bottom: 2rem;
}

.top-rated-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.top-rated-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
}

.top-rated-item:hover {
    border-color: var(--warning);
    text-decoration: none;
}

.top-rated-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--warning);
}

.top-rated-rating svg {
    width: 24px;
    height: 24px;
}

.top-rated-rating span {
    font-weight: 700;
}

.top-rated-content h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.rating-count-small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Articles List */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.article-row {
    display: block;
    padding: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color 0.2s;
}

.article-row:hover {
    border-color: var(--primary);
    text-decoration: none;
}

.article-row h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.article-row p {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary);
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-description {
    font-size: 1.125rem;
    color: var(--text-light);
}

/* Article Page */
.article-page {
    padding: 2rem 0;
}

.article-header {
    margin-bottom: 2rem;
}

.article-header h1 {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.article-summary {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.article-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.meta-separator {
    opacity: 0.5;
}

.article-image {
    margin-bottom: 2rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Article Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text);
}

.tag:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    text-decoration: none;
}

.article-body {
    font-size: 1.125rem;
    line-height: 1.8;
}

.article-body h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

.article-body h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
}

.article-body p {
    margin-bottom: 1.25rem;
}

.article-body ul, .article-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-light);
}

.article-body iframe {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

/* Do & Don't Section */
.do-dont-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.do-list, .dont-list {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.do-list {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.do-list h3 {
    color: #166534;
}

.dont-list {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.dont-list h3 {
    color: #991b1b;
}

.do-list h3, .dont-list h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .do-dont-section {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mistakes Section */
.mistakes-section {
    background: #fffbeb;
    border: 1px solid #fde68a;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

.mistakes-section h3 {
    color: #92400e;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Rating Section */
.rating-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-alt);
    border-radius: var(--radius-lg);
    text-align: center;
}

.rating-section h4 {
    margin-bottom: 1rem;
}

.star-rating {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.star svg {
    width: 32px;
    height: 32px;
}

.star:hover, .star.active {
    color: var(--warning);
    transform: scale(1.1);
}

.star:hover svg, .star.active svg {
    fill: currentColor;
}

.rating-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.rating-avg {
    font-weight: 700;
    color: var(--text);
}

/* Article Share */
.article-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.article-share > span {
    color: var(--text-light);
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text);
    transition: background 0.2s, color 0.2s;
    padding: 0;
    overflow: hidden;
}

.share-btn svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    flex-shrink: 0;
}

.share-btn:hover {
    text-decoration: none;
}

.share-vk:hover { background: #4c75a3; color: white; }
.share-tg:hover { background: #0088cc; color: white; }
.share-wa:hover { background: #25d366; color: white; }
.share-copy:hover { background: var(--text); color: white; }
.share-print:hover { background: var(--secondary); color: white; }

.favorite-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text);
    margin-left: auto;
}

.favorite-btn svg {
    width: 20px;
    height: 20px;
}

.favorite-btn:hover, .favorite-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.favorite-btn.active svg {
    fill: currentColor;
}

/* Comments Section */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comments-section h3 {
    margin-bottom: 1.5rem;
}

.comment-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-notice {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment {
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-author {
    color: var(--text);
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-body {
    color: var(--text-light);
}

.no-comments {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.pagination a:hover {
    background: var(--bg-alt);
    text-decoration: none;
}

.pagination-info {
    color: var(--text-muted);
}

/* Search Page */
.search-page-form {
    margin-bottom: 2rem;
}

.search-input-wrapper {
    display: flex;
    max-width: 600px;
    gap: 0;
}

.search-page-form input {
    flex: 1;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 1rem;
}

.search-page-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-page-form button {
    padding: 1rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    font-weight: 600;
}

.search-results-count {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.search-section {
    margin-bottom: 2.5rem;
}

.search-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-result-item {
    display: block;
    padding: 1rem 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-result-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.search-result-item .result-type {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.search-result-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.search-result-item p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

.search-empty, .search-hints {
    padding: 2rem;
    background: var(--bg-alt);
    border-radius: var(--radius-lg);
}

.search-empty ul, .search-hints ul {
    margin-top: 1rem;
    padding-left: 1.5rem;
}

.search-empty li, .search-hints li {
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.search-meta {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Button */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Newsletter Section */
.newsletter-section {
    background: var(--bg-dark);
    padding: 2rem 0;
}

.newsletter-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.newsletter-text h3 {
    color: white;
    margin-bottom: 0.25rem;
}

.newsletter-text p {
    color: var(--text-muted);
}

.newsletter-form {
    display: flex;
    width: 100%;
    max-width: 400px;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 1rem;
}

.newsletter-form button {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-weight: 600;
    cursor: pointer;
}

.newsletter-message {
    color: var(--success);
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .newsletter-inner {
        flex-direction: row;
        text-align: left;
    }

    .newsletter-text {
        flex: 1;
    }
}

/* FAQ Page */
.faq-container {
    margin-bottom: 2rem;
}

.faq-category {
    margin-bottom: 2rem;
}

.faq-category-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem;
    background: var(--bg);
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.faq-question span {
    flex: 1;
    padding-right: 1rem;
}

.faq-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.faq-item.open .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: 0 1rem 1rem;
    background: var(--bg);
    color: var(--text-light);
}

.faq-item.open .faq-answer {
    display: block;
}

/* FAQ Category Cards */
.faq-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.faq-category-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    position: relative;
}

.faq-category-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.faq-category-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.faq-category-card .faq-count {
    font-size: 0.875rem;
    color: var(--text-light);
}

.faq-category-card .card-arrow {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    max-width: 20px;
    min-height: 20px;
    max-height: 20px;
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
}

.faq-category-card:hover .card-arrow {
    color: var(--primary);
    transform: translateY(-50%) translateX(4px);
}

.faq-navigation {
    margin: 2rem 0;
}

.faq-cta {
    text-align: center;
    padding: 2rem;
    background: var(--bg-alt);
    border-radius: var(--radius-lg);
}

.faq-cta h3 {
    margin-bottom: 0.5rem;
}

.faq-cta p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.faq-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Glossary */
.glossary-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.glossary-letter {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 500;
}

.glossary-letter:hover, .glossary-letter.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    text-decoration: none;
}

.glossary-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.glossary-item {
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.glossary-term-link {
    color: var(--text);
}

.glossary-term-link:hover {
    text-decoration: none;
}

.glossary-term-link:hover .glossary-term {
    color: var(--primary);
}

.glossary-term {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.glossary-definition {
    color: var(--text-light);
    font-size: 0.875rem;
}

.glossary-term-page {
    padding: 2rem 0;
}

.glossary-term-definition {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.glossary-related {
    margin-bottom: 2rem;
}

.glossary-related h3 {
    margin-bottom: 1rem;
}

.related-terms-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-term {
    display: block;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    color: var(--text);
}

.related-term:hover {
    text-decoration: none;
    background: var(--border-light);
}

.related-term strong {
    display: block;
    margin-bottom: 0.25rem;
}

.related-term span {
    font-size: 0.875rem;
    color: var(--text-light);
}

.glossary-term-footer {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: #cbd5e1;
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer h3, .footer h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-about p {
    font-size: 0.875rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid #334155;
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
}

@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

/* Utility */
.main {
    min-height: calc(100vh - 300px);
}

/* Print Styles */
@media print {
    .header, .footer, .newsletter-section,
    .favorites-sidebar, .favorites-overlay,
    .article-share, .comments-section,
    .rating-section, .hero-search, .hero-links,
    .section-alt, .breadcrumb, .nav, .search-form {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .article-page {
        padding: 0;
    }

    .article-header h1 {
        font-size: 24pt;
    }

    .article-body {
        font-size: 11pt;
    }

    a {
        color: black;
        text-decoration: none;
    }

    .article-body a::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }
}
