/*
Theme Name: abFilmy
Theme URI: https://abfilmy.com
Author: Ramesh Dhakal
Author URI: https://rameshcodes.dev
Description: Lightweight Nepali entertainment news magazine theme.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: abfilmy
*/

/* -------------------------------------------------------------------------- */
/* Design tokens                                                              */
/* -------------------------------------------------------------------------- */
:root {
    --ab-bg:           #ffffff;
    --ab-fg:           #111111;
    --ab-muted:        #6b6b6b;
    --ab-border:       #e6e6e6;
    --ab-border-strong:#111111;
    --ab-accent:       #d6001c;
    --ab-accent-hover: #a80016;
    --ab-overlay:      rgba(17, 17, 17, 0.55);

    --ab-container:    1280px;
    --ab-radius:       2px;

    --ab-font-sans:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --ab-font-serif:   "Playfair Display", "Times New Roman", Georgia, serif;

    --ab-shadow-pop:   0 12px 32px rgba(0, 0, 0, 0.12);
}

/* -------------------------------------------------------------------------- */
/* Base                                                                       */
/* -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--ab-font-sans);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ab-fg);
    background: var(--ab-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--ab-accent); }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    background: var(--ab-fg);
    color: #fff;
    padding: 12px 16px;
}
.skip-link:focus {
    left: 16px;
    top: 16px;
}

.site {
    max-width: var(--ab-container);
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
}

/* -------------------------------------------------------------------------- */
/* Header                                                                     */
/* -------------------------------------------------------------------------- */
.site-header {
    background: var(--ab-bg);
    border-top: 3px solid var(--ab-fg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__container {
    max-width: var(--ab-container);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.site-header__bar {
    border-bottom: 1px solid var(--ab-border);
}

.site-header__bar .site-header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 84px;
}

/* Branding ----------------------------------------------------------------- */
.site-branding {
    display: flex;
    align-items: center;
}

.site-title {
    margin: 0;
    line-height: 1;
    letter-spacing: -0.02em;
}

.site-title a {
    font-family: var(--ab-font-serif);
    font-weight: 900;
    font-style: italic;
    font-size: clamp(2rem, 4vw, 2.75rem);
    color: var(--ab-accent);
    display: inline-flex;
    align-items: baseline;
    text-decoration: none;
}

.site-title a:hover { color: var(--ab-accent-hover); }
.site-title__mark { color: var(--ab-accent); }
.site-title__rest { color: var(--ab-fg); }

.custom-logo-link img,
.custom-logo {
    max-height: 56px;
    width: auto;
}

/* Actions (search + hamburger) -------------------------------------------- */
.site-header__actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header-icon {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    color: var(--ab-fg);
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--ab-radius);
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.header-icon:hover {
    background: #f5f5f5;
    color: var(--ab-accent);
}

.header-icon:focus-visible {
    outline: 2px solid var(--ab-accent);
    outline-offset: 2px;
}

.header-icon[aria-expanded="true"] {
    background: var(--ab-fg);
    color: #fff;
}

.header-icon svg { display: block; }

.header-icon--menu { display: none; }

/* Primary navigation ------------------------------------------------------- */
.site-nav {
    border-bottom: 1px solid var(--ab-border);
    background: var(--ab-bg);
}

.site-nav__container {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
}

.site-nav__toggle {
    appearance: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: auto;
    padding: 0.7rem 0;
    margin-right: 0.5rem;
    border-right: 1px solid var(--ab-border);
    align-self: stretch;
    color: var(--ab-fg);
    flex: 0 0 auto;
    transition: background-color 150ms ease, color 150ms ease;
}

.site-nav__toggle:hover,
.site-nav__toggle[aria-expanded="true"] {
    background: var(--ab-accent);
    color: #fff;
}

.site-nav__toggle:focus-visible {
    outline: 2px solid var(--ab-accent);
    outline-offset: 2px;
}

.site-nav__toggle svg { display: block; }

.site-nav__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    flex: 1;
}

.site-nav__menu > li {
    position: relative;
}

.site-nav__menu > li > a {
    display: inline-block;
    padding: 0.95rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ab-fg);
    transition: color 150ms ease;
}

.site-nav__menu > li > a:hover,
.site-nav__menu > li.current-menu-item > a,
.site-nav__menu > li.current-menu-parent > a {
    color: var(--ab-accent);
}

.site-nav__menu > li > a::after {
    content: "";
    display: block;
    height: 2px;
    width: 0;
    background: var(--ab-accent);
    transition: width 180ms ease;
    margin-top: 4px;
}

.site-nav__menu > li:hover > a::after,
.site-nav__menu > li.current-menu-item > a::after {
    width: 100%;
}

/* Search panel ------------------------------------------------------------- */
.site-search-panel {
    border-bottom: 1px solid var(--ab-border);
    background: #fafafa;
    animation: ab-slide-down 220ms ease;
}

.site-search-panel__form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
}

