/*
Theme Name: Atahualpa TCTD Edition
Theme URI: https://truechiptilldeath.com/themes/atahualpa-tctd
Description: Security-hardened, modernized fork of Atahualpa theme. Optimized for TCTD (True Chip Till Death) properties with enterprise-grade security, modern WordPress standards, 8K monitor support, and TCTD brand defaults. Features: SQL injection protection, XSS prevention, CSRF tokens, modern HTML5 semantics, block editor support, accessibility improvements, ultra-wide display support up to 7680px, dynamic styling system, and GDPR-ready privacy controls.
Version: 4.0.4-tctd.3
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
Author: TCTD (forked from BytesForAll)
Author URI: https://truechiptilldeath.com
License: GNU General Public License v2.0
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: block-styles, left-sidebar, right-sidebar, fluid-layout, fixed-layout, one-column, two-columns, three-columns, four-columns, custom-colors, custom-header, theme-options, threaded-comments, sticky-post, translation-ready, accessibility-ready, security-hardened, ultra-wide
Text Domain: atahualpa-tctd
Domain Path: /languages

Original Atahualpa theme by BytesForAll
TCTD Edition: Security hardened and modernized for production use with 8K display support
*/

/* ------------------------------------------------------------------
   Base Responsive Layout - 8K Monitor Support
------------------------------------------------------------------ */

:root {
    /* Layout Dimensions (from TCTD settings) */
    --content-width: 900px;
    --content-min-width: 770px;
    --content-max-width: 1250px;
    --sidebar-width: 215px;
    --wide-width: 7680px;
    --container-padding: 0;

    /* TCTD Brand Colors (from actual truechiptilldeath.com) */
    --tctd-yellow: #FFFF00;
    --tctd-red: #CC0000;
    --tctd-dark-bg: #1b1b1b;
    --tctd-gray: #999999;
    --tctd-white: #FFFFFF;
    --tctd-black: #000000;
    --tctd-light-gray: #CCCCCC;
    --tctd-menu-bg: #333333;
    --tctd-menu-hover: #666666;
    --tctd-border: #FFFF66;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', Tahoma, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: var(--tctd-yellow);
    background: var(--tctd-dark-bg);
}

/* Use Inter variable font if supported */
@supports (font-variation-settings: normal) {
    body {
        font-family: 'Inter var', Tahoma, Arial, sans-serif;
    }
}

/* Container system for ultra-wide displays */
.site-container {
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.content-wrapper {
    width: var(--content-width);
    min-width: var(--content-min-width);
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* Responsive breakpoints including 8K */
@media (min-width: 320px) {
    /* Mobile */
}

@media (min-width: 768px) {
    /* Tablet */
}

@media (min-width: 1024px) {
    /* Desktop */
}

@media (min-width: 1920px) {
    /* Full HD */
    :root {
        font-size: 18px;
    }
}

@media (min-width: 3840px) {
    /* 4K */
    :root {
        font-size: 20px;
    }
}

@media (min-width: 7680px) {
    /* 8K Ultra-Wide */
    :root {
        font-size: 24px;
    }

    .site-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(1280px, 1fr));
        gap: 2rem;
    }
}

/* ------------------------------------------------------------------
   Base WordPress Required Styles
------------------------------------------------------------------ */

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignleft {
    float: left;
    margin-right: 1.5em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    text-align: center;
    font-size: 0.875em;
    color: #666;
    margin: 0.5em 0;
}

.gallery-caption {
    font-size: 0.875em;
    color: #666;
}

.sticky {
    /* Sticky post styling */
}

.bypostauthor {
    /* Post author styling */
}

/* ------------------------------------------------------------------
   Accessibility - Screen Reader Text
------------------------------------------------------------------ */

.screen-reader-text,
.skip-link {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus,
.skip-link:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #0066cc;
    display: block;
    font-size: 0.875rem;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ------------------------------------------------------------------
   Links
------------------------------------------------------------------ */

a {
    color: var(--tctd-yellow);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--tctd-red);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--tctd-yellow);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------
   Images - Responsive & High DPI
------------------------------------------------------------------ */

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

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* High DPI/Retina optimization */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ------------------------------------------------------------------
   Typography
------------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
    margin: 1em 0 0.5em;
    line-height: 1.2;
    font-weight: 600;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1em;
}

code, pre {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    background: #f5f5f5;
    border-radius: 3px;
}

pre {
    padding: 1em;
    overflow-x: auto;
    max-width: 100%;
}

code {
    padding: 0.2em 0.4em;
}

