/*
Theme Name: Kagojer Singho
Theme URI: https://example.com/kagojer-singho
Author: Kagojer Singho
Author URI: https://example.com
Description: A Bangla vintage and classic newspaper theme with old-press typography, column layouts, and warm paper textures.
Version: 1.1.3
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kagojer-singho
Tags: blog, news, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  --paper: #f3ead5;
  --paper-deep: #e3d3ad;
  --ink: #1d1712;
  --ink-soft: #4d4034;
  --accent: #8f241b;
  --gold: #b68436;
  --line: rgba(29, 23, 18, 0.34);
  --shadow: rgba(29, 23, 18, 0.16);
  --lead-headline: 68px;
  --secondary-headline: 38px;
  --font-bangla: "Noto Serif Bengali", "SolaimanLipi", "Kalpurush", "Bangla MN", serif;
  --font-latin: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(143, 36, 27, 0.08), transparent 22rem),
    linear-gradient(90deg, rgba(29, 23, 18, 0.035) 1px, transparent 1px),
    linear-gradient(var(--paper), var(--paper));
  background-size: auto, 18px 18px, auto;
  font-family: var(--font-bangla);
  font-size: 18px;
  line-height: 1.72;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(29, 23, 18, 0.025), rgba(29, 23, 18, 0.025) 1px, transparent 1px, transparent 4px),
    radial-gradient(rgba(29, 23, 18, 0.09) 0.6px, transparent 0.6px);
  background-size: 100% 6px, 9px 9px;
  mix-blend-mode: multiply;
  opacity: 0.42;
  z-index: 1000;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover,
a:focus {
  color: #5f1711;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  clip: auto;
  padding: 0.55rem 0.8rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 2000;
}

.site {
  width: min(1260px, calc(100% - 24px));
  margin: 0 auto;
  background: color-mix(in srgb, var(--paper) 86%, white 14%);
  border-left: 1px solid rgba(29, 23, 18, 0.18);
  border-right: 1px solid rgba(29, 23, 18, 0.18);
  padding: 0 0.85rem;
}

.site-header {
  padding: 0.85rem 0 0.55rem;
  border-bottom: 8px double var(--ink);
}

.top-strip {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.22rem 0.35rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(260px, auto) minmax(130px, 1fr);
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0 0.45rem;
  text-align: center;
}

.masthead::before,
.masthead::after {
  content: "";
  min-height: 76px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background:
    linear-gradient(135deg, transparent 44%, rgba(29, 23, 18, 0.16) 45%, rgba(29, 23, 18, 0.16) 55%, transparent 56%),
    linear-gradient(45deg, transparent 44%, rgba(29, 23, 18, 0.12) 45%, rgba(29, 23, 18, 0.12) 55%, transparent 56%);
  background-size: 18px 18px;
  opacity: 0.7;
}

.site-branding {
  min-width: min(620px, 100%);
}

.custom-logo-link {
  display: inline-flex;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.custom-logo {
  max-height: 86px;
  width: auto;
}

.site-title {
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 6.25rem);
  line-height: 0.86;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
  text-shadow: 2px 2px 0 rgba(143, 36, 27, 0.12);
  overflow-wrap: anywhere;
}

.site-title a {
  color: var(--ink);
  text-decoration: none;
}

.site-description {
  margin: 0.32rem auto 0;
  max-width: 36rem;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 2vw, 1.18rem);
  font-weight: 700;
}

.edition-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.1rem;
  padding: 0.34rem 0;
  border-top: 4px solid var(--ink);
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.main-navigation {
  position: relative;
  margin-top: 0.55rem;
}

.menu-toggle {
  display: none;
  width: 100%;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  font-weight: 800;
  cursor: pointer;
}

.main-navigation ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-navigation a {
  display: block;
  padding: 0.42rem 0.85rem;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

.main-navigation li:last-child a {
  border-right: 0;
}

.main-navigation a:hover,
.main-navigation a:focus {
  background: rgba(143, 36, 27, 0.1);
  color: var(--accent);
}

.site-main {
  padding: 0.85rem 0 2.5rem;
}

.layout {
  display: block;
}

.front-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 1.35rem;
  align-items: start;
}

.newspaper-front {
  border-top: 2px solid var(--ink);
}

.lead-story {
  border-bottom: 5px solid var(--ink);
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
}

.lead-story .headline-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "meta"
    "title"
    "summary"
    "more";
  gap: 0.55rem 1rem;
  margin: 0;
  padding: 0;
  border-bottom: 0;
}

.lead-story .headline-card.has-lead-image,
.lead-story .headline-card:has(.post-thumbnail) {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  grid-template-areas:
    "meta meta"
    "title title"
    "summary image"
    "more image";
}

.lead-story .entry-header {
  display: contents;
}

.lead-story .entry-meta {
  grid-area: meta;
}

.lead-story .entry-title {
  grid-area: title;
  width: 100%;
  margin: 0;
  font-size: clamp(3.2rem, 8.6vw, calc(var(--lead-headline) * 1.35));
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.lead-story .entry-summary {
  grid-area: summary;
  columns: 4;
  column-gap: 1.15rem;
  column-rule: 1px solid var(--line);
  font-weight: 700;
}

.lead-story .headline-card.has-lead-image .entry-summary,
.lead-story .headline-card:has(.post-thumbnail) .entry-summary {
  columns: 3;
}

.lead-story .read-more {
  grid-area: more;
}

.lead-story .post-thumbnail {
  grid-area: image;
  align-self: stretch;
  margin: 0;
  box-shadow: none;
  border-width: 2px;
}

.lead-story .post-thumbnail img {
  height: 100%;
  min-height: 240px;
  aspect-ratio: auto;
  object-fit: cover;
}

.front-secondary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.front-secondary .post-card {
  display: block;
  min-height: 100%;
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.front-secondary .post-card:nth-child(3n) {
  border-right: 0;
}

.front-secondary .post-card:nth-child(1),
.front-secondary .post-card:nth-child(2) {
  grid-column: span 1;
}

.front-secondary .post-card .entry-title {
  font-size: clamp(2rem, 4vw, calc(var(--secondary-headline) * 1.65));
  line-height: 0.98;
}

.front-secondary .post-card:nth-child(n + 3) .entry-title {
  font-size: clamp(1.55rem, 2.6vw, calc(var(--secondary-headline) * 1.1));
  line-height: 1.04;
}

.front-secondary .post-thumbnail {
  box-shadow: none;
  margin-bottom: 0.65rem;
}

.front-secondary .post-thumbnail img {
  aspect-ratio: 4 / 3;
  filter: grayscale(0.45) sepia(0.25) contrast(1.08);
}

.section-title,
.widget-title,
.page-title,
.comments-title,
.comment-reply-title {
  margin: 0 0 0.85rem;
  padding-bottom: 0.32rem;
  border-bottom: 3px double var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.22;
  font-weight: 900;
}

.headline-card,
.post-card,
.single-article,
.page-article,
.not-found {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.25rem;
  margin-bottom: 1.35rem;
}

.headline-card {
  padding: 0 0 1.35rem;
}

.post-thumbnail {
  margin-bottom: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--paper-deep);
  box-shadow: 5px 5px 0 var(--shadow);
}

.post-thumbnail img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: sepia(0.2) contrast(1.05);
}

.headline-card .post-thumbnail img {
  aspect-ratio: 1.65 / 1;
}

.entry-title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.8rem, 4vw, 4.2rem);
  line-height: 1.12;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.post-card .entry-title {
  font-size: clamp(1.55rem, 2.8vw, 2.6rem);
}

.entry-title a {
  color: var(--ink);
  text-decoration: none;
}

.entry-title a:hover,
.entry-title a:focus {
  color: var(--accent);
}

.entry-meta,
.entry-footer {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.entry-meta span,
.entry-footer span {
  margin-right: 0.55rem;
}

.entry-summary,
.entry-content {
  color: var(--ink);
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content p {
  margin: 0 0 1.05rem;
}

.entry-content blockquote {
  margin: 1.3rem 0;
  padding: 0.3rem 1rem;
  border-left: 5px solid var(--accent);
  color: var(--ink-soft);
  font-size: 1.15rem;
  font-weight: 700;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--line);
  padding: 0.5rem;
}

.read-more {
  display: inline-flex;
  align-items: center;
  margin-top: 0.35rem;
  color: var(--accent);
  font-weight: 900;
}

.rail-list .post-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.8rem;
}

.rail-list .post-thumbnail {
  margin: 0;
  box-shadow: none;
}

.rail-list .post-thumbnail img {
  aspect-ratio: 1 / 1;
}

.rail-list .entry-summary {
  display: none;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.post-grid .post-card {
  margin: 0;
  padding: 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.newspaper-columns .entry-content {
  column-count: 2;
  column-gap: 2rem;
  column-rule: 1px solid var(--line);
}

.sidebar {
  display: none;
  border-left: 1px solid var(--line);
  padding-left: 1.15rem;
}

.widget {
  margin-bottom: 1.35rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.widget ul {
  margin: 0;
  padding-left: 1.2rem;
}

.widget li {
  margin-bottom: 0.38rem;
}

.search-form {
  display: flex;
  gap: 0.35rem;
}

.search-field,
.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--ink);
  background: rgba(255, 252, 244, 0.55);
  color: var(--ink);
  padding: 0.55rem 0.65rem;
}

.search-submit,
.submit,
.wp-block-button__link {
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.52rem 0.78rem;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

.search-submit:hover,
.submit:hover,
.wp-block-button__link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff8e8;
}

.pagination,
.post-navigation,
.posts-navigation {
  margin: 1.6rem 0;
  padding-top: 1rem;
  border-top: 3px double var(--ink);
}

.nav-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-numbers,
.nav-links a {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 0.35rem 0.62rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.page-numbers.current,
.nav-links a:hover,
.nav-links a:focus {
  background: var(--ink);
  color: var(--paper);
}

.comments-area {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 5px double var(--ink);
}

.comment-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-body {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.comment-meta {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.site-footer {
  padding: 1rem 0 1.4rem;
  border-top: 5px double var(--ink);
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.92rem;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  text-align: left;
}

.footer-column {
  border-right: 1px solid var(--line);
  padding-right: 1rem;
}

.footer-column:last-child {
  border-right: 0;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text,
.gallery-caption {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.alignleft {
  float: left;
  margin: 0.35rem 1rem 1rem 0;
}

.alignright {
  float: right;
  margin: 0.35rem 0 1rem 1rem;
}

.aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.bypostauthor {
  border-left: 4px solid var(--gold);
  padding-left: 0.7rem;
}

@media (max-width: 900px) {
  .layout,
  .lead-story .headline-card,
  .front-secondary,
  .front-grid,
  .post-grid,
  .footer-columns {
    grid-template-columns: 1fr;
  }

  .lead-story .headline-card {
    grid-template-areas:
      "meta"
      "title"
      "image"
      "summary"
      "more";
  }

  .lead-story .entry-summary {
    columns: 2;
  }

  .lead-story .post-thumbnail img {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .front-secondary {
    border-left: 1px solid var(--line);
  }

  .front-secondary .post-card,
  .front-secondary .post-card:nth-child(3n) {
    border-right: 0;
  }

  .front-secondary .post-card {
    border-right: 1px solid var(--line);
  }

  .masthead {
    grid-template-columns: 1fr minmax(260px, auto) 1fr;
    gap: 0.55rem;
  }

  .masthead::before,
  .masthead::after {
    min-height: 44px;
  }

  .newspaper-columns .entry-content {
    column-count: 1;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  .site {
    width: min(100% - 12px, 1180px);
    padding: 0 0.45rem;
    border-left: 0;
    border-right: 0;
  }

  .site-header {
    padding-top: 0.55rem;
    border-bottom-width: 6px;
  }

  .top-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 0.2rem 0.8rem;
    font-size: 0.72rem;
    line-height: 1.45;
  }

  .masthead {
    grid-template-columns: 1fr;
    padding: 0.55rem 0 0.35rem;
  }

  .masthead::before,
  .masthead::after {
    min-height: 12px;
    background-size: 12px 12px;
  }

  .site-branding {
    min-width: 0;
  }

  .site-title {
    font-size: clamp(2.7rem, 16vw, 4.8rem);
    line-height: 0.92;
  }

  .site-description {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .edition-bar {
    gap: 0.2rem 0.7rem;
    font-size: 0.76rem;
    line-height: 1.45;
  }

  .menu-toggle {
    display: block;
  }

  .main-navigation ul {
    display: none;
    border: 1px solid var(--line);
    border-top: 0;
  }

  .main-navigation.toggled ul {
    display: block;
  }

  .main-navigation a {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    white-space: normal;
  }

  .site-main {
    padding-top: 0.6rem;
  }

  .lead-story {
    margin-bottom: 0.7rem;
    padding-bottom: 0.55rem;
    border-bottom-width: 4px;
  }

  .lead-story .entry-title {
    font-size: clamp(2.55rem, 13.5vw, 4.9rem);
    line-height: 0.94;
  }

  .lead-story .entry-meta,
  .entry-meta,
  .entry-footer {
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .lead-story .entry-summary {
    columns: 1;
    font-size: 0.96rem;
    line-height: 1.65;
  }

  .front-secondary {
    border-left: 1px solid var(--line);
  }

  .front-secondary .post-card {
    padding: 0.75rem 0.7rem 0.85rem;
  }

  .front-secondary .post-card .entry-title,
  .front-secondary .post-card:nth-child(n + 3) .entry-title {
    font-size: clamp(1.75rem, 9vw, 2.8rem);
    line-height: 1;
  }

  .front-secondary .entry-summary {
    font-size: 0.95rem;
    line-height: 1.62;
  }

  .post-grid .post-card {
    padding: 0.75rem 0.7rem 0.85rem;
  }

  .entry-title,
  .post-card .entry-title {
    font-size: clamp(1.75rem, 9vw, 2.85rem);
    line-height: 1;
  }

  .rail-list .post-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .search-form {
    display: grid;
  }

  .footer-columns {
    gap: 0;
  }
}

@media (min-width: 681px) and (max-width: 1100px) {
  .site {
    width: min(100% - 20px, 1040px);
    padding: 0 0.7rem;
  }

  .site-title {
    font-size: clamp(3.3rem, 9vw, 5.7rem);
  }

  .lead-story .entry-title {
    font-size: clamp(3.6rem, 9vw, 6.7rem);
    line-height: 0.88;
  }

  .lead-story .entry-summary {
    columns: 2;
  }

  .front-secondary,
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .front-secondary .post-card:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .front-secondary .post-card:nth-child(2n),
  .post-grid .post-card:nth-child(2n) {
    border-right: 0;
  }

  .front-secondary .post-card .entry-title,
  .front-secondary .post-card:nth-child(n + 3) .entry-title {
    font-size: clamp(1.9rem, 4.6vw, 3.35rem);
  }
}

@media (max-width: 420px) {
  .site {
    width: 100%;
    padding: 0 0.38rem;
  }

  .site-title {
    font-size: clamp(2.35rem, 15vw, 3.8rem);
  }

  .lead-story .entry-title {
    font-size: clamp(2.15rem, 12.5vw, 3.6rem);
  }

  .front-secondary .post-card .entry-title,
  .front-secondary .post-card:nth-child(n + 3) .entry-title,
  .entry-title,
  .post-card .entry-title {
    font-size: clamp(1.45rem, 8.5vw, 2.25rem);
  }

  .top-strip span,
  .edition-bar span {
    max-width: 100%;
  }
}