.site-search-panel__field {
    flex: 1;
    appearance: none;
    border: 1px solid var(--ab-border);
    background: #fff;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--ab-fg);
    border-radius: var(--ab-radius);
}

.site-search-panel__field:focus {
    outline: 2px solid var(--ab-accent);
    outline-offset: 1px;
    border-color: transparent;
}

.site-search-panel__submit {
    appearance: none;
    border: 0;
    background: var(--ab-fg);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.85rem 1.3rem;
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: var(--ab-radius);
    transition: background-color 150ms ease;
}

.site-search-panel__submit:hover { background: var(--ab-accent); }

.site-search-panel__close {
    appearance: none;
    background: transparent;
    border: 0;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--ab-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 150ms ease, color 150ms ease;
}
.site-search-panel__close:hover {
    background: #eee;
    color: var(--ab-fg);
}

/* Mega menu (desktop only — opened by .site-nav__toggle) ------------------ */
.mega-menu {
    position: fixed;
    inset: 0;
    background: var(--ab-overlay);
    z-index: 200;
    animation: ab-fade-in 180ms ease;
}

.mega-menu__inner {
    background: var(--ab-bg);
    max-width: min(720px, 92vw);
    height: 100%;
    overflow-y: auto;
    box-shadow: var(--ab-shadow-pop);
    animation: ab-slide-in-left 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.mega-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--ab-border);
    position: sticky;
    top: 0;
    background: var(--ab-bg);
    z-index: 1;
}

.mega-menu__heading {
    font-family: var(--ab-font-serif);
    font-style: italic;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--ab-fg);
}

.mega-menu__close {
    appearance: none;
    background: transparent;
    border: 0;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--ab-fg);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: background-color 150ms ease;
}
.mega-menu__close:hover { background: #f0f0f0; }

.mega-menu__body {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

.mega-menu__categories {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1.5rem;
}

.mega-menu__category {
    border-bottom: 1px solid var(--ab-border);
    padding-bottom: 1.25rem;
}

.mega-menu__category:last-child { border-bottom: 0; }

.mega-menu__category-link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-family: var(--ab-font-serif);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--ab-fg);
    margin-bottom: 0.65rem;
}

.mega-menu__category-link:hover { color: var(--ab-accent); }

.mega-menu__count {
    font-family: var(--ab-font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--ab-muted);
}

.mega-menu__posts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.mega-menu__posts a {
    display: inline-block;
    font-size: 0.95rem;
    color: var(--ab-fg);
    line-height: 1.45;
    padding: 0.15rem 0;
}

.mega-menu__posts a:hover { color: var(--ab-accent); }

.mega-menu__empty {
    color: var(--ab-muted);
    font-style: italic;
}

body.ab-no-scroll { overflow: hidden; }

/* Animations --------------------------------------------------------------- */
@keyframes ab-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes ab-slide-in-left {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}
@keyframes ab-slide-down {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------- */
/* Responsive                                                                 */
/* -------------------------------------------------------------------------- */
@media (max-width: 780px) {
    .site-header__bar .site-header__container { min-height: 68px; }
    .site-title a { font-size: 1.85rem; }

    .header-icon--menu { display: inline-flex; }

    .site-nav__toggle { display: none; }

    .site-nav { display: none; }
    .site-nav.is-open {
        display: block;
        animation: ab-slide-down 200ms ease;
        border-top: 1px solid var(--ab-border);
    }

    .site-nav__menu {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        overflow: visible;
    }
    .site-nav__menu > li {
        width: 100%;
        border-bottom: 1px solid var(--ab-border);
    }
    .site-nav__menu > li:last-child { border-bottom: 0; }
    .site-nav__menu > li > a {
        display: block;
        width: 100%;
        padding: 0.95rem 1.25rem;
        font-size: 0.85rem;
        white-space: normal;
    }
    .site-nav__menu > li > a::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .site-search-panel,
    .mega-menu,
    .mega-menu__inner {
        animation: none;
    }
}

/* -------------------------------------------------------------------------- */
/* Footer                                                                     */
/* -------------------------------------------------------------------------- */
.site-footer {
    position: relative;
    background:
        radial-gradient(1200px 400px at 80% 0%, rgba(214, 0, 28, 0.05), transparent 60%),
        linear-gradient(180deg, #fafafa 0%, #f1f1f1 100%);
    color: var(--ab-fg);
    margin-top: 4.5rem;
    overflow: hidden;
}

.site-footer::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ab-accent) 0%, var(--ab-accent) 38%, var(--ab-fg) 38%, var(--ab-fg) 100%);
}

.site-footer__inner {
    max-width: var(--ab-container);
    margin: 0 auto;
    padding: 4rem 1.5rem 0;
    position: relative;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr 1.1fr;
    gap: 3.5rem;
    padding-bottom: 3rem;
}

