/*
Theme Name: Blokio
Author: Bhavesh
Author URI: https://profiles.wordpress.org/bhavesh456/
Description: A premium, lightweight Full Site Editing theme for modern travel and lifestyle blogs — immersive hero sections, elegant card layouts, and a full block pattern library, with no page-builder dependency.
Version: 1.0.2
Requires at least: 6.8
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blokio
Tags: blog, entertainment, food-and-drink, one-column, two-columns, right-sidebar, block-patterns, custom-colors, custom-menu, editor-style, featured-images, full-site-editing, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks

Almost all visual design for Blokio lives in theme.json, which WordPress
compiles into CSS custom properties and per-block styles automatically.
This file only contains what theme.json cannot express: hover/scroll
choreography, the custom block-rendered components (badges, breadcrumbs,
share buttons, related posts), and the dark-mode media-query fallback
for visitors who haven't explicitly picked a Global Styles variation.
*/

/* -------------------------------------------------------------
   Self-hosted fonts
   WordPress.org guidelines require themes to self-host fonts rather
   than load them from a third-party server/CDN (e.g. Google Fonts),
   for user privacy. Place the corresponding .woff2 files in
   assets/fonts/ — see assets/fonts/README.txt for exact filenames.
   ------------------------------------------------------------- */

/* Poppins */
@font-face {
	font-family: "Poppins";
	src: url("assets/fonts/Poppins/Poppins-Black.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Poppins";
	src: url("assets/fonts/Poppins/Poppins-SemiBold.ttf") format("truetype");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Poppins";
	src: url("assets/fonts/Poppins/Poppins-Bold.ttf") format("truetype");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}


/* -------------------------------------------------------------
   Motion & interaction primitives
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .blokio-card,
  .wp-block-post-featured-image img,
  .blokio-badge,
  a.wp-block-navigation-item__content {
    transition:
      transform var(--wp--custom--transition--base),
      box-shadow var(--wp--custom--transition--base),
      background-color var(--wp--custom--transition--base),
      color var(--wp--custom--transition--base);
  }

  .blokio-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease, transform 600ms ease;
  }

  .blokio-reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 3px;
}

/* -------------------------------------------------------------
   Blog / archive cards
   ------------------------------------------------------------- */
.blokio-card {
  border-radius: var(--wp--custom--radius--md);
  overflow: hidden;
  background: var(--wp--preset--color--surface);
  box-shadow: var(--wp--preset--shadow--card);
}

.blokio-card:hover,
.blokio-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--wp--preset--shadow--card-hover);
}

.blokio-card .wp-block-post-featured-image {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.blokio-card .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blokio-card:hover .wp-block-post-featured-image img {
  transform: scale(1.05);
}

.blokio-badge {
  display: inline-block;
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--primary);
  font-weight: 600;
  font-size: var(--wp--preset--font-size--small);
  padding: 0.3em 0.9em;
  border-radius: var(--wp--custom--radius--pill);
  box-shadow: var(--wp--preset--shadow--card);
}

/* -------------------------------------------------------------
   Header: sticky behavior, search popup, mega menu, mobile
   ------------------------------------------------------------- */
.blokio-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--wp--preset--color--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
}

.blokio-header.is-scrolled {
  border-bottom-color: var(--wp--preset--color--border);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
}

.blokio-header--transparent {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 40;
  background: transparent;
  border-bottom: none;
}

.blokio-header--transparent .wp-block-navigation-item__content,
.blokio-header--transparent .wp-block-site-title a,
.blokio-header--transparent .blokio-theme-toggle {
  color: #fff;
}

/* AI-generated / manually-typed post content is often plain HTML
   (h2/h3/h4, p) rather than Gutenberg heading blocks, so it doesn't
   carry a wp-block-heading class for theme.json's element styles to
   latch onto reliably. Target it explicitly so it always matches the
   same adaptive color as the rest of the article body. */
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  color: var(--wp--preset--color--text);
}

