/*
Theme Name: Divstarter
Theme URI: https://example.com/divstarter
Author: DivaProd
Author URI: https://example.com
Description: Minimal, modern theme designed as a companion for the DivaProd product plugin. Clean typography, fast loading, mobile-first responsive design.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: divstarter
Tags: custom-menu, featured-images, one-column, e-commerce, translation-ready
*/

/* ==========================================================================
   Divstarter — Base Theme Styles
   ========================================================================== */

:root {
    --ds-black: #111;
    --ds-white: #fff;
    --ds-gray-50: #fafafa;
    --ds-gray-100: #f5f5f5;
    --ds-gray-200: #e5e5e5;
    --ds-gray-400: #a3a3a3;
    --ds-gray-600: #525252;
    --ds-gray-800: #262626;
    --ds-accent: #111;
    --ds-radius: 8px;
    --ds-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --ds-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --ds-max-width: 1280px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--ds-font);
    color: var(--ds-black);
    background: var(--ds-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ds-black); text-decoration: none; transition: color var(--ds-transition); }
a:hover { color: var(--ds-gray-600); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.375rem, 3vw, 2rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); }

p { margin-bottom: 1rem; }

/* ---------- Layout ---------- */
.ds-container {
    max-width: var(--ds-max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ---------- Header ---------- */
.ds-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ds-gray-100);
}

.ds-header-inner {
    max-width: var(--ds-max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

/* ---------- Skip to Content ---------- */
.ds-skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 10000;
    background: var(--ds-black);
    color: var(--ds-white);
    padding: 0.5rem 1.25rem;
    border-radius: 0 0 var(--ds-radius) var(--ds-radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.15s ease;
}
.ds-skip-link:focus {
    top: 0;
    outline: 2px solid var(--ds-black);
    outline-offset: 2px;
}

/* ---------- Logo — responsive across all devices ---------- */
.ds-logo-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    min-width: 0;
}

.ds-logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ds-black);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ds-logo:hover, .ds-logo:focus { color: var(--ds-black); }

.ds-logo img,
.ds-logo-wrap .custom-logo {
    max-height: 52px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ---------- Navigation ---------- */
.ds-nav { display: flex; align-items: center; gap: 0; }

.ds-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}

.ds-nav a {
    display: block;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ds-gray-600);
    border-radius: 100px;
    transition: all var(--ds-transition);
}

.ds-nav a:hover,
.ds-nav .current-menu-item > a,
.ds-nav .current_page_item > a {
    color: var(--ds-black);
    background: var(--ds-gray-100);
}

/* Mobile menu toggle */
.ds-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--ds-black);
}

.ds-menu-toggle svg { display: block; }

/* ---------- Main ---------- */
.ds-main {
    min-height: calc(100vh - 64px - 200px);
}

/* ---------- Footer ---------- */
.ds-footer {
    background: var(--ds-gray-50);
    border-top: 1px solid var(--ds-gray-100);
    padding: 3rem 0;
    margin-top: 4rem;
    font-family: var(--ds-font);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--ds-gray-600);
}

.ds-footer-inner {
    max-width: var(--ds-max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
}

.ds-footer-col h4 {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ds-gray-600);
    margin-bottom: 0.75rem;
}

.ds-footer-desc {
    font-size: 0.875rem;
    color: var(--ds-gray-600);
    margin: 0;
    max-width: 400px;
}

.ds-footer-logo img,
.ds-footer-logo .custom-logo {
    max-height: 45px;
    width: auto;
    margin-bottom: 0.5rem;
}

.ds-footer-col ul { list-style: none; padding: 0; margin: 0; }
.ds-footer-col li { margin-bottom: 0.35rem; }
.ds-footer-col a { font-size: 0.875rem; color: var(--ds-gray-600); }
.ds-footer-col a:hover { color: var(--ds-black); }

