/*
Theme Name: GoriGizmo Tech v3 - TechnoEdge Layout
Theme URI: https://example.com
Author: Antigravity
Description: A hyper-dense, high-fidelity tech theme with 3-column layout.
Version: 3.0.0
*/

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

:root {
    --bg-body: #f5f5f5;
    --bg-card: #ffffff;
    --bg-header: #0a0e27;
    /* Dark Blue TechnoEdge Style */

    --text-main: #111111;
    --text-muted: #757575;
    --text-header: #ffffff;

    --accent-gizmodo: #7c40ff;
    /* Violet */
    --accent-gori: #e93e2f;
    /* Red */
    --accent-link: #000000;
}

/* Reset */
/* Reset handled by Normalize.css */

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Roboto', 'Noto Sans JP', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.1s;
}

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

ul {
    list-style: none;
}

/* 
   LAYOUT: TechnoEdge 3-Column Grid
   - Left Sidebar: Fixed Navigation
   - Center: Feed
   - Right: Widgets
*/

.site-container {
    display: grid;
    grid-template-columns: 240px 1fr 340px;
    /* Fixed Left, Fluid Main, Fixed Right */
    gap: 0;
    /* Gap handled by padding inside columns if needed, or stick to 0 for full height sidebar */
    max-width: 100%;
    margin: 0;
    min-height: 100vh;
}

/* LEFT SIDEBAR */
.left-sidebar {
    background-color: var(--bg-header);
    color: #fff;
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    margin-bottom: 30px;
}

