/* Custom Styles for Justin Glover */

/* Hero Title Animation */
@keyframes shine {
    0%, 100% { 
        background-position: 0% 0%; 
    }
    50% { 
        background-position: 0% 100%; 
    }
}

.hero-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 4.5rem;
    color: #f5f5f5;
    -webkit-text-stroke: 2px #f5f5f5;
    background-image: linear-gradient(180deg, #f5f5f5 0%, #ffa07a 100%);
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    background-position: 0 0;
    animation: shine 3s ease-in-out infinite;
    text-shadow: 
        3px 3px 0px rgba(255, 160, 122, 0.5),
        6px 6px 0px rgba(0, 0, 0, 0.2);
    font-display: swap;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Section Scroll Margin for Fixed Header */
section {
    scroll-margin-top: 120px;
}

/* Navigation Link Underline Effect */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #ffa07a;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Contact Link - No Underline */
.contact-link::after {
    display: none;
}

/* Header - Keep normal spacing until items would overlap, then switch to hamburger */
/* The hamburger menu breakpoint is now set to Tailwind's lg: breakpoint (1024px) */
/* This keeps normal spacing longer and only shows hamburger when items would actually overlap */

/* Header Scrolled State */
#header.scrolled {
    width: 100% !important;
    max-width: none !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    border-radius: 0 !important;
    background-color: rgba(45, 45, 45, 0.95) !important;
    backdrop-filter: blur(10px) !important;
}

/* Prevent Learning/Contact overlap at specific breakpoints */
@media (max-width: 1226px) and (min-width: 1104px) {
    #header:not(.scrolled) nav ul li:nth-child(4) {
        margin-right: 2.5rem !important;
    }
    #header:not(.scrolled) nav ul li.absolute[class*="right"] {
        right: 0.5rem !important;
    }
    /* Reduce nav link font size */
    #header:not(.scrolled) nav ul li .nav-link {
        font-size: 0.95rem !important;
    }
}

@media (max-width: 1103px) and (min-width: 925px) {
    #header:not(.scrolled) nav ul li:nth-child(4) {
        margin-right: 2.5rem !important;
    }
    #header:not(.scrolled) nav ul li.absolute[class*="right"] {
        right: 0.5rem !important;
    }
    /* Reduce nav link font size */
    #header:not(.scrolled) nav ul li .nav-link {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 925px) and (min-width: 856px) {
    #header:not(.scrolled) nav ul li:nth-child(4) {
        margin-right: 2.5rem !important;
    }
    #header:not(.scrolled) nav ul li.absolute[class*="right"] {
        right: 0.5rem !important;
    }
    /* Reduce nav link font size */
    #header:not(.scrolled) nav ul li .nav-link {
        font-size: 0.875rem !important;
    }
}

@media (max-width: 856px) and (min-width: 768px) {
    #header:not(.scrolled) nav ul li:nth-child(4) {
        margin-right: 3rem !important;
    }
    #header:not(.scrolled) nav ul li.absolute[class*="right"] {
        right: 0.25rem !important;
    }
    /* Reduce nav link font size */
    #header:not(.scrolled) nav ul li .nav-link {
        font-size: 0.85rem !important;
    }
    /* Reduce Contact button size */
    #header:not(.scrolled) nav ul li.absolute[class*="right"] .contact-link {
        font-size: 0.75rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* Mobile Responsive Hero Title */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3.2rem;
        -webkit-text-stroke: 1px #f5f5f5;
    }
}

/* Learning Detail Pages */
.post-content {
    line-height: 1.6;
    color: #f5f5f5;
}

