/**
 * Grammar Section Frontend Styles
 * W3Schools-inspired sidebar navigation with brand colors
 */

/* Breadcrumbs Strip - Grammar Pages */
.breadcrumbs-strip {
    background: #4a4a4a;
    padding: 0.75rem 0;
    width: 100%;
}

.breadcrumbs-strip .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.breadcrumbs-strip .breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin: 0;
    padding: 0;
}

.breadcrumbs-strip .breadcrumbs a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs-strip .breadcrumbs a:hover {
    color: #f6b402;
    text-decoration: underline;
}

.breadcrumbs-strip .breadcrumbs .separator {
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0.25rem;
}

.breadcrumbs-strip .breadcrumbs .current {
    font-weight: 600;
    color: white;
}

/* Hero Section */
.grammar-hero-section {
    background: linear-gradient(135deg, #F5F1EE 0%, #F9F6F3 100%);
    padding: 60px 0;
    min-height: 350px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.grammar-hero-section .hero-content {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 40px;
    align-items: center;
}

.grammar-hero-section .hero-text {
    padding-right: 20px;
}

.grammar-hero-section .hero-title {
    font-family: 'Aleo', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: #34190d;
    margin-bottom: 15px;
}

.grammar-hero-section .hero-tagline {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.grammar-hero-section .hero-stats {
    display: flex;
    gap: 40px;
}

.grammar-hero-section .stat-item {
    text-align: center;
}

.grammar-hero-section .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: #007b98;
    margin-bottom: 5px;
}

.grammar-hero-section .stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.grammar-hero-section .hero-image {
    position: relative;
}

.grammar-hero-section .fale-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    opacity: 0.9;
}

/* Animations */
.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out;
}

