/*
Theme Name: WebWorld Blog
Theme URI: https://www.webworld.blog/
Description: Modern, SEO-optimised child theme for the WebWorld Blog. Red / black / white palette, category-led homepage, structured data, and a shared WebWorld footer. Built on top of AssentPress / ConsultStreet.
Author: WebWorld
Author URI: https://webworld.ie/
Template: consultstreet
Version: 1.0.2
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: webworld-blog
Tags: blog, red, black, white, seo-optimised
*/

/* ============================================================
   1. CSS custom properties (design tokens)
   ============================================================ */
:root {
    --ww-red: #c8102e;
    --ww-red-dark: #a00b23;
    --ww-red-tint: #fce7ea;
    --ww-black: #111111;
    --ww-black-soft: #1f1f1f;
    --ww-grey-900: #2a2a2a;
    --ww-grey-700: #4a4a4a;
    --ww-grey-500: #7a7a7a;
    --ww-grey-300: #d9d9d9;
    --ww-grey-200: #e8e8e8;
    --ww-grey-100: #f4f4f4;
    --ww-white: #ffffff;

    --ww-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --ww-font-heading: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --ww-radius: 8px;
    --ww-radius-lg: 14px;
    --ww-shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
    --ww-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --ww-shadow-lg: 0 12px 32px rgba(0,0,0,0.12);

    --ww-transition: 0.2s ease;
    --ww-container: 1200px;
}

/* ============================================================
   2. Base resets and typography
   ============================================================ */
body,
body.blog,
body.archive,
body.single,
body.page {
    background: var(--ww-white);
    color: var(--ww-black);
    font-family: var(--ww-font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.entry-title,
.widget-title,
.section-title {
    font-family: var(--ww-font-heading);
    color: var(--ww-black);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

h1, .entry-title { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }

a { color: var(--ww-red); text-decoration: none; transition: color var(--ww-transition); }
a:hover, a:focus { color: var(--ww-red-dark); text-decoration: underline; }

hr { border: none; border-top: 1px solid var(--ww-grey-200); margin: 2rem 0; }

::selection { background: var(--ww-red); color: var(--ww-white); }

/* ============================================================
   3. Header (override parent theme chrome)
   ============================================================ */
#wrapper { background: var(--ww-white); }

.navbar,
.navbar-light,
nav.navbar {
    background-color: var(--ww-white) !important;
    padding: 0.75rem 0 !important;
    border-bottom: 1px solid var(--ww-grey-200);
    box-shadow: var(--ww-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container-full {
    max-width: var(--ww-container);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.navbar .row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0 !important;
}

/* Constrain the enormous parent logo */
.navbar-brand img.custom-logo {
    max-height: 44px !important;
    width: auto !important;
    height: auto !important;
    display: block;
}

/* Hide the parent theme's redundant site title + tagline (we show these in hero) */
.site-branding-text {
    display: none !important;
}

.navbar-brand,
.navbar-brand a,
.site-title a {
    color: var(--ww-black) !important;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding-left: 0;
    margin: 0;
    list-style: none;
    align-items: center;
}

.navbar-nav .nav-link,
.navbar .nav-link {
    color: var(--ww-black) !important;
    font-weight: 500;
    padding: 0.5rem 0.9rem !important;
    border-radius: 6px;
    transition: color var(--ww-transition), background var(--ww-transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .active > .nav-link,
.navbar-nav .nav-link.active,
.navbar-nav .current-menu-item > .nav-link {
    color: var(--ww-red) !important;
    background: var(--ww-red-tint);
    text-decoration: none;
}

/* Push the menu to the right */
.navbar-nav.m-right-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

@media (max-width: 900px) {
    .navbar-toggler { display: inline-block !important; }
    #navbarNavDropdown { flex-basis: 100%; }
    #navbarNavDropdown .navbar-nav { flex-direction: column; align-items: stretch; }
    #navbarNavDropdown .navbar-nav .nav-link { padding: 0.65rem 0.9rem !important; }
}

/* ============================================================
   4. Homepage: hero + category cards + latest posts
   ============================================================ */
.ww-hero {
    background: linear-gradient(135deg, var(--ww-black) 0%, var(--ww-black-soft) 100%);
    color: var(--ww-white);
    padding: 4.5rem 1.5rem 4rem;
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--ww-red);
}

.ww-hero::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 40%;
    background: linear-gradient(135deg, transparent 0%, var(--ww-red) 100%);
    opacity: 0.15;
    pointer-events: none;
}

.ww-hero h1 {
    color: var(--ww-white);
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin: 0 0 1rem;
    position: relative;
    z-index: 1;
}

.ww-hero .ww-tagline {
    color: var(--ww-grey-300);
    font-size: 1.15rem;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.ww-hero .ww-hero-accent {
    display: inline-block;
    width: 60px;
    height: 4px;
    background: var(--ww-red);
    margin: 1.25rem auto 0;
    position: relative;
    z-index: 1;
}

.ww-section {
    max-width: var(--ww-container);
    margin: 0 auto 3.5rem;
    padding: 0 1rem;
}

.ww-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--ww-black);
}

.ww-section-heading h2 {
    margin: 0;
    font-size: 1.5rem;
}

.ww-section-heading .ww-see-all {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ww-red);
}

/* Category grid */
.ww-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.ww-cat-card {
    background: var(--ww-white);
    border: 1px solid var(--ww-grey-200);
    border-radius: var(--ww-radius-lg);
    padding: 1.5rem;
    transition: transform var(--ww-transition), box-shadow var(--ww-transition), border-color var(--ww-transition);
    display: block;
    text-decoration: none !important;
    color: var(--ww-black) !important;
    position: relative;
    overflow: hidden;
}

.ww-cat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: var(--ww-red);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform var(--ww-transition);
}

.ww-cat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ww-shadow-md);
    border-color: var(--ww-red);
}

