/* =========================================================
   Editorial WP — Bootstrap 5 rebuild
   Design tokens from html5up.net/editorial
   ========================================================= */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;1,400&family=Roboto+Slab:wght@400;700&display=swap');
@import url('../css/fontawesome-all.min.css');

/* ---- CSS Variables ---- */
:root {
    --ed-bg:          #ffffff;
    --ed-bg-alt:      #f5f6f7;
    --ed-fg:          #7f888f;
    --ed-fg-bold:     #3d4449;
    --ed-fg-light:    #9fa3a6;
    --ed-border:      rgba(210, 215, 217, 0.75);
    --ed-border-bg:   rgba(230, 235, 237, 0.25);
    --ed-accent:      #f56a6a;
    --ed-sidebar-w:   min(26em, 300px);
    --ed-radius:      0.375em;
    --ed-transition:  0.2s ease-in-out;
    --ed-font:        'Open Sans', sans-serif;
    --ed-font-head:   'Roboto Slab', serif;
}

/* ---- Base Reset ---- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--ed-font);
    font-size: 13pt;
    font-weight: 400;
    line-height: 1.65;
    color: var(--ed-fg);
    background: var(--ed-bg);
    overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--ed-font-head);
    font-weight: 700;
    color: var(--ed-fg-bold);
    line-height: 1.5;
    margin: 0 0 1em 0;
    letter-spacing: 0.075em;
}
h1 { font-size: 2.5em; line-height: 1.3; }
h2 { font-size: 1.75em; }
h3 { font-size: 1.25em; }
h4 { font-size: 1.1em; }
h5 { font-size: 0.9em; }
h6 { font-size: 0.7em; }

p { margin: 0 0 2em 0; color: var(--ed-fg); }

a {
    color: var(--ed-accent);
    text-decoration: none;
    border-bottom: dotted 1px transparent;
    transition: color var(--ed-transition), border-bottom-color var(--ed-transition);
}
a:hover {
    color: var(--ed-accent);
    border-bottom-color: var(--ed-accent);
}

strong, b { color: var(--ed-fg-bold); font-weight: 600; }

hr {
    border: 0;
    border-bottom: solid 1px var(--ed-border);
    margin: 2em 0;
}

blockquote {
    border-left: solid 3px var(--ed-border);
    font-style: italic;
    margin: 0 0 2em 0;
    padding: 0.5em 0 0.5em 2em;
}

/* ---- Layout: Wrapper ---- */
#page-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
#sidebar {
    width: var(--ed-sidebar-w);
    min-width: var(--ed-sidebar-w);
    background: var(--ed-bg-alt);
    border-right: solid 1px var(--ed-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.5s ease, width 0.5s ease;
    z-index: 1000;
}

#sidebar .inner {
    padding: 1.5em 1.5em 1em 1.5em;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Sidebar collapsed state */
body.sidebar-hidden #sidebar {
    transform: translateX(calc(-1 * var(--ed-sidebar-w)));
    width: 0;
    min-width: 0;
}

/* ---- Main Content ---- */
#main {
    flex: 1;
    min-width: 0;
}

#main > .inner {
    padding: 3em 3em 2em 3em;
    max-width: 900px;
}

/* ---- Site Header (inside #main) ---- */
#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: solid 1px var(--ed-border);
    padding-bottom: 1.5em;
    margin-bottom: 2em;
}

#header .logo {
    font-family: var(--ed-font-head);
    font-weight: 700;
    font-size: 1.1em;
    color: var(--ed-fg-bold);
    text-decoration: none;
    border-bottom: none;
    letter-spacing: 0.075em;
}
#header .logo:hover { color: var(--ed-accent); border-bottom: none; }
#header .logo strong { color: var(--ed-accent); }

/* Sidebar toggle button */
#sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ed-fg-bold);
    font-size: 1.2em;
    padding: 0.4em 0.6em;
    margin-right: 1em;
    border-radius: var(--ed-radius);
    transition: color var(--ed-transition), background var(--ed-transition);
    display: flex;
    align-items: center;
}
#sidebar-toggle:hover { color: var(--ed-accent); background: var(--ed-bg-alt); }

