/*
Theme Name: Xotlist
Theme URI: https://xotlist.com
Author: Xotlist
Description: Clean, fast media theme built with CSS Grid and native WordPress templates.
Version: 1.0.2
License: GNU General Public License v2 or later
Text Domain: xotlist
*/

/* =========================================
   RESET & BASE
========================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Global focus reset — prevent browser default outlines on pagination etc */
.page-numbers:focus,
.page-numbers:focus-visible,
a.page-numbers:focus,
a.page-numbers:focus-visible,
span.page-numbers:focus,
span.page-numbers:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

:root {
    --color-bg:         #ffffff;
    --color-surface:    #f5f5f5;
    --color-border:     #e0e0e0;
    --color-text:       #111111;
    --color-muted:      #666666;
    --color-accent:     #e63946;
    --color-accent-hover: #c1121f;

    --font-primary:     'Inter', system-ui, sans-serif;
    --font-size-base:   16px;
    --line-height-base: 1.6;

    --spacing-xs:  0.25rem;
    --spacing-sm:  0.5rem;
    --spacing-md:  1rem;
    --spacing-lg:  2rem;
    --spacing-xl:  4rem;

    --max-width:   1200px;
    --gap:         1.5rem;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: var(--line-height-base);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
    text-decoration: none;
}

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

/* =========================================
   SITE LAYOUT — CSS GRID
========================================= */

.site {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--spacing-lg);
}

/* Main content + optional sidebar */
.site-content {
    padding-block: var(--spacing-lg);
}

.content-area {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--gap);
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--spacing-lg);
}

/* Full width — no sidebar */
.content-area.full-width {
    grid-template-columns: 1fr;
}

/* =========================================
   HEADER
========================================= */

.site-header {
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.site-branding a {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--color-text);
}

.site-branding a:hover {
    color: var(--color-accent);
}

/* =========================================
   NAVIGATION
========================================= */

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-lg);
}

.main-navigation a {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text);
    transition: color 0.2s;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
    color: var(--color-accent);
}

/* =========================================
   POST CARDS — CSS GRID
========================================= */

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--gap);
}

/* Featured / hero — spans full width */
.post-grid .post-card--featured {
    grid-column: 1 / -1;
}

.post-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.post-card__title a {
    color: var(--color-text);
}

.post-card__meta {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.post-card__thumbnail img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.post-card__body {
    padding: var(--spacing-md);
}

.post-card__category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-accent);
    margin-bottom: var(--spacing-xs);
}

.post-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
}

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

.post-card__meta {
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* =========================================
   SINGLE POST
========================================= */

.entry-header {
    margin-bottom: var(--spacing-lg);
}

.entry-title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

.entry-meta {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.entry-thumbnail {
    margin-bottom: var(--spacing-lg);
    border-radius: 6px;
    overflow: hidden;
}

.entry-content {
    max-width: 720px;
}

.entry-content p {
    margin-bottom: var(--spacing-md);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-weight: 700;
    line-height: 1.3;
    margin-block: var(--spacing-lg) var(--spacing-sm);
}

.entry-content h2 { font-size: 1.6rem; }
.entry-content h3 { font-size: 1.3rem; }
.entry-content h4 { font-size: 1.1rem; }

/* =========================================
   SIDEBAR
========================================= */

.widget-area {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.widget {
    background: var(--color-surface);
    border-radius: 6px;
    padding: var(--spacing-md);
}

.widget-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-accent);
}

/* =========================================
   FOOTER
========================================= */

.site-footer {
    background-color: var(--color-text);
    color: #cccccc;
    padding-block: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    font-size: 0.85rem;
}

.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.site-footer a {
    color: #cccccc;
}

.site-footer a:hover {
    color: var(--color-accent);
}

.footer-nav ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-lg);
}

/* =========================================
   HERO — Homepage featured post
========================================= */

.hero {
    background-color: #111111;
    color: #ffffff;
    padding: 3rem 0 0;
}

.hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--spacing-lg);
}

.hero__image {
    border-radius: 8px;
    overflow: hidden;
}

.hero__image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hero__image:hover img {
    transform: scale(1.02);
}

.hero__category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-accent);
    margin-bottom: var(--spacing-sm);
}

.hero__title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

.hero__title a {
    color: #ffffff;
}

.hero__title a:hover {
    color: var(--color-accent);
}

.hero__excerpt {
    font-size: 1rem;
    color: #cccccc;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.hero__meta {
    font-size: 0.8rem;
    color: #999999;
}

/* =========================================
   HOME GRID SECTION
========================================= */

.home-grid {
    background-color: #ffffff;
    padding: 2rem 0 3rem;
}

/* =========================================
   UTILITY
========================================= */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 768px) {
    .content-area {
        grid-template-columns: 1fr;
    }

    .main-navigation {
        display: none; /* swap for mobile menu later */
    }

    .site-footer .container {
        flex-direction: column;
        text-align: center;
    }

    .hero__inner {
        grid-template-columns: 1fr;
    }

    .hero__image {
        order: -1;
    }
}