/*
Theme Name: problem-industries
Description: Dark mode starter theme based on Underscores.
Version: 1.1.0
*/

:root {
--bg-primary: #121212;
--bg-secondary: #111;
--text-primary: #FBFFFE;
--text-secondary: #e1e1e1;
--accent: #9F2B25;
--accent-hover: #b24741;
--border: #92898A;
--shadow: 0 4px 12px rgba(0,0,0,0.5);
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
--headings-font: "AlteHaasGrotesk", var(--font-family);
}

/* Generic - Normalize & Base Styles */
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
box-sizing: border-box;
}

*, *:before, *:after {
box-sizing: inherit;
}

body {
margin: 0;
background: var(--bg-primary);
color: var(--text-primary);
font-family: var(--font-family);
font-size: 1rem;
line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
clear: both;
color: var(--text-primary);
font-weight: 600;
line-height: 1.3;
margin: 2rem 0 1rem;
font-family: var(--headings-font);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
p { margin-bottom: 1.5rem; font-size: 1.1rem; }

blockquote {
margin: 2rem 0;
padding: 1.5rem 2rem;
background: var(--bg-secondary);
border-left: 4px solid var(--accent);
font-style: italic;
}

pre {
background: var(--bg-secondary);
padding: 1.5rem;
border-radius: 8px;
overflow: auto;
}

/* Elements */
hr {
background: var(--border);
border: 0;
height: 1px;
margin: 3rem 0;
}

ul, ol { margin: 0 0 1.5rem 2rem; }
ul { list-style: disc; }
img { max-width: 100%; height: auto; }

/* Links */
a {
color: var(--accent);
text-decoration: none;
transition: color 0.3s ease;
}

a:hover, a:focus {
color: var(--accent-hover);
}

/* Forms & Buttons */
input[type="text"],
input[type="email"],
input[type="search"],
textarea {
background: var(--bg-secondary);
border: 2px solid var(--border);
border-radius: 12px;
color: var(--text-primary);
padding: 1rem 1.25rem;
font-size: 1rem;
width: 100%;
transition: all 0.3s ease;
}

input:focus, textarea:focus {
outline: none;
border-color: var(--accent);
}

button,
input[type="submit"],
input[type="button"] {
background: var(--accent);
border: none;
border-radius: 12px;
color: #fff;
padding: 1rem 2rem;
font-size: 1rem;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
}

button:hover {
background: var(--accent-hover);
transform: translateY(-2px);
box-shadow: var(--shadow);
}

/* Header Layout */
.site-header {
background: var(--bg-primary);
padding: 1.5rem 2rem;
max-width: 1200px;
margin: 0 auto;
}

.header-top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
}

.logo-section a {
display: inline-block;
}

.logo-svg {
height: 90px;
width: auto;
transition: transform 0.3s ease;
}

.search-section {
max-width: 250px;
flex: 1;
display: flex;
justify-content: flex-end;
}

.search-field-wrapper {
display: flex;
align-items: center;
width: 100%;
border-bottom: 1px solid #666;
transition: border-color 0.3s ease;
}

.search-field-wrapper:focus-within {
border-bottom-color: var(--accent);
}

.search-field-wrapper input[type="search"] {
background: transparent !important;
border: none !important;
border-radius: 0 !important;
color: var(--text-primary);
padding: 0.5rem 0.5rem 0.5rem 0 !important;
font-size: 0.95rem;
width: 100%;
}

.search-field-wrapper input[type="search"]::placeholder {
color: #666;
font-style: italic;
}

.search-field-wrapper input[type="search"]:focus {
outline: none;
box-shadow: none;
}

.search-icon-btn {
background: none;
border: none;
padding: 0;
margin-right: 10px;
width: 18px;
height: 18px;
cursor: pointer;
background-color: #666;
-webkit-mask: url('images/search.svg') no-repeat center;
mask: url('images/search.svg') no-repeat center;
-webkit-mask-size: contain;
mask-size: contain;
transition: background-color 0.3s ease;
}

.search-field-wrapper:focus-within .search-icon-btn {
background-color: var(--accent);
}

.main-navigation {
border-top: 1px solid var(--border);
padding-top: 1rem;
}

.main-menu {
display: flex;
justify-content: space-between;
list-style: none;
margin: 0;
padding: 0;
width: 100%;
gap: 0.5rem; /* Add gap for better spacing control */
}

.main-menu > li > a {
display: block;
color: var(--text-primary);
text-transform: uppercase;
font-size: 0.8rem; /* Slightly tighter */
font-weight: 600;
letter-spacing: 1.2px; /* More compact letter spacing */
padding: 0.4rem 0; /* Tighter vertical padding */
transition: color 0.3s ease;
}