.training-section {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.training-section h2 {
    font-size: 1.8rem;
    margin: 0 0 1rem;
    color: #ffa07a;
    border-bottom: 1px solid rgba(255, 160, 122, 0.4);
    padding-bottom: 0.5rem;
}

.training-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffa07a;
    margin: 1.5rem 0 0.75rem;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.training-section ul {
    list-style: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.training-section ul ul {
    list-style: circle;
    margin-top: 0.5rem;
    margin-left: 1.5rem;
}

.proof-highlights {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.video-item {
    list-style: none;
    margin-left: 0;
}

.video-details {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.video-title {
    font-weight: 700;
    color: #ffa07a;
    letter-spacing: 0.02em;
}

.video-title-underline {
    /* Removed underline - room names are now just bold */
}

.sub-list-title {
    list-style: none;
    margin-left: -1.5rem;
}

.sub-list-heading {
    list-style: none;
    margin-left: -1.5rem;
}

.video-details summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
}

.video-details summary::-webkit-details-marker {
    display: none;
}

.video-details summary::after {
    content: "+";
    font-weight: 700;
    color: #ffa07a;
    text-decoration: none;
}

.video-details[open] summary::after {
    content: "−";
}

.video-content {
    padding: 0 1.2rem 1rem;
}

.video-subtitle,
.sub-list-title {
    margin: 0.6rem 0 0.4rem;
    color: #1a2634;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.85rem;
    background: #ffa07a;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    display: inline-block;
}

.video-content ul.sub-list {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.video-content ul.sub-list > li {
    margin-bottom: 0.4rem;
}

.video-content ul.sub-list > li:last-child {
    margin-bottom: 0;
}

.video-content ol {
    list-style: decimal;
    margin-left: 1.5rem;
    padding-left: 1rem;
}

.video-content ol > li {
    margin-bottom: 0.4rem;
}

.best-practice-note {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

/* Blog Posts */
.blog-article {
    color: #f5f5f5;
    line-height: 1.7;
}

.blog-article .post-header {
    text-align: center;
    margin-bottom: 2rem;
}

.blog-article .post-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.blog-article .post-header h2 {
    font-size: 1.25rem;
    color: rgba(245, 245, 245, 0.8);
    margin-bottom: 1rem;
}

.blog-article .post-meta {
    color: rgba(245, 245, 245, 0.6);
    font-size: 0.9rem;
}

.blog-article .post-meta span:not(:last-child)::after {
    content: "•";
    margin: 0 0.5rem;
}

.blog-article .hero-container {
    margin: 2rem auto;
}

.blog-article .hero-container img {
    width: 100%;
    max-width: 900px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 12px;
}

.blog-article .hero-container img.smaller-hero {
    max-width: 600px;
}

.blog-article .post-content h2 {
    font-size: 1.6rem;
    margin: 2rem 0 1rem;
    color: #ffa07a;
}

.blog-article .post-content h3 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem;
    color: #ffa07a;
}

.blog-article .post-content p {
    margin-bottom: 1rem;
}

.blog-article .post-content ul,
.blog-article .post-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    list-style-type: disc;
}

.blog-article .post-content ol {
    list-style-type: decimal;
}

.blog-article .post-content ul ul {
    list-style-type: circle;
    margin-top: 0.5rem;
}

.blog-article .post-content ol ol {
    list-style-type: lower-alpha;
    margin-top: 0.5rem;
}

.blog-article .post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 10px;
}

.blog-article .post-content pre {
    background: rgba(0, 0, 0, 0.25);
    padding: 1rem;
    border-radius: 10px;
    overflow-x: auto;
}

.blog-article .post-content code {
    font-family: 'Courier New', Courier, monospace;
    color: #f5f5f5;
}

/* Command-line blocks (labs / technical articles) */
.blog-article .post-content pre.command-line {
    background: rgba(0, 0, 0, 0.4);
    border-left: 4px solid #ffa07a;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}
.blog-article .post-content pre.command-line code {
    color: #f5f5f5;
}

/* TryHackMe Badge */
.thm-badge {
    width: 500px;
    max-width: 100%;
    overflow: hidden;
    display: block;
    margin: 0;
}

.thm-badge iframe {
    width: 100%;
    max-width: 500px;
    height: 200px;
    border: 0;
    display: block;
    margin: 0 auto;
    overflow: hidden;
}

/* Blog Post Footer and Navigation */
.post-footer {
    margin: 2.5rem 0 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-footer .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0;
}

.post-footer .tag {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    background: rgba(255, 160, 122, 0.2);
    color: #ffa07a;
    border: 1px solid rgba(255, 160, 122, 0.3);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 1rem;
}

.post-navigation .back-to-blog {
    color: #ffa07a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.post-navigation .back-to-blog:hover {
    color: #f5f5f5;
}

.post-navigation .back-to-blog::before {
    content: "← ";
    font-size: 1.2rem;
}

.post-navigation .share-button {
    color: #ffa07a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.post-navigation .share-button:hover {
    color: #f5f5f5;
}

.post-navigation .share-button i {
    font-size: 1.1rem;
}

@media (max-width: 640px) {
    .post-navigation {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .post-navigation .back-to-blog,
    .post-navigation .share-button {
        width: 100%;
    }
}

/* Mobile fixes for training pages - wider text on nested sections */
@media (max-width: 768px) {
    /* Reduce main container padding on training pages */
    main {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Make article container wider */
    article.max-w-5xl {
        max-width: 100% !important;
    }
    
    /* Reduce training section padding */
    .training-section {
        padding: 1rem 0.75rem !important;
    }
    
    /* Reduce video content padding */
    .video-content {
        padding: 0 0.75rem 1rem !important;
    }
    
    /* Reduce sub-list padding */
    .video-content ul.sub-list {
        padding: 0.5rem 0.75rem 0.5rem 1rem !important;
    }
    
    /* Reduce video details summary padding */
    .video-details summary {
        padding: 0.75rem 1rem !important;
    }
    
    /* Reduce nested list margins */
    .training-section ul {
        margin-left: 1rem !important;
    }
    
    .training-section ul ul {
        margin-left: 1rem !important;
    }
}

/* Image Lightbox/Modal */
.image-lightbox {
    cursor: pointer;
    transition: opacity 0.3s;
}

.image-lightbox:hover {
    opacity: 0.9;
}

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    margin: auto;
    display: block;
}

.lightbox-content img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-content {
        max-width: 100%;
        padding: 10px;
    }
}