/* Section titles ----------------------------------------------------------- */
.footer-col__eyebrow {
    display: inline-block;
    font-family: var(--ab-font-sans);
    font-size: 0.78rem;
    font-weight: 800;
    font-style: normal;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ab-accent);
    margin: 0 0 1.2rem;
    line-height: 1.2;
    position: relative;
    padding-left: 1.8rem;
}

.footer-col__eyebrow::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1.3rem;
    height: 2px;
    background: var(--ab-accent);
}

.footer-col__eyebrow--small {
    margin: 1.75rem 0 0.7rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--ab-muted);
}

.footer-col__eyebrow--small::before { background: var(--ab-muted); }

.footer-col__title {
    margin: 0 0 1.35rem;
    font-family: var(--ab-font-serif);
    font-size: 1.6rem;
    font-weight: 800;
    font-style: italic;
    color: var(--ab-fg);
    letter-spacing: -0.015em;
    line-height: 1.15;
    position: relative;
    padding-bottom: 0.85rem;
}

.footer-col__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 38px;
    height: 3px;
    background: var(--ab-accent);
}

/* Brand column ------------------------------------------------------------- */
.footer-brand {
    display: inline-block;
    text-decoration: none;
    margin-bottom: 1rem;
    line-height: 1;
}

.footer-brand__text {
    font-family: var(--ab-font-serif);
    font-weight: 900;
    font-style: italic;
    font-size: 2.75rem;
    letter-spacing: -0.02em;
    color: var(--ab-accent);
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
}

.footer-brand__mark { color: var(--ab-accent); }
.footer-brand__rest { color: var(--ab-fg); }

.footer-brand .custom-logo,
.footer-brand .custom-logo-link img {
    max-height: 64px;
    width: auto;
}

.footer-tagline {
    margin: 0;
    max-width: 38ch;
    color: var(--ab-muted);
    font-size: 1rem;
    line-height: 1.65;
    font-style: italic;
    border-left: 3px solid var(--ab-accent);
    padding: 0.15rem 0 0.15rem 1rem;
}

.footer-contact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.9rem;
}

.footer-contact__item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--ab-fg);
    font-size: 0.95rem;
}

.footer-contact__item svg {
    flex: 0 0 auto;
    color: var(--ab-accent);
    width: 20px;
    height: 20px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.footer-contact__item a {
    color: var(--ab-fg);
    text-decoration: none;
    transition: color 150ms ease;
    font-weight: 500;
}

.footer-contact__item a:hover {
    color: var(--ab-accent);
}

/* Link list (Categories) --------------------------------------------------- */
.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.footer-links--grid {
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
}

.footer-links a {
    color: var(--ab-fg);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 150ms ease, transform 150ms ease;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    line-height: 1.3;
}

.footer-links__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ab-fg);
    flex: 0 0 auto;
    transition: background-color 150ms ease, transform 150ms ease;
}

.footer-links a:hover {
    color: var(--ab-accent);
    transform: translateX(2px);
}

.footer-links a:hover .footer-links__dot {
    background: var(--ab-accent);
    transform: scale(1.6);
}

/* Socials ------------------------------------------------------------------ */
.footer-socials__intro {
    margin: 0 0 1.1rem;
    color: var(--ab-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 28ch;
}

.footer-socials {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.footer-social {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem 0.4rem 0.4rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 999px;
    color: var(--ab-fg);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.footer-social__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--ab-fg);
    color: #fff;
    flex: 0 0 auto;
    transition: background-color 180ms ease;
}

.footer-social__icon svg {
    display: block;
    width: 12px;
    height: 12px;
}

.footer-social:hover {
    color: #fff;
    background: var(--ab-fg);
    border-color: var(--ab-fg);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.footer-social:hover .footer-social__icon {
    background: var(--ab-accent);
}

.footer-social--facebook:hover { background: #1877f2; border-color: #1877f2; }
.footer-social--youtube:hover  { background: #ff0000; border-color: #ff0000; }
.footer-social--x:hover        { background: #000;    border-color: #000;    }

.footer-social--facebook:hover .footer-social__icon,
.footer-social--youtube:hover .footer-social__icon,
.footer-social--x:hover .footer-social__icon {
    background: rgba(255, 255, 255, 0.18);
}

/* Bottom copyright bar ----------------------------------------------------- */
.site-footer__bottom {
    border-top: 1px solid #e0e0e0;
    padding: 1.5rem 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
}

.site-footer__copyright {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ab-muted);
    letter-spacing: 0.04em;
}

.site-footer__copyright::before {
    content: "★";
    color: var(--ab-accent);
    margin-right: 0.55rem;
    font-size: 0.75rem;
    vertical-align: 1px;
}

@media (max-width: 980px) {
    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
    .footer-col--brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .site-footer__inner { padding: 3rem 1.25rem 0; }
    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: 2.25rem;
    }
    .footer-links--grid { grid-template-columns: 1fr; }
    .footer-brand__text { font-size: 2.25rem; }
    .footer-col__title { font-size: 1.4rem; }
}