.sidebar-logo a {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.left-sidebar .main-navigation ul {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.left-sidebar .main-navigation a {
    color: #a0a4b8;
    /* Muted blue-grey */
    font-size: 15px;
    font-weight: 700;
    text-transform: none;
}

.left-sidebar .main-navigation a:hover {
    color: #fff;
    padding-left: 5px;
    /* Slight nudge */
    transition: all 0.2s;
}

.sidebar-search {
    margin: 30px 0;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links {
    margin-bottom: 20px;
}

.social-links span {
    display: block;
    font-size: 10px;
    color: #666;
    margin-bottom: 10px;
    letter-spacing: 2px;
    font-weight: 900;
    text-transform: uppercase;
}

.social-links a {
    color: #fff;
    margin-right: 15px;
    font-size: 14px;
}

.auth-links a {
    font-size: 12px;
    color: #666;
    font-weight: 700;
}

/* MAIN CONTENT STREAM */
.site-main {
    padding: 25px;
    background: #f9f9f9;
}

/* Hero Post */
.hero-post {
    margin-bottom: 50px;
    background: #fff;
    /* Clean look */
}

.hero-image {
    width: 100%;
    aspect-ratio: 16/9;
    margin-bottom: 24px;
    overflow: hidden;
    border-radius: 4px;
    background: #ddd;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hero-post:hover .hero-image img {
    transform: scale(1.02);
}

.hero-meta {
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-gizmodo);
    display: flex;
    gap: 15px;
}

.hero-cat {
    color: var(--accent-gizmodo);
}

.hero-date {
    color: #999;
    font-weight: 400;
}

.hero-title {
    font-size: 32px;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 16px;
    color: #111;
    letter-spacing: -0.5px;
}

.hero-author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    font-family: 'Noto Sans JP', sans-serif;
}

.hero-author img {
    border-radius: 50%;
    width: 28px;
    height: 28px;
}

/* Main Grid (2 Columns) */
.main-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* Grid Card */
.grid-card {
    display: flex;
    flex-direction: column;
}

.card-image {
    aspect-ratio: 16/9;
    background: #eee;
    margin-bottom: 12px;
    border-radius: 4px;
    overflow: hidden;
}

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

.grid-card:hover .card-image img {
    transform: scale(1.03);
}

.card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-meta {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-cat {
    color: var(--accent-gizmodo);
}

.card-date {
    color: #aaa;
    font-weight: 400;
    font-family: monospace;
    /* Tech feel */
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #111;
}

.card-title:hover {
    color: var(--accent-gizmodo);
}

.card-author {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #777;
}

.card-author img {
    border-radius: 50%;
    width: 20px;
    height: 20px;
}

/* RIGHT SIDEBAR */
.widget-area {
    padding: 40px 30px;
    background: #fff;
    border-left: 1px solid #eee;
    height: 100%;
}

.widget {
    margin-bottom: 40px;
}

.widget-title {
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget-title::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    background: var(--accent-gizmodo);
    border-radius: 50%;
    /* Icon placeholder */
}

.widget ul li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.widget ul li a {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    display: block;
    color: #333;
}

.widget ul li a:hover {
    color: var(--accent-gizmodo);
}

/* Pagination (Island Style) */
.pagination {
    margin-top: 40px;
    text-align: center;
    padding: 15px 0;
}

.pagination .nav-links {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: #fff;
    /* Island: White card */
    color: #111;
    font-weight: 700;
    font-size: 16px;
    border-radius: 12px;
    /* Rounded Island */
    text-decoration: none;
    transition: all 0.2s ease;
    /* Optional: Add shadow for true "Island" feel? The image was flat, but "Island" usually implies depth.
       However, the image shows simple text 1 2 ... 4 ->.
       I will stick to a Clean Flat Island (White bg on Grey body) or just Transparent if that matches better.
       Let's go with White Buttons + Hover Effect to satisfy "Island Button" description + Image Layout. */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination .page-numbers.current {
    background: #111;
    color: #fff;
    box-shadow: none;
}

.pagination .page-numbers:hover:not(.current) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: var(--accent-gizmodo);
}

.pagination .page-numbers.dots {
    background: transparent;
    box-shadow: none;
    min-width: auto;
    color: #999;
}

.pagination .prev,
.pagination .next {
    font-weight: 900;
}

/* Footer Simplification */
.site-footer-minimal {
    grid-column: 1 / -1;
    /* Span full width if inside grid, but it's outside in structure? No, it's inside in my PHP */
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: #999;
    border-top: 1px solid #eee;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .site-container {
        grid-template-columns: 200px 1fr 300px;
    }
}

@media (max-width: 1024px) {
    .site-container {
        grid-template-columns: 80px 1fr 280px;
        /* Condensed Nav */
    }

    .left-sidebar {
        padding: 20px 10px;
        align-items: center;
    }

    .sidebar-logo a,
    .main-navigation a,
    .sidebar-footer {
        display: none;
        /* Hide text, show icons maybe? For now just hide text */
    }

    /* Simple fallback for icon logic would be needed here, or just keep it simple */
    .sidebar-logo a {
        display: block;
        font-size: 10px;
    }

    /* Just small */
}

@media (max-width: 900px) {
    .site-container {
        display: block;
        /* Stack */
    }

    .left-sidebar {
        height: auto;
        position: relative;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
    }

    .sidebar-logo {
        margin: 0;
    }

    .sidebar-logo a {
        display: block;
        font-size: 18px;
    }

    .main-navigation {
        display: none;
        /* Hide nav on mobile for now - normally add hamburger */
    }

    .site-main {
        padding: 20px;
    }

    .main-grid-container {
        grid-template-columns: 1fr;
    }

    .widget-area {
        padding: 20px;
        border-left: none;
    }
}

/* --- ADDED FOR V3.1 --- */

/* Dark Hero Section */
.dark-hero-section {
    background-color: #1a1b2e;
    /* Dark Blue */
    color: #fff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.dark-hero-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    /* Left wider */
    gap: 25px;
}

/* Left Big Post */
.hero-post-main .hero-image {
    aspect-ratio: 16/9;
    border-radius: 6px;
    margin-bottom: 15px;
    background: #333;
    overflow: hidden;
}

.hero-post-main .hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.hero-post-main:hover .hero-image img {
    transform: scale(1.03);
}

.hero-post-main .hero-title {
    color: #fff;
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 12px;
    line-height: 1.3;
}

.hero-post-main .hero-cat {
    color: #7c7cff;
    /* Light Violet */
    font-weight: bold;
    font-size: 13px;
    margin-right: 15px;
}

.hero-post-main .hero-date {
    color: #a0a0b0;
    font-size: 13px;
}

.hero-post-main .author-name {
    color: #ccc;
    font-weight: 500;
    font-size: 13px;
}

.hero-post-main .hero-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-post-main .hero-author img {
    border-radius: 50%;
}

/* Right Side List */
.hero-right-list {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero-side-item {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.hero-side-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.side-item-image {
    width: 100px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #333;
}

.side-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.side-item-content {
    flex: 1;
}

.side-item-title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 5px;
}

.side-item-title:hover {
    color: #7c7cff;
}

.side-item-meta {
    font-size: 10px;
    color: #7c7cff;
    margin-bottom: 4px;
    display: flex;
    gap: 10px;
}

.side-item-date {
    color: #888;
}

.side-item-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #aaa;
}

.side-item-author img {
    border-radius: 50%;
}


/* COLLAPSED SIDEBAR STATE */
body.sidebar-closed .site-container {
    grid-template-columns: 60px 1fr 340px;
    /* Shrink left col */
}

body.sidebar-closed .left-sidebar {
    padding: 20px 10px;
    align-items: center;
}

body.sidebar-closed .sidebar-logo a {
    font-size: 0;
    /* Hide text */
}

body.sidebar-closed .sidebar-logo a::before {
    content: 'G';
    /* Show Icon */
    font-size: 24px;
    display: block;
    font-weight: 900;
}

body.sidebar-closed .main-navigation ul {
    align-items: center;
}

body.sidebar-closed .main-navigation a {
    font-size: 0;
    /* Hide text */
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    display: block;
    margin-bottom: 10px;
    border-radius: 2px;
}

body.sidebar-closed .main-navigation a:hover {
    background: #fff;
}

body.sidebar-closed .sidebar-footer,
body.sidebar-closed .sidebar-search {
    display: none;
    /* Hide */
}

/* Toggle Button */
.sidebar-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    margin-bottom: 20px;
    padding: 5px;
    display: block;
    align-self: flex-start;
}

