/*
Theme Name: Silverglades Legacy Blog
Theme URI: https://www.silvergladeslegacygurgaon.com/blog/
Description: Custom blog theme for silvergladeslegacygurgaon.com, matched to the main site (Cormorant headings, Poppins body, #526d4d / #f3b35e, 1170px container).
Author: Silverglades Legacy Gurgaon
Version: 1.1
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sgl-blog
*/

/* ---------- Fonts (served from the main site) ---------- */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  src: local(""), url("/fonts/poppins-v20-latin-regular.woff") format("woff");
  font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  font-style: normal;
  font-weight: 700;
  src: local(""), url("/fonts/cormorant-v18-latin-700.woff") format("woff");
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --sgl-primary: #526d4d;
  --sgl-primary-dark: #30402d;
  --sgl-gold: #f3b35e;
  --sgl-body: #212529;
  --sgl-muted: #6c757d;
  --sgl-light: #f7f7f7;
  --sgl-border: #dee2e6;
  --sgl-line: rgba(82, 109, 77, 0.15);
  --sgl-dark: #212529;
  --sgl-container: 1170px;
  --sgl-radius: 0.375rem;
  --sgl-radius-lg: 12px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--sgl-body);
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; vertical-align: middle; border-style: none; }
figure { margin: 0 0 1rem; }
svg { vertical-align: middle; }

a { color: var(--sgl-primary); text-decoration: none; }
a:hover { color: var(--sgl-primary-dark); }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3 {
  font-family: "Cormorant", Georgia, "Times New Roman", serif;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.75rem;
  line-height: 1.2;
  color: var(--sgl-primary-dark);
}
h1 { font-size: 2.9rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.7rem; }
h4 { font-size: 1.35rem; }
p { margin-top: 0; margin-bottom: 1.5rem; font-size: 1.05rem; }

@media (max-width: 767px) {
  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.4rem; }
  p { font-size: 1rem; }
}

.sgl-container {
  width: 100%;
  max-width: var(--sgl-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
@media (max-width: 1199px) { .sgl-container { padding-left: 2.5rem; padding-right: 2.5rem; } }
@media (max-width: 767px) { .sgl-container { padding-left: 1.2rem; padding-right: 1.2rem; } }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--sgl-primary); color: #fff; padding: 0.6rem 1rem; z-index: 9999; }
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Eyebrow ---------- */
.sgl-eyebrow {
  display: block;
  font-family: "Poppins", sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sgl-gold);
  margin-bottom: 0.5rem;
}

/* ---------- Buttons ---------- */
.sgl-btn {
  display: inline-block;
  position: relative;
  padding: 0.65rem 1.6rem;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--sgl-radius);
  border: 1px solid var(--sgl-primary);
  background-color: var(--sgl-primary);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.sgl-btn:hover { transform: translateY(-4px); background-color: var(--sgl-primary-dark); border-color: var(--sgl-primary-dark); color: #fff; }
.sgl-btn--gold { background-color: var(--sgl-gold); border-color: var(--sgl-gold); color: #000; }
.sgl-btn--gold:hover { background-color: #f4c07a; border-color: #f4c07a; color: #000; }

/* ---------- Header ---------- */
.sgl-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: var(--sgl-light);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
}
.sgl-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.sgl-brand { display: flex; align-items: center; }
.sgl-brand img { height: 45px; width: auto; display: block; }

.sgl-nav ul { display: flex; align-items: center; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.sgl-nav a {
  display: block;
  padding: 1.1rem 0.7rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--sgl-body);
}
.sgl-nav a:hover { color: var(--sgl-primary); }
.sgl-nav .current-menu-item > a,
.sgl-nav .current_page_item > a,
.sgl-nav li.is-active > a { color: var(--sgl-primary); box-shadow: inset 0 -3px 0 var(--sgl-gold); }

.sgl-nav-toggle { display: none; background: none; border: 0; padding: 0.5rem; line-height: 0; cursor: pointer; }
.sgl-nav-toggle span { display: block; width: 26px; height: 2px; margin: 5px 0; background-color: var(--sgl-primary); }

@media (max-width: 991px) {
  .sgl-nav-toggle { display: block; }
  .sgl-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--sgl-light);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
    display: none;
  }
  .sgl-nav.is-open { display: block; }
  .sgl-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .sgl-nav a { padding: 0.85rem 1.2rem; border-top: 1px solid var(--sgl-line); }
}