.blokio-search-toggle,
.blokio-search-popup__close {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  padding: 0.5rem;
  border-radius: var(--wp--custom--radius--pill);
}

.blokio-search-toggle:hover {
  background: var(--wp--preset--color--background);
}

.blokio-search-popup {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--wp--preset--color--text) 60%, transparent);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

.blokio-search-popup.is-open { display: flex; }

.blokio-search-popup__panel {
  background: var(--wp--preset--color--surface);
  border-radius: var(--wp--custom--radius--md);
  box-shadow: var(--wp--preset--shadow--popover);
  width: min(560px, 90vw);
  padding: 1.5rem;
}

.blokio-search-popup .search-form {
  display: flex;
  gap: 0.5rem;
}

.blokio-search-popup input[type="search"] {
  flex: 1;
  font-size: 1.1rem;
  padding: 0.7em 1em;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--wp--custom--radius--sm);
}

/* -------------------------------------------------------------
   Back to top
   ------------------------------------------------------------- */
.blokio-back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--wp--preset--color--primary);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  box-shadow: var(--wp--preset--shadow--card-hover);
}

.blokio-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* -------------------------------------------------------------
   Breadcrumbs, share buttons, related posts, copyright (shortcode-rendered)
   ------------------------------------------------------------- */
.blokio-breadcrumbs {
  font-size: var(--wp--preset--font-size--small);
  color: var(--wp--preset--color--text-secondary);
}

.blokio-breadcrumbs a { color: inherit; }
.blokio-breadcrumbs a:hover { color: var(--wp--preset--color--primary); }

.blokio-copyright {
  font-size: var(--wp--preset--font-size--small);
  color: #94A3B8;
}

.blokio-related-posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.blokio-related-posts__item {
  display: block;
  color: inherit;
}

.blokio-related-posts__thumb {
  border-radius: var(--wp--custom--radius--sm);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  margin-bottom: 0.5rem;
}

.blokio-related-posts__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blokio-related-posts__title {
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 600;
  font-size: var(--wp--preset--font-size--small);
}

/* -------------------------------------------------------------
   Instagram gallery pattern
   ------------------------------------------------------------- */
.blokio-instagram-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}

.blokio-instagram-grid .wp-block-image {
  margin: 0;
  aspect-ratio: 1 / 1;
  border-radius: var(--wp--custom--radius--sm);
  overflow: hidden;
}

.blokio-instagram-grid .wp-block-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 960px) {
  .blokio-grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .blokio-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 780px) {
  .blokio-instagram-grid { grid-template-columns: repeat(3, 1fr); }

  /* core/group with a fixed grid columnCount has no responsive default
     of its own (unlike core/post-template, which core already handles) —
     these are hand-collapsed here instead. */
  .blokio-grid-3 { grid-template-columns: 1fr !important; }
}

@media (max-width: 600px) {
  .blokio-grid-4 { grid-template-columns: 1fr !important; }
}

/* -------------------------------------------------------------
   FAQ (details/summary — zero JS)
   ------------------------------------------------------------- */
.blokio-faq-item {
  border-bottom: 1px solid var(--wp--preset--color--border);
  padding: 1.25rem 0;
}

.blokio-faq-item summary {
  cursor: pointer;
  font-family: var(--wp--preset--font-family--heading);
  font-weight: 600;
  list-style: none;
}

.blokio-faq-item summary::-webkit-details-marker { display: none; }

.blokio-faq-item summary::after {
  content: "+";
  float: right;
  font-weight: 400;
  color: var(--wp--preset--color--primary);
}

.blokio-faq-item[open] summary::after { content: "\2212"; }