body.sidebar-closed .sidebar-toggle {
    align-self: center;
}

/* Responsive adaptations for Dark Hero */
@media (max-width: 900px) {
    .dark-hero-inner {
        grid-template-columns: 1fr;
    }
}

/* --- SIDEBAR DARK FEED DESIGN (Added V3.2) --- */
.dark-sidebar {
    background-color: #1e1e1e;
    /* Dark background matching image */
    padding: 0;
    border-left: 1px solid #333;
}

.sidebar-feed-container {
    padding: 20px;
}

.sidebar-feed-item {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
}

.sidebar-feed-item:last-child {
    border-bottom: none;
}

.sidebar-feed-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.feed-source-icon {
    background: #fff;
    color: #000;
    font-weight: 900;
    font-size: 10px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.feed-source-name {
    color: #ccc;
    font-size: 12px;
    font-weight: 700;
}

.sidebar-feed-main {
    display: flex;
    justify-content: space-between;
    /* Title Left, Image Right */
    gap: 15px;
    margin-bottom: 10px;
}

.sidebar-feed-content {
    flex: 1;
}

.sidebar-feed-title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.sidebar-feed-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    /* Rounded corners like image */
    overflow: hidden;
    flex-shrink: 0;
    background: #333;
}

.sidebar-feed-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #333, #444);
}

.sidebar-feed-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feed-time {
    color: #888;
    font-size: 12px;
}

.feed-action-btn {
    background: #2a2a2a;
    border: none;
    color: #888;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.feed-action-btn:hover {
    background: #3a3a3a;
    color: #fff;
}

/* --- SIDEBAR WHITE THEME REFACTOR (Added V3.3) --- */
.dark-sidebar {
    background-color: #ffffff;
    /* User Request: White */
    border-left: 1px solid #eee;
    color: #333;
}