/* ------------------------------------------------------------------
   Three-Column Layout System (CSS Grid)
------------------------------------------------------------------ */

.layout-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
    max-width: var(--content-max-width);
    min-width: var(--content-min-width);
    margin: 0 auto;
}

/* Desktop: Three-column layout */
@media (min-width: 1024px) {
    .layout-three-column .layout-wrapper {
        grid-template-columns: var(--sidebar-width) 1fr var(--sidebar-width);
        grid-template-areas: "sidebar-left content sidebar-right";
    }

    .layout-three-column #sidebar-left {
        grid-area: sidebar-left;
    }

    .layout-three-column .content-area {
        grid-area: content;
    }

    .layout-three-column #sidebar-right {
        grid-area: sidebar-right;
    }

    /* Two-column with left sidebar */
    .layout-two-column.has-left-sidebar .layout-wrapper {
        grid-template-columns: var(--sidebar-width) 1fr;
        grid-template-areas: "sidebar-left content";
    }

    .layout-two-column.has-left-sidebar #sidebar-left {
        grid-area: sidebar-left;
    }

    .layout-two-column.has-left-sidebar .content-area {
        grid-area: content;
    }

    /* Two-column with right sidebar */
    .layout-two-column.has-right-sidebar .layout-wrapper {
        grid-template-columns: 1fr var(--sidebar-width);
        grid-template-areas: "content sidebar-right";
    }

    .layout-two-column.has-right-sidebar .content-area {
        grid-area: content;
    }

    .layout-two-column.has-right-sidebar #sidebar-right {
        grid-area: sidebar-right;
    }
}

/* Tablet: Stack to single column or optional two-column */
@media (min-width: 768px) and (max-width: 1023px) {
    .layout-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    #sidebar-left,
    #sidebar-right {
        width: 100%;
    }
}

/* Mobile: Single column stack */
@media (max-width: 767px) {
    .layout-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

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

    #sidebar-left,
    #sidebar-right {
        width: 100%;
    }
}

/* Sidebar Styling (from TCTD settings) */
.sidebar {
    padding: 10px;
    background: var(--tctd-black);
}

#sidebar-left {
    padding: 10px;
    background: var(--tctd-black);
}

#sidebar-right {
    padding: 10px;
    background: var(--tctd-black);
}

/* Content Area Styling (from TCTD settings) */
.content-area {
    padding: 15px;
    background: var(--tctd-black);
    color: var(--tctd-white);
}

/* Widget Styling (from TCTD settings) */
.widget {
    margin: 0 0 15px 0;
}

.widget-title {
    font-size: 12px;
    font-weight: bold;
    color: var(--tctd-yellow);
    text-transform: uppercase;
    margin: 0 0 10px 0;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    margin: 0;
    padding: 1px 5px 1px 12px;
    border-left: 2px solid var(--tctd-menu-bg);
    transition: border-color 0.2s ease;
}

.widget ul li:hover {
    border-left-color: var(--tctd-yellow);
}

.widget a {
    color: var(--tctd-gray);
    font-weight: normal;
    text-decoration: none;
    display: block;
    padding-left: 10px;
}

.widget a:hover {
    color: var(--tctd-white);
    text-decoration: none;
}

/* ------------------------------------------------------------------
   Lists
------------------------------------------------------------------ */

ul, ol {
    margin: 1em 0;
    padding-left: 2em;
}

li {
    margin: 0.5em 0;
}

/* ------------------------------------------------------------------
   Tables
------------------------------------------------------------------ */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

th, td {
    padding: 0.75em;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    font-weight: 600;
    background: #f5f5f5;
}

/* ------------------------------------------------------------------
   Forms
------------------------------------------------------------------ */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 1rem;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    border-color: #0066cc;
}

button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
    padding: 0.75em 1.5em;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
    background: #ff6600;
}

button:focus,
input[type="submit"]:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* ------------------------------------------------------------------
   Print Styles
------------------------------------------------------------------ */

@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }

    img {
        page-break-inside: avoid;
    }

    h2, h3 {
        page-break-after: avoid;
    }
}

/* ------------------------------------------------------------------
   Header & Navigation Menu (from TCTD settings)
------------------------------------------------------------------ */

.site-header {
    background: var(--tctd-dark-bg);
}

.site-branding {
    padding: 15px 0;
}

.site-title {
    margin: 0;
    padding: 0;
    font-size: 240%;
    font-weight: bold;
    line-height: 1;
}

.site-title a {
    color: var(--tctd-yellow);
    text-decoration: none;
}

.site-title a:hover {
    color: #DADADA;
}

