/*

Theme Name: My Theme

Description: A WordPress theme based on BBC GEL design system.

Version: 1.0

Author: Your Name

*/

@import url('style/static/css/gel.css');

/* Custom styles for the theme */

/* Sticky footer */
.content-wrapper {
    flex: 1;
    background-color: #fff;
}

/* Override body font to use Reith */
body {
    font-family: 'ReithSans', Helvetica, Arial, sans-serif;
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Headings use ReithSerif */
h1, h2, h3, h4, h5, h6 {
    font-family: 'ReithSerif', Georgia, serif;
}

/* Header styles */
header {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
}

.header-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 10px 0px;
    max-width: 1200px;
    margin: 0 auto;
}

.branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.branding a {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
}

.site-logo {
    max-width: 180px;
    height: auto;
    display: block;
}

.site-title {
    font-size: 1.8em;
    font-weight: bold;
    margin: 15px 0 0 0;
    color: #333;
}

nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    padding: 5px 10px;
    display: block;
    font-weight: normal;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-right: 20px;
}

nav ul li:last-child {
    margin-right: 0;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    padding: 10px;
    display: block;
}

main {
    background-color: #fff;
    padding: 20px 0;
}

article {
    margin-bottom: 40px;
}

.featured {
    margin-bottom: 40px;
}

.articles-grid {
    margin-top: 40px;
}