/* ---------- Page head ---------- */
.sgl-pagehead {
  background-color: var(--sgl-light);
  padding: 3rem 0 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--sgl-line);
}
.sgl-pagehead h1 { margin-bottom: 0.5rem; }
.sgl-pagehead p { color: rgba(0, 0, 0, 0.6); max-width: 700px; margin: 0 auto; }

.sgl-breadcrumb { font-size: 0.85rem; color: var(--sgl-muted); margin-bottom: 0.85rem; }
.sgl-breadcrumb a { color: var(--sgl-primary); }
.sgl-breadcrumb span + span::before { content: "›"; padding: 0 0.45rem; color: var(--sgl-muted); }

/* ---------- Layout ---------- */
.sgl-main { padding: 3.5rem 0; }
@media (max-width: 991px) { .sgl-main { padding: 2.5rem 0; } }

.sgl-layout { display: flex; flex-wrap: wrap; gap: 3rem; }
.sgl-content { flex: 1 1 0; min-width: 0; }
.sgl-sidebar { width: 330px; flex-shrink: 0; }
@media (max-width: 991px) { .sgl-layout { gap: 2rem; } .sgl-sidebar { width: 100%; } }

/* ---------- Post cards ---------- */
.sgl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
@media (max-width: 767px) { .sgl-grid { grid-template-columns: 1fr; gap: 1.5rem; } }

.sgl-card {
  background: #fff;
  border-radius: var(--sgl-radius-lg);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}
.sgl-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(82, 109, 77, 0.2); }
.sgl-card__media { display: block; overflow: hidden; background: var(--sgl-light); }
.sgl-card__media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; transition: transform 0.4s; }
.sgl-card:hover .sgl-card__media img { transform: scale(1.05); }
.sgl-card__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1 1 auto; }
.sgl-card__date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sgl-muted);
  margin-bottom: 0.6rem;
}
.sgl-card__date::before { content: ""; width: 22px; height: 2px; background: var(--sgl-gold); display: inline-block; }
.sgl-card__title { font-size: 1.4rem; line-height: 1.35; margin-bottom: 0.9rem; }
.sgl-card__title a { color: var(--sgl-primary-dark); transition: color 0.3s; }
.sgl-card__title a:hover { color: var(--sgl-primary); }
.sgl-card__excerpt { font-size: 0.95rem; color: rgba(0, 0, 0, 0.65); margin-bottom: 1.2rem; }
.sgl-card__more {
  margin-top: auto;
  font-family: "Poppins", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sgl-primary);
}
.sgl-card__more::after { content: " →"; }

/* ---------- Single ---------- */
.sgl-article__header { margin-bottom: 1.75rem; }
.sgl-article__header h1 { font-size: 2.6rem; }
@media (max-width: 767px) { .sgl-article__header h1 { font-size: 2rem; } }

.sgl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.88rem;
  color: var(--sgl-muted);
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--sgl-gold);
}
.sgl-meta strong { color: var(--sgl-body); font-weight: 700; }

.sgl-featured { margin: 1.75rem 0 2rem; }
.sgl-featured img { width: 100%; border-radius: var(--sgl-radius-lg); display: block; }