.main-menu > li > a:hover {
color: var(--accent);
}

/* Content & Layout Updates */
.site-main {
max-width: 1200px;
margin: 0 auto;
padding: 0 2rem;
}

/* Posts keep padding */
.post {
    background: var(--bg-primary);
    padding: 2rem 0;
    border-radius: 0;
    /* margin-bottom: 3rem; */
    box-shadow: none;
}

/* Pages have no top padding */
.page {
    background: var(--bg-primary);
    padding: 0 0 3rem 0; /* No top padding */
    border-radius: 0;
    margin-bottom: 3rem;
    box-shadow: none;
}

.entry-title, .entry-title a {
color: var(--text-primary) !important; /* Force primary color on titles */
margin-bottom: 1.5rem;
}

.entry-meta {
color: var(--text-secondary);
font-size: 0.95rem;
margin-bottom: 2rem;
}

/* Hiding Comments */
#comments, 
.comments-area, 
.comment-respond, 
.comment-list {
display: none !important;
}

/* Footer */
.site-footer {
background: var(--bg-secondary);
padding: 3rem 0 2rem;
text-align: center;
color: var(--text-secondary);
}

/* Accessibility */
.screen-reader-text {
border: 0;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute !important;
width: 1px;
word-wrap: normal !important;
}

/* Tablet breakpoint */
@media screen and (max-width: 1024px) {
.site-header {
padding: 1.5rem 1.5rem;
}

.logo-svg {
height: 75px;
}

.main-menu > li > a {
font-size: 0.8rem;
letter-spacing: 1.2px;
padding: 0.4rem 0;
}

.site-main {
padding: 0 1.5rem;
}

.site-footer {
padding: 0 1.5rem 3rem;
}

.footer__nav a,
.footer__contact a {
font-size: 0.85rem;
margin-right: 1.2rem;
}

.footer__main-content {
gap: 1.5rem;
}

.footer__socials {
gap: 1.2rem;
}
}

/* Mobile breakpoint */
@media screen and (max-width: 768px) {
.site-header {
padding: 1.5rem 1rem;
}

.header-top {
flex-direction: column;
gap: 1.5rem;
text-align: center;
margin-bottom: 1.25rem;
}

.logo-svg {
height: 70px; /* Larger logo on mobile for better visibility */
}

.search-section {
max-width: 100%;
justify-content: center;
}

.main-navigation {
padding-top: 0.75rem;
}

.main-menu {
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: 0.5rem; /* Tighter menu spacing */
}

.main-menu > li > a {
padding: 0.4rem 0.6rem; /* More compact padding */
font-size: 0.75rem; /* Slightly smaller on mobile */
letter-spacing: 1px;
}

.site-main {
padding: 0 1rem;
}

.post, .page {
padding: 2rem 0;
margin-bottom: 2rem;
}

.site-footer {
padding: 0 1rem 3rem;
}

/* Footer mobile layout */
.footer__main-content {
flex-direction: column;
gap: 2rem;
align-items: center; /* Center items */
margin-bottom: 3rem;
}

.footer__nav {
display: none; /* Hide text menu on mobile */
}

.footer__socials {
width: 100%;
justify-content: space-between; /* Spread icons across */
}

.footer__contact {
width: 100%;
text-align: center; /* Center contact link */
}

.footer__contact a {
font-size: 0.9rem;
}

.footer__meta {
font-size: 0.55rem; /* Smaller meta text on mobile */
line-height: 1.5;
}

.footer__meta p:first-child {
font-size: 0.5rem; /* Even smaller for "Made with love" text */
}

/* Hide the long GitHub URL on mobile to prevent horizontal scroll */
.github-blurb-url {
display: none;
}
}

/* Extra small mobile breakpoint */
@media screen and (max-width: 480px) {
.logo-svg {
height: 60px;
}

.main-menu > li > a {
padding: 0.35rem 0.5rem;
font-size: 0.7rem;
}

.footer__contact a {
font-size: 0.85rem;
}

.footer__socials svg {
width: 18px;
height: 18px;
}

.footer__meta {
font-size: 0.5rem;
}

.footer__meta p:first-child {
font-size: 0.4rem; /* Smaller "Made with love" text */
}
}

/* Layout for post list items */
.post, .page {
    position: relative; /* Allows absolute positioning of the link */
    display: flex;
    flex-direction: column;
}

/* Featured Image Styling */
.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 1rem;
}

/* Post Title Styling */
.entry-title a {
    text-decoration: none;
    color: var(--text-primary);
}