.ds-footer-widget,
.ds-footer-widget p,
.ds-footer-widget li,
.ds-footer-widget span,
.ds-footer-widget div,
.ds-footer-widget a {
    font-family: var(--ds-font);
    font-size: 0.875rem;
    line-height: 1.6;
}
.ds-footer-widget p { color: var(--ds-gray-600); margin: 0 0 0.5rem; }
.ds-footer-widget ul { list-style: none; padding: 0; margin: 0; }
.ds-footer-widget li { margin-bottom: 0.35rem; }
.ds-footer-widget a { color: var(--ds-gray-600); }
.ds-footer-widget a:hover { color: var(--ds-black); }

.ds-footer-bottom {
    max-width: var(--ds-max-width);
    margin: 0 auto;
    padding: 1.5rem 1.25rem 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--ds-gray-400);
    border-top: 1px solid var(--ds-gray-200);
    margin-top: 2rem;
}

/* ---------- Homepage Hero ---------- */
.ds-hero {
    text-align: center;
    padding: 4rem 1.25rem 3rem;
    max-width: 640px;
    margin: 0 auto;
}

.ds-hero h1 { margin-bottom: 1rem; }

.ds-hero p {
    font-size: 1.0625rem;
    color: var(--ds-gray-600);
    max-width: 480px;
    margin: 0 auto 2rem;
}

.ds-hero-btn {
    display: inline-block;
    padding: 0.875rem 2.5rem;
    background: var(--ds-black);
    color: var(--ds-white);
    border-radius: 100px;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: opacity var(--ds-transition);
}

.ds-hero-btn:hover { opacity: 0.85; color: var(--ds-white); }

/* ---------- Products Section ---------- */
.ds-products-section {
    max-width: var(--ds-max-width);
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
}

.ds-products-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

/* ---------- Page Content ---------- */
.ds-page-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 1.25rem 4rem;
}

.ds-page-content h1 { margin-bottom: 1.5rem; }

/* ---------- Entry Content (rich text) ---------- */
.ds-page-content p,
.ds-entry-content p { color: var(--ds-gray-600); line-height: 1.7; }
.ds-entry-content h2 { margin: 2rem 0 0.75rem; }
.ds-entry-content h3 { margin: 1.5rem 0 0.5rem; }
.ds-entry-content ul,
.ds-entry-content ol { margin: 0 0 1.25rem 1.5rem; color: var(--ds-gray-600); }
.ds-entry-content li { margin-bottom: 0.35rem; line-height: 1.7; }
.ds-entry-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--ds-gray-200);
    color: var(--ds-gray-600);
    font-style: italic;
}
.ds-entry-content img {
    border-radius: var(--ds-radius);
    margin: 1rem 0;
}
.ds-entry-content a { text-decoration: underline; text-underline-offset: 2px; }
.ds-entry-content a:hover { color: var(--ds-gray-600); }
.ds-entry-content table {
    width: 100%; border-collapse: collapse; margin: 1.5rem 0;
}
.ds-entry-content th,
.ds-entry-content td {
    padding: 0.5rem 0.75rem; border: 1px solid var(--ds-gray-200);
    text-align: left; font-size: 0.9375rem;
}
.ds-entry-content th { background: var(--ds-gray-50); font-weight: 600; }
.ds-entry-content pre,
.ds-entry-content code {
    font-family: "SF Mono", Consolas, monospace;
    font-size: 0.875rem;
}
.ds-entry-content pre {
    background: var(--ds-gray-50); padding: 1rem; border-radius: var(--ds-radius);
    overflow-x: auto; margin: 1rem 0;
}

/* ---------- Post Entry (blog list) ---------- */
.ds-post-entry { margin-bottom: 0.5rem; }
.ds-post-entry h2 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.ds-post-entry h2 a { text-decoration: none; }
.ds-post-entry h2 a:hover { color: var(--ds-gray-600); }