/* -------------------------------------------------------------
   Skip link
   ------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--wp--preset--color--primary);
  color: #fff;
  padding: 0.75em 1.25em;
  z-index: 999;
  border-radius: 0 0 var(--wp--custom--radius--sm) 0;
}

.skip-link:focus {
  left: 0;
}

/* -------------------------------------------------------------
   Dark / light mode
   Every element in this theme is styled with the
   --wp--preset--color--* custom properties WordPress generates
   from theme.json, so re-pointing a handful of those variables is
   enough to re-theme the whole site — no per-component overrides
   needed.

   Precedence:
   1. html[data-blokio-theme="dark"|"light"] — explicit visitor
      choice from the header toggle, saved to localStorage and
      applied before paint (see the inline script in wp_head).
   2. Otherwise, prefers-color-scheme: dark — visitor's system/
      browser setting, used until they make an explicit choice.
   ------------------------------------------------------------- */
:root {
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  html:not([data-blokio-theme]) {
    --wp--preset--color--background: var(--wp--preset--color--dark-background);
    --wp--preset--color--surface: var(--wp--preset--color--dark-surface);
    --wp--preset--color--text: var(--wp--preset--color--dark-text);
    --wp--preset--color--text-secondary: var(--wp--preset--color--dark-text-secondary);
    --wp--preset--color--border: var(--wp--preset--color--dark-border);
  }
}

html[data-blokio-theme="dark"] {
  --wp--preset--color--background: var(--wp--preset--color--dark-background);
  --wp--preset--color--surface: var(--wp--preset--color--dark-surface);
  --wp--preset--color--text: var(--wp--preset--color--dark-text);
  --wp--preset--color--text-secondary: var(--wp--preset--color--dark-text-secondary);
  --wp--preset--color--border: var(--wp--preset--color--dark-border);
}

.blokio-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: none;
  background: none;
  color: var(--wp--preset--color--text);
  cursor: pointer;
}

.blokio-theme-toggle:hover {
  color: var(--wp--preset--color--primary);
}

.blokio-theme-toggle .blokio-theme-toggle__sun { display: none; }
.blokio-theme-toggle .blokio-theme-toggle__moon { display: block; }

html[data-blokio-theme="dark"] .blokio-theme-toggle .blokio-theme-toggle__sun { display: block; }
html[data-blokio-theme="dark"] .blokio-theme-toggle .blokio-theme-toggle__moon { display: none; }

@media (prefers-color-scheme: dark) {
  html:not([data-blokio-theme]) .blokio-theme-toggle .blokio-theme-toggle__sun { display: block; }
  html:not([data-blokio-theme]) .blokio-theme-toggle .blokio-theme-toggle__moon { display: none; }
}

ul.wp-block-categories-list
{
  text-decoration: none;
  list-style: none;
}

/* =========================================================
   INSTAGRAM / SOCIAL IMAGE GRID
   ========================================================= */

.blokio-instagram-grid {
    display: grid;

    /* Desktop: 6 items */
    grid-template-columns: repeat(6, minmax(0, 1fr));

    gap: 0.5rem;

    width: 100%;
    max-width: 100%;

    box-sizing: border-box;
}


/* Each Gutenberg Group inside grid */
.blokio-instagram-grid > .wp-block-group {
    width: 100%;
    min-width: 0;
    max-width: 100%;

    margin: 0 !important;
    padding: 0;

    box-sizing: border-box;

    /* Keep every item square */
    aspect-ratio: 1 / 1;
}


/* =========================================================
   LARGE TABLET / SMALL LAPTOP
   ========================================================= */

@media (max-width: 1200px) {

    .blokio-instagram-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .blokio-instagram-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .blokio-instagram-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 360px) {

    .blokio-instagram-grid {
        grid-template-columns: 1fr;
    }

}
/* ============================================================
   BLOKIO FOOTER
   ============================================================ */

/*
 * Main footer grid
 *
 * Columns:
 * 1. Brand / Social
 * 2. Recent Posts
 * 3. Categories
 * 4. Newsletter
 */
.wp-block-group.blokio-footer-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.1fr)
        minmax(0, 1.4fr)
        minmax(0, 1fr)
        minmax(0, 1.2fr);

    gap: 2rem;

    width: 100%;
    max-width: 100%;

    align-items: start;
}


