/*
Theme Name: DECOR CAD
Theme URI: https://decorcad.com
Author: DECOR CAD Team
Author URI: https://decorcad.com
Description: A modern one-page theme for free AutoCAD DWG file downloads. Features hero section, category grid, popular downloads, and clean professional design.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
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: decor-cad
Tags: one-column, custom-menu, featured-images, theme-options, translation-ready
*/

/* ========== CSS Variables / Design Tokens ========== */
:root {
  --bg: hsl(210, 20%, 98%);
  --fg: hsl(220, 25%, 10%);
  --card: hsl(0, 0%, 100%);
  --card-fg: hsl(220, 25%, 10%);
  --primary: hsl(174, 62%, 38%);
  --primary-fg: hsl(0, 0%, 100%);
  --secondary: hsl(215, 20%, 93%);
  --secondary-fg: hsl(220, 25%, 15%);
  --muted: hsl(210, 15%, 95%);
  --muted-fg: hsl(215, 14%, 50%);
  --border: hsl(214, 20%, 90%);
  --radius: 0.5rem;
  --card-shadow: 0 1px 3px 0 hsl(220 25% 10% / 0.06), 0 1px 2px -1px hsl(220 25% 10% / 0.06);
  --card-shadow-hover: 0 10px 25px -5px hsl(220 25% 10% / 0.1), 0 8px 10px -6px hsl(220 25% 10% / 0.08);
  --badge-bg: hsl(174, 62%, 95%);
  --badge-fg: hsl(174, 62%, 28%);
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

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

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

/* ========== Container ========== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ========== Utility ========== */
.text-gradient {
  background: linear-gradient(135deg, hsl(174, 62%, 45%), hsl(174, 62%, 60%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: hsla(0, 0%, 100%, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

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

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo__icon {
  display: flex;
  height: 32px;
  width: 32px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 0.75rem;
  font-weight: 700;
}

.site-logo__text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--fg);
}

.main-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

.main-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-fg);
}

.main-nav a:hover {
  color: var(--fg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn {
  display: flex;
  height: 36px;
  width: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--muted-fg);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.icon-btn:hover {
  background: var(--secondary);
  color: var(--fg);
}

.menu-toggle {
  display: flex;
}

/* Mobile nav */
.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 1rem;
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-fg);
}

.mobile-nav a:hover {
  color: var(--fg);
}

@media (min-width: 768px) {
  .main-nav {
    display: flex;
  }
  .menu-toggle {
    display: none;
  }
}

/* ========== Hero ========== */
.hero {
  position: relative;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsl(220, 25%, 12%), hsl(220, 30%, 18%));
  opacity: 0.9;
}

.hero .container {
  position: relative;
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.hero__inner {
  max-width: 672px;
  margin: 0 auto;
  text-align: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background: hsla(174, 62%, 38%, 0.1);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsla(0, 0%, 100%, 0.8);
  border: 1px solid hsla(174, 62%, 38%, 0.2);
  margin-bottom: 1rem;
}

.hero__badge svg {
  width: 12px;
  height: 12px;
}

.hero h1 {
  margin-bottom: 1rem;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--primary-fg);
}

.hero p {
  margin-bottom: 2rem;
  font-size: 1rem;
  color: hsla(0, 0%, 100%, 0.7);
}

.hero__search {
  display: flex;
  max-width: 512px;
  margin: 0 auto;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  background: hsla(0, 0%, 100%, 0.1);
  padding: 6px;
  border: 1px solid hsla(255, 255, 255, 0.1);
}

.hero__search-input-wrap {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  background: var(--card);
  padding: 0.625rem 0.75rem;
}

.hero__search-input-wrap svg {
  width: 16px;
  height: 16px;
  color: var(--muted-fg);
  flex-shrink: 0;
}

.hero__search input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--fg);
  outline: none;
}

.hero__search input::placeholder {
  color: var(--muted-fg);
}

.hero__search-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  background: var(--primary);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-fg);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.hero__search-btn:hover {
  background: hsl(174, 62%, 33%);
}

.hero__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: hsla(0, 0%, 100%, 0.5);
}

.hero__stats svg {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
}

@media (min-width: 768px) {
  .hero .container {
    padding-top: 7rem;
    padding-bottom: 7rem;
  }
  .hero h1 {
    font-size: 3rem;
  }
  .hero p {
    font-size: 1.125rem;
  }
}

@media (min-width: 1024px) {
  .hero h1 {
    font-size: 3.75rem;
  }
}

/* ========== Section Titles ========== */
.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--muted-fg);
}

@media (min-width: 768px) {
  .section-header h2 {
    font-size: 1.875rem;
  }
}

/* ========== Category Grid ========== */
.categories {
  padding: 4rem 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: all 0.2s;
}

.category-card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: hsla(174, 62%, 38%, 0.3);
  transform: translateY(-2px);
}

.category-card__icon {
  display: flex;
  height: 44px;
  width: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: var(--secondary);
  color: var(--muted-fg);
  transition: background 0.2s, color 0.2s;
}

.category-card:hover .category-card__icon {
  background: var(--primary);
  color: var(--primary-fg);
}

.category-card__icon svg {
  width: 20px;
  height: 20px;
}

.category-card h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
}

.category-card .count {
  font-size: 0.75rem;
  color: var(--muted-fg);
  margin-top: 2px;
}

@media (min-width: 640px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

/* ========== Popular Downloads ========== */
.popular {
  padding: 4rem 0;
}

.popular__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.popular__header .view-all {
  display: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
}

.popular__header .view-all:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .popular__header .view-all {
    display: block;
  }
}

/* ========== Drawing Card ========== */
.drawing-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .drawing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .drawing-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
  .drawing-grid { grid-template-columns: repeat(4, 1fr); }
}

.drawing-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--card-shadow);
  transition: all 0.2s;
}

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

.drawing-card__thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.drawing-card__thumb svg {
  width: 48px;
  height: 48px;
  color: hsla(215, 14%, 50%, 0.3);
}

.drawing-card__badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  border-radius: var(--radius);
  background: var(--badge-bg);
  color: var(--badge-fg);
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.drawing-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem;
}

.drawing-card__cat {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.drawing-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--fg);
  margin-bottom: 0.375rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.drawing-card:hover .drawing-card__title {
  color: var(--primary);
}

.drawing-card__desc {
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--muted-fg);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.drawing-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: auto;
}

.drawing-card__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted-fg);
}

.drawing-card__meta svg {
  width: 12px;
  height: 12px;
  margin-right: 4px;
  vertical-align: -1px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: var(--radius);
  background: var(--primary);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-fg);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-download:hover {
  background: hsl(174, 62%, 33%);
}

.btn-download svg {
  width: 12px;
  height: 12px;
}

/* ========== Footer ========== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
}

.site-footer .container {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
}

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

.footer-brand p {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-fg);
}

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.75rem;
}

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

.footer-col li + li {
  margin-top: 0.5rem;
}

.footer-col a {
  font-size: 0.875rem;
  color: var(--muted-fg);
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--fg);
}

.footer-bottom {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-fg);
}
