/*
Theme Name: Techmates Solutions
Theme URI: https://techmates-solutions.com
Author: Techmates Solutions
Author URI: https://techmates-solutions.com
Description: Custom lightweight WordPress theme built from the Techmates Solutions HTML website. Features a modern, responsive design with Tailwind CSS integration.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: techmates
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: custom-menu, featured-images, threaded-comments, translation-ready, blog, portfolio
*/

/* ================================================
   1.0 - RESET & BASE
   ============================================ */

/* WordPress adds extra paragraphs inside some blocks */
.entry-content p:empty {
    display: none;
}

/* Ensure images are responsive by default */
img {
    max-width: 100%;
    height: auto;
}

/* WordPress sticky post class */
.sticky {
    display: block;
}

/* ================================================
   2.0 - IMAGE ALIGNMENT
   ============================================ */

/* WordPress alignment classes */
.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;
    margin-bottom: 1.5rem;
}

.alignnone {
    margin-bottom: 1.5rem;
}

/* ================================================
   3.0 - CAPTIONS
   ============================================ */

.wp-caption {
    max-width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 1rem;
    overflow: hidden;
}

.wp-caption-text {
    padding: 0.75rem 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    background: #f9f8f4;
}

.wp-caption.aligncenter {
    margin-left: auto;
    margin-right: auto;
}

.wp-caption.alignleft {
    float: left;
    margin-right: 1.5rem;
}

.wp-caption.alignright {
    float: right;
    margin-left: 1.5rem;
}

/* ================================================
   4.0 - GALLERIES
   ============================================ */

.gallery {
    display: grid;
    grid-gap: 1rem;
    margin-bottom: 1.5rem;
}

.gallery-item {
    display: inline-block;
    text-align: center;
    vertical-align: top;
    width: 100%;
}

.gallery-item img {
    border-radius: 0.5rem;
    width: 100%;
    height: auto;
}

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

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

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

.gallery-columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.gallery-columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

.gallery-columns-7 {
    grid-template-columns: repeat(7, 1fr);
}

.gallery-columns-8 {
    grid-template-columns: repeat(8, 1fr);
}

.gallery-columns-9 {
    grid-template-columns: repeat(9, 1fr);
}

.gallery-caption {
    padding: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
    text-align: center;
}

/* ================================================
   5.0 - SCREEN READER
   ============================================ */

.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;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ================================================
   6.0 - GUTENBERG / BLOCK COMPATIBILITY
   ============================================ */

/* Ensure Gutenberg blocks don't break layout */
.wp-block {
    max-width: 100%;
}

/* Block alignment classes */
.wp-block-image.alignleft,
.wp-block-image.alignright {
    margin-bottom: 1rem;
}

.wp-block-image .alignleft,
.wp-block-image .alignright,
.wp-block-image .aligncenter,
.wp-block-image .alignnone {
    margin-bottom: 0;
}

/* Group block spacing */
.wp-block-group {
    margin-bottom: 1.5rem;
}

/* Cover block */
.wp-block-cover {
    margin-bottom: 1.5rem;
}

/* Buttons block - ensure styling doesn't override Tailwind */
.wp-block-button .wp-block-button__link {
    background: #646c4a;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.wp-block-button .wp-block-button__link:hover {
    background: #55603e;
    transform: translateY(-2px);
}

.wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent;
    color: #646c4a;
    border: 2px solid #646c4a;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: #646c4a;
    color: #ffffff;
}

/* Quote block */
.wp-block-quote {
    border-left: 4px solid #646c4a;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    background: #f9f8f4;
    border-radius: 1rem;
    font-style: italic;
    color: #1a1f2c;
}

.wp-block-quote cite {
    color: #6b7280;
    font-style: normal;
    font-size: 0.875rem;
}

/* Pullquote block */
.wp-block-pullquote {
    padding: 2rem;
    margin: 2rem 0;
    border-top: 4px solid #646c4a;
    border-bottom: 4px solid #646c4a;
}

.wp-block-pullquote blockquote {
    margin: 0;
    font-style: italic;
}

.wp-block-pullquote cite {
    color: #6b7280;
    font-style: normal;
    font-size: 0.875rem;
}

/* Table block */
.wp-block-table {
    margin: 1.5rem 0;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
}

.wp-block-table th {
    background: #646c4a;
    color: #ffffff;
    padding: 0.75rem 1rem;
    text-align: left;
}

.wp-block-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.wp-block-table tr:nth-child(even) {
    background: #f9f8f4;
}