/* ============================================================
   GRID CHILDREN
   Critical: prevents content from forcing grid overflow
   ============================================================ */

.wp-block-group.blokio-footer-grid > .wp-block-group {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}


/* ============================================================
   FOOTER HEADINGS
   ============================================================ */

.blokio-footer-grid .wp-block-heading {
    margin-top: 0;
    margin-bottom: 1rem;
}


/* ============================================================
   SITE TITLE
   ============================================================ */

.blokio-footer-grid .wp-block-site-title {
    margin-top: 0;
}

.blokio-footer-grid .wp-block-site-title a {
    text-decoration: none;
}


/* ============================================================
   TEXT
   ============================================================ */

.blokio-footer-grid p {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}


/* ============================================================
   SOCIAL LINKS
   ============================================================ */

.blokio-footer-grid .wp-block-social-links {
    display: flex;
    flex-wrap: wrap;

    gap: 0.75rem;

    margin-top: 1rem;
    padding-left: 0;
}

.blokio-footer-grid .wp-block-social-link {
    flex: 0 0 auto;
}


/* ============================================================
   RECENT POSTS
   ============================================================ */

.blokio-footer-grid .wp-block-query {
    width: 100%;
    max-width: 100%;
}

.blokio-footer-grid .wp-block-post-template {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
}

.blokio-footer-grid .wp-block-post {
    width: 100%;
    max-width: 100%;
}

.blokio-footer-grid .wp-block-post-title {
    width: 100%;
    max-width: 100%;

    overflow-wrap: break-word;
    word-break: normal;
}

.blokio-footer-grid .wp-block-post-title a {
    display: inline;

    max-width: 100%;

    overflow-wrap: break-word;
    word-wrap: break-word;
}


/* ============================================================
   CATEGORIES
   ============================================================ */

.blokio-footer-grid .wp-block-categories {
    width: 100%;
    max-width: 100%;

    margin: 0;
    padding-left: 0;

    list-style: none;
}

.blokio-footer-grid .wp-block-categories li {
    width: 100%;
    max-width: 100%;

    margin-bottom: 0.4rem;

    overflow-wrap: break-word;
}

.blokio-footer-grid .wp-block-categories a {
    overflow-wrap: break-word;
    word-wrap: break-word;
}


/* ============================================================
   NEWSLETTER
   ============================================================ */

.blokio-footer-newsletter {
    display: flex !important;

    align-items: center;

    gap: 0.5rem;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    margin: 0;

    box-sizing: border-box;
}


/*
 * IMPORTANT
 *
 * Input elements have an intrinsic minimum width.
 * min-width: 0 allows the input to shrink inside the
 * Gutenberg Grid column.
 */
.blokio-footer-newsletter input[type="email"] {
    flex: 1 1 0 !important;

    width: 100%;
    min-width: 0;
    max-width: 100%;

    box-sizing: border-box;

    padding: 0.6em 0.8em;

    border: 1px solid #334155;
    border-radius: 8px;

    background: #1e293b;
    color: #f1f5f9;

    font: inherit;

    outline: none;
}


/* Placeholder */
.blokio-footer-newsletter input[type="email"]::placeholder {
    color: #94a3b8;
}


/* Input focus */
.blokio-footer-newsletter input[type="email"]:focus {
    border-color: currentColor;
}


/* Newsletter button */
.blokio-footer-newsletter .wp-element-button,
.blokio-footer-newsletter button[type="submit"] {
    flex: 0 0 auto;

    width: auto;
    min-width: max-content;

    box-sizing: border-box;

    white-space: nowrap;

    cursor: pointer;
}


/* ============================================================
   SEPARATOR
   ============================================================ */

footer .wp-block-separator {
    width: 100%;
    max-width: 100%;
}


/* ============================================================
   FOOTER BOTTOM ROW
   ============================================================ */

