/* Homepage Layout Fixes - Centered Sections */

/* === KABI PARICHAYA SECTION === */
.kabi-parichaya-section {
    margin: 3rem 0;
    padding: 2rem 0;
    background: linear-gradient(135deg, rgba(255, 248, 240, 0.3) 0%, rgba(240, 228, 208, 0.3) 100%);
}

.kabi-parichaya-box {
    max-width: 1000px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(255, 248, 240, 0.98) 0%, rgba(252, 245, 235, 0.98) 100%);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 3rem;
    box-shadow: 
        0 15px 35px rgba(139, 69, 19, 0.15),
        0 5px 15px rgba(139, 69, 19, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(160, 82, 45, 0.2);
    position: relative;
    transition: all 0.4s ease;
    overflow: hidden;
}

/* Decorative border effect - REMOVED OVAL LINE */
.kabi-parichaya-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
}

.kabi-parichaya-box:hover {
    box-shadow: 
        0 20px 45px rgba(139, 69, 19, 0.2),
        0 8px 20px rgba(139, 69, 19, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-3px);
}

/* === POEMS SECTION === */
.poems-section {
    margin: 3rem 0;
    padding: 2rem 0;
}

.poems-header-box {
    max-width: 1000px;
    margin: 0 auto 3rem auto;
    background: rgba(255, 248, 240, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.15);
    border: 1px solid rgba(160, 82, 45, 0.2);
    transition: all 0.3s ease;
}

.poems-header-box:hover {
    box-shadow: 0 15px 40px rgba(139, 69, 19, 0.2);
    transform: translateY(-2px);
}

/* === SECTION HEADERS === */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 2;
}

.section-header h2 {
    font-size: 2.8rem;
    color: #8b4513;
    margin-bottom: 1rem;
    font-weight: bold;
    font-family: 'Noto Serif Devanagari', serif;
    text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.1);
    position: relative;
}

/* Decorative underline for section headers */
.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #8b4513, transparent);
    border-radius: 2px;
}

.section-header p {
    font-size: 1.4rem;
    color: #5d4e37;
    margin-bottom: 0;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(93, 78, 55, 0.1);
}

/* === INTRO CARD LAYOUT === */
.intro-card {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    text-align: center;
}

.poet-photo-section {
    order: 1;
}

.poet-intro-text {
    order: 2;
    text-align: center;
}

.poet-intro-text p {
    font-size: 1.2rem;
    line-height: 1.9;
    color: #5d4e37;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 248, 240, 0.6) 100%);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    border: 1px solid rgba(139, 69, 19, 0.1);
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* === PHOTO FRAME === */
.photo-frame {
    width: 220px;
    height: 220px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    border: 4px solid rgba(139, 69, 19, 0.3);
    box-shadow: 
        0 10px 25px rgba(139, 69, 19, 0.2),
        0 4px 10px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.4s ease;
    position: relative;
    background: #fff;
}

/* Decorative corner elements */
.photo-frame::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 15px;
    pointer-events: none;
    z-index: 1;
}