/* List blocks */
.wp-block-list {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.wp-block-list li {
    margin-bottom: 0.5rem;
}

/* Code block */
.wp-block-code {
    background: #1a1f2c;
    color: #e5e7eb;
    padding: 1.5rem;
    border-radius: 1rem;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.875rem;
    margin: 1.5rem 0;
}

/* Preformatted block */
.wp-block-preformatted {
    background: #f3f4f6;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.875rem;
    margin: 1.5rem 0;
}

/* Separator */
.wp-block-separator {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 2rem 0;
}

.wp-block-separator.is-style-dots {
    border: none;
    text-align: center;
}

/* ================================================
   7.0 - COMMENTS
   ============================================ */

/* Comment list */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .comment {
    padding: 1.5rem;
    background: #f9f8f4;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.comment-list .comment .avatar {
    float: left;
    margin-right: 1rem;
    border-radius: 50%;
}

.comment-list .comment .comment-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

.comment-list .comment .comment-author {
    font-weight: 700;
    color: #1a1f2c;
}

.comment-list .comment .comment-content {
    margin-top: 0.5rem;
    color: #4b5563;
}

.comment-list .children {
    list-style: none;
    padding-left: 2.5rem;
    margin-top: 1rem;
}

/* Comment form */
.comment-respond {
    margin-top: 2rem;
}

.comment-respond .comment-reply-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1f2c;
    margin-bottom: 1rem;
}

.comment-respond .comment-form input[type="text"],
.comment-respond .comment-form input[type="email"],
.comment-respond .comment-form input[type="url"],
.comment-respond .comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.comment-respond .comment-form input[type="text"]:focus,
.comment-respond .comment-form input[type="email"]:focus,
.comment-respond .comment-form input[type="url"]:focus,
.comment-respond .comment-form textarea:focus {
    border-color: #646c4a;
    box-shadow: 0 0 0 3px rgba(100, 108, 74, 0.15);
    outline: none;
}

.comment-respond .comment-form .submit {
    background: #646c4a;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-respond .comment-form .submit:hover {
    background: #55603e;
    transform: translateY(-2px);
}

.comment-respond .comment-notes,
.comment-respond .form-allowed-tags {
    font-size: 0.875rem;
    color: #6b7280;
}

.comment-respond .required {
    color: #dc2626;
}

/* ================================================
   8.0 - WIDGETS
   ============================================ */

.widget {
    margin-bottom: 2rem;
}

.widget-title {
    font-weight: 700;
    font-size: 1.125rem;
    color: #1a1f2c;
    margin-bottom: 1rem;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.3s ease;
}

.widget ul li a:hover {
    color: #646c4a;
}

/* Search widget */
.widget_search .search-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.widget_search .search-field:focus {
    border-color: #646c4a;
    box-shadow: 0 0 0 3px rgba(100, 108, 74, 0.15);
    outline: none;
}

.widget_search .search-submit {
    display: inline-block;
    margin-top: 0.5rem;
    background: #646c4a;
    color: #ffffff;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.widget_search .search-submit:hover {
    background: #55603e;
}

/* Calendar widget */
.widget_calendar table {
    width: 100%;
    border-collapse: collapse;
}

.widget_calendar th,
.widget_calendar td {
    padding: 0.25rem 0.5rem;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.widget_calendar caption {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.widget_calendar #today {
    background: #646c4a;
    color: #ffffff;
    border-radius: 0.25rem;
}

/* Tag cloud widget */
.widget_tag_cloud .tagcloud a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin: 0.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 0.75rem !important;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.3s ease;
}

.widget_tag_cloud .tagcloud a:hover {
    background: #646c4a;
    color: #ffffff;
    border-color: #646c4a;
}

/* ================================================
   9.0 - POST NAVIGATION
   ============================================ */

.nav-links {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.nav-links .nav-previous a,
.nav-links .nav-next a {
    color: #646c4a;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-links .nav-previous a:hover,
.nav-links .nav-next a:hover {
    color: #55603e;
}

/* ================================================
   10.0 - RESPONSIVE OVERRIDES
   ============================================ */

/* Responsive gallery columns */
@media (max-width: 1024px) {
    .gallery-columns-4,
    .gallery-columns-5,
    .gallery-columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

    .alignleft,
    .alignright {
        float: none;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    .wp-caption.alignleft,
    .wp-caption.alignright {
        float: none;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    .comment-list .children {
        padding-left: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-columns-2,
    .gallery-columns-3,
    .gallery-columns-4,
    .gallery-columns-5,
    .gallery-columns-6 {
        grid-template-columns: 1fr 1fr;
    }
}