.sgl-entry { font-size: 1.05rem; line-height: 1.8; }
.sgl-entry > *:first-child { margin-top: 0; }
.sgl-entry h2 { font-size: 2rem; margin-top: 2.5rem; margin-bottom: 1rem; }
.sgl-entry h3 { font-size: 1.55rem; margin-top: 2rem; color: var(--sgl-primary); }
.sgl-entry h4 { font-size: 1.25rem; margin-top: 1.6rem; }
.sgl-entry ul, .sgl-entry ol { padding-left: 1.35rem; margin-bottom: 1.5rem; }
.sgl-entry ul { list-style: disc; }
.sgl-entry ol { list-style: decimal; }
.sgl-entry li { margin-bottom: 0.55rem; }
.sgl-entry img { border-radius: var(--sgl-radius-lg); }
.sgl-entry figcaption { font-size: 0.875em; color: var(--sgl-muted); text-align: center; padding-top: 0.5rem; }
.sgl-entry a { text-decoration: underline; }
.sgl-entry blockquote {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--sgl-light);
  border-left: 4px solid var(--sgl-gold);
  border-radius: 0 var(--sgl-radius) var(--sgl-radius) 0;
}
.sgl-entry blockquote p:last-child { margin-bottom: 0; }

.sgl-entry table { width: 100%; border-collapse: collapse; margin-bottom: 1.75rem; font-size: 0.95rem; }
.sgl-entry table th, .sgl-entry table td {
  border: 1px solid var(--sgl-border);
  padding: 0.75rem 0.9rem;
  text-align: left;
  vertical-align: top;
}
.sgl-entry table thead th { background-color: var(--sgl-primary); color: #fff; border-color: var(--sgl-primary); font-family: "Poppins", sans-serif; }
.sgl-entry table tbody tr:nth-child(even) { background-color: var(--sgl-light); }
.sgl-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1.75rem; }
.sgl-table-scroll > table { margin-bottom: 0; }

.sgl-tags { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--sgl-line); font-size: 0.88rem; }
.sgl-tags a {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  margin: 0 0.35rem 0.4rem 0;
  border: 1px solid var(--sgl-line);
  border-radius: 50rem;
  color: var(--sgl-primary);
}
.sgl-tags a:hover { background: var(--sgl-primary); border-color: var(--sgl-primary); color: #fff; }

/* ---------- Project CTA ---------- */
.sgl-cta {
  margin-top: 3rem;
  padding: 2.5rem 2rem;
  background-color: var(--sgl-primary);
  border-radius: var(--sgl-radius-lg);
  text-align: center;
  color: #fff;
}
.sgl-cta h2 { color: #fff; font-size: 2rem; margin-bottom: 0.6rem; }
.sgl-cta .sgl-eyebrow { color: var(--sgl-gold); }
.sgl-cta p { color: rgba(255, 255, 255, 0.85); max-width: 640px; margin: 0 auto 1.5rem; }

/* ---------- Post navigation ---------- */
.sgl-postnav { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
.sgl-postnav__item { flex: 1 1 240px; padding: 1.1rem 1.25rem; background: var(--sgl-light); border-radius: var(--sgl-radius); }
.sgl-postnav__label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--sgl-gold); font-weight: 700; margin-bottom: 0.35rem; }
.sgl-postnav__item a { font-family: "Cormorant", Georgia, serif; font-weight: 700; font-size: 1.15rem; color: var(--sgl-primary-dark); }
.sgl-postnav__item a:hover { color: var(--sgl-primary); }
.sgl-postnav__item--next { text-align: right; }

/* ---------- Related ---------- */
.sgl-related { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--sgl-line); }
.sgl-related h2 { font-size: 2rem; margin-bottom: 1.5rem; }

