/* ==========================================================================
   The Value of Sparrows — Theme Stylesheet
   --------------------------------------------------------------------------
   Color palette (extracted from original Wayback render):
     #c79796  Primary rose       — accents, buttons, hover, borders
     #a15b58  Dark rose          — links, link hover
     #f5d0d0  Light pink         — ticker border, soft accents
     #cac9cb  Warm gray          — body background
     #898989  Mid gray           — secondary BG, dropdowns
     #303030  Dark gray          — heading text, footer bg
     #464647  Body text          — paragraph color
     #191919  Near-black         — deep accents
   Typography: Noto Sans (body + headings), Open Sans fallback.
   ========================================================================== */

/* ---------- CSS Custom Properties (for customizer overrides) ------------ */
:root {
    --tvos-color-primary: #c79796;
    --tvos-color-link: #a15b58;
    --tvos-color-accent-soft: #f5d0d0;
    --tvos-color-bg: #cac9cb;
    --tvos-color-secondary: #898989;
    --tvos-color-heading: #303030;
    --tvos-color-text: #464647;
    --tvos-color-dark: #191919;
    --tvos-color-footer-bg: #303030;
    --tvos-color-footer-text: #ffffff;

    --tvos-font-body: "Noto Sans", "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    --tvos-font-heading: "Noto Sans", "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;

    --tvos-max-width: 1200px;
    --tvos-gutter: 30px;
}

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

html {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--tvos-font-body);
    color: var(--tvos-color-text);
    background-color: var(--tvos-color-bg);
    font-size: 1rem;
    line-height: 1.7;
}

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

a {
    color: var(--tvos-color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--tvos-color-link);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--tvos-font-heading);
    color: var(--tvos-color-heading);
    font-weight: 400;
    line-height: 1.3;
    margin: 0 0 0.6em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.05rem; }
h6 { font-size: 0.95rem; }

p {
    margin: 0 0 1.2em;
}

blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background: var(--tvos-color-bg);
    border-left: 4px solid var(--tvos-color-primary);
    color: #4c4c4c;
    font-style: italic;
}

/* ---------- Accessibility ----------------------------------------------- */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    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;
}

/* ---------- Layout container ------------------------------------------- */
.tvos-container {
    max-width: var(--tvos-max-width);
    margin: 0 auto;
    padding: 0 var(--tvos-gutter);
}

/* ---------- Header & Hero ---------------------------------------------- */
.tvos-header {
    background: #fff;
}

.tvos-hero {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    min-height: 380px;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 30px 40px;
}

.tvos-hero-inner {
    text-align: right;
    max-width: 500px;
}

.tvos-site-title {
    font-size: 2.5rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    line-height: 1.1;
    color: var(--tvos-color-heading);
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.4);
}

.tvos-site-title a {
    color: inherit;
}

.tvos-site-description {
    font-style: italic;
    margin: 5px 0 0;
    color: var(--tvos-color-heading);
    font-size: 1rem;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.4);
}

/* ---------- Main Navigation -------------------------------------------- */
.tvos-main-nav {
    background: var(--tvos-color-heading);
    border-top: 3px solid var(--tvos-color-primary);
}

.tvos-menu-toggle {
    display: none;
    background: transparent;
    color: #fff;
    border: 0;
    padding: 12px 20px;
    font-size: 1.2rem;
    cursor: pointer;
}

.tvos-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: var(--tvos-max-width);
    margin-left: auto;
    margin-right: auto;
}

.tvos-menu li {
    position: relative;
}

.tvos-menu li a {
    display: block;
    padding: 14px 18px;
    color: #fff;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.tvos-menu li:hover > a,
.tvos-menu li.current-menu-item > a {
    background: var(--tvos-color-primary);
    color: var(--tvos-color-heading);
}

.tvos-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--tvos-color-secondary);
    display: none;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.tvos-menu .sub-menu li a {
    padding: 10px 15px;
    text-transform: none;
    font-size: 0.85rem;
}

