/*
 * TTO Theme - Pages Styles
 * For: index, category, tag, author, archive, search, 404
 */

/* ====================================
   PAGE HEADER
   ==================================== */
.page-header {
    padding: 25px 0 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.page-label {
    display: inline-block;
    background: var(--dark);
    color: var(--white);
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 700;
}

.page-label-line {
    display: flex;
    align-items: flex-end;
    gap: 0;
    margin-bottom: 20px;
}

.page-label-line::after {
    content: '';
    flex: 1;
    height: 2px;
    background: #000;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 10px;
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.page-title-row .page-title {
    margin-bottom: 0;
}

.page-description {
    color: var(--gray);
    font-size: 15px;
    margin-bottom: 0;
}

/* Subcategories - inline with title */
.subcategories-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subcat-link {
    display: inline-block;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    font-size: 13px;
    font-weight: 600;
    color: var(--black);
    transition: all 0.3s ease;
}

.subcat-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* Old subcategories styles - keep for compatibility */
.subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.subcategories-title {
    width: 100%;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.page-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.page-tags a {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--gray);
    transition: all 0.3s ease;
}

.page-tags a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ====================================
   AUTHOR HEADER
   ==================================== */
.author-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 25px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 30px;
    background: #f5f5f5;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-avatar i {
    font-size: 40px;
    color: #ccc;
}

.author-content {
    flex: 1;
}

.author-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 10px;
}

.author-name-count {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-content h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--black);
    margin: 0;
    text-transform: uppercase;
}

.author-posts-count {
    color: var(--gray);
    font-size: 13px;
}

.author-social {
    display: flex;
    gap: 10px;
}

.author-social a {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    color: var(--white);
    font-size: 14px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.author-social a:hover {
    background: var(--primary);
}

.author-bio {
    color: var(--gray);
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
    width: 100%;
}

/* ====================================
   POSTS GRID
   ==================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.post-card {
    position: relative;
}

.post-thumbnail {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
    aspect-ratio: 1200/675;
    display: block;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-thumbnail-link {
    display: block;
    width: 100%;
    height: 100%;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: var(--white);
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    transition: background-color .2s ease, color .2s ease;
}

.post-category:hover,
.post-category:focus-visible {
    color: var(--white);
    background: #bd1620;
}

.post-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--black);
}

.post-title a {
    color: inherit;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--primary);
}

/* Keep related, category, author and tag archive cards visually even. */
.posts-grid .post-title {
    display: -webkit-box;
    min-height: calc(2em * 1.4);
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--gray);
}

.post-meta .author {
    color: var(--black);
    font-weight: 500;
}

.post-meta .author:hover {
    color: var(--primary);
}

.post-meta .sep {
    margin: 0 5px;
}

/* ====================================
   PAGINATION
   ==================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 7px;
    width: 100%;
    max-width: 760px;
    margin: 40px 0;
    margin-inline: auto;
    padding-inline: 12px;
}

.pagination > a,
.pagination > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-light);
    background: var(--white);
    color: var(--black);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination .prev,
.pagination .next {
    gap: 7px;
    min-width: 105px;
    padding-inline: 16px;
    border-color: #cfd3d8;
}

.pagination .dots {
    min-width: 28px;
    padding: 0 4px;
    border-color: transparent;
    background: transparent;
}

.pagination > a:hover,
.pagination .current {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.pagination > a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ====================================
   SEARCH PAGE
   ==================================== */
.search-section {
    padding: 30px 0;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 30px;
}

.search-form-large {
    max-width: 100%;
    margin: 0 0 20px;
    display: flex;
    gap: 0;
}

.search-form-large input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #ddd;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-form-large input:focus {
    border-color: var(--primary);
}

.search-form-large button {
    padding: 12px 30px;
    background: var(--primary);
    border: none;
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-form-large button:hover {
    background: var(--primary-dark);
}

.search-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.search-tags-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--black);
}

.search-tags a {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 8px 15px;
    border: 1px solid #ddd;
    font-size: 13px;
    color: var(--black);
    transition: all 0.3s ease;
}

.search-tags a i {
    font-size: 11px;
    color: var(--gray);
}

