/*
Theme Name: Precision Crafting BBC Layout
Theme URI: https://precision-crafting.com/
Author: Precision Crafting
Author URI: https://precision-crafting.com/
Description: A rigid, BBC-styled news theme layout converted from the static html block.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: precision-crafting-bbc
*/

:root {
    /* Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f6f6f6;
    --text-primary: #222222;
    --text-secondary: #404040;
    --text-muted: #666666;
    
    --accent-primary: #B80000;
    --accent-hover: #990000;
    --accent-light: #fef1f1;
    
    --border-color: #dddddd;
    --glass-bg: #ffffff;
    --glass-border: #dddddd;
    
    /* Typography */
    --font-sans: Arial, Helvetica, sans-serif;
    --font-heading: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    
    /* Shadows - Flattened for BBC look */
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-glass: none;
    
    /* Transitions */
    --transition-fast: 0s;
    --transition-normal: 0.1s;
    --transition-slow: 0.2s;
    
    /* Spacing */
    --container-max-width: 1200px;
    --nav-height: 80px;
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Global Text Selection */
::selection {
    background-color: var(--accent-light);
    color: var(--accent-primary);
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Utilities */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.icon-btn:hover {
    color: var(--accent-primary);
    transform: scale(1.05);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: 50px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: none;
    border-radius: 0;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: none;
    box-shadow: none;
    color: white;
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 0px;
}

.gradient-text {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.section-title-wrapper {
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
}

.title-line {
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-color), transparent);
}

/* Navigation & Progress Bar */
.reading-progress-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1001;
}

.reading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), #8b5cf6);
    transition: width 0.1s ease-out;
}

.header {
    height: var(--nav-height);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #000000;
    color: #ffffff;
    border-bottom: none;
    transition: all var(--transition-normal);
}

.header.scrolled {
    background: #000000;
    height: 70px;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: -0.5px;
    display: flex;
    align-items: baseline;
}

.logo-bold {
    font-weight: 700;
    color: var(--accent-primary);
}

.main-nav {
    display: none;
}

@media (min-width: 992px) {
    .main-nav {
        display: block;
    }
}

.nav-list {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-primary);
    transition: width var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
}

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

.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-toggle svg {
    transition: transform var(--transition-fast);
}

.dropdown:hover .dropdown-toggle svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dropdown-menu li a:hover {
    background: var(--accent-light);
    color: var(--accent-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none;
    }
}

.bar {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-fast);
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    position: relative;
    transform: translateY(20px);
    transition: all var(--transition-normal);
}

.search-overlay.active .search-container {
    transform: translateY(0);
}

.close-search {
    position: absolute;
    top: -40px;
    right: 20px;
}

.search-form {
    display: flex;
    border-bottom: 2px solid var(--text-primary);
}

.search-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 1rem 0;
    font-size: 1.5rem;
    font-family: var(--font-heading);
    color: var(--text-primary);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: transparent;
    border: none;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hero Section */
.hero {
    position: relative;
    padding: calc(var(--nav-height) + 6rem) 0 6rem;
    overflow: hidden;
}

.glass-hero {
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.05), transparent 40%),
                radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.05), transparent 40%);
}

.premium-hero {
    /* Base fallback */
    background: transparent;
    position: relative;
}

/* Premium Video Background */
.hero-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    object-fit: cover;
    /* Optional: Slight animation on the video container itself if desired, but 
       we'll remove the pan as the video is already animated */
}

/* Light Purple Overlay */
.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Very light, sophisticated purple wash that lets the video shine through clearly */
    background: linear-gradient(135deg, rgba(200, 155, 255, 0.15) 0%, rgba(240, 230, 255, 0.2) 100%);
}

.hero-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: pulseShape 12s infinite ease-in-out alternate;
    pointer-events: none; /* Ensure shapes don't block clicks on the video if needed */
}

