/* RTO Exam Blog — listing & detail page styles.
   Colors / container / reset come from the theme's style.css, loaded before this file. */

/* =============================================
   Page header (same look as the main site's "Settings & Help" header)
   ============================================= */
.page-header { 
    background: #F6F6F6;
    border-bottom: 1px solid #E6E6E6;
    padding: 20px 0 24px;
}

.page-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.page-header__title {
    font-size: 2.7em;
    font-weight: 400;
    line-height: 1.25;
    color: var(--rto-dark);
    margin-bottom: 8px;
}

.page-header__text {
    font-size: 14px;
    color: var(--rto-text);
    line-height: 110%;
}

/* =============================================
   Search form
   ============================================= */
.search-form {
    display: flex;
    align-items: center;
    width: 360px;
    max-width: 100%;
    flex-shrink: 0;
    background: #FFFFFF;
    border: 1px solid var(--rto-border);
    border-radius: 999px;
    padding: 4px 4px 4px 20px;
    transition: border-color .25s ease, box-shadow .25s ease;
}

.search-form:focus-within {
    border-color: var(--rto-header);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

.search-form label {
    flex: 1;
    display: flex;
    margin: 0;
}

.search-form .search-field {
    flex: 1;
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: var(--rto-dark);
    padding: 10px 0;
}

.search-form .search-field::placeholder {
    color: #9E9E9E;
}

.search-form .search-submit {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    border: none;
    border-radius: 50%;
    background-color: var(--rto-header);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    transition: background-color .25s ease, transform .15s ease;
}

.search-form .search-submit:hover {
    background-color: var(--rto-dark);
    transform: scale(1.06);
}

.search-form .search-submit:active {
    transform: scale(.94);
}

/* =============================================
   Shared small components
   ============================================= */
.blog-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--rto-accent);
    color: var(--rto-dark);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    transition: background-color .2s ease;
}

.blog-chip:hover {
    background: #F5C800;
}

.blog-chip--outline {
    background: transparent;
    border: 1px solid var(--rto-border);
    color: var(--rto-text);
}

.blog-chip--outline:hover {
    background: var(--rto-light-bg);
}

.blog-btn {
    display: inline-flex;
    align-items: center;
    padding: 11px 26px;
    border-radius: 999px;
    background: var(--rto-header);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
    transition: background-color .25s ease;
}

.blog-btn:hover {
    background: var(--rto-dark);
    color: #FFFFFF;
}

/* =============================================
   Listing grid & cards
   ============================================= */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    padding: 40px 0;
}

/* Search results heading, shown just above the listing grid */
.blog-search-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding: 36px 0 16px;
    border-bottom: 1px solid var(--rto-border);
}

.blog-search-head + .blog-grid {
    padding-top: 28px;
}

.blog-search-head__title {
    font-size: 22px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--rto-dark);
    overflow-wrap: anywhere;
}

.blog-search-head__count {
    margin-top: 4px;
    font-size: 13px;
    color: var(--rto-muted);
}

.blog-search-head__clear {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--rto-dark);
    border-bottom: 2px solid var(--rto-accent);
    padding-bottom: 1px;
}

.blog-search-head__clear:hover {
    border-bottom-color: var(--rto-dark);
}

.blog-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--rto-border);
    border-radius: 10px;
    overflow: hidden;
    background: #FFFFFF;
    transition: transform .25s ease, box-shadow .25s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .1);
}

.blog-card__thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--rto-header);
}

.blog-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.blog-card:hover .blog-card__thumb img {
    transform: scale(1.04);
}

.blog-card__thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.blog-card__thumb .blog-card__thumb-placeholder img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    opacity: .9;
}

.blog-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 22px;
}

.blog-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.blog-card__date {
    font-size: 13px;
    color: var(--rto-muted);
}

.blog-card__title {
    font-size: 19px;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 10px;
}

.blog-card__title a {
    color: var(--rto-dark);
    transition: color .2s ease;
}

.blog-card__title a:hover {
    color: #000000;
    text-decoration: underline;
}

.blog-card__excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #616161;
    margin-bottom: 16px;
}

.blog-card__link {
    margin-top: auto;
    align-self: flex-start;
    font-size: 14px;
    font-weight: 500;
    color: var(--rto-dark);
    border-bottom: 2px solid var(--rto-accent);
    padding-bottom: 1px;
}

.blog-card__link:hover {
    border-bottom-color: var(--rto-dark);
}

/* =============================================
   Pagination
   ============================================= */
.blog-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding-bottom: 50px;
}

.blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid var(--rto-border);
    color: var(--rto-dark);
    font-weight: 500;
    font-size: 14px;
    transition: border-color .2s ease, background-color .2s ease;
}

.blog-pagination a.page-numbers:hover {
    border-color: var(--rto-header);
}

.blog-pagination .page-numbers.current {
    background: var(--rto-header);
    border-color: var(--rto-header);
    color: #FFFFFF;
}

.blog-pagination .page-numbers.dots {
    border-color: transparent;
}

/* =============================================
   Empty states (no posts / no search results / 404)
   ============================================= */
.blog-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
    padding: 72px 0;
}

.blog-empty-state__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 22px;
    border-radius: 50%;
    background: var(--rto-accent);
    color: var(--rto-dark);
    border: 1px solid #e1cb00;
}

.blog-empty-state__title {
    font-size: 24px;
    font-weight: 500;
    color: var(--rto-dark);
    margin-bottom: 10px;
}

.blog-empty-state__text {
    font-size: 14px;
    line-height: 1.6;
    color: #616161;
    margin-bottom: 24px;
}

.blog-empty-state .search-form {
    margin-bottom: 20px;
}

/* =============================================
   Detail page
   ============================================= */
.blog-single__header {
    padding: 24px 0 28px;
}

.blog-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--rto-muted);
    margin-bottom: 10px;
}

.blog-breadcrumb a {
    color: var(--rto-text);
}

.blog-breadcrumb a:hover {
    color: #000000;
    text-decoration: underline;
}

.blog-single__title {
    max-width: 900px;
    font-size: 38px;
    font-weight: 400;
}

.blog-single__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--rto-muted);
}

.blog-single {
    padding: 40px 0 0;
}

.blog-single__article {
    /* max-width: 800px; */
    margin: 0 auto;
    padding-bottom: 50px;
}

.blog-single__thumb {
    margin-bottom: 32px;
    border-radius: 10px;
    overflow: hidden;
}

.blog-single__thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.blog-single__content {
    font-size: 16px;
    line-height: 1.75;
    color: #3A3A3A;
    overflow-wrap: break-word;
}

.blog-single__content h1,
.blog-single__content h2,
.blog-single__content h3,
.blog-single__content h4,
.blog-single__content h5,
.blog-single__content h6 {
    color: var(--rto-dark);
    font-weight: 500;
    line-height: 1.3;
    margin: 30px 0 12px;
}

.blog-single__content h1 {
    font-size: 32px;
}

.blog-single__content h2 {
    font-size: 26px;
}

.blog-single__content h3 {
    font-size: 22px;
}

.blog-single__content h4 {
    font-size: 19px;
}

.blog-single__content h5,
.blog-single__content h6 {
    font-size: 17px;
}

.blog-single__content > :first-child {
    margin-top: 0;
}

.blog-single__content p {
    margin-bottom: 20px;
}

.blog-single__content ul,
.blog-single__content ol {
    margin: 0 0 20px;
    padding-left: 24px;
}

.blog-single__content ul {
    list-style: disc;
}

.blog-single__content ol {
    list-style: decimal;
}

.blog-single__content li {
    margin-bottom: 8px;
}

.blog-single__content li > ul,
.blog-single__content li > ol {
    margin: 8px 0 0;
}

.blog-single__content a {
    color: var(--rto-dark);
    text-decoration: underline;
    text-decoration-color: var(--rto-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.blog-single__content a:hover {
    text-decoration-color: var(--rto-dark);
}

.blog-single__content blockquote {
    margin: 0 0 20px;
    padding: 14px 20px;
    border-left: 4px solid var(--rto-accent);
    background: var(--rto-light-bg);
    color: #555555;
    font-style: italic;
}

.blog-single__content blockquote p:last-child {
    margin-bottom: 0;
}

.blog-single__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.blog-single__content figure {
    margin: 0 0 24px;
}

.blog-single__content figcaption {
    font-size: 13px;
    color: var(--rto-muted);
    text-align: center;
    margin-top: 8px;
}

/* Table stays a real table so it stretches to the full content width;
   the block editor's figure wrapper scrolls sideways if it's too wide (phones). */
.blog-single__content .wp-block-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 24px;
}

.blog-single__content table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 15px;
}

.blog-single__content .wp-block-table table {
    margin-bottom: 0;
}

.blog-single__content th,
.blog-single__content td {
    padding: 10px 14px;
    border: 1px solid var(--rto-border);
    text-align: left;
}

.blog-single__content th {
    background: var(--rto-light-bg);
    color: var(--rto-dark);
    font-weight: 500;
}

.blog-single__content hr {
    border: none;
    border-top: 1px solid var(--rto-border);
    margin: 32px 0;
}

.blog-single__content pre,
.blog-single__content code {
    font-family: Consolas, Monaco, monospace;
    background: var(--rto-light-bg);
    border-radius: 4px;
}

.blog-single__content code {
    padding: 2px 6px;
    font-size: .9em;
}

.blog-single__content pre {
    padding: 16px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.blog-single__content pre code {
    padding: 0;
}

.blog-single__pages {
    margin-top: 20px;
    font-weight: 500;
}

.blog-single__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 30px;
}

.blog-single__back {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--rto-border);
}

.blog-single__back a {
    font-weight: 500;
    color: var(--rto-dark);
}

.blog-single__back a:hover {
    text-decoration: underline;
}

.blog-related {
    padding: 50px 0 10px;
    background: var(--rto-light-bg);
}

.blog-related__title { 
    font-size: 28px;
    font-weight: 400;
    color: var(--rto-dark);
}

.blog-related .blog-grid {
    padding-top: 30px;
}

/* =============================================
   Responsive Breakpoints
   ============================================= */

/* 992px — tablets landscape */
@media (max-width: 992px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .page-header__title {
        font-size: 36px;
    }

    .blog-single__title {
        font-size: 32px;
    }
}

/* 768px — tablets portrait / large phones */
@media (max-width: 768px) {
    .page-header__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        width: 100%;
    }

    .blog-single__content h1 {
        font-size: 22px;
    }

    .blog-single__content h2 {
        font-size: 20px;
    }

    .blog-related__title {
        font-size: 24px;
    }
}

/* 600px — phones */
@media (max-width: 600px) {
    .blog-grid {
        grid-template-columns: 1fr;
        padding: 28px 0;
    }

    .blog-search-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-top: 24px;
    }

    .blog-search-head + .blog-grid {
        padding-top: 20px;
    }

    .blog-search-head__title {
        font-size: 19px;
    }

    .page-header {
        padding: 22px 0 20px;
    }

    .page-header__title {
        font-size: 30px;
    }

    .blog-single__title {
        font-size: 22px;
    }

    .blog-single {
        padding-top: 24px;
    }

    .blog-single__content {
        font-size: 15px;
    }

    .blog-empty-state {
        padding: 48px 0;
    }
}
