/*
Theme Name: Adot Minimalis
Author: Sandy Firmansyah
Description: Theme WordPress ultra-minimalis, super cepat, dan SEO-ready tanpa plugin.
Version: 11.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: adot-minimalis
Tags: blog, one-column, two-columns, right-sidebar, custom-logo, post-formats, custom-background, custom-header, editor-style, wide-blocks
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
*/

/*
Copyright 2025 Sandy Firmansyah
This theme is licensed under the GNU General Public License v2 or later.
*/

/* --- Global & Reset --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    /* Reduced from 1.7 for tighter professional look */
    color: #212121;
    background: #fff;
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #111;
}

.entry-title,
.page-title {
    line-height: 1.25;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: #2C8E4A;
    text-decoration: none;
}

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

/* --- Accessibility: keyboard focus --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #2C8E4A;
    outline-offset: 2px;
}

/* --- Accessibility: underline links in content/comments/widgets --- */
.post-content a,
.page-content a,
.post-excerpt a,
.comment-content a,
.widget_text a,
.textwidget a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- WordPress Core CSS Classes --- */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.alignleft {
    float: left;
    margin: 0.5em 1em 0.5em 0;
}

.alignright {
    float: right;
    margin: 0.5em 0 0.5em 1em;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    max-width: 100%;
    margin-bottom: 1.5em;
}

.wp-caption-text {
    text-align: center;
    font-size: 12px;
    color: #555;
    margin: 0.5em 0;
}

.gallery-caption {
    text-align: center;
    font-size: 12px;
    color: #555;
    margin: 0.5em 0;
}

.sticky {
    background: #f5f5f5;
    padding: 20px;
    border-left: 3px solid #2C8E4A;
}

.bypostauthor>.comment-body {
    border-left: 2px solid #2C8E4A;
    padding-left: 15px;
}


/* --- Header --- */
.site-header {
    padding: 8px 0;
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-branding .custom-logo {
    max-height: 45px;
    width: auto;
    height: 45px;
    /* Fixed height for SVG */
}

.custom-logo-link {
    display: inline-block;
    /* Fix for collapsed link */
}


/* =================================
   MOBILE FIRST LAYOUT (Default)
   ================================= */

/* --- Mobile Header Layout --- */
.site-branding,
.main-navigation {
    order: 1;
}

.header-search {
    order: 2;
    width: 100%;
    margin-top: 15px;
}

.search-form {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 400px;
    /* Limit width */
}

.search-form label {
    display: none;
    /* Hide label */
}

.search-form .search-field {
    flex: 1;
    width: auto;
    border: 1px solid #2C8E4A;
    border-right: none;
    padding: 10px 15px;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    color: #333;
    outline: none;
}

.search-form .search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    position: static;
    width: 50px;
    height: auto;
    background-color: #2C8E4A;
    color: #fff;
    border: 1px solid #2C8E4A;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s;
}

.search-form .search-submit:hover {
    background-color: #24753cfe;
}

.search-form .search-submit svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}


/* --- Mobile Navigation --- */
.menu-toggle {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger-icon {
    display: block;
    position: relative;
    width: 22px;
    height: 2px;
    background-color: #333;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background-color: #333;
    left: 0;
    transition: all 0.2s ease-in-out;
}

.hamburger-icon::before {
    top: -7px;
}

.hamburger-icon::after {
    top: 7px;
}

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

.main-navigation .menu {
    display: none;
}

.main-navigation.toggled .menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 10px 0;
    border-top: 1px solid #e9e9e9;
}

.main-navigation li {
    display: block;
    position: relative;
}

.main-navigation a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    transition: color 0.2s;
}

.main-navigation a:hover {
    color: #2C8E4A;
}

.dropdown-toggle {
    position: static;
    width: auto;
    height: auto;
    padding: 0 10px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.arrow-down {
    border: solid #555;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.2s;
}

.main-navigation .menu-item-has-children.is-toggled>a .arrow-down {
    transform: rotate(-135deg);
}

.main-navigation .sub-menu {
    display: none;
    padding-left: 0;
    background: #f9f9f9;
}

.main-navigation .menu-item-has-children.is-toggled>.sub-menu {
    display: block;
}

.main-navigation .sub-menu a {
    display: block;
    padding: 10px 20px 10px 30px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}


/* --- Hero Section & Main Content --- */
.hero-section {
    background-color: #f9f9f9;
    padding: 40px 0;
    border-bottom: 1px solid #e9e9e9;
}

.main-content-area {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding-top: 40px;
}

.hero-grid,
.archive-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
    margin-bottom: 40px;
}

.hero-grid-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background-color: #eee;
    aspect-ratio: 4/3;
}

.hero-grid-item img,
.post-thumbnail-list img,
.post-thumbnail-single img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hero-grid-item:hover img,
.post-thumbnail-list a:hover img,
.post-thumbnail-single:hover img {
    transform: scale(1.05);
}

.hero-item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
    margin: 0;
    padding: 30px 20px 20px;
    font-size: 18px;
}