footer
.wp-block-group.is-content-justification-space-between.is-layout-flex {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    width: 100%;

    flex-wrap: wrap;
}


/* ============================================================
   FOOTER NAVIGATION
   ============================================================ */

footer .wp-block-navigation {
    max-width: 100%;
}

footer .wp-block-navigation__container {
    flex-wrap: wrap;
}


/* ============================================================
   BACK TO TOP
   ============================================================ */

.blokio-back-to-top {
    position: fixed;

    right: 1.5rem;
    bottom: 1.5rem;

    z-index: 999;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    cursor: pointer;

    opacity: 0;
    visibility: hidden;

    transform: translateY(10px);

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;
}


.blokio-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}


.blokio-back-to-top svg {
    display: block;

    width: 18px;
    height: 18px;
}


/* ============================================================
   TABLET
   <= 1024px
   ============================================================ */

@media (max-width: 1024px) {

    /*
     * Change footer from:
     *
     * 1 | 2 | 3 | 4
     *
     * to:
     *
     * 1 | 2
     * -----
     * 3 | 4
     */

    .wp-block-group.blokio-footer-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 2.5rem 2rem;
    }


    .blokio-footer-grid > .wp-block-group {
        min-width: 0;
    }


    .blokio-footer-newsletter {
        width: 100%;
        max-width: 100%;
    }


    .blokio-footer-newsletter input[type="email"] {
        min-width: 0;
    }
}


/* ============================================================
   SMALL TABLET
   <= 782px
   WordPress common breakpoint
   ============================================================ */

@media (max-width: 782px) {

    .wp-block-group.blokio-footer-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 2rem 1.5rem;
    }


    /*
     * Gutenberg can apply generated width/min-width rules.
     * Force footer children to remain shrinkable.
     */

    .wp-block-group.blokio-footer-grid > .wp-block-group {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }


    .blokio-footer-newsletter {
        min-width: 0;
    }


    .blokio-footer-newsletter input[type="email"] {
        width: 0;
        min-width: 0;

        flex-grow: 1;
    }
}


/* ============================================================
   MOBILE
   <= 600px
   ============================================================ */

@media (max-width: 600px) {

    /*
     * Stack all footer sections:
     *
     * Brand
     * -------
     * Posts
     * -------
     * Categories
     * -------
     * Newsletter
     */

    .wp-block-group.blokio-footer-grid {
        grid-template-columns:
            minmax(0, 1fr);

        gap: 2rem;
    }


    .wp-block-group.blokio-footer-grid > .wp-block-group {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }


    /* Newsletter can remain horizontal */

    .blokio-footer-newsletter {
        display: flex !important;

        width: 100%;

        gap: 0.5rem;
    }


    .blokio-footer-newsletter input[type="email"] {
        flex: 1 1 0 !important;

        width: 0;
        min-width: 0;
    }


    .blokio-footer-newsletter button[type="submit"] {
        flex: 0 0 auto;
    }


    /* Bottom footer */

    footer
    .wp-block-group.is-content-justification-space-between.is-layout-flex {
        flex-direction: column;

        align-items: flex-start;

        gap: 1rem;
    }


    /* Back to top */

    .blokio-back-to-top {
        right: 1rem;
        bottom: 1rem;

        width: 42px;
        height: 42px;
    }
}


/* ============================================================
   VERY SMALL MOBILE
   <= 400px
   ============================================================ */

@media (max-width: 400px) {

    /*
     * On very narrow screens:
     *
     * Email
     * ----------
     * Join
     */

    .blokio-footer-newsletter {
        flex-direction: column;

        align-items: stretch;

        gap: 0.75rem;
    }


    .blokio-footer-newsletter input[type="email"] {
        width: 100%;
        min-width: 0;
    }


    .blokio-footer-newsletter .wp-element-button,
    .blokio-footer-newsletter button[type="submit"] {
        width: 100%;

        text-align: center;
    }
}