.delay-200 {
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

.delay-400 {
    animation-delay: 0.4s;
    animation-fill-mode: both;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Main Layout */
.grammar-main-content {
    background: #F9F6F3;
    min-height: 600px;
    padding: 40px 0;
}

/* Archive page has no padding - sections handle their own */
.archive-page.grammar-main-content {
    padding: 0;
    background: transparent;
}

/* Single page - W3Schools style with no top padding */
.single-grammar.grammar-main-content {
    padding-top: 0;
    background: #fff;
}

.grammar-layout {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
}

/* Archive page - full width layout */
.grammar-full-width {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Welcome Section - White Background */
.grammar-welcome-section {
    background: #fff;
    padding: 60px 0;
}

/* Categories Section - Gradient Background */
.grammar-categories-section {
    background: linear-gradient(135deg, #F5F1EE 0%, #F9F6F3 100%);
    padding: 60px 0;
}

/* Promo Section - White Background */
.grammar-promo-section {
    background: #fff;
    padding: 60px 0;
}

/* Sidebar Navigation - W3Schools Style */
.grammar-sidebar {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* Single page sidebar - W3Schools style */
.single-grammar .grammar-sidebar {
    background: #E7E9EB;
    border-radius: 5px 0 0 5px;
    box-shadow: none;
    border-right: 1px solid #d1d1d1;
    top: 0;
    max-height: 100vh;
    position: sticky;
}

.grammar-nav {
    padding: 20px;
}

/* Single page nav - W3Schools style */
.single-grammar .grammar-nav {
    padding: 15px 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f6b402;
}

/* Single page sidebar header - W3Schools style */
.single-grammar .sidebar-header {
    padding: 10px 15px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
}

.sidebar-header h3 {
    font-size: 1.2rem;
    color: #323710;
    margin: 0;
}

.single-grammar .sidebar-header h3 {
    font-size: 1.1rem;
    color: #000;
    font-weight: 500;
}

.sidebar-header h3 a {
    color: #323710;
    text-decoration: none;
}

.single-grammar .sidebar-header h3 a {
    color: #000;
}

.sidebar-header h3 a:hover {
    color: #007b98;
}

.single-grammar .sidebar-header h3 a:hover {
    color: #4CAF50;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #323710;
    margin: 4px 0;
    transition: all 0.3s;
}

/* Grammar Categories */
.grammar-category {
    margin-bottom: 15px;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.grammar-category.active {
    border-left-color: #007b98;
    background: #f0f8fa;
}

/* Single page categories - W3Schools style */
.single-grammar .grammar-category {
    margin-bottom: 0;
    border-left: none;
}

.single-grammar .grammar-category.active {
    background: transparent;
}

.category-title {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #323710;
    cursor: pointer;
    transition: all 0.3s;
}

/* Single page category title - W3Schools style */
.single-grammar .category-title {
    padding: 8px 15px;
    font-size: 1rem;
    font-weight: normal;
    color: #000;
}

.category-title:hover {
    background: #fff9e6;
    color: #007b98;
}

.single-grammar .category-title:hover {
    background: transparent;
    color: #000;
}

.category-title a {
    color: inherit;
    text-decoration: none;
    flex: 1;
    margin-left: 8px;
}

.category-title a.current-page {
    color: #007b98;
    font-weight: 600;
}

.single-grammar .category-title a.current-page {
    color: #000;
    font-weight: normal;
}

.toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    min-width: 15px;
    transition: transform 0.3s;
    color: #666;
    font-size: 0.8rem;
}

/* Subcategories */
.subcategories {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fafafa;
    overflow: hidden;
    transition: all 0.3s;
}

/* Single page subcategories - W3Schools style */
.single-grammar .subcategories {
    background: transparent;
}

.subcategories li {
    padding: 8px 15px 8px 45px;
    border-bottom: 1px solid #eee;
}

.single-grammar .subcategories li {
    padding: 6px 15px 6px 38px;
    border-bottom: none;
}

.subcategories li:last-child {
    border-bottom: none;
}

.subcategories a {
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    transition: all 0.3s;
}

.single-grammar .subcategories a {
    color: #000;
    font-size: 0.95rem;
}

.subcategories a:hover {
    color: #007b98;
    padding-left: 5px;
}

.single-grammar .subcategories a:hover {
    color: #fff;
    background: #4CAF50;
    padding-left: 0;
    margin: 0 -15px 0 -38px;
    padding: 6px 15px 6px 38px;
}

.subcategories a.current-page {
    color: #007b98;
    font-weight: 600;
    background: #e6f7fb;
    margin: 0 -15px 0 -45px;
    padding: 8px 15px 8px 50px;
}

.single-grammar .subcategories a.current-page {
    color: #fff;
    background: #4CAF50;
    font-weight: normal;
    margin: 0 -15px 0 -38px;
    padding: 6px 15px 6px 38px;
}

.subcategories .coming-soon {
    color: #ccc;
    font-style: italic;
    font-size: 0.95rem;
}

/* Main Content Area */
.grammar-content {
    background: #fff;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Single page content - W3Schools style */
.single-grammar .grammar-content {
    background: #fff;
    border-radius: 0 5px 5px 0;
    box-shadow: none;
    padding: 40px 50px;
    min-height: 100vh;
}

/* Grammar Introduction */
.grammar-introduction {
    margin-bottom: 40px;
}

.grammar-introduction h2 {
    font-family: 'Aleo', serif;
    font-size: 1.8rem;
    color: #323710;
    margin-bottom: 15px;
}

.grammar-introduction p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #666;
}

/* Grammar Overview */
.grammar-overview {
    margin-bottom: 40px;
}

.grammar-overview h3 {
    font-family: 'Aleo', serif;
    font-size: 1.4rem;
    color: #323710;
    margin-bottom: 20px;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.topic-card {
    background: #f9f9f9;
    border-left: 4px solid #f6b402;
    padding: 20px;
    border-radius: 5px;
    transition: all 0.3s;
}

.topic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.topic-card h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.topic-card h4 a {
    color: #007b98;
    text-decoration: none;
}

.topic-card h4 a:hover {
    text-decoration: underline;
}

.topic-card p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Categories Grid */
.grammar-categories-grid {
    margin: 0;
}

.grammar-categories-grid h3 {
    font-family: 'Aleo', serif;
    font-size: 1.6rem;
    color: #323710;
    margin-bottom: 30px;
    text-align: center;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.category-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

.category-card:hover {
    border-color: #007b98;
    box-shadow: 0 4px 12px rgba(0,123,152,0.15);
}

.category-card h4 {
    color: #323710;
    font-size: 1.1rem;
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f6b402;
}

.category-brief {
    color: #666;
    font-size: 0.9rem;
    margin: 10px 0;
    line-height: 1.4;
}

.subtopic-list {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.subtopic-list li {
    padding: 5px 0;
    color: #666;
    font-size: 0.9rem;
    position: relative;
    padding-left: 15px;
}

.subtopic-list li:before {
    content: "›";
    position: absolute;
    left: 0;
    color: #007b98;
}

.subtopic-list .more {
    color: #007b98;
    font-style: italic;
}

/* Grammar Table of Contents - W3Schools Style */
.grammar-toc-section {
    margin: 60px 0;
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.grammar-toc-section h3 {
    font-family: 'Aleo', serif;
    font-size: 1.6rem;
    color: #323710;
    margin-bottom: 30px;
    text-align: center;
}

.grammar-toc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.toc-column {
    padding: 0;
}

.toc-column h4 {
    font-size: 1.1rem;
    color: #323710;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f6b402;
}

.toc-column h4 a {
    color: #323710;
    text-decoration: none;
}

.toc-column h4 a:hover {
    color: #007b98;
}

.toc-column ul {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.toc-column li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.toc-column li:last-child {
    border-bottom: none;
}

.toc-column li a {
    color: #007b98;
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding-left: 15px;
    position: relative;
}

.toc-column li a:before {
    content: "›";
    position: absolute;
    left: 0;
    color: #ccc;
}

.toc-column li a:hover {
    color: #323710;
    padding-left: 20px;
}

.toc-column .coming-soon {
    color: #ccc;
    font-style: italic;
    font-size: 0.95rem;
    padding-left: 15px;
    display: block;
}

.toc-break {
    display: none;
}

/* Blog Promo Section */
.grammar-blog-promo {
    margin: 0 0 60px 0;
    padding: 0;
    background: transparent;
}

.grammar-blog-promo h3 {
    font-family: 'Aleo', serif;
    font-size: 1.6rem;
    color: #323710;
    text-align: center;
    margin-bottom: 30px;
}

.blog-cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.blog-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.blog-card-image {
    height: 150px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-content {
    padding: 20px;
}

.blog-card h4 {
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.blog-card h4 a {
    color: #323710;
    text-decoration: none;
}

.blog-card h4 a:hover {
    color: #007b98;
}

.blog-card p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.blog-cta {
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #007b98;
    color: #fff;
}

.btn-primary:hover {
    background: #005a70;
    transform: translateX(5px);
}

.btn-secondary {
    background: #f6b402;
    color: #323710;
}

.btn-secondary:hover {
    background: #e5a502;
}

/* Lessons Promo Strip */
.grammar-lessons-promo {
    background: #007b98;
    color: #fff;
    padding: 40px;
    text-align: center;
    border-radius: 10px;
    margin: 40px 0;
}

.grammar-lessons-promo h3 {
    font-family: 'Aleo', serif;
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.grammar-lessons-promo p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.95;
}

.grammar-lessons-promo .btn-secondary {
    background: #fff;
    color: #007b98;
}

.grammar-lessons-promo .btn-secondary:hover {
    background: #f6b402;
    color: #323710;
}

/* Single Grammar Page Styles */
.single-grammar .rule-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f6b402;
}

.single-grammar h1 {
    font-family: 'Aleo', serif;
    font-size: 2rem;
    color: #323710;
    margin-bottom: 15px;
}

.rule-brief {
    font-size: 1.2rem;
    color: #666;
    line-height: 1.6;
    font-style: italic;
}

.rule-content {
    margin-bottom: 40px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.rule-content h2 {
    font-family: 'Aleo', serif;
    font-size: 1.5rem;
    color: #323710;
    margin: 30px 0 15px;
}

.rule-content h3 {
    font-family: 'Aleo', serif;
    font-size: 1.3rem;
    color: #007b98;
    margin: 25px 0 15px;
}

/* Category Subtopics */
.category-subtopics {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
}

.category-subtopics h3 {
    font-family: 'Aleo', serif;
    font-size: 1.3rem;
    color: #323710;
    margin: 0 0 15px 0;
}

.subtopic-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subtopic-link {
    display: inline-block;
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
}

.subtopic-link:hover {
    background: #007b98;
    color: #fff;
    border-color: #007b98;
}

/* Related Grammar Rules */
.related-grammar-rules {
    margin: 40px 0;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
}

.related-grammar-rules h3 {
    font-family: 'Aleo', serif;
    font-size: 1.4rem;
    color: #323710;
    margin: 0 0 20px 0;
}

.related-rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.related-rule-card {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    border-left: 3px solid #007b98;
    transition: all 0.3s;
}

.related-rule-card:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.related-rule-card h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.related-rule-card h4 a {
    color: #007b98;
    text-decoration: none;
}

.related-rule-card h4 a:hover {
    text-decoration: underline;
}

.related-rule-card p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Exercises Section */
.grammar-exercises-section {
    margin: 40px 0;
    padding: 30px;
    background: #fff9e6;
    border-radius: 8px;
    border: 2px dashed #f6b402;
}

.grammar-exercises-section h3 {
    font-family: 'Aleo', serif;
    font-size: 1.4rem;
    color: #323710;
    margin: 0 0 20px 0;
}

.exercises-placeholder {
    color: #666;
}

.exercises-placeholder ul {
    margin: 15px 0 0 20px;
}

/* Related Lessons */
.related-lessons {
    margin: 40px 0;
    padding: 25px;
    background: #f0f8fa;
    border-radius: 8px;
}

.related-lessons h3 {
    font-family: 'Aleo', serif;
    font-size: 1.4rem;
    color: #323710;
    margin: 0 0 15px 0;
}

.coming-soon-note {
    color: #666;
    font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .blog-cards-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 968px) {
    .grammar-hero-section .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .grammar-hero-section .hero-text {
        padding-right: 0;
    }
    
    .grammar-hero-section .hero-stats {
        justify-content: center;
    }
    
    .grammar-hero-section .hero-image {
        display: none;
    }
    
    .grammar-layout {
        grid-template-columns: 1fr;
    }
    
    .grammar-sidebar {
        position: static;
        margin-bottom: 30px;
    }
    
    .mobile-toggle {
        display: block !important;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .related-rules-grid {
        grid-template-columns: 1fr;
    }
    
    .grammar-toc {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .blog-cards-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .grammar-hero-section .hero-title {
        font-size: 1.8rem;
    }
    
    .grammar-content {
        padding: 20px;
    }
    
    .quick-links {
        grid-template-columns: 1fr;
    }
}