/* Social icons in header */
.icons {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5em;
}
.icons li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    border-radius: 50%;
    background: transparent;
    color: var(--ed-fg-light);
    font-size: 0.85em;
    border: solid 1px var(--ed-border);
    border-bottom: solid 1px var(--ed-border);
    transition: background var(--ed-transition), color var(--ed-transition), border-color var(--ed-transition);
}
.icons li a:hover {
    background: var(--ed-accent);
    color: #fff;
    border-color: var(--ed-accent);
}
.icons .label { display: none; }

/* ---- Banner / Hero ---- */
#banner {
    display: flex;
    align-items: center;
    gap: 3em;
    padding-bottom: 3em;
    margin-bottom: 3em;
    border-bottom: solid 1px var(--ed-border);
}
#banner .content { flex: 1; }
#banner .content header h1 { font-size: 2.5em; margin-bottom: 0.3em; }
#banner .content header p {
    font-size: 1.1em;
    color: var(--ed-fg-light);
    margin-bottom: 1.5em;
}
#banner .image.object {
    width: 22em;
    min-width: 22em;
    border-radius: var(--ed-radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
#banner .image.object img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---- Section headers ---- */
.section-header {
    border-bottom: solid 3px var(--ed-accent);
    padding-bottom: 0.75em;
    margin-bottom: 2em;
}
.section-header h2 {
    margin: 0;
    font-size: 1.4em;
    color: var(--ed-fg-bold);
}

/* ---- Features grid ---- */
.features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    margin-bottom: 3em;
}
.features article {
    display: flex;
    align-items: flex-start;
    gap: 1em;
}
.features article .icon {
    flex-shrink: 0;
    width: 3em;
    height: 3em;
    background: var(--ed-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
}
.features article .content h3 { font-size: 1.05em; margin-bottom: 0.4em; }
.features article .content p { font-size: 0.9em; margin: 0; }

/* ---- Posts grid ---- */
.posts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    margin-bottom: 3em;
}
.posts article {
    background: var(--ed-bg);
    border: solid 1px var(--ed-border);
    border-radius: var(--ed-radius);
    overflow: hidden;
    transition: box-shadow var(--ed-transition), transform var(--ed-transition);
}
.posts article:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.09);
    transform: translateY(-2px);
}
.posts article .image a {
    display: block;
    overflow: hidden;
    height: 160px;
    border-bottom: none;
}
.posts article .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.posts article:hover .image img { transform: scale(1.04); }
.posts article .post-content { padding: 1.25em 1.25em 1em; }
.posts article h3 {
    font-size: 1em;
    margin-bottom: 0.5em;
    line-height: 1.4;
}
.posts article h3 a { color: var(--ed-fg-bold); border-bottom: none; }
.posts article h3 a:hover { color: var(--ed-accent); }
.posts article p { font-size: 0.85em; margin-bottom: 1em; }

/* ---- Buttons ---- */
.btn-editorial {
    display: inline-block;
    padding: 0.5em 1.5em;
    background: transparent;
    color: var(--ed-fg-bold);
    border: solid 2px var(--ed-border);
    border-radius: var(--ed-radius);
    font-family: var(--ed-font-head);
    font-size: 0.85em;
    font-weight: 700;
    letter-spacing: 0.075em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--ed-transition), border-color var(--ed-transition), color var(--ed-transition);
}
.btn-editorial:hover {
    background: var(--ed-accent);
    border-color: var(--ed-accent);
    color: #fff;
}
.btn-editorial.primary {
    background: var(--ed-accent);
    border-color: var(--ed-accent);
    color: #fff;
}
.btn-editorial.primary:hover { background: #e05555; border-color: #e05555; }
.btn-editorial.big { padding: 0.75em 2em; font-size: 1em; }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    gap: 0.5em;
    align-items: center;
    margin: 2em 0;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5em;
    height: 2.5em;
    padding: 0 0.75em;
    border: solid 1px var(--ed-border);
    border-radius: var(--ed-radius);
    color: var(--ed-fg-bold);
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    border-bottom: solid 1px var(--ed-border);
    transition: background var(--ed-transition), color var(--ed-transition), border-color var(--ed-transition);
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--ed-accent);
    border-color: var(--ed-accent);
    color: #fff;
}