.sidebar-inner {
    padding: 15px;
}

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-section-title {
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 15px;
    color: #111;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-feed-item {
    border-bottom: 1px solid #e5e5e5;
    /* Slightly darker border */
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.sidebar-feed-title {
    color: #111;
    /* Dark text */
}

.sidebar-feed-header .feed-source-name {
    color: #666;
    /* Darker grey */
}

.sidebar-feed-meta .feed-time {
    color: #999;
}

/* Rank Badge */
.feed-rank-badge {
    background: #333;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-rank-badge.rank-1 {
    background: #d4af37;
}

/* Gold */
.feed-rank-badge.rank-2 {
    background: #c0c0c0;
}

/* Silver */
.feed-rank-badge.rank-3 {
    background: #cd7f32;
}

/* Bronze */

.feed-source-icon {
    color: #333;
    background: #f0f0f0;
}

/* --- SIDEBAR SIMPLIFICATION (Added V3.4) --- */
/* Override flex direction and image styles */

.sidebar-feed-main {
    align-items: flex-start;
    /* Top align */
}

/* Image on Left, Square */
.sidebar-feed-image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    /* Square with slight radius */
    margin-right: 12px;
    /* Spacing between image and title */
    order: -1;
    /* Move to start */
}

/* Ranking Badge on Image */
.rank-image-container {
    position: relative;
}

.feed-rank-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Adjust Title Size */
.sidebar-feed-title {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 4px;
}

/* Remove old header styles if they cause padding issues */
.sidebar-feed-header {
    display: none;
    /* Just in case */
}
/* --- DESIGN POLISH (Added V3.5) --- */

/* Subtle hover effects on cards */
.grid-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.grid-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

/* Sidebar item hover */
.sidebar-feed-item a:hover .sidebar-feed-title {
    color: var(--accent-gizmodo);
}

/* Slightly stronger border for widget items */
.widget ul li {
    border-bottom: 1px solid #e5e5e5;
}

/* Navigation link transition */
.left-sidebar .main-navigation a {
    transition: color 0.2s, padding-left 0.2s;
}
/* --- LEFT SIDEBAR REDESIGN (V3.6) --- */

/* Remove old collapsed sidebar styles */
body.sidebar-closed .site-container,
body.sidebar-closed .left-sidebar,
body.sidebar-closed .sidebar-logo a,
body.sidebar-closed .sidebar-logo a::before,
body.sidebar-closed .main-navigation ul,
body.sidebar-closed .main-navigation a,
body.sidebar-closed .main-navigation a:hover,
body.sidebar-closed .sidebar-footer,
body.sidebar-closed .sidebar-search,
body.sidebar-closed .sidebar-toggle {
    /* Nullify all collapsed states */
    all: revert;
}

/* Hide toggle button (cleanup) */
.sidebar-toggle {
    display: none !important;
}

/* New Sidebar Design */
.left-sidebar {
    background: linear-gradient(180deg, #0f1629 0%, #1a2038 100%);
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

/* Brand/Logo */
.sidebar-brand {
    margin-bottom: 40px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #7c40ff 0%, #a855f7 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.brand-name {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.5px;
}

/* Navigation */
.left-sidebar .main-navigation {
    flex: 1;
}

.left-sidebar .main-navigation ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.left-sidebar .main-navigation li {
    list-style: none;
}

.left-sidebar .main-navigation a {
    display: block;
    padding: 12px 16px;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.left-sidebar .main-navigation a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    padding-left: 20px;
}

/* Search */
.sidebar-search {
    margin: 20px 0;
}

.sidebar-search input[type="search"] {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
}

.sidebar-search input[type="search"]::placeholder {
    color: #6b7280;
}

.sidebar-search input[type="search"]:focus {
    outline: none;
    border-color: #7c40ff;
    background: rgba(255,255,255,0.12);
}

/* Footer/Social */
.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.social-links a {
    color: #6b7280;
    font-size: 16px;
    transition: color 0.2s;
}

.social-links a:hover {
    color: #fff;
}

.copyright {
    font-size: 11px;
    color: #4b5563;
}