/* ---------- Single Post ---------- */
.ds-post-meta {
    font-size: 0.8125rem;
    color: var(--ds-gray-400);
    margin-bottom: 1.5rem;
}
.ds-post-thumbnail {
    margin-bottom: 2rem;
    border-radius: var(--ds-radius);
    overflow: hidden;
}
.ds-post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}
.ds-post-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ds-gray-100);
}
.ds-post-nav__link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-decoration: none;
    max-width: 45%;
}
.ds-post-nav__next { text-align: right; margin-left: auto; }
.ds-post-nav__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ds-gray-400);
}
.ds-post-nav__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ds-black);
    transition: color var(--ds-transition);
}
.ds-post-nav__link:hover .ds-post-nav__title { color: var(--ds-gray-600); }

/* ---------- Search ---------- */
.ds-search-count {
    font-size: 0.875rem;
    color: var(--ds-gray-400);
    margin-bottom: 2rem;
}

/* ---------- Pagination ---------- */
.ds-pagination { margin-top: 2rem; }
.ds-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
}
.ds-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: var(--ds-radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ds-gray-600);
    text-decoration: none;
    transition: all var(--ds-transition);
}
.ds-pagination .page-numbers:hover { background: var(--ds-gray-100); color: var(--ds-black); }
.ds-pagination .page-numbers.current {
    background: var(--ds-black);
    color: var(--ds-white);
}
.ds-pagination .page-numbers.dots { background: none; cursor: default; }

/* ---------- 404 ---------- */
.ds-404 {
    text-align: center;
    padding: 6rem 1.25rem;
}

.ds-404 h1 {
    font-size: 5rem;
    font-weight: 800;
    color: var(--ds-gray-200);
    margin-bottom: 1rem;
}

.ds-404 p {
    font-size: 1.125rem;
    color: var(--ds-gray-600);
    margin-bottom: 2rem;
}

.ds-404-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--ds-black);
    color: var(--ds-white);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: opacity var(--ds-transition);
}

.ds-404-btn:hover { opacity: 0.85; color: var(--ds-white); }

/* ---------- Focus Styles ---------- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--ds-black);
    outline-offset: 2px;
}

/* ---------- Responsive — Mobile ≤768px ---------- */
@media (max-width: 768px) {
    .ds-menu-toggle { display: block; }

    .ds-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--ds-white);
        border-bottom: 1px solid var(--ds-gray-200);
        padding: 1rem 1.25rem;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }

    .ds-nav.ds-nav--open { display: block; }

    .ds-nav ul { flex-direction: column; gap: 0; }

    .ds-nav a {
        padding: 0.75rem 0;
        border-radius: 0;
        font-size: 1rem;
        text-align: left;
        justify-content: flex-start;
    }

    .ds-nav ul {
        align-items: flex-start;
    }

    .ds-hero { padding: 2.5rem 1rem 2rem; }

    /* Logo responsive — mobile */
    .ds-logo { font-size: 1.125rem; max-width: 180px; }
    .ds-logo img,
    .ds-logo-wrap .custom-logo { max-height: 42px; }

}

/* ---------- Responsive — Small mobile ≤480px ---------- */
@media (max-width: 480px) {
    .ds-logo { font-size: 1rem; max-width: 150px; }
    .ds-logo img,
    .ds-logo-wrap .custom-logo { max-height: 45px; }
    .ds-header-inner { padding: 0 1rem; }
    .ds-hero h1 { font-size: 1.5rem; }
}

/* ---------- Responsive — Desktop ≥960px ---------- */
@media (min-width: 960px) {
    .ds-footer-inner { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .ds-header-inner { height: 72px; }
    .ds-hero { padding: 5rem 1.25rem 3.5rem; }

    /* Logo responsive — desktop */
    .ds-logo { max-width: 280px; font-size: 1.5rem; }
    .ds-logo img,
    .ds-logo-wrap .custom-logo { max-height: 60px; }
}