/* ---- Sidebar Search ---- */
#search {
    margin-bottom: 1.5em;
    padding-bottom: 1.5em;
    border-bottom: solid 1px var(--ed-border);
}
#search form { position: relative; }
#search input[type="search"],
#search input[type="text"] {
    width: 100%;
    padding: 0.6em 2.8em 0.6em 0.9em;
    border: solid 1px var(--ed-border);
    border-radius: var(--ed-radius);
    background: var(--ed-bg);
    color: var(--ed-fg-bold);
    font-family: var(--ed-font);
    font-size: 0.9em;
    outline: none;
    transition: border-color var(--ed-transition);
}
#search input:focus { border-color: var(--ed-accent); }
#search button[type="submit"] {
    position: absolute;
    right: 0.5em;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--ed-fg-light);
    cursor: pointer;
    font-size: 1em;
    padding: 0.2em;
    transition: color var(--ed-transition);
}
#search button[type="submit"]:hover { color: var(--ed-accent); }

/* ---- Sidebar Navigation ---- */
#menu {
    margin-bottom: 1.5em;
    padding-bottom: 1.5em;
    border-bottom: solid 1px var(--ed-border);
}
#menu .sidebar-section-title {
    font-family: var(--ed-font-head);
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ed-fg-bold);
    margin-bottom: 1em;
}

/* nav ul reset */
#menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#menu > ul > li {
    border-top: solid 1px var(--ed-border);
}
#menu > ul > li:first-child { border-top: none; }

#menu > ul > li > a,
#menu > ul > li > .opener {
    display: block;
    padding: 0.6em 0;
    color: var(--ed-fg-bold);
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    border-bottom: none;
    transition: color var(--ed-transition);
    cursor: pointer;
    user-select: none;
}
#menu > ul > li > a:hover,
#menu > ul > li > .opener:hover { color: var(--ed-accent); }
#menu > ul > li.current-menu-item > a { color: var(--ed-accent); }

/* Opener arrow */
#menu .opener { position: relative; }
#menu .opener::after {
    content: '\f078';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.65em;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform var(--ed-transition), color var(--ed-transition);
    color: var(--ed-fg-light);
}
#menu .opener.active::after { transform: translateY(-50%) rotate(180deg); color: var(--ed-accent); }

/* Submenu */
#menu ul ul {
    display: none;
    background: var(--ed-border-bg);
    border-radius: var(--ed-radius);
    padding: 0.5em 0 0.5em 1em;
    margin: 0 0 0.5em 0;
}
#menu ul ul.active { display: block; }
#menu ul ul li a {
    display: block;
    padding: 0.35em 0;
    color: var(--ed-fg);
    font-size: 0.85em;
    text-decoration: none;
    border-bottom: none;
    transition: color var(--ed-transition);
}
#menu ul ul li a:hover { color: var(--ed-accent); }

/* ---- Mini posts (sidebar) ---- */
.mini-posts-section {
    margin-bottom: 1.5em;
    padding-bottom: 1.5em;
    border-bottom: solid 1px var(--ed-border);
}
.mini-posts-section .sidebar-section-title {
    font-family: var(--ed-font-head);
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ed-fg-bold);
    margin-bottom: 1em;
}
.mini-posts article {
    display: flex;
    gap: 0.9em;
    margin-bottom: 1em;
    padding-bottom: 1em;
    border-bottom: solid 1px var(--ed-border);
}
.mini-posts article:last-child { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.mini-posts article .image {
    flex-shrink: 0;
    width: 4.5em;
    height: 3.5em;
    overflow: hidden;
    border-radius: var(--ed-radius);
    border-bottom: none;
}
.mini-posts article .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.mini-posts article:hover .image img { transform: scale(1.05); }
.mini-posts article .mini-post-content { flex: 1; min-width: 0; }
.mini-posts article .mini-post-content h4 {
    font-size: 0.8em;
    margin-bottom: 0.2em;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mini-posts article .mini-post-content h4 a { color: var(--ed-fg-bold); border-bottom: none; }
.mini-posts article .mini-post-content h4 a:hover { color: var(--ed-accent); }
.mini-posts article .mini-post-content .date {
    font-size: 0.75em;
    color: var(--ed-fg-light);
}

/* ---- Contact section in sidebar ---- */
.contact-section {
    margin-bottom: 1.5em;
}
.contact-section .sidebar-section-title {
    font-family: var(--ed-font-head);
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ed-fg-bold);
    margin-bottom: 1em;
}
ul.contact {
    list-style: none;
    padding: 0;
    margin: 0;
}
ul.contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.7em;
    padding: 0.45em 0;
    font-size: 0.85em;
    color: var(--ed-fg);
    border-top: solid 1px var(--ed-border);
}
ul.contact li:first-child { border-top: none; }
ul.contact li i { color: var(--ed-accent); margin-top: 0.2em; flex-shrink: 0; }
ul.contact li a { color: var(--ed-fg); border-bottom: none; }
ul.contact li a:hover { color: var(--ed-accent); }

