/*
Theme Name: AutoNews
Theme URI: https://autonews.example.com
Author: AutoNews Team
Author URI: https://autonews.example.com
Description: A modern, professional news magazine theme with automated content aggregation capabilities. Features a clean, responsive design with multiple layout options, custom widgets, and optimized for speed and SEO.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: autonews
Tags: news, magazine, blog, responsive, custom-menu, featured-images, threaded-comments, translation-ready, custom-colors, editor-style, rtl-language-support
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
1.0 Reset & Base Styles
2.0 Typography
3.0 Layout & Grid
4.0 Header & Navigation
5.0 Content Sections
6.0 Cards & Components
7.0 Footer
8.0 Responsive Design
9.0 Utilities
--------------------------------------------------------------*/

/*--------------------------------------------------------------
1.0 Reset & Base Styles
--------------------------------------------------------------*/

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

:root {
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Merriweather', Georgia, serif;
  
  /* Colors - Light Mode */
  --color-background: #ffffff;
  --color-foreground: #1a1a1a;
  --color-card: #ffffff;
  --color-card-foreground: #1a1a1a;
  --color-muted: #f5f5f5;
  --color-muted-foreground: #737373;
  --color-border: #e5e5e5;
  --color-primary: #2563eb;
  --color-primary-foreground: #ffffff;
  --color-secondary: #f5f5f5;
  --color-secondary-foreground: #1a1a1a;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  /* Border Radius */
  --radius: 0.65rem;
  --radius-sm: 0.45rem;
  --radius-lg: 0.85rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-foreground);
  background: #ffffff !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--color-foreground);
}

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

p {
  margin-bottom: 1rem;
}

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

a:hover {
  color: #1d4ed8;
}

/*--------------------------------------------------------------
3.0 Layout & Grid
--------------------------------------------------------------*/

.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

/*--------------------------------------------------------------
4.0 Header & Navigation
--------------------------------------------------------------*/

.site-header {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-foreground);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo:hover {
  color: var(--color-primary);
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  color: var(--color-foreground);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.main-navigation a:hover {
  color: var(--color-primary);
}

/* Category Menu */
.category-menu {
  background: var(--color-secondary);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 73px;
  z-index: 999;
}

.category-menu ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 1rem 0;
  overflow-x: auto;
}

.category-menu a {
  color: var(--color-foreground);
  font-weight: 500;
  white-space: nowrap;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.category-menu a:hover,
.category-menu a.active {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
}

/*--------------------------------------------------------------
5.0 Content Sections
--------------------------------------------------------------*/

.content-area {
  padding: 2rem 0;
}

.section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--color-primary);
  display: inline-block;
}

/*--------------------------------------------------------------
6.0 Cards & Components
--------------------------------------------------------------*/

.card {
  background: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.card-content {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-category {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-category:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Badge on image positioning */
.card > a {
  position: relative;
  display: block;
}

.card > a > .card-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  margin-bottom: 0;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-title a {
  color: var(--color-foreground);
}

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

.card-excerpt {
  color: var(--color-muted-foreground);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--color-muted-foreground);
  margin-top: auto;
}

/* Category Colors - Glassmorphism */
.category-allmant { background: rgba(59, 130, 246, 0.9); color: white; }
.category-ekonomi { background: rgba(16, 185, 129, 0.9); color: white; }
.category-sport { background: rgba(245, 158, 11, 0.9); color: white; }
.category-teknik { background: rgba(139, 92, 246, 0.9); color: white; }
.category-underhallning { background: rgba(236, 72, 153, 0.9); color: white; }
.category-vetenskap { background: rgba(20, 184, 166, 0.9); color: white; }

/*--------------------------------------------------------------
7.0 Footer
--------------------------------------------------------------*/

.site-footer {
  background: #1a1a1a;
  color: #ffffff;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: #ffffff;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #a3a3a3;
  transition: color var(--transition-fast);
}

.footer-section a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 1.5rem;
  text-align: center;
  color: #a3a3a3;
  font-size: 0.875rem;
}

/*--------------------------------------------------------------
8.0 Responsive Design
--------------------------------------------------------------*/

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  
  .main-navigation {
    display: none;
  }
  
  .site-logo {
    font-size: 1.5rem;
  }
  
  .category-menu {
    top: 65px;
  }
}

/*--------------------------------------------------------------
9.0 Utilities
--------------------------------------------------------------*/

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.hidden { display: none; }

@media (max-width: 768px) {
  .hidden-mobile { display: none; }
}

@media (min-width: 769px) {
  .hidden-desktop { display: none; }
}


/*--------------------------------------------------------------
10.0 Search Form
--------------------------------------------------------------*/

.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
}

.search-field {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: border-color var(--transition-fast);
}

.search-field:focus {
    outline: none;
    border-color: var(--color-primary);
}

.search-form button[type="submit"] {
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: var(--color-primary-foreground);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-form button[type="submit"]:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

/*--------------------------------------------------------------
11.0 404 Page
--------------------------------------------------------------*/

.error-404-content {
    padding: 4rem 0;
    text-align: center;
}

.error-404-inner {
    max-width: 600px;
    margin: 0 auto 4rem;
}

.error-404-number {
    font-size: 8rem;
    font-weight: 900;
    font-family: var(--font-serif);
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 1rem;
}

.error-404-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.error-404-text {
    font-size: 1.125rem;
    color: var(--color-muted-foreground);
    margin-bottom: 2rem;
}

.error-404-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.error-404-actions .search-form {
    width: 100%;
}

.error-404-recent {
    margin-top: 4rem;
}

.error-404-recent h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.button {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.button-primary {
    background: var(--color-primary);
    color: var(--color-primary-foreground);
}

.button-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    .error-404-number {
        font-size: 5rem;
    }
    
    .error-404-title {
        font-size: 1.75rem;
    }
    
    .error-404-text {
        font-size: 1rem;
    }
}

/*--------------------------------------------------------------
12.0 Scroll to Top Button
--------------------------------------------------------------*/

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: var(--color-primary-foreground);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 999;
    box-shadow: var(--shadow-lg);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #1d4ed8;
    transform: translateY(-4px);
}

/*--------------------------------------------------------------
13.0 Mobile Menu
--------------------------------------------------------------*/

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-foreground);
    transition: all var(--transition-fast);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-navigation {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        background: var(--color-card);
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        z-index: 998;
    }
    
    .main-navigation.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 1rem;
    }
}

/*--------------------------------------------------------------
14.0 No Results
--------------------------------------------------------------*/

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.no-results h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.no-results p {
    font-size: 1.125rem;
    color: var(--color-muted-foreground);
    margin-bottom: 2rem;
}

.no-results .search-form {
    margin: 0 auto;
}

/*--------------------------------------------------------------
Breadcrumbs
--------------------------------------------------------------*/

.breadcrumbs {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: inline-block;
}

.breadcrumbs a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.breadcrumbs .separator {
    margin: 0 0.5rem;
    color: var(--color-muted-foreground);
}

@media (max-width: 768px) {
    .breadcrumbs {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}