.photo-frame:hover {
    transform: scale(1.08) rotate(1deg);
    box-shadow: 
        0 15px 35px rgba(139, 69, 19, 0.3),
        0 6px 15px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.poet-photo {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f4f0 0%, #e8dcc0 50%, #f4f1e8 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    position: relative;
    z-index: 2;
}

.photo-placeholder {
    font-size: 3.5rem;
    color: rgba(139, 69, 19, 0.6);
    text-shadow: 2px 2px 4px rgba(139, 69, 19, 0.1);
    animation: gentle-pulse 3s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.photo-text {
    font-size: 1rem;
    color: rgba(139, 69, 19, 0.8);
    text-align: center;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* === RESPONSIVE DESIGN === */
@media (min-width: 768px) {
    .intro-card {
        flex-direction: row;
        text-align: left;
        gap: 3rem;
    }
    
    .poet-photo-section {
        order: 1;
        flex-shrink: 0;
    }
    
    .poet-intro-text {
        order: 2;
        text-align: left;
        flex: 1;
    }
    
    .poet-intro-text p {
        text-align: left;
        margin: 0;
    }
}

@media (max-width: 767px) {
    .kabi-parichaya-box,
    .poems-header-box {
        margin: 0 1rem;
        padding: 2rem 1.5rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .section-header p {
        font-size: 1.1rem;
    }
    
    .photo-frame {
        width: 150px;
        height: 150px;
    }
    
    .photo-placeholder {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .kabi-parichaya-box,
    .poems-header-box {
        margin: 0 0.5rem;
        padding: 1.5rem 1rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .poet-intro-text p {
        font-size: 1rem;
    }
}

/* 2. FIX POEM CARD IMAGE SIZING - 90% COVERAGE */
.poem-card {
    background: rgba(255, 248, 240, 0.9);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(160, 82, 45, 0.1);
    height: 400px;
    display: flex;
    flex-direction: column;
}

.poem-card .poem-image {
    height: 90%;
    width: 100%;
    background: linear-gradient(135deg, #f4f1e8 0%, #e8dcc0 100%);
    position: relative;
    overflow: hidden;
    flex: 1;
}

.poem-card .poem-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.poem-card .poem-content {
    height: 10%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 248, 240, 0.95);
}

.poem-card .poem-title {
    font-size: 1rem;
    margin: 0;
    text-align: center;
    color: #8b4513;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poem-card .poem-excerpt {
    display: none; /* Hide excerpt to save space */
}

.poem-card .poem-meta {
    display: none; /* Hide meta to save space */
}

.poem-card .poem-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(139, 69, 19, 0.9);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.poem-card .poem-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: rgba(139, 69, 19, 0.3);
    background: linear-gradient(135deg, rgba(255, 248, 240, 0.8) 0%, rgba(232, 220, 192, 0.8) 100%);
}

/* 3. REMOVE CONNECTION MESSAGES */
.connection-status {
    display: none !important;
}

.slow-connection-notice {
    display: none !important;
}

.fast-connection-notice {
    display: none !important;
}

/* 4. ENSURE POEMS SECTION IS CENTERED */
.poems-section-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.poems-header-box {
    text-align: center;
    margin-bottom: 2rem;
}

.poem-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    margin-top: 2rem;
    width: 100%;
    max-width: 1200px;
}

/* === POEMS GRID LAYOUT === */
.poems-section .poem-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 2rem 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Override any conflicting styles for homepage poem cards */
.poems-section .poem-card {
    background: rgba(255, 248, 240, 0.9);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(160, 82, 45, 0.1);
    height: 450px;
    display: flex;
    flex-direction: column;
}

.poems-section .poem-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(139, 69, 19, 0.2);
}

.poems-section .poem-card .poem-image {
    height: 60%;
    width: 100%;
    background: linear-gradient(135deg, #f4f1e8 0%, #e8dcc0 100%);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.poems-section .poem-card .poem-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.poems-section .poem-card:hover .poem-image img {
    transform: scale(1.05);
}

.poems-section .poem-card .poem-content {
    height: 40%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 248, 240, 0.95);
    flex-grow: 1;
}

.poems-section .poem-card .poem-title {
    font-size: 1.2rem;
    margin: 0 0 0.5rem 0;
    color: #8b4513;
    font-weight: bold;
    line-height: 1.3;
}

.poems-section .poem-card .poem-excerpt {
    display: block;
    margin: 0.5rem 0;
    color: #5d4e37;
    line-height: 1.4;
    font-size: 0.9rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-grow: 1;
}

.poems-section .poem-card .poem-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(139, 69, 19, 0.1);
    flex-shrink: 0;
}

.poems-section .poem-card .poem-author {
    font-weight: bold;
    color: #8b4513;
    font-size: 0.9rem;
}

.poems-section .poem-card .poem-date {
    color: rgba(139, 69, 19, 0.7);
    font-size: 0.8rem;
    font-style: italic;
}

.poems-section .poem-card .poem-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(139, 69, 19, 0.9);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.poems-section .poem-card .poem-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: rgba(139, 69, 19, 0.3);
    background: linear-gradient(135deg, rgba(255, 248, 240, 0.8) 0%, rgba(232, 220, 192, 0.8) 100%);
}

/* Hide unnecessary elements on homepage cards */
.poems-section .poem-card .poem-excerpt,
.poems-section .poem-card .poem-meta {
    display: flex; /* Show these on homepage too */
}

/* Homepage responsive design */
@media (max-width: 1024px) {
    /* Tablet - 2 columns */
    .poems-section .poem-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Mobile - 1 column */
    .poems-section .poem-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem 0;
    }
    
    .poems-section .poem-card {
        height: 400px;
    }
    
    .read-more-btn, body.poems-page .read-more-btn {
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
        min-width: 120px !important;
    }
    
    .poem-actions, body.poems-page .poem-actions {
        margin-top: 0.8rem !important;
        padding: 0.3rem !important;
    }
}

@media (max-width: 480px) {
    .poems-section .poem-cards {
        gap: 1rem;
    }
    
    .poems-section .poem-card {
        height: 350px;
    }
    
    .poems-section .poem-card .poem-content {
        padding: 1rem;
    }
    
    .read-more-btn, body.poems-page .read-more-btn {
        padding: 8px 16px !important;
        font-size: 0.85rem !important;
        min-width: 100px !important;
        gap: 6px !important;
    }
}

/* Homepage card fixes - Enhanced Design */
.poem-card {
    min-height: 420px !important;
    height: auto !important;
    transition: all 0.4s ease !important;
    will-change: transform !important;
    display: flex !important;
    flex-direction: column !important;
    background: linear-gradient(135deg, rgba(255, 248, 240, 0.98) 0%, rgba(252, 245, 235, 0.98) 100%) !important;
    border-radius: 20px !important;
    box-shadow: 
        0 10px 30px rgba(139, 69, 19, 0.15),
        0 5px 15px rgba(139, 69, 19, 0.1) !important;
    border: 2px solid rgba(160, 82, 45, 0.1) !important;
    overflow: hidden !important;
    cursor: default !important;
}

.poem-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 
        0 20px 45px rgba(139, 69, 19, 0.25),
        0 10px 25px rgba(139, 69, 19, 0.15) !important;
    border-color: rgba(160, 82, 45, 0.2) !important;
}

.poem-image {
    height: 200px !important;
    min-height: 200px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.05) 0%, rgba(160, 82, 45, 0.1) 100%) !important;
    position: relative !important;
}

.poem-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: all 0.4s ease !important;
}

.poem-card:hover .poem-image img {
    transform: scale(1.05) !important;
}

.poem-category {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    background: rgba(139, 69, 19, 0.95) !important;
    color: white !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 20px !important;
    font-size: 0.75rem !important;
    font-weight: bold !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    z-index: 2 !important;
}

.poem-content {
    padding: 1.5rem !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.8rem !important;
    min-height: 220px !important;
}

.poem-title {
    font-size: 1.4rem !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.3 !important;
    min-height: auto !important;
    color: #8b4513 !important;
    font-weight: 700 !important;
    text-align: center !important;
    font-family: 'Noto Serif Devanagari', serif !important;
}

.poem-excerpt-container {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    background: rgba(139, 69, 19, 0.03) !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    border-left: 3px solid #8b4513 !important;
    min-height: 80px !important;
}

.poem-excerpt {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    color: #5d4e37 !important;
    font-style: italic !important;
    margin: 0 !important;
    white-space: pre-line !important;
    font-family: 'Noto Serif Devanagari', serif !important;
}

.poem-meta {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.8rem 0 0.5rem 0 !important;
    border-top: 1px solid rgba(139, 69, 19, 0.1) !important;
    font-size: 0.85rem !important;
    margin-top: auto !important;
    min-height: 40px !important;
}

.poem-author, .poem-date {
    display: flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    color: #8b4513 !important;
    font-weight: 600 !important;
}

.author-icon, .date-icon {
    font-size: 0.8rem !important;
}

.poem-actions {
    margin-top: 0.8rem !important;
    text-align: center !important;
    padding: 0.5rem 0 !important;
}

.read-more-btn {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%) !important;
    color: white !important;
    border: none !important;
    padding: 10px 16px !important;
    border-radius: 25px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    font-family: 'Noto Serif Devanagari', serif !important;
    box-shadow: 
        0 3px 12px rgba(139, 69, 19, 0.25),
        0 1px 6px rgba(139, 69, 19, 0.15) !important;
    text-decoration: none !important;
    outline: none !important;
    position: relative !important;
    overflow: hidden !important;
    min-width: 100px !important;
    max-width: calc(100% - 1rem) !important;
    letter-spacing: 0.3px !important;
    white-space: nowrap !important;
    margin: 0.5rem 0 !important;
}

.read-more-btn::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
    transition: left 0.5s !important;
}

.read-more-btn:hover::before {
    left: 100% !important;
}

.read-more-btn:hover {
    background: linear-gradient(135deg, #a0522d 0%, #8b4513 100%) !important;
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 
        0 8px 25px rgba(139, 69, 19, 0.35),
        0 4px 15px rgba(139, 69, 19, 0.25) !important;
}

.read-more-btn:active {
    transform: translateY(-1px) scale(0.98) !important;
    transition: all 0.1s !important;
}

.read-more-btn .arrow-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 1rem !important;
    font-weight: bold !important;
}

.read-more-btn:hover .arrow-icon {
    transform: translateX(4px) !important;
}

/* === OLD STYLE CLEANUP === */
.poem-card .poem-image {
    height: 90%;
    width: 100%;
    background: linear-gradient(135deg, #f4f1e8 0%, #e8dcc0 100%);
    position: relative;
    overflow: hidden;
    flex: 1;
}

.poem-card .poem-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.poem-card .poem-content {
    height: 10%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 248, 240, 0.95);
}

.poem-card .poem-title {
    font-size: 1rem;
    margin: 0;
    text-align: center;
    color: #8b4513;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poem-card .poem-excerpt {
    display: none; /* Hide excerpt to save space */
}

.poem-card .poem-meta {
    display: none; /* Hide meta to save space */
}

.poem-card .poem-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(139, 69, 19, 0.9);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.poem-card .poem-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: rgba(139, 69, 19, 0.3);
    background: linear-gradient(135deg, rgba(255, 248, 240, 0.8) 0%, rgba(232, 220, 192, 0.8) 100%);
}