/* ---- Sidebar footer ---- */
#sidebar-footer {
    margin-top: auto;
    padding-top: 1.5em;
    border-top: solid 1px var(--ed-border);
    font-size: 0.75em;
    color: var(--ed-fg-light);
}
#sidebar-footer a { color: var(--ed-fg-light); }
#sidebar-footer a:hover { color: var(--ed-accent); }

/* ---- Single post / Page ---- */
.post-header { margin-bottom: 2.5em; padding-bottom: 2em; border-bottom: solid 1px var(--ed-border); }
.post-header h1 { margin-bottom: 0.4em; }
.post-meta { font-size: 0.85em; color: var(--ed-fg-light); }
.post-meta a { color: var(--ed-fg-light); border-bottom: none; }
.post-meta a:hover { color: var(--ed-accent); }
.post-meta span { margin-right: 1em; }
.post-meta i { margin-right: 0.3em; color: var(--ed-accent); }

.post-thumbnail {
    margin-bottom: 2em;
    border-radius: var(--ed-radius);
    overflow: hidden;
    max-height: 400px;
}
.post-thumbnail img {
    width: 100%;
    object-fit: cover;
    display: block;
}

.post-content { font-size: 1em; line-height: 1.8; }
.post-content h2, .post-content h3 { margin-top: 2em; }
.post-content img { max-width: 100%; border-radius: var(--ed-radius); margin: 1em 0; }

/* Tags */
.post-tags { margin-top: 2em; padding-top: 1.5em; border-top: solid 1px var(--ed-border); }
.post-tags a {
    display: inline-block;
    padding: 0.25em 0.75em;
    background: var(--ed-bg-alt);
    border: solid 1px var(--ed-border);
    border-radius: var(--ed-radius);
    font-size: 0.8em;
    color: var(--ed-fg);
    margin: 0.2em;
    text-decoration: none;
    border-bottom: solid 1px var(--ed-border);
    transition: background var(--ed-transition), color var(--ed-transition), border-color var(--ed-transition);
}
.post-tags a:hover { background: var(--ed-accent); color: #fff; border-color: var(--ed-accent); }

/* ---- Overlay (mobile) ---- */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 1280px) {
    body { font-size: 11pt; }
    #main > .inner { padding: 2em 2em 1.5em; }
}

@media (max-width: 980px) {
    body { font-size: 10pt; }

    #sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(calc(-1 * var(--ed-sidebar-w)));
        z-index: 1001;
        box-shadow: 4px 0 20px rgba(0,0,0,0.12);
    }
    #sidebar.open {
        transform: translateX(0);
    }
    #sidebar-overlay.show { display: block; }

    #banner { flex-direction: column; }
    #banner .image.object { width: 100%; min-width: unset; }

    .posts { grid-template-columns: 1fr 1fr; }
    .features { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 736px) {
    body { font-size: 10pt; }
    #main > .inner { padding: 1.5em 1.5em 1em; }

    .posts { grid-template-columns: 1fr; }
    .features { grid-template-columns: 1fr; }

    #banner .content header h1 { font-size: 1.75em; }
}

@media (max-width: 480px) {
    body { font-size: 9pt; }
    #main > .inner { padding: 1em; }
}
