/**
 * Observatorio de TO — Category Editorial Styles
 * Scope: Only loaded on category archives (is_category)
 * Namespace: .oto-category-*
 */

:root {
    --oto-primary: #164B5B;
    --oto-dark: #0F3A47;
    --oto-text: #1F2328;
    --oto-meta: #667078;
    --oto-divider: #E3E7EA;
    --oto-alt: #F5F6F7;
    --oto-white: #FFFFFF;
}

/* ===================================================
   0. CATEGORY BODY
   =================================================== */

body.oto-category-body {
    background: #F0F1F2;
}

/* ===================================================
   0b. LINK STATE POLICY — CATEGORY ONLY
   =================================================== */

.oto-category-page a,
.oto-category-nav a {
    color: var(--oto-primary);
}

.oto-category-page a:visited,
.oto-category-nav a:visited {
    color: var(--oto-primary);
}

.oto-category-page a:hover,
.oto-category-nav a:hover {
    color: var(--oto-dark);
}

.oto-category-page a:focus-visible,
.oto-category-nav a:focus-visible {
    color: var(--oto-primary);
    outline: 2px solid var(--oto-primary);
    outline-offset: 2px;
}

.oto-category-page a:active,
.oto-category-nav a:active {
    color: var(--oto-dark);
}

/* ===================================================
   1. PAGE
   =================================================== */

.oto-category-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 72px;
}

/* ===================================================
   2. HEADER
   =================================================== */

.oto-category-header {
    padding: 40px 0 32px;
    border-bottom: 2px solid var(--oto-primary);
    margin-bottom: 32px;
}

.oto-category-title {
    margin: 0 0 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--oto-text);
    letter-spacing: -0.5px;
}

.oto-category-description {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--oto-meta);
    max-width: 720px;
}

.oto-category-count {
    margin: 0;
    font-size: 14px;
    color: var(--oto-meta);
}

/* ===================================================
   3. LIST
   =================================================== */

.oto-category-list {
    display: flex;
    flex-direction: column;
}

/* ===================================================
   4. ITEM
   =================================================== */

.oto-category-item {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--oto-divider);
}

.oto-category-item:first-child {
    padding-top: 0;
}

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

/* ===================================================
   5. IMAGE
   =================================================== */

.oto-category-item-image {
    flex: 0 0 280px;
    width: 280px;
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
}

.oto-category-item-image img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.oto-category-item-image:hover img {
    transform: scale(1.02);
}

/* ===================================================
   6. BODY
   =================================================== */

.oto-category-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ===================================================
   7. META
   =================================================== */

.oto-category-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--oto-meta);
}

.oto-category-item-meta-sep {
    opacity: 0.5;
}

.oto-category-item-meta-cat {
    color: var(--oto-primary);
    text-decoration: none;
    font-weight: 600;
}

.oto-category-item-meta-cat:hover {
    color: var(--oto-dark);
    text-decoration: underline;
}

.oto-category-item-meta-cat:visited {
    color: var(--oto-primary);
}

/* ===================================================
   8. TITLE
   =================================================== */

.oto-category-item-title {
    margin: 0 0 8px;
}

.oto-category-item-title a {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--oto-text);
    text-decoration: none;
    letter-spacing: -0.3px;
}

.oto-category-item-title a:hover {
    color: var(--oto-primary);
}

.oto-category-item-title a:visited {
    color: var(--oto-text);
}

.oto-category-item-title a:visited:hover {
    color: var(--oto-primary);
}

/* ===================================================
   9. EXCERPT
   =================================================== */

.oto-category-item-excerpt {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--oto-meta);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===================================================
   10. PAGINATION
   =================================================== */

.oto-category-pagination {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--oto-divider);
    text-align: center;
    font-size: 14px;
}

.oto-category-pagination a,
.oto-category-pagination span {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 2px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--oto-text);
    transition: background 0.15s, color 0.15s;
}

.oto-category-pagination a:hover {
    background: var(--oto-alt);
    color: var(--oto-primary);
}

.oto-category-pagination a:visited {
    color: var(--oto-text);
}

.oto-category-pagination .current {
    background: var(--oto-primary);
    color: var(--oto-white);
    font-weight: 600;
}

/* ===================================================
   11. EMPTY STATE
   =================================================== */

.oto-category-empty {
    padding: 60px 0;
    text-align: center;
    color: var(--oto-meta);
    font-size: 16px;
}

/* ===================================================
   12. RESPONSIVE — TABLET
   =================================================== */

@media (max-width: 1024px) {
    .oto-category-item-image {
        flex: 0 0 220px;
        width: 220px;
    }
}

/* ===================================================
   13. RESPONSIVE — MOBILE
   =================================================== */

@media (max-width: 768px) {
    .oto-category-page {
        padding: 0 16px 48px;
    }

    .oto-category-header {
        padding: 16px 0 14px;
        margin-bottom: 20px;
    }

    .oto-category-title {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .oto-category-description {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .oto-category-count {
        font-size: 13px;
    }

    .oto-category-item {
        flex-direction: column;
        gap: 10px;
        padding: 14px 0;
    }

    .oto-category-item-image {
        flex: none;
        width: 100%;
    }

    .oto-category-item-title a {
        font-size: 17px;
    }
}

/* ===================================================
   F8.2.18 — SHARED READING HEADER STYLES
   =================================================== */

.oto-reading-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #fff;
    border-bottom: 1px solid var(--oto-divider);
    height: 52px;
}

.oto-reading-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.oto-reading-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--oto-text);
    min-width: 0;
}

.oto-reading-header__wordmark {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oto-reading-header__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.oto-reading-header__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--oto-text);
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}

.oto-reading-header__btn:hover {
    background: var(--oto-alt);
}

.oto-reading-header__btn svg {
    flex-shrink: 0;
}

.oto-reading-header__search-bar {
    border-top: 1px solid var(--oto-divider);
    padding: 8px 16px;
    background: #fff;
}

.oto-reading-header__search-bar form {
    display: flex;
    gap: 8px;
    max-width: 760px;
    margin: 0 auto;
}

.oto-reading-header__search-bar input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 0 16px;
    height: 46px;
    border: 1px solid var(--oto-divider);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

.oto-reading-header__search-bar input[type="search"]:focus {
    border-color: var(--oto-primary);
}

.oto-reading-header__search-bar button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 46px;
    padding: 0 20px;
    border: none;
    background: var(--oto-primary);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.oto-reading-header__search-btn-label {
    display: inline;
}

@media (max-width: 768px) {
    .oto-reading-header__search-btn-label {
        display: none;
    }

    .oto-reading-header__search-bar button {
        width: 40px;
        padding: 0;
    }

    .oto-reading-header__search-bar input[type="search"] {
        height: 40px;
        font-size: 16px;
    }
}

/* ===================================================
   CATEGORY NAVIGATION BAR
   =================================================== */

.oto-category-nav {
    border-bottom: 1px solid #e3e7ea;
    background: #fff;
}

.oto-category-nav__inner {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 16px;
    gap: 0;
}

.oto-category-nav__inner::-webkit-scrollbar {
    display: none;
}

.oto-category-nav__link {
    flex: 0 0 auto;
    padding: 12px 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #667078;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.oto-category-nav__link:hover {
    color: #164B5B;
}

.oto-category-nav__link--active {
    color: #164B5B;
    font-weight: 600;
    border-bottom-color: #164B5B;
}

@media (min-width: 768px) {
    .oto-category-nav__inner {
        max-width: 1180px;
        margin: 0 auto;
        padding: 0 24px;
    }

    .oto-category-nav__link {
        padding: 14px 20px;
        font-size: 14px;
    }
}