/* Hide author byline but keep the date */
.byline, .author {
    display: none !important;
}

/* Hide category and tag links in the footer */
.cat-links, .tags-links {
    display: none !important;
}

/* Hide the entire archive header if the PHP filter isn't used */
.archive-header {
    display: none !important;
}

/* Highlight the active menu item and its parent/ancestor links */
.main-navigation .main-menu .current-menu-item > a,
.main-navigation .main-menu .current-post-ancestor > a,
.main-navigation .main-menu .current-menu-parent > a {
    color: var(--accent) !important; /* This uses your #9F2B25 red */
    font-weight: 700;
}

/* Container for date and read more link */
.entry-footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Vertically centers both items */
    width: 100%;
    margin-top: 2rem;
}

/* Ensure the raw date has no extra margins that break the flex row */
.post-date-raw {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: var(--font-family);
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: none;
}

/* Style the Read More link */
.custom-read-more {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.custom-read-more:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Repeating texture separator between posts */
.post-texture-separator {
    width: 100%;
    height: 20px; /* Specific height requested */
    margin: 3rem 0; /* Vertical spacing between posts */
    background-image: url('images/post_dot.svg');
    background-repeat: repeat-x; /* Repeats only horizontally */
    background-position: center;
    background-size: contain; /* Adjusts SVG to fit the 20px height */
    opacity: 0.4; /* Optional: softens the texture */
}

/* Hero container for the post item */
.post-hero-container {
    position: relative;
    height: 400px; /* Fixed height */
    width: 100%;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    margin-bottom: 1rem;
    background-color: var(--bg-secondary); /* Fallback if no image */
}

/* Lower saturation and darkening effect on the image */
.post-hero-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    filter: saturate(0.3) brightness(0.5); /* Low saturation & darken */
    z-index: 1;
}

/* Overlay to position content at the bottom */
.post-content-overlay {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Pushes content to the bottom */
    padding: 2.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7)); /* Better readability */
}

/* Ensure title doesn't have huge top margins in this view */
.post-content-overlay .entry-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.post-content-overlay .entry-footer-meta {
    margin-top: 1rem;
}


/* Footer Horizontal Line */
.footer-separator {
    width: 100%;
    height: 1px;
    background-color: var(--border); /* Or #fff if you want pure white */
    margin-bottom: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.site-footer {
    background: var(--bg-primary);
    padding: 0 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Main row with three groups */
.footer__main-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

/* Navigation & Contact links */
.footer__nav a, 
.footer__contact a {
    color: var(--text-primary);
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-right: 1.5rem;
    text-decoration: none;
}

.footer__contact a { margin-right: 0; }

/* Social Icons */
.footer__socials {
    display: flex;
    gap: 1.5rem;
}

.footer__socials svg {
    width: 20px;
    height: 20px;
    transition: fill 0.3s ease;
}

/* Apply a white glow effect to social icons on hover */
.footer__socials a:hover svg {
    /* 
       Format: drop-shadow(horizontal-offset vertical-offset blur-radius color) 
       0 0 8px creates a centered glow that radiates outward by 8 pixels.
    */
    filter: drop-shadow(0 0 8px var(--text-primary));
    
    /* Ensure the icon itself also transitions to the accent color if desired */
    transition: filter 0.3s ease, fill 0.3s ease;
}
/* Meta Information */
.footer__meta {
    text-align: center;
    color: #313131;
    font-family: monospace; /* Matches the "typewriter" style in image */
    font-size: 0.6rem;
    line-height: 1.8;
}

.footer__meta p { margin: 0; }

/* Post Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 0 0 auto;
    max-width: 45%;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation .nav-subtitle {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.post-navigation .nav-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

.post-navigation .nav-previous-spacer {
    flex: 0 0 auto;
}

/* Mobile: Hide next link */
@media (max-width: 768px) {
    .post-navigation .nav-next {
        display: none !important;
    }
    
    .post-navigation .nav-previous {
        max-width: 100% !important;
    }
}

/* Clickable hero image overlay */
.post-hero-container {
    position: relative;
}

.post-hero-container .hero-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    cursor: pointer;
}

.post-hero-container .post-content-overlay {
    position: relative;
    z-index: 2;
    pointer-events: none; /* Allows clicks to pass through to hero-link */
}

.post-hero-container .post-content-overlay a,
.post-hero-container .post-content-overlay .entry-title a,
.post-hero-container .post-content-overlay .custom-read-more {
    pointer-events: auto; /* Re-enables clicks on actual links */
    position: relative;
    z-index: 3;
}