.site-description {
    margin: 0;
    padding: 0;
    font-size: 1.2em;
    font-weight: bold;
    color: #666666;
}

/* Primary Navigation Menu - Horizontal */
.main-navigation {
    background: var(--tctd-menu-bg);
    border-top: solid 1px var(--tctd-border);
    border-bottom: solid 1px var(--tctd-border);
}

.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.primary-menu li {
    margin: 0;
    position: relative;
}

.primary-menu a {
    display: block;
    padding: 6px 10px;
    color: var(--tctd-yellow);
    font-size: 11px;
    font-family: Arial, Verdana, sans-serif;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: normal;
    border: solid 1px var(--tctd-border);
    transition: background 0.2s ease, color 0.2s ease;
}

.primary-menu a:hover,
.primary-menu a:focus {
    background: var(--tctd-menu-hover);
    color: #FDFDFD;
    text-decoration: none;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: var(--tctd-menu-bg);
    color: var(--tctd-yellow);
    border: 1px solid var(--tctd-border);
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

@media (max-width: 767px) {
    .menu-toggle {
        display: block;
        width: 100%;
    }

    .primary-menu {
        display: none;
        flex-direction: column;
    }

    .primary-menu.toggled {
        display: flex;
    }

    .primary-menu li {
        width: 100%;
    }
}

/* ------------------------------------------------------------------
   Post Styling (from TCTD settings)
------------------------------------------------------------------ */

.post {
    margin: 0 0 30px 0;
    border: none;
    padding: 5px;
}

/* Hide duplicate "updated" date */
.entry-meta .updated {
    display: none;
}

/* Align article title horizontally with sidebar */
.entry-header {
    margin-top: 0;
}

.entry-header .entry-title {
    margin-top: 0;
}

/* Post metadata formatting */
.entry-meta {
    margin: 0.5em 0 1em 0;
    line-height: 1.8;
}

/* Post footer metadata - inline with separator */
.entry-footer {
    margin-top: 1em;
    line-height: 1.8;
}

.entry-footer .cat-links::after {
    content: " | ";
    margin: 0 0.5em;
}

.entry-footer .tags-links::after {
    content: " | ";
    margin: 0 0.5em;
}

/* Remove trailing separator after last item */
.entry-footer .comments-link::after,
.entry-footer > *:last-child::after {
    content: none;
}

.post-kicker {
    margin: 0 0 5px 0;
}

.post-kicker a {
    color: var(--tctd-light-gray);
    text-decoration: none;
    text-transform: lowercase;
}

.post-kicker a:hover {
    color: var(--tctd-red);
}

.post-headline {
    padding: 0;
    margin: 0;
}

.post-headline h2,
.post-headline h1 {
    padding: 0;
    margin: 0;
    color: var(--tctd-yellow);
}

.post-headline a {
    color: var(--tctd-yellow);
    text-decoration: none;
}

.post-headline a:hover {
    color: var(--tctd-white);
    text-decoration: none;
}

.post-byline {
    margin: 5px 0 10px 0;
    font-size: 0.9em;
    color: var(--tctd-gray);
}

.post-bodycopy {
    margin: 15px 0;
    line-height: 1.6;
}

.post-footer {
    margin: 0;
    padding: 5px;
    background: var(--tctd-black);
    color: #333;
    line-height: 18px;
    font-size: 0.9em;
}

.post-footer a {
    color: #666;
    font-weight: normal;
    text-decoration: none;
}

.post-footer a:hover {
    color: #666;
    text-decoration: underline;
}

/* Sticky Post */
.sticky {
    background: var(--tctd-black);
    padding: 10px;
}

/* Comments */
.comment {
    background: var(--tctd-black);
    border: dotted 1px var(--tctd-yellow);
    padding: 10px;
    margin: 10px 0;
}

.comment-alt {
    background: var(--tctd-menu-bg);
}

.comment-author {
    font-size: 135%;
    font-weight: bold;
    color: var(--tctd-yellow);
}

.comment-form {
    margin: 25px 0;
    padding: 25px;
    background: var(--tctd-menu-bg);
    border-radius: 8px;
}

/* ------------------------------------------------------------------
   Footer (from TCTD settings)
------------------------------------------------------------------ */

.site-footer {
    background-color: var(--tctd-dark-bg);
    padding: 10px;
    text-align: center;
    color: var(--tctd-gray);
    font-size: 95%;
    margin-top: 20px;
}

.site-footer a {
    text-decoration: none;
    color: #777777;
    font-weight: normal;
}

.site-footer a:hover {
    text-decoration: none;
    color: #333333;
}