@keyframes pulseShape {
    0% { transform: scale(1) translate(0, 0); opacity: 0.2; }
    100% { transform: scale(1.2) translate(20px, -20px); opacity: 0.5; }
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(168, 85, 247, 0.4); /* Purple accent */
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: rgba(139, 92, 246, 0.35); /* Deep purple accent */
    bottom: -50px;
    left: -100px;
    animation-delay: -4s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: rgba(216, 180, 254, 0.45); /* Light purple accent */
    top: 30%;
    left: 40%;
    animation-delay: -8s;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* 3 Column Hero Layout */
.hero-heading-container {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.hero-3col-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    position: relative;
    z-index: 10;
}

@media (min-width: 992px) {
    .hero-3col-layout {
        grid-template-columns: 1fr 2fr 1fr;
        gap: 1.5rem;
        align-items: stretch;
    }
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-main {
    display: flex;
    flex-direction: column;
}

.hero-post-card {
    display: flex;
    flex-direction: column;
    border-radius: 0px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #dddddd;
    position: relative;
    transition: background-color 0.2s ease-in-out;
    height: 100%;
    color: var(--text-primary);
}

.hero-post-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease-out;
}

.hero-post-card:hover {
    box-shadow: none;
    background: #f9f9f9;
}

.hero-post-card:hover::after {
    transform: scaleX(1);
}

.hero-post-img-wrapper {
    position: relative;
    overflow: hidden;
    flex-grow: 1;
}

.card-small .hero-post-img-wrapper {
    height: 180px;
    flex-grow: 0;
    flex-shrink: 0;
}

.card-large .hero-post-img-wrapper {
    min-height: 350px;
    height: 100%;
}

.hero-post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-post-card:hover .hero-post-img {
    /* BBC generally doesn't scale images on hover */
}

.hero-post-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.card-small .hero-post-content {
    padding: 1.25rem;
}

.hero-post-title {
    font-size: 1.15rem;
    line-height: 1.4;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.card-large .hero-post-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.hero-post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-post-card .post-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--accent-light);
    color: var(--accent-primary);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -1px;
    margin-bottom: 2rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-inline: auto;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Base Body Background adjustments to support glass effect lower down */
body {
    background: #ffffff;
}

/* Content Layout (Blog Container Background Blur) */
.content-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 2rem 0;
    margin-top: 2rem;
    margin-bottom: 6rem;
    background: #ffffff;
    border-top: 2px solid #dddddd;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

@media (min-width: 992px) {
    .content-layout {
        grid-template-columns: 2fr 1fr;
        gap: 4rem;
        padding: 3rem 0;
    }
}

/* Post Cards */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    box-shadow: none;
    transition: none;
}

.post-card:last-child {
    border-bottom: none;
}

.post-card:hover {
    box-shadow: none;
    transform: none;
}

@media (min-width: 768px) {
    .post-card {
        flex-direction: row;
        align-items: flex-start;
    }
}

.post-img-wrapper {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .post-img-wrapper {
        width: 300px;
        height: 200px;
    }
}

.post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card:hover .post-img {
    /* No scale */
}

.category-badge {
    position: absolute;
    bottom: 0px;
    left: 0rem;
    top: auto;
    background: var(--accent-primary);
    padding: 0.15rem 0.5rem;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
}

.post-content {
    flex-grow: 1;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.post-title a:hover {
    color: var(--accent-primary);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 0.9rem;
}

.read-more svg {
    transition: transform var(--transition-fast);
}

.read-more:hover svg {
    transform: translateX(4px);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 4rem;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.page-btn:not(.active):not(.page-dots):hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.page-btn:last-child {
    width: auto;
    padding: 0 1rem;
}

.page-dots {
    color: var(--text-muted);
}

/* Sidebar Widgets */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: sticky;
    top: calc(var(--nav-height) + 2rem);
    align-self: start;
}

.widget {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.widget-about p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.category-list li {
    margin-bottom: 0.75rem;
}

.category-list li:last-child {
    margin-bottom: 0;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.category-list a:hover {
    color: var(--accent-primary);
}

.category-list span {
    background: var(--bg-primary);
    padding: 0.1rem 0.5rem;
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Footer */
.footer {
    background: #0f172a;
    color: #f8fafc;
    padding-top: 5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer-logo {
    color: white;
    margin-bottom: 1.5rem;
}

.footer-desc {
    color: #94a3b8;
    max-width: 300px;
}

.footer-title {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    background: #020617;
    padding: 1.5rem 0;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* Animations */
.fade-up {
    opacity: 1;
    transform: none;
    transition: none;
}

.fade-up.visible {
    opacity: 1;
    transform: none;
}