.ww-cat-card:hover::before { transform: scaleY(1); }

.ww-cat-card .ww-cat-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.ww-cat-card .ww-cat-count {
    color: var(--ww-grey-500);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ww-cat-card .ww-cat-desc {
    color: var(--ww-grey-700);
    font-size: 0.95rem;
    margin: 0.75rem 0 0;
}

/* Post grid */
.ww-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem;
}

.ww-post-card {
    background: var(--ww-white);
    border: 1px solid var(--ww-grey-200);
    border-radius: var(--ww-radius-lg);
    overflow: hidden;
    transition: transform var(--ww-transition), box-shadow var(--ww-transition);
    display: flex;
    flex-direction: column;
}

.ww-post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--ww-shadow-md);
}

.ww-post-card .ww-post-thumb {
    aspect-ratio: 16 / 9;
    background: var(--ww-grey-100);
    overflow: hidden;
    position: relative;
}

.ww-post-card .ww-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.ww-post-card .ww-post-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, var(--ww-black) 0%, var(--ww-grey-900) 100%);
    color: var(--ww-red);
    font-size: 2.5rem;
    font-weight: 800;
}

.ww-post-card .ww-post-body {
    padding: 1.25rem 1.5rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ww-post-card .ww-post-cat {
    display: inline-block;
    background: var(--ww-red-tint);
    color: var(--ww-red);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    align-self: flex-start;
    text-decoration: none !important;
}

.ww-post-card .ww-post-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.5rem;
}

.ww-post-card .ww-post-title a {
    color: var(--ww-black);
    text-decoration: none;
}

.ww-post-card:hover .ww-post-title a { color: var(--ww-red); }

.ww-post-card .ww-post-excerpt {
    color: var(--ww-grey-700);
    font-size: 0.95rem;
    margin: 0 0 1rem;
    flex: 1;
}

.ww-post-card .ww-post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--ww-grey-500);
    margin-top: auto;
}

.ww-post-card .ww-post-meta time { color: var(--ww-grey-500); }

/* ============================================================
   5. Single post / page
   ============================================================ */
.single .entry-title,
.page .entry-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.entry-meta {
    color: var(--ww-grey-500);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ww-grey-200);
}

.entry-meta a { color: var(--ww-red); }

.entry-content {
    font-size: 1.075rem;
    line-height: 1.75;
    color: var(--ww-grey-900);
}

.entry-content p { margin-bottom: 1.25rem; }
.entry-content h2 { margin: 2.25rem 0 1rem; }
.entry-content h3 { margin: 1.75rem 0 0.75rem; }
.entry-content blockquote {
    border-left: 4px solid var(--ww-red);
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin: 1.5rem 0;
    color: var(--ww-grey-700);
    font-style: italic;
    background: var(--ww-grey-100);
    border-radius: 0 var(--ww-radius) var(--ww-radius) 0;
}
.entry-content code {
    background: var(--ww-grey-100);
    color: var(--ww-red-dark);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}
.entry-content pre {
    background: var(--ww-black);
    color: var(--ww-white);
    padding: 1rem 1.25rem;
    border-radius: var(--ww-radius);
    overflow-x: auto;
    font-size: 0.9rem;
}
.entry-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Breadcrumbs */
.ww-breadcrumbs {
    max-width: var(--ww-container);
    margin: 1.5rem auto 0;
    padding: 0 1rem;
    font-size: 0.9rem;
    color: var(--ww-grey-500);
}
.ww-breadcrumbs a { color: var(--ww-grey-700); }
.ww-breadcrumbs a:hover { color: var(--ww-red); }
.ww-breadcrumbs span[aria-current] { color: var(--ww-black); font-weight: 600; }
.ww-breadcrumbs .sep { margin: 0 0.5rem; color: var(--ww-grey-300); }

