/*
Theme Name: UndeUnde Theme
Theme URI: https://undeunde.ro
Author: Claude
Description: Custom theme for UndeUnde.ro - Romanian business directory
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: undeunde
*/

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --primary-color: #e74c3c;
    --primary-dark: #c0392b;
    --secondary-color: #3498db;
    --text-color: #333;
    --text-light: #666;
    --background: #f5f5f5;
    --white: #fff;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem;
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin: 0 0 1rem;
}

ul, ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-content {
    min-height: calc(100vh - 300px);
    padding: 40px 0;
}

.content-area {
    float: left;
    width: 70%;
    padding-right: 30px;
}

.widget-area {
    float: right;
    width: 30%;
}

.site-main::after,
.container::after {
    content: "";
    display: table;
    clear: both;
}

/* Full width layout */
.full-width .content-area {
    float: none;
    width: 100%;
    padding-right: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.site-title a {
    color: var(--primary-color);
}

.site-description {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.custom-logo {
    max-height: 50px;
    width: auto;
}

/* Navigation */
.main-navigation {
    flex-grow: 1;
    text-align: right;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    gap: 5px;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 10px 15px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    background: var(--primary-color);
    color: var(--white);
}

/* Dropdown */
.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    min-width: 200px;
    flex-direction: column;
    gap: 0;
    border-radius: 4px;
    overflow: hidden;
}

.main-navigation li:hover > ul {
    display: flex;
}

.main-navigation ul ul a {
    padding: 10px 15px;
    border-radius: 0;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    margin: 5px 0;
    transition: 0.3s;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0 0;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-widget h3 {
    color: var(--white);
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.footer-widget a {
    color: #bdc3c7;
}

.footer-widget a:hover {
    color: var(--white);
}

.footer-widget ul {
    list-style: none;
    padding: 0;
}

.footer-widget li {
    padding: 5px 0;
}

.site-info {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.875rem;
}

.site-info a {
    color: #bdc3c7;
}

/* ==========================================================================
   Posts & Pages
   ========================================================================== */
.entry-header {
    margin-bottom: 1.5rem;
}

.entry-title {
    margin-bottom: 0.5rem;
}

.entry-title a {
    color: var(--text-color);
}

.entry-title a:hover {
    color: var(--primary-color);
}

.entry-meta {
    font-size: 0.875rem;
    color: var(--text-light);
}

.entry-meta a {
    color: var(--text-light);
}

.entry-content {
    margin-bottom: 1.5rem;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: 1.5rem;
}

.entry-footer {
    font-size: 0.875rem;
    color: var(--text-light);
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Post cards for archives */
article.post,
article.page {
    background: var(--white);
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.post-thumbnail {
    margin-bottom: 1rem;
    border-radius: 4px;
    overflow: hidden;
}

.post-thumbnail img {
    display: block;
    width: 100%;
}

/* Business listing specific */
.business-contact {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.business-contact h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.business-contact p {
    margin-bottom: 0.5rem;
}

.business-contact a[href^="tel:"] {
    font-weight: 600;
    font-size: 1.125rem;
}

/* ==========================================================================
   Sidebar & Widgets
   ========================================================================== */
.widget {
    background: var(--white);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--text-color);
}

.widget a:hover {
    color: var(--primary-color);
}

/* Search widget */
.search-form {
    display: flex;
}

.search-field {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.search-submit {
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
}

.search-submit:hover {
    background: var(--primary-dark);
}

/* ==========================================================================
   Categories Grid
   ========================================================================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 2rem 0;
}

.category-card {
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.category-card h3 {
    margin-bottom: 0.5rem;
}

.category-card .count {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination,
.post-navigation,
.posts-navigation {
    margin: 30px 0;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-numbers {
    display: inline-block;
    padding: 10px 15px;
    background: var(--white);
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.page-numbers.current,
.page-numbers:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* ==========================================================================
   Comments
   ========================================================================== */
.comments-area {
    margin-top: 40px;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-author {
    font-weight: 600;
}

.comment-meta {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.comment-respond {
    margin-top: 30px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 15px;
}

.comment-form textarea {
    min-height: 150px;
}

.form-submit input {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.form-submit input:hover {
    background: var(--primary-dark);
}

/* ==========================================================================
   404 Page
   ========================================================================== */
.error-404 {
    text-align: center;
    padding: 60px 20px;
}

.error-404 h1 {
    font-size: 6rem;
    color: var(--primary-color);
    margin-bottom: 0;
}

.error-404 p {
    font-size: 1.25rem;
    color: var(--text-light);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .content-area {
        float: none;
        width: 100%;
        padding-right: 0;
    }

    .widget-area {
        float: none;
        width: 100%;
        margin-top: 40px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .main-navigation {
        width: 100%;
        text-align: left;
        display: none;
    }

    .main-navigation.toggled {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        width: 100%;
    }

    .main-navigation ul ul {
        position: static;
        box-shadow: none;
        padding-left: 20px;
    }

    .main-navigation li:hover > ul {
        display: none;
    }

    .main-navigation li.focus > ul {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    article.post,
    article.page {
        padding: 20px;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .site-content {
        padding: 20px 0;
    }
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
    padding: 10px;
}

.sticky {
    border-left: 4px solid var(--primary-color);
}

.bypostauthor {
    background: #f8f9fa;
}

.gallery-caption {
    font-size: 0.875rem;
}
