/*
Theme Name: Blogsy
Theme URI: https://example.com/blogsy
Author: DeepMind Team
Author URI: https://example.com
Description: Ultra-fast, PageSpeed 95+ WordPress news & magazine theme created from scratch based on Blogsy Homepage.html layout with primary color #663300.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blogsy
Tags: news, magazine, responsive-layout, grid-layout, accessibility-ready, custom-menu
*/

/* ============================================================
   1. DESIGN SYSTEM & CSS VARIABLES
   ============================================================ */
:root {
  --clr-primary: #663300;
  --clr-primary-hover: #442200;
  --clr-primary-light: #884400;
  --clr-primary-alpha: rgba(102, 51, 0, 0.1);
  --clr-bg: #ffffff;
  --clr-bg-alt: #fcf9f5;
  --clr-border: #e8e3dd;
  --clr-border-dark: #d5ccbf;
  --clr-text: #111111;
  --clr-text-muted: #222222;
  --clr-link: #663300;
  --clr-link-hover: #442200;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-heading: 'Roboto Slab', Georgia, serif;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ============================================================
   2. BASE RESETS & TYPOGRAPHY
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--clr-text);
  text-decoration: none;
  transition: color 0.25s ease, opacity 0.25s ease;
}
a:hover, a:focus {
  color: var(--clr-primary);
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--clr-primary);
  color: #ffffff;
  padding: 12px 20px;
  z-index: 99999;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}
.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 !important;
  width: 1px;
  word-wrap: normal !important;
}

/* ============================================================
   3. LAYOUT CONTAINERS & GRIDS
   ============================================================ */
.blogsy-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.blogsy-section-wrap {
  padding: 40px 0;
  border-bottom: 1px solid var(--clr-border);
}

.blogsy-grid-70-30 {
  display: grid;
  grid-template-columns: 70% 30%;
  gap: 32px;
}

.blogsy-grid-66-33 {
  display: grid;
  grid-template-columns: 66% 33%;
  gap: 24px;
}

.blogsy-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.blogsy-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ============================================================
   4. BLOGSY ANIMATIONS & CARD LAYOUT STYLING
   ============================================================ */
.title-animation-underline {
  position: relative;
  display: inline;
  background-image: linear-gradient(var(--clr-primary), var(--clr-primary));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 2px;
  transition: background-size 0.3s ease;
}
.title-animation-underline:hover {
  background-size: 100% 2px;
  color: var(--clr-primary) !important;
  text-decoration: none;
}

/* Category Text Links */
.blogsy-cat-link,
.terms-wrapper a,
.term-item {
  color: var(--clr-primary) !important;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: none !important;
  padding: 0 !important;
  display: inline-block;
  margin-bottom: 4px;
}
.terms-wrapper a:hover,
.blogsy-cat-link:hover {
  color: var(--clr-primary-hover) !important;
  text-decoration: underline;
}

/* Smooth Image Container */
.blogsy-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #f0eae1;
}
.blogsy-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.blogsy-image-wrapper:hover img {
  transform: scale(1.04);
}

/* ALL POST CARD LAYOUT SPECIFIC STYLES */
.post-wrapper.card-layout {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #e8e8ed;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.post-wrapper.card-layout:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.09);
}

.post-wrapper.card-layout .post-inner {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

.post-wrapper.card-layout .image-outer-wrapper {
  position: relative;
}

.post-wrapper.card-layout .image-wrapper {
  height: 210px;
  border-radius: 12px;
  overflow: hidden;
  background: #eeeeee;
  position: relative;
}

.post-wrapper.card-layout .image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-wrapper.card-layout .content-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 210px;
}

.post-wrapper.card-layout .title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 8px 0;
}

.post-wrapper.card-layout .meta-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #333333;
  font-weight: 600;
  margin-bottom: 12px;
}

.post-wrapper.card-layout .excerpt {
  font-size: 13px;
  color: #222222;
  line-height: 1.5;
  margin: 0 0 16px 0;
}

.post-wrapper.card-layout .footer-wrap {
  border-top: 1px dashed #cccccc;
  padding-top: 12px;
  margin-top: auto;
}

.post-wrapper.card-layout .footer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: #333333;
  font-weight: 700;
}

/* ============================================================
   5. HEADER & STICKY NAVIGATION STYLING
   ============================================================ */
#blogsy-site-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 9999 !important;
  background: #ffffff !important;
  border-bottom: 2px solid var(--clr-primary) !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06) !important;
}

.blogsy-header-nav-wrapper ul,
ul.blogsy-primary-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  white-space: nowrap;
}
.blogsy-header-nav-wrapper a,
ul.blogsy-primary-menu a {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--clr-text);
  letter-spacing: 0.05em;
  padding: 8px 0;
  display: block;
}
.blogsy-header-nav-wrapper a:hover,
ul.blogsy-primary-menu a:hover {
  color: var(--clr-primary) !important;
  text-decoration: none;
}

.popup-search-opener {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: var(--clr-bg-alt);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  transition: all 0.25s ease;
}
.popup-search-opener:hover {
  background: var(--clr-primary);
  color: #ffffff;
  border-color: var(--clr-primary);
}

.popup-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17, 17, 17, 0.95);
  z-index: 999999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.popup-search-overlay.active {
  display: flex;
}
.popup-search-modal {
  width: 100%;
  max-width: 600px;
  text-align: center;
  color: #ffffff;
}
.popup-search-close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #ffffff;
  font-size: 32px;
  cursor: pointer;
  font-weight: 700;
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   6. PAGINATION & CONTENT LAYOUT
   ============================================================ */
nav.blogsy-pagination,
.blogsy-pagination {
  margin-top: 36px !important;
  margin-bottom: 20px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  width: 100% !important;
}

nav.blogsy-pagination a,
nav.blogsy-pagination span,
.blogsy-pagination a,
.blogsy-pagination span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 42px !important;
  height: 42px !important;
  padding: 0 14px !important;
  background-color: #ffffff !important;
  border: 1px solid var(--clr-border-dark) !important;
  border-radius: 4px !important;
  color: var(--clr-text) !important;
  font-family: var(--font-body) !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  text-decoration: none !important;
  transition: all 0.2s ease-in-out !important;
}

nav.blogsy-pagination span.current,
.blogsy-pagination span.current {
  background-color: var(--clr-primary) !important;
  color: #ffffff !important;
  border-color: var(--clr-primary) !important;
}

nav.blogsy-pagination a:hover,
.blogsy-pagination a:hover {
  background-color: var(--clr-primary) !important;
  color: #ffffff !important;
  border-color: var(--clr-primary) !important;
}

/* Single Post Content Width Layout (840px) */
.blogsy-single-article,
.blogsy-single-content,
.entry-content {
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   7. FOOTER SECTION STYLING (PURE WHITE TEXT ON #663300 = 12.4:1 CONTRAST RATIO)
   ============================================================ */
#blogsy-footer,
footer#blogsy-footer,
.blogsy-footer-wrap {
  background-color: var(--clr-primary) !important;
  color: #ffffff !important;
  padding: 48px 0 24px 0 !important;
}

#blogsy-footer p,
#blogsy-footer span,
#blogsy-footer div,
#blogsy-footer li,
#blogsy-footer strong,
#blogsy-footer b,
#blogsy-footer a,
#blogsy-footer h1,
#blogsy-footer h2,
#blogsy-footer h3,
#blogsy-footer h4,
#blogsy-footer h5,
#blogsy-footer h6,
.blogsy-footer-bottom,
.blogsy-footer-bottom p,
.blogsy-footer-bottom strong {
  color: #ffffff !important;
}

#blogsy-footer a {
  text-decoration: underline;
  transition: opacity 0.2s ease-in-out;
}

#blogsy-footer a:hover {
  opacity: 0.85;
}

.blogsy-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.3) !important;
  padding-top: 20px;
  text-align: center;
  font-size: 14px;
  color: #ffffff !important;
}

/* ============================================================
   8. MOBILE RESPONSIVE STYLING (HIDE SECTIONS 2-7 ON MOBILE)
   ============================================================ */
@media (max-width: 768px) {
  /* HIDE SECTIONS 2 UNTIL 7 ON MOBILE DEVICES AS REQUESTED */
  #blogsy-hero,
  #blogsy-sec-cat1,
  #blogsy-sec-cat2,
  #blogsy-sec-cats-3-4-5,
  #blogsy-sec-cat3,
  #blogsy-sec-cat4,
  #blogsy-sec-cat5 {
    display: none !important;
  }

  /* SECTION 1 (HEADER) MOBILE ADJUSTMENTS */
  #blogsy-site-header .blogsy-container > div {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: center !important;
  }

  .blogsy-header-nav-wrapper {
    width: 100% !important;
  }

  .blogsy-header-nav-wrapper ul,
  ul.blogsy-primary-menu {
    flex-wrap: wrap !important;
    gap: 10px 16px !important;
    justify-content: center !important;
  }

  /* SECTION 8 (ALL POST) MOBILE ADJUSTMENTS */
  .blogsy-grid-70-30 {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .post-wrapper.card-layout .post-inner {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .post-wrapper.card-layout .image-wrapper {
    height: 180px !important;
  }

  .post-wrapper.card-layout .title {
    font-size: 18px !important;
  }

  /* SECTION 9 (FOOTER) MOBILE ADJUSTMENTS */
  #blogsy-footer .blogsy-container > div {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    text-align: center !important;
  }
}