/* ============================================================
   6. Footer
   ============================================================ */
#colophon,
.site-footer,
footer.site-footer {
    background: var(--ww-black) !important;
    color: var(--ww-grey-300);
    padding: 3rem 1rem 1.5rem;
    margin-top: 4rem;
}

.site-footer a { color: var(--ww-grey-300); }
.site-footer a:hover { color: var(--ww-red); }

.ww-footer-top {
    max-width: var(--ww-container);
    margin: 0 auto 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.ww-footer-col h4 {
    color: var(--ww-white);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 1rem;
    border-bottom: 2px solid var(--ww-red);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.ww-footer-col ul { list-style: none; padding: 0; margin: 0; }
.ww-footer-col li { margin-bottom: 0.4rem; }

.ww-footer-sites {
    max-width: var(--ww-container);
    margin: 0 auto;
    padding: 1.5rem 0;
    border-top: 1px solid var(--ww-grey-900);
    border-bottom: 1px solid var(--ww-grey-900);
    text-align: center;
}

.ww-footer-sites .ww-sites-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ww-grey-500);
    margin-bottom: 0.75rem;
}

.ww-footer-sites .ww-sites-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.ww-footer-sites .ww-sites-list a {
    color: var(--ww-white);
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color var(--ww-transition), color var(--ww-transition);
}

.ww-footer-sites .ww-sites-list a:hover {
    color: var(--ww-red);
    border-bottom-color: var(--ww-red);
    text-decoration: none;
}

.ww-footer-sites .ww-sites-list .sep { color: var(--ww-grey-700); }

.ww-footer-bottom {
    max-width: var(--ww-container);
    margin: 1.5rem auto 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--ww-grey-500);
}

.ww-footer-bottom a { color: var(--ww-grey-500); }

/* ============================================================
   7. Buttons + utilities
   ============================================================ */
.ww-btn,
.btn-primary,
button[type="submit"],
input[type="submit"] {
    background: var(--ww-red);
    color: var(--ww-white) !important;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--ww-radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background var(--ww-transition), transform var(--ww-transition);
    display: inline-block;
    text-decoration: none !important;
}

.ww-btn:hover,
.btn-primary:hover,
button[type="submit"]:hover {
    background: var(--ww-red-dark);
    color: var(--ww-white) !important;
    transform: translateY(-1px);
}

.ww-btn-outline {
    background: transparent;
    color: var(--ww-red) !important;
    border: 2px solid var(--ww-red);
    padding: 0.65rem 1.4rem;
}

.ww-btn-outline:hover {
    background: var(--ww-red);
    color: var(--ww-white) !important;
}

/* ============================================================
   8. Pagination
   ============================================================ */
.pagination,
.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2.5rem 0;
    padding: 0;
    list-style: none;
}

.pagination .page-numbers,
.nav-links .page-numbers {
    display: inline-block;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--ww-grey-300);
    border-radius: var(--ww-radius);
    color: var(--ww-black);
    background: var(--ww-white);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--ww-transition);
}

.pagination .page-numbers:hover {
    border-color: var(--ww-red);
    color: var(--ww-red);
}

.pagination .page-numbers.current,
.nav-links .page-numbers.current {
    background: var(--ww-red);
    border-color: var(--ww-red);
    color: var(--ww-white);
}

/* ============================================================
   9. Responsive
   ============================================================ */
@media (max-width: 768px) {
    body { font-size: 16px; }
    h1, .entry-title { font-size: 1.75rem; }
    .ww-hero { padding: 3rem 1rem 2rem; }
    .ww-section { margin-bottom: 2.5rem; }
    .ww-section-heading h2 { font-size: 1.3rem; }
    .ww-post-grid, .ww-cat-grid { gap: 1rem; }
    .ww-footer-top { gap: 1.5rem; }
}

/* ============================================================
   10. Hide / neutralise unwanted parent-theme elements
   ============================================================ */
.consultstreet-page-header,
.page-header-default,
.consultstreet-blog-header,
.entry-header .featured-image,
.footer-widgets-wrapper,
.footer-copyright-wrap {
    display: none !important;
}

/* Parent uses .container-full for full-bleed but adds padding elsewhere.
   We rein it in for content sections while keeping our hero full-width. */
.container-full {
    max-width: 100%;
    padding: 0;
}

/* Ensure body/main don't inherit weird spacing from parent */
#content, #primary, .site-content, main {
    background: var(--ww-white);
}
