/*
Theme Name:   Astra Child - E-Paper
Theme URI:    https://krantibhaskar.com/
Description:  Astra child theme for the Loktej-style e-paper site. Custom coded header/footer (fast, no
              page-builder weight); logo, site title and menus stay editable from the WordPress Customizer
              and Appearance > Menus, same as any theme.
Author:       -
Template:     astra
Version:      1.0.0
Text Domain:  astra-child-epaper
*/

:root {
  --brand-red: #ea2e2e;
  --brand-red-dark: #c81f1f;
  --brand-ink: #111111;
  --brand-muted: #767676;
  --brand-white: #ffffff;
  --header-height: 68px;
  /* one shared content width + side gutter so header and footer content line up exactly */
  --container-max: 1440px;
  --container-gutter: 20px;
  /* overridden from Appearance > Customize > Header & Footer (see functions.php) */
  --hdr-bg: #ea2e2e;
  --hdr-fg: #ffffff;
  --ftr-bg: #ea2e2e;
  --ftr-fg: #ffffff;
}

/* ---- reset a few Astra defaults so the custom header/footer look intentional, not "themed" ---- */
body {
  color: var(--brand-ink);
}

a {
  color: var(--brand-red);
}

a:hover,
a:focus {
  color: var(--brand-red-dark);
}

/* ================= HEADER ================= */
.epaper-header {
  background: var(--hdr-bg);
  color: var(--hdr-fg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  position: sticky;
  top: 0;
  z-index: 300;
}

.epaper-header__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 20px;
}

.epaper-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.epaper-header__brand a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.epaper-header__brand img,
.epaper-header__brand .custom-logo {
  max-height: 46px;
  width: auto;
  display: block;
}

.epaper-header__brand span {
  font-size: 22px;
  font-weight: 800;
  color: var(--hdr-fg);
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epaper-nav {
  display: flex;
  align-items: center;
}

.epaper-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.epaper-nav li {
  position: relative;
}

.epaper-nav a {
  display: block;
  padding: 8px 14px;
  color: var(--hdr-fg);
  opacity: .92;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border-radius: 4px;
  position: relative;
  transition: color 0.15s ease;
}

/* sliding underline — expands outward from centre on hover */
.epaper-nav a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  right: 50%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: left 0.2s ease, right 0.2s ease;
}

.epaper-nav a:hover,
.epaper-nav a:focus {
  color: var(--hdr-fg);
  opacity: 1;
}

.epaper-nav a:hover::after,
.epaper-nav a:focus::after {
  left: 10px;
  right: 10px;
}

.epaper-nav .current-menu-item>a {
  color: var(--hdr-fg);
  opacity: 1;
  font-weight: 700;
}

.epaper-nav .current-menu-item>a::after {
  left: 10px;
  right: 10px;
}

/* submenu */
.epaper-nav ul ul {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
  border-radius: 6px;
  padding: 6px;
  display: none;
  flex-direction: column;
}

.epaper-nav li:hover>ul,
.epaper-nav li:focus-within>ul {
  display: flex;
}

.epaper-nav ul ul a {
  font-weight: 500;
  font-size: 14px;
  padding: 8px 12px;
  color: var(--brand-ink);
  border-radius: 4px;
}

/* submenu links: underline uses red on white background */
.epaper-nav ul ul a::after {
  background: var(--brand-red);
}

.epaper-nav ul ul a:hover,
.epaper-nav ul ul a:focus {
  color: var(--brand-red);
  background: #fdeaea;
}

.epaper-nav ul ul .current-menu-item>a {
  color: var(--brand-red);
  background: #fdeaea;
  font-weight: 600;
}

.epaper-burger {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.epaper-burger span {
  width: 22px;
  height: 2.5px;
  background: var(--hdr-fg);
  border-radius: 2px;
  display: block;
}

@media (max-width: 860px) {
  .epaper-burger {
    display: flex;
  }

  /* center the logo on mobile — burger sits absolute on the right */
  .epaper-header__inner {
    justify-content: center;
    position: relative;
  }

  .epaper-burger {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
  }

  .epaper-nav {
    position: fixed;
    inset: var(--header-height) 0 0 auto;
    width: 78vw;
    max-width: 320px;
    background: #ffffff;
    box-shadow: -12px 0 30px rgba(0, 0, 0, .2);
    transform: translateX(100%);
    transition: transform .22s ease;
    padding: 16px 14px;
    overflow-y: auto;
    align-items: flex-start;
  }

  .epaper-nav.is-open {
    transform: translateX(0);
  }

  .epaper-nav ul {
    flex-direction: column;
    gap: 2px;
  }

  /* mobile drawer is white — reset underline to red and link color to dark */
  .epaper-nav a {
    color: var(--brand-ink);
    font-size: 15px;
    padding: 10px 14px;
  }

  .epaper-nav a::after {
    background: var(--brand-red);
  }

  .epaper-nav a:hover,
  .epaper-nav a:focus {
    color: var(--brand-red);
    background: #fdeaea;
  }

  .epaper-nav .current-menu-item>a {
    color: var(--brand-red);
    font-weight: 700;
  }

  .epaper-nav .current-menu-item>a::after {
    background: var(--brand-red);
  }

  .epaper-nav ul ul {
    position: static;
    box-shadow: none;
    padding-left: 12px;
    display: none;
  }

  .epaper-nav li.is-open>ul {
    display: flex;
  }
}

/* ================= FOOTER ================= */
.epaper-footer {
  background: var(--ftr-bg);
  color: var(--ftr-fg);
  margin-top: 16px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.epaper-footer__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 32px var(--container-gutter) 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.epaper-footer__logo {
  display: flex;
  align-items: center;
}

.epaper-footer__logo a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.epaper-footer__logo img,
.epaper-footer__logo .custom-logo {
  max-height: 46px;
  width: auto;
  display: block;
}

.epaper-footer__logo span {
  color: var(--ftr-fg);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .2px;
}

.epaper-footer nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
  margin: 0;
  padding: 0;
}

.epaper-footer nav a {
  color: var(--ftr-fg);
  opacity: .88;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  position: relative;
  transition: color 0.15s ease;
}

/* sliding underline for footer nav links */
.epaper-footer nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: right 0.2s ease;
}

.epaper-footer nav a:hover,
.epaper-footer nav a:focus {
  color: var(--ftr-fg);
  opacity: 1;
}

.epaper-footer nav a:hover::after,
.epaper-footer nav a:focus::after {
  right: 0;
}

.epaper-footer__copy {
  width: 100%;
  border-top: 1px solid color-mix(in srgb, var(--ftr-fg) 25%, transparent);
  margin: 0px;
  padding-top: 16px;
  font-size: 13px;
  color: var(--ftr-fg);
  opacity: .88;
  text-align: center;
}

.epaper-footer__copy a {
  color: var(--ftr-fg);
  text-decoration: underline;
}

@media (max-width: 680px) {
  .epaper-footer__inner {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 16px;
  }

  .epaper-footer nav ul {
    justify-content: center;
  }
}

/* keep the e-paper viewer full-bleed even inside Astra's boxed content wrapper */
.epaper-full-bleed {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.epaper-full-bleed-page .ast-container,
body.epaper-full-bleed-page .site-content .ast-container {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

body.epaper-full-bleed-page #primary,
body.epaper-full-bleed-page .entry-content {
  max-width: none;
  width: 100%;
}