.search-tags a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.search-tags a:hover i {
    color: var(--primary);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.no-results p {
    color: var(--gray);
    margin-bottom: 25px;
}

/* ====================================
   404 PAGE
   ==================================== */
.error-404 {
    text-align: center;
    padding: 80px 20px;
}

.error-404 h1 {
    font-size: 120px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 20px;
}

.error-404 h2 {
    font-size: 28px;
    margin-bottom: 15px;
}

.error-404 p {
    color: var(--gray);
    margin-bottom: 30px;
}

.error-404 .btn {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 12px 30px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.error-404 .btn:hover {
    background: var(--primary-dark);
}

/* ====================================
   RESPONSIVE - Pages
   ==================================== */
@media (max-width: 992px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .page-title {
        font-size: 26px;
    }
    
    .page-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .subcategories-inline {
        width: 100%;
    }
    
    .author-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .author-top-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .author-name-count {
        flex-direction: column;
        gap: 5px;
    }
    
    .author-avatar {
        width: 70px;
        height: 70px;
    }
    
    .author-content h1 {
        font-size: 20px;
    }
    
    .author-bio {
        text-align: center;
    }
    
    .author-social {
        justify-content: center;
    }
    
    .error-404 h1 {
        font-size: 80px;
    }
    
    .search-form-large {
        flex-direction: column;
    }
    
    .search-form-large button {
        width: 100%;
    }
    
    .search-tags {
        justify-content: center;
    }
    
    .subcat-link {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .pagination > a,
    .pagination > span {
        min-width: 35px;
        height: 35px;
        padding: 0 9px;
        font-size: 13px;
    }

    .pagination {
        gap: 5px;
        padding-inline: 0;
    }

    .pagination .prev,
    .pagination .next {
        min-width: 35px;
    }

    .pagination .prev span,
    .pagination .next span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .page-title {
        font-size: 22px;
    }

    .post-title {
        font-size: 16px;
    }

    .post-meta {
        font-size: 12px;
    }
}

/* ====================================
   STATIC PAGES (About, Contact, Privacy, etc.)
   ==================================== */
.page-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 0 60px;
}

.static-page {
    background: var(--white);
}

.page-header-static {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--black);
}

.page-title-static {
    font-size: 32px;
    font-weight: 700;
    color: var(--black);
    margin: 0;
}

.page-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.page-content p {
    margin-bottom: 20px;
}

.page-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 35px 0 15px;
    color: var(--black);
}

.page-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 25px 0 12px;
    color: var(--black);
}

.page-content ul,
.page-content ol {
    margin: 20px 0;
    padding-left: 25px;
}

.page-content li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.page-content a {
    color: var(--primary);
}

.page-content a:hover {
    text-decoration: underline;
}

.page-content strong {
    font-weight: 600;
    color: var(--black);
}

/* Social Links on Page */
.social-links-page {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.social-links-page a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--dark);
    color: var(--white);
    font-size: 14px;
    transition: background 0.3s ease;
    text-decoration: none !important;
}

.social-links-page a:hover {
    background: var(--primary);
}

.social-links-page a i {
    font-size: 16px;
}

/* ====================================
   TEAM SECTION
   ==================================== */
.team-section {
    margin: 30px 0 40px;
}

.team-role {
    margin-bottom: 35px;
}

.role-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--black);
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.team-member {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.team-member:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.member-avatar {
    flex-shrink: 0;
}

.member-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.member-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 4px;
}

.member-role {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.member-info p {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.5;
    margin: 0 0 10px 0;
}

.member-social {
    display: flex;
    gap: 8px;
}

.member-social a {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--gray);
    font-size: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.member-social a:hover {
    background: var(--primary);
    color: var(--white);
}

/* Compact team member for contributors */
.team-member-compact {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
}

.team-member-compact .member-avatar img {
    width: 60px;
    height: 60px;
}

.team-member-compact .member-info h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.team-member-compact .member-role {
    font-size: 11px;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: 1fr;
    }

    .team-member {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .member-social {
        justify-content: center;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .page-wrapper {
        padding: 30px 0 40px;
    }
    
    .page-title-static {
        font-size: 26px;
    }
    
    .page-content h2 {
        font-size: 20px;
    }
    
    .page-content h3 {
        font-size: 17px;
    }
    
    .social-links-page {
        flex-direction: column;
    }
    
    .social-links-page a {
        justify-content: center;
    }
}