.tvos-menu .sub-menu li:hover > a {
    background: var(--tvos-color-primary);
    color: var(--tvos-color-dark);
}

/* ---------- Secondary Navigation (book series) ------------------------- */
.tvos-secondary-nav {
    background: var(--tvos-color-primary);
}

.tvos-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: var(--tvos-max-width);
    margin-left: auto;
    margin-right: auto;
}

.tvos-submenu li a {
    display: block;
    padding: 10px 14px;
    color: var(--tvos-color-heading);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tvos-submenu li a:hover {
    color: #fff;
    background: rgba(0, 0, 0, 0.1);
}

/* ---------- Main Content Area ------------------------------------------ */
.tvos-content {
    padding: 40px 0;
}

.tvos-main-wrap {
    max-width: var(--tvos-max-width);
    margin: 0 auto;
    padding: 0 var(--tvos-gutter);
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.tvos-main {
    min-width: 0;
}

.tvos-sidebar {
    min-width: 0;
}

/* Single column layout for posts/pages without sidebar */
.tvos-main-wrap.full-width {
    grid-template-columns: 1fr;
}

/* ---------- Post / Article -------------------------------------------- */
.tvos-post,
.tvos-page {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-bottom: 3px solid var(--tvos-color-primary);
}

.tvos-post-title {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.tvos-post-title a {
    color: var(--tvos-color-heading);
}

.tvos-post-title a:hover {
    color: var(--tvos-color-link);
}

.tvos-post-meta {
    color: var(--tvos-color-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.2em;
}

.tvos-post-meta a {
    color: var(--tvos-color-secondary);
}

.tvos-post-meta a:hover {
    color: var(--tvos-color-link);
}

.tvos-post-thumbnail {
    margin-bottom: 1.2em;
    margin-left: -30px;
    margin-right: -30px;
    margin-top: -30px;
}

.tvos-post-thumbnail img {
    width: 100%;
    height: auto;
}

.tvos-entry-content a {
    color: var(--tvos-color-link);
    text-decoration: underline;
}

.tvos-entry-content a:hover {
    color: var(--tvos-color-primary);
}

.tvos-readmore {
    display: inline-block;
    margin-top: 1em;
    padding: 8px 16px;
    background: var(--tvos-color-primary);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.2s ease;
}

.tvos-readmore:hover {
    background: var(--tvos-color-link);
    color: #fff !important;
}

/* ---------- Homepage Grid (front-page) -------------------------------- */
.tvos-home-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.tvos-home-grid .tvos-card {
    background: #fff;
    border-bottom: 3px solid var(--tvos-color-primary);
    overflow: hidden;
}

.tvos-home-grid .tvos-card-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.tvos-home-grid .tvos-card-body {
    padding: 18px;
}

.tvos-home-grid .tvos-card-title {
    font-size: 1.05rem;
    margin: 0 0 0.5em;
    line-height: 1.3;
}

.tvos-home-grid .tvos-card-title a {
    color: var(--tvos-color-heading);
}

.tvos-home-grid .tvos-card-excerpt {
    font-size: 0.9rem;
    color: var(--tvos-color-text);
    margin: 0;
}

.tvos-section-title {
    border-bottom: 2px solid var(--tvos-color-primary);
    padding-bottom: 8px;
    margin: 0 0 20px;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tvos-section-title a {
    color: var(--tvos-color-heading);
}

/* ---------- Sidebar Widgets ------------------------------------------- */
.tvos-sidebar .widget {
    background: #fff;
    padding: 20px;
    margin-bottom: 25px;
    border-bottom: 3px solid var(--tvos-color-primary);
}

.tvos-sidebar .widget-title,
.tvos-sidebar h2.widget-title {
    border-bottom: 2px solid var(--tvos-color-primary);
    padding-bottom: 8px;
    margin: 0 0 15px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tvos-color-heading);
}

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

.tvos-sidebar ul li {
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.tvos-sidebar ul li:last-child {
    border-bottom: 0;
}

.tvos-sidebar ul li a {
    color: var(--tvos-color-text);
}

.tvos-sidebar ul li a:hover {
    color: var(--tvos-color-link);
}

/* ---------- Footer Widgets (4-column) --------------------------------- */
.tvos-footer-widgets {
    background: var(--tvos-color-secondary);
    color: #fff;
    padding: 40px 0;
}

.tvos-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.tvos-footer-col {
    color: #fff;
}

.tvos-footer-col a {
    color: #fff;
}

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

.tvos-footer-col .widget-title,
.tvos-footer-col h2.widget-title,
.tvos-footer-col h6.footer-widget-title {
    color: #fff;
    border-bottom: 2px solid var(--tvos-color-primary);
    padding-bottom: 8px;
    margin: 0 0 15px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.tvos-footer-col ul li {
    padding: 5px 0;
}

/* ---------- Custom Post Widget (mh_custom_posts replica) -------------- */
.tvos-cpw-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.2);
}

.tvos-cpw-item:last-child {
    border-bottom: 0;
}

.tvos-cpw-thumb {
    flex: 0 0 80px;
}

.tvos-cpw-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.tvos-cpw-content {
    flex: 1;
    min-width: 0;
}

.tvos-cpw-title {
    font-size: 0.85rem;
    margin: 0 0 5px;
    line-height: 1.3;
}

.tvos-cpw-title a {
    color: inherit;
}

.tvos-cpw-meta {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Light variant for sidebar custom post widgets */
.tvos-sidebar .tvos-cpw-item {
    border-bottom: 1px solid #eee;
}

.tvos-sidebar .tvos-cpw-title a {
    color: var(--tvos-color-heading);
}

/* ---------- Site Footer (copyright bar) ------------------------------- */
.tvos-site-footer {
    background: var(--tvos-color-footer-bg);
    color: var(--tvos-color-footer-text);
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
}

.tvos-site-footer a {
    color: var(--tvos-color-primary);
}

.tvos-site-footer a:hover {
    color: #fff;
}

/* ---------- Pagination ------------------------------------------------ */
.tvos-pagination {
    text-align: center;
    margin: 30px 0;
}

.tvos-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    background: var(--tvos-color-primary);
    color: #fff;
    text-decoration: none;
    transition: background 0.2s ease;
}

.tvos-pagination .page-numbers:hover,
.tvos-pagination .page-numbers.current {
    background: var(--tvos-color-link);
}

/* ---------- Comments -------------------------------------------------- */
.tvos-comments {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
}

.tvos-comments h2 {
    border-bottom: 2px solid var(--tvos-color-primary);
    padding-bottom: 8px;
    margin: 0 0 20px;
}

.tvos-comments .comment {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.tvos-comments .comment-author {
    font-weight: 600;
    color: var(--tvos-color-heading);
}

.tvos-comments .comment-meta {
    font-size: 0.85rem;
    color: var(--tvos-color-secondary);
    margin-bottom: 8px;
}

/* ---------- Forms ----------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    background: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--tvos-color-primary);
}

input[type="submit"],
button[type="submit"],
.tvos-btn {
    display: inline-block;
    padding: 10px 22px;
    background: var(--tvos-color-primary);
    color: #fff;
    border: 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s ease;
}

input[type="submit"]:hover,
button[type="submit"]:hover,
.tvos-btn:hover {
    background: var(--tvos-color-link);
    color: #fff;
}

/* Search form */
.tvos-search-form {
    display: flex;
    gap: 0;
}

.tvos-search-form input[type="search"] {
    flex: 1;
    border-right: 0;
}

.tvos-search-form button {
    padding: 10px 16px;
}

/* ---------- 404 Page -------------------------------------------------- */
.tvos-404 {
    background: #fff;
    padding: 60px 30px;
    text-align: center;
}

.tvos-404 h1 {
    font-size: 5rem;
    color: var(--tvos-color-primary);
    margin: 0;
}

/* ---------- Responsive ------------------------------------------------ */
@media screen and (max-width: 980px) {
    .tvos-main-wrap {
        grid-template-columns: 1fr;
    }

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

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

@media screen and (max-width: 720px) {
    :root {
        --tvos-gutter: 18px;
    }

    .tvos-site-title {
        font-size: 1.8rem;
    }

    .tvos-hero {
        min-height: 240px;
        padding: 20px;
    }

    .tvos-menu-toggle {
        display: block;
        width: 100%;
        text-align: left;
    }

    .tvos-menu {
        display: none;
        flex-direction: column;
    }

    .tvos-menu.is-open {
        display: flex;
    }

    .tvos-menu li {
        width: 100%;
    }

    .tvos-menu li a {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .tvos-menu .sub-menu {
        position: static;
        display: block;
        background: rgba(0, 0, 0, 0.2);
        box-shadow: none;
    }

    .tvos-submenu {
        flex-direction: column;
    }

    .tvos-home-grid {
        grid-template-columns: 1fr;
    }

    .tvos-footer-grid {
        grid-template-columns: 1fr;
    }

    .tvos-post,
    .tvos-page,
    .tvos-comments {
        padding: 18px;
    }

    .tvos-post-thumbnail {
        margin-left: -18px;
        margin-right: -18px;
        margin-top: -18px;
    }
}

/* ---------- WordPress Core Classes (alignments, captions) ------------- */
.alignleft  { float: left;  margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }

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

.wp-caption-text {
    font-size: 0.85rem;
    color: var(--tvos-color-secondary);
    text-align: center;
    margin-top: 5px;
    font-style: italic;
}

.sticky { /* Sticky post highlight */ }
.gallery-caption {}
.bypostauthor {}

/* ==========================================================================
   Auth Buttons (Login & Daftar)
   --------------------------------------------------------------------------
   Desktop: docked right inside the main nav bar.
   Mobile (<980px): floating sticky button group, top-right.
   Order: Login first, then Daftar (per user spec).
   Style: Outline button — border only, no fill, fills on hover.
   ========================================================================== */

/* Nav bar becomes a flex container so menu + auth buttons share one row. */
.tvos-main-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* Main menu still centers / fills available space; container max-width keeps it aligned with site. */
.tvos-main-nav .tvos-menu {
    flex: 1;
}

/* Auth button group — desktop default. */
.tvos-auth-buttons {
    display: flex;
    gap: 8px;
    padding: 0 18px;
    align-items: center;
}

.tvos-auth-btn {
    display: inline-block;
    padding: 7px 18px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid var(--tvos-color-primary);
    color: #fff;
    background: transparent;
    text-decoration: none;
    line-height: 1.2;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tvos-auth-btn:hover,
.tvos-auth-btn:focus {
    background: var(--tvos-color-primary);
    color: var(--tvos-color-heading);
    border-color: var(--tvos-color-primary);
}

/* Mobile: floating sticky top-right (≤980px). */
@media screen and (max-width: 980px) {
    .tvos-auth-buttons {
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 9999;
        padding: 0;
        background: rgba(48, 48, 48, 0.92);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        border-radius: 4px;
        padding: 6px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .tvos-auth-btn {
        padding: 6px 12px;
        font-size: 0.72rem;
        border-width: 1px;
    }

    /* Push down when WordPress admin bar is showing. */
    body.admin-bar .tvos-auth-buttons {
        top: 58px;
    }
}

@media screen and (max-width: 480px) {
    .tvos-auth-buttons {
        top: 8px;
        right: 8px;
        padding: 4px;
        gap: 4px;
    }

    .tvos-auth-btn {
        padding: 5px 10px;
        font-size: 0.68rem;
        letter-spacing: 0.03em;
    }

    body.admin-bar .tvos-auth-buttons {
        top: 50px;
    }
}