/* ---------- Sidebar ---------- */
.sgl-widget { background: #fff; border-radius: var(--sgl-radius-lg); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07); padding: 1.5rem; margin-bottom: 1.75rem; }
.sgl-widget__title { font-size: 1.4rem; margin-bottom: 1.1rem; padding-bottom: 0.65rem; border-bottom: 2px solid var(--sgl-gold); }
.sgl-widget ul { list-style: none; margin: 0; padding: 0; }
.sgl-widget li { padding: 0.6rem 0; border-bottom: 1px solid var(--sgl-line); font-size: 0.95rem; }
.sgl-widget li:last-child { border-bottom: 0; padding-bottom: 0; }
.sgl-widget a { color: var(--sgl-body); }
.sgl-widget a:hover { color: var(--sgl-primary); }

.sgl-widget--project { background-color: var(--sgl-primary); color: #fff; }
.sgl-widget--project .sgl-widget__title { color: #fff; }
.sgl-widget--project .sgl-facts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
  border-bottom-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
}
.sgl-widget--project .sgl-facts strong { color: #fff; font-weight: 700; text-align: right; }
.sgl-widget--project .sgl-btn { width: 100%; text-align: center; margin-top: 1.2rem; }

.sgl-searchform { display: flex; gap: 0.5rem; }
.sgl-searchform input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--sgl-body);
  border: 1px solid var(--sgl-border);
  border-radius: var(--sgl-radius);
}
.sgl-searchform input[type="search"]:focus { outline: 0; border-color: var(--sgl-primary); box-shadow: 0 0 0 0.25rem rgba(82, 109, 77, 0.25); }
.sgl-searchform button { flex-shrink: 0; }

/* ---------- Sticky sidebar ---------- */
@media (min-width: 992px) {
  .sgl-layout { align-items: flex-start; }

  .sgl-sidebar {
    position: sticky;
    align-self: flex-start;
    top: 84px;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--sgl-gold) transparent;
  }
  .sgl-sidebar::-webkit-scrollbar { width: 6px; }
  .sgl-sidebar::-webkit-scrollbar-track { background: transparent; }
  .sgl-sidebar::-webkit-scrollbar-thumb { background: var(--sgl-gold); border-radius: 3px; }

  /* Clear the WordPress admin bar for logged-in users. */
  body.admin-bar .sgl-sidebar { top: 116px; max-height: calc(100vh - 136px); }
}

/* ---------- Pagination ---------- */
.sgl-pagination { margin-top: 3rem; }
.sgl-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.sgl-pagination .page-numbers {
  display: inline-block;
  min-width: 2.6rem;
  padding: 0.55rem 0.8rem;
  text-align: center;
  border: 1px solid var(--sgl-line);
  border-radius: var(--sgl-radius);
  color: var(--sgl-body);
  font-size: 0.95rem;
}
.sgl-pagination .page-numbers:hover { background: var(--sgl-light); }
.sgl-pagination .page-numbers.current { background: var(--sgl-primary); border-color: var(--sgl-primary); color: #fff; }

/* ---------- Comments ---------- */
.sgl-comments { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--sgl-line); }
.sgl-comments h2, .sgl-comments h3 { font-size: 1.75rem; }
.sgl-comments .comment-list { list-style: none; margin: 0 0 2rem; padding: 0; }
.sgl-comments .comment-list li { padding: 1.2rem 0; border-bottom: 1px solid var(--sgl-line); }
.sgl-comments .comment-list .children { list-style: none; padding-left: 1.75rem; }
.sgl-comments .comment-meta { font-size: 0.85rem; color: var(--sgl-muted); margin-bottom: 0.4rem; }
.sgl-comments input[type="text"],
.sgl-comments input[type="email"],
.sgl-comments input[type="url"],
.sgl-comments textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--sgl-border);
  border-radius: var(--sgl-radius);
}
.sgl-comments textarea { min-height: 140px; }
.sgl-comments .comment-form p { margin-bottom: 1rem; }
.sgl-comments label { display: block; font-size: 0.85rem; color: var(--sgl-muted); margin-bottom: 0.25rem; }
.sgl-comments .submit {
  display: inline-block;
  padding: 0.65rem 1.6rem;
  font-weight: 700;
  border: 1px solid var(--sgl-primary);
  background: var(--sgl-primary);
  color: #fff;
  border-radius: var(--sgl-radius);
  cursor: pointer;
}

/* ---------- Footer ---------- */
.sgl-footer { background-color: var(--sgl-dark); }
.sgl-footer__copy { font-size: 0.9rem; padding: 1.5rem 1rem; text-align: center; color: #495057; }
.sgl-footer__copy a { color: #dee2e6; }
.sgl-footer__copy a:hover { color: var(--sgl-gold); }
.sgl-footer__copy--legal { padding-top: 0; }

/* ---------- WordPress core classes ---------- */
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide, .alignfull { max-width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.875em; color: var(--sgl-muted); text-align: center; }
.sticky, .gallery-caption, .bypostauthor { display: block; }
.wp-block-image { margin-bottom: 1.75rem; }