/* Post List Item styling is now handled by internal structure */
.post-item-list {
    display: block !important;
    /* Force stack layout */
    width: 100%;
    margin-bottom: 50px;
    border-bottom: 1px solid #eee;
    padding-bottom: 40px;
}

.post-list-header {
    display: block !important;
    width: 100%;
}

.post-item-list:last-child {
    border-bottom: none;
}

/* Fix vertical alignment of excerpt text vs image */
.post-excerpt p:first-of-type {
    margin-top: 0;
}

/* Post List Hover Effects */
.post-thumb-wrapper img {
    transition: transform 0.3s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-thumb-wrapper:hover img {
    transform: scale(1.05);
}

.post-list-header .post-title a {
    transition: color 0.2s ease;
}

/* Load More Button */
.load-more-button {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 15px !important;
    background-color: var(--adot-btn-bg);
    color: var(--adot-btn-text);
    min-width: 200px;
    padding: 25px 50px;
    margin: 100px auto 120px;
    border: none !important;
    border-radius: 0 !important;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.load-more-button span {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: 1px;
}

.load-more-button .load-more-icon {
    display: block !important;
    float: none !important;
    position: static !important;
    margin: 0 !important;
    transition: transform 0.5s ease;
}

.load-more-button:hover {
    background-color: var(--adot-btn-bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.load-more-button:active {
    transform: translateY(1px);
}

.load-more-button:hover .load-more-icon {
    transform: rotate(180deg);
}

.load-more-button.loading .load-more-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.post-list-header .post-title a:hover {
    color: var(--adot-primary-hover) !important;
}

/* Mobile Responsive for Post List */
@media screen and (max-width: 768px) {
    .post-list-body {
        flex-direction: column;
    }

    .post-thumb-wrapper {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 15px;
    }
}

.post-thumbnail-list {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

#secondary.widget-area {
    width: 100%;
}

.post-thumbnail-single {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

.single-post-container .post-header {
    overflow: visible;
}

.single-post-container .post-meta {
    float: none;
    text-align: left;
    margin: 20px 0;
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

.single-post-container .post-meta a {
    color: #2C8E4A;
    text-decoration: underline;
}

/* Sembunyikan item hero ke-4 dst di mobile */
.hero-grid-item:nth-child(n+4) {
    display: none;
}

/* Styling untuk Marquee */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.marquee-section {
    width: 100%;
    overflow: hidden;
    padding: 10px 0;
    background-color: #333;
    color: #fff;
    border-bottom: 1px solid #444;
}

.marquee-inner {
    display: flex;
    width: fit-content;
    animation: marquee 80s linear infinite;
}

.marquee-content {
    display: flex;
    white-space: nowrap;
    flex-shrink: 0;
    align-items: center;
    /* Ensures text and separator are vertically centered */
}

.marquee-content a {
    color: #fff;
    padding: 0 15px;
    font-size: 14px;
    font-weight: 500;
}

.marquee-content a:hover {
    text-decoration: underline;
}

.marquee-content .marquee-separator {
    color: #2C8E4A;
}


/* =================================
   DESKTOP LAYOUT
   ================================= */
@media screen and (min-width: 769px) {

    /* Header Desktop */
    .site-branding,
    .main-navigation {
        order: 1;
    }

    .header-search {
        order: 2;
        width: auto;
        margin-top: 0;
    }

    .header-inner {
        flex-wrap: nowrap;
    }

    .menu-toggle {
        display: none;
    }

    .main-navigation .menu {
        display: flex !important;
        position: static;
        background: none;
        box-shadow: none;
        width: auto;
    }

    .main-navigation .menu>li {
        margin-left: 10px;
    }

    .main-navigation .menu>li:first-child {
        margin-left: 0;
    }

    .main-navigation a {
        border: none;
        padding: 10px 15px;
        border-radius: 4px;
    }

    .main-navigation a:hover {
        background-color: #f5f5f5;
        color: #2C8E4A;
    }

    .main-navigation .menu-item-has-children>a {
        padding-right: 40px;
        position: relative;
    }

    .main-navigation .menu-item-has-children .dropdown-toggle {
        display: block;
        position: absolute;
        top: 50%;
        right: 15px;
        transform: translateY(-50%);
        pointer-events: none;
    }

    .main-navigation .sub-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        min-width: 220px;
        border: 1px solid #eee;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    }

    .main-navigation li:hover>.sub-menu {
        display: block;
    }

    .main-navigation .sub-menu a {
        border-bottom: none;
    }

    .main-navigation .sub-menu a:hover {
        background-color: #2C8E4A;
        color: #fff;
    }

    /* Content Layout Desktop */
    .main-content-area {
        flex-direction: row;
        align-items: flex-start;
    }

    #primary.content-area {
        flex: 1;
    }

    #secondary.widget-area {
        flex-basis: 300px;
        flex-shrink: 0;
        position: -webkit-sticky;
        position: sticky;
        top: 80px;
    }

    .post-item-list {
        flex-direction: row;
        align-items: center;
    }

    .post-thumbnail-list {
        width: 300px;
        flex-shrink: 0;
        aspect-ratio: 3 / 2;
    }

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

    .hero-grid-item:nth-child(n+4) {
        display: block;
    }
}

@media screen and (min-width: 992px) {

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

/* --- Lainnya --- */
.archive-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9e9e9;
}

.archive-header .page-title {
    font-size: 32px;
}

.archive-description {
    color: #555;
    font-size: 16px;
    margin-top: 10px;
}

.pagination {
    margin: 40px 0;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.page-numbers {
    display: block;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
}

.page-numbers.current,
.page-numbers:hover {
    background-color: #2C8E4A;
    color: #fff;
    border-color: #2C8E4A;
}

.widget {
    margin-bottom: 30px;
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9e9e9;
    color: #111;
    letter-spacing: -0.5px;
}

.widget-area .widget a {
    color: #111;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.4;
    transition: color 0.2s;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
}

.widget-area .widget a:hover {
    color: #2C8E4A;
    text-decoration: underline;
}

.widget .post-date {
    display: block;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: 5px;
}

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

.widget ul li {
    margin-bottom: 25px;
    padding-bottom: 0;
    border-bottom: none;
    display: flex;
    flex-direction: column;
}

.widget ul li:last-child {
    margin-bottom: 0;
}

.sidebar-inner {
    border: 1px solid #e9e9e9;
    padding: 20px;
    border-radius: 8px;
}

.site-footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px 20px;
    font-size: 14px;
    color: #555;
    border-top: 1px solid #e9e9e9;
}

.post-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9e9e9;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.post-footer>span {
    margin-right: 15px;
}

.post-footer span span {
    font-weight: bold;
    color: #333;
    margin-right: 8px;
}

.post-footer a {
    text-decoration: underline;
    text-decoration-color: #ddd;
    text-decoration-thickness: 1px;
}

.post-footer a:hover {
    text-decoration-color: #2C8E4A;
}

.comments-area,
.comment-respond {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e9e9e9;
}

.comments-area ol {
    list-style: none;
    padding: 0;
}

.comment-form input[type="submit"] {
    background-color: #2C8E4A;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.tag-cloud a {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 6px 6px 0;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 14px !important;
}

/* Sidebar / Gutenberg Search Widget Fix */
.wp-block-search__inside-wrapper {
    display: flex !important;
    gap: 0 !important;
    width: 100%;
    border: none;
    padding: 0;
}

.wp-block-search .wp-block-search__input {
    border-radius: 4px 0 0 4px !important;
    border: 1px solid #2C8E4A !important;
    border-right: none !important;
    margin-right: 0 !important;
    padding: 10px 15px !important;
    flex-grow: 1;
    max-width: unset;
}

.wp-block-search .wp-block-search__button {
    border-radius: 0 4px 4px 0 !important;
    margin-left: 0 !important;
    padding: 10px 20px !important;
    background-color: #2C8E4A !important;
    color: #fff !important;
    border: 1px solid #2C8E4A !important;
    transition: background-color 0.3s ease;
}

.wp-block-search .wp-block-search__button:hover {
    background-color: #24753c !important;
}

.wp-block-search .wp-block-search__label {
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
    color: #333;
}

/* Force Category Text Size Update */
.adot-rp-cat,
.widget-area .widget .adot-rp-cat {
    font-size: 10px !important;
    line-height: 1.2;
    margin-bottom: 3px;
    color: var(--adot-primary) !important;
}

/* Custom Adot Recent Posts Widget */
.adot-recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Fix Sidebar Headings for Gutenberg Groups */
#secondary .wp-block-heading,
#secondary h2:not(.widget-title) {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 35px !important;
    /* More spacing */
    padding-bottom: 15px;
    border-bottom: 1px solid #e9e9e9;
    color: #111;
    letter-spacing: -0.5px;
    margin-top: 0;
    line-height: 1.4;
}

.adot-rp-item {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

.adot-rp-item:last-child {
    margin-bottom: 0;
}

.adot-rp-cat {
    display: inline-block;
    color: #448AFF;
    /* Standard Business Blue */
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    text-decoration: none !important;
}

.adot-rp-cat:hover {
    text-decoration: underline !important;
}

.adot-rp-title {
    margin: 0 0 5px;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;
}

.adot-rp-title a {
    color: #111;
    text-decoration: none;
    transition: color 0.2s;
}

.adot-rp-title a:hover {
    color: #2C8E4A;
}

.adot-rp-meta {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.adot-rp-sep {
    margin: 0 5px;
}

/* 404 Page Specifics: Center Search Form */
.search-wrapper-404 {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Ensure inner form is flexible but centered */
.search-wrapper-404 .search-form {
    flex-grow: 0;
    width: 100%;
    max-width: 400px;
    margin: 0 auto !important;
}

/* Page Builder Canvas Template */
.page-builder-canvas {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    display: block !important;
    float: none !important;
    display: block !important;
}

/* Footer Social Icons */
.adot-social-icons {
    display: flex;
    gap: 15px;
    /* Increased to 15px */
    align-items: center;
    flex-wrap: wrap;
}

.adot-social-icons .social-link {
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.adot-social-icons .social-link:hover {
    color: var(--adot-primary);
    transform: translateY(-2px);
}

.adot-social-icons svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    /* Use text color for fill */
}