.search-form {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.search-form label {
    flex: 1;
    margin-right: 10px;
}

.search-input-wrapper {
    position: relative;
    display: block;
}

.search-form input[type="search"],
.search-field {
    width: 100%;
    padding: 12px 16px;
    padding-left: 44px; /* space for the icon */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.search-form .search-icon-button {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    margin: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
}

.search-form .search-icon-button svg {
    display: block;
    width: 18px;
    height: 18px;
}

.search-form button {
    padding: 12px 16px;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-form button:hover {
    background-color: #e0e0e0;
}

.post-meta {
    margin-top: 20px;
    font-size: 0.9em;
    color: #666;
}

.post-navigation {
    margin-top: 40px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

footer {
    background-color: #121212;
    color: #fff;
    padding: 20px 0;
    border-top: 1px solid #ddd;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 10px 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    .branding {
        margin-bottom: 10px;
    }
    /* Keep logo same proportion as desktop on mobile */
    .site-logo {
        max-width: 180px; /* matches desktop constraint */
    }
    .site-title {
        font-size: 1.5em;
    }
    nav ul {
        flex-direction: row;
        gap: 10px;
    }
}

/* Sidebar styles */
.sidebar {
    padding-left: 20px;
}

.widget {
    margin-bottom: 24px;
}

.widget-title {
    font-size: 1.1em;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.recent-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-posts-list li {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.recent-posts-list li a {
    color: #222;
    text-decoration: none;
    font-weight: 500;
}

.recent-posts-list .post-date {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
}

/* Comment count / badge */
.post-comments {
    display: inline-block;
    margin-left: 12px;
    vertical-align: middle;
}

.post-comments a {
    color: #666;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
}

.comment-count {
    background: #eee;
    color: #333;
    border-radius: 12px;
    padding: 2px 8px;
    font-weight: 600;
}

.comment-label {
    text-transform: none;
    color: #666;
}

/* Comments & Comment Form (professional styling) */
.comments-area {
    margin-top: 36px;
    padding-top: 16px;
    border-top: 1px solid #e6e6e6;
}

.comments-title {
    font-size: 1.2em;
    margin: 0 0 16px 0;
    font-weight: 600;
}


.comment-list {
    list-style: none;
    margin: 0 0 24px 0;
    padding: 0;
}

/* Each comment should be a block; child reply threads are nested inside the parent li
   Avatar + content are arranged with flex inside the comment body so replies (children)
   remain below the parent comment instead of to the right. */
.comment-list li {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-list .comment-body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.comment-list .comment-body .comment-author {
    flex: 0 0 48px;
}

.comment-list .comment-body .comment-author img.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: block;
}

/* Ensure the main content area of a comment grows */
.comment-list .comment-body > div:not(.comment-author) {
    flex: 1 1 auto;
}

.comment-author.vcard, .comment-meta {
    display: block;
    font-size: 0.95em;
    color: #222;
    font-weight: 600;
}

.comment-meta {
    font-weight: 400;
    color: #666;
    font-size: 0.85em;
    margin-top: 4px;
}

.comment-content {
    margin-top: 8px;
    color: #333;
    line-height: 1.6;
}

.no-comments {
    color: #666;
}

.comment-form {
    margin-top: 18px;
}

.comment-form p {
    margin-bottom: 12px;
}

.comment-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.95em;
    color: #333;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form input[type="search"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
    font-size: 14px;
    color: #222;
}

.comment-form textarea {
    min-height: 140px;
    resize: vertical;
}

.comment-form .form-submit {
    margin-top: 12px;
}

.comment-form .form-submit input[type="submit"],
.comment-form .form-submit button {
    background: #0071bc;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.comment-form .form-submit input[type="submit"]:hover,
.comment-form .form-submit button:hover {
    background: #005fa3;
}

/* Reply link */
.comment-reply-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.9em;
    color: #0071bc;
}

/* Smaller avatar on mobile */
@media (max-width: 480px) {
    .comment-list li {
        gap: 8px;
    }
    .comment-list .comment-avatar {
        flex: 0 0 40px;
    }
}

/* Improved nested reply readability */
.comment-list .children {
    margin-top: 12px;
}

/* Indent replies and add a subtle vertical rule to show thread structure */
.comment-list .children,
.comment-list li .children {
    margin-left: 56px;
    padding-left: 16px;
    border-left: 3px solid rgba(0,0,0,0.05);
}

/* So the child comment box stands out a bit from its parent */
.comment-list li .children li {
    background: rgba(0,0,0,0.02);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* Toning down author/title and improving time readability */
.comment-author.vcard .fn,
.comment-list .comment-author a {
    font-weight: 600;
    color: #111;
}

.comment-meta a,
.comment-meta {
    color: #7a7a7a;
    font-size: 0.85em;
}

/* Slight visual separation for top-level comments */
.comment-list > li {
    padding-top: 18px;
}

/* Make reply link less prominent but visible */
.comment-reply-link {
    color: #0071bc;
    background: transparent;
    border: none;
    padding: 0;
    font-weight: 500;
}

/* Compact the edit link and move it inline with metadata */
.comment-edit-link {
    font-size: 0.85em;
    color: #999;
    margin-left: 8px;
}

/* Improve overall contrast and spacing for readability */
.comments-area,
.comment-list .children li,
.comment-list > li {
    line-height: 1.55;
}

/* Make sure avatars and comment bodies align nicely on small screens */
@media (max-width: 640px) {
    .comment-list .comment-body {
        flex-direction: row;
        gap: 10px;
    }
    .comment-list .children {
        margin-left: 40px;
        padding-left: 12px;
    }
}

@media (max-width: 768px) {
    /* Stack main + sidebar on small screens */
    .gel-layout {
        display: block;
    }
    .gel-layout__item {
        width: 100% !important;
        box-sizing: border-box;
    }
    .sidebar {
        padding-left: 0;
        margin-top: 20px;
    }
}

/* Single post styles */
.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    margin-bottom: 18px;
}

.post-header {
    margin-bottom: 18px;
}

.post-title {
    font-size: 2.1rem;
    line-height: 1.15;
    margin: 0 0 8px 0;
    font-family: 'ReithSerif', Georgia, serif;
}

.post-meta p {
    margin: 0;
    color: #666;
    font-size: 0.95em;
}

.entry-content {
    margin-top: 18px;
    color: #222;
    font-size: 1rem;
    line-height: 1.75;
}

.entry-content h2, .entry-content h3 {
    margin-top: 1.2em;
    margin-bottom: .6em;
    font-family: 'ReithSerif', Georgia, serif;
}

.entry-content p {
    margin-bottom: 1em;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 16px 0;
}

.entry-content blockquote {
    margin: 18px 0;
    padding: 12px 16px;
    background: #f7f7f7;
    border-left: 4px solid #e0e0e0;
}

.post-footer {
    margin-top: 28px;
    border-top: 1px solid #eee;
    padding-top: 18px;
}

.author-box {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 22px;
    padding: 12px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
}

.author-box .author-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.author-box .author-info {
    line-height: 1.3;
}

@media (max-width: 768px) {
    .post-title { font-size: 1.6rem; }
    .author-box { flex-direction: row; }
}
