/*
Theme Name: Agentstvo Dialog Modern
Description: Modern, fully responsive theme for the Agentstvo Dialog website. Restores the classic, minimal newspaper/editorial print style using CSS Grid, Flexbox, and fluid typography.
Version: 2.0.0
Author: Agentstvo Dialog
Tags: modern-theme, responsive, grid, flexbox, minimalist, editorial
*/

/* --- 1. DESIGN SYSTEM & TYPOGRAPHIC CORE --- */
:root {
  /* Color Palette - Pure Paper & Ink */
  --bg-primary: #ffffff;
  --bg-secondary: #eff0f2;
  
  --text-main: #111111;
  --text-muted: #444444;
  --text-light: #666666;
  --text-date: #999999;
  
  --border-dotted: 1px dotted #999999;
  --border-double: 3px double #cccccc;
  
  /* Category Signature Colors (Classic Palette) */
  --color-first: #48820e;   /* Green */
  --color-second: #006699;  /* Blue */
  --color-third: #660000;   /* Deep Red */
  --color-fourth: #646250;  /* Olive Warm Gray */
  --color-fifth: #333333;   /* Charcoal */
  --color-sixth: #90644c;   /* Warm Brown */
  --color-seventh: #c55c1a; /* Orange */
  --color-eighth: #330000;  /* Dark Maroon */
  --color-nineth: #993333;  /* Coral Red */
  
  /* Fonts */
  --font-serif: Georgia, serif;
  --font-sans: Tahoma, Arial, Helvetica, sans-serif;
  
  /* Width */
  --container-width: 1280px;
}

/* --- 2. BASE RESET & INITIALS --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  font-size: 100%; /* Default base scaling */
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Scrollbar styling matching minimalist style */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #cccccc;
  border-radius: 3px;
}

/* Typography elements mimicking a printed journal */
h1 { font-family: var(--font-serif); font-size: 2.2em; font-weight: normal; line-height: 1.4em; margin: 0.6em 0 0 0; }
h2 { font-family: var(--font-serif); font-size: 1.9em; font-weight: normal; line-height: 1.4em; margin: 0.6em 0 0 0; }
h3 { font-family: var(--font-serif); font-size: 1.5em; font-weight: normal; line-height: 1.4em; margin: 0.6em 0 0 0; }
h4 { font-family: var(--font-serif); font-size: 1.2em; font-weight: normal; line-height: 1.4em; margin: 0.6em 0 0 0; }
h5 { font-family: var(--font-serif); font-size: 1em;   font-weight: normal; line-height: 1.4em; margin: 0.6em 0 0 0; }
h6 { font-family: var(--font-serif); font-size: .8em;  font-style: italic; color: var(--text-muted); font-weight: normal; line-height: 1.4em; margin: 0.6em 0 0 0; }

address { font-size: 1em; font-family: var(--font-serif); font-weight: normal; font-style: italic; margin: 0; }
pre { font-size: .8em; font-family: var(--font-sans); font-weight: normal; margin: 0; }

a:link { text-decoration: underline; }
a:active { text-decoration: none; }
a:visited { text-decoration: underline; }
a:hover { text-decoration: none; }

/* Image classes matching old WP styles */
.alignleft { float: left; margin: 0.5em 1em 0.5em 0; }
.alignright { float: right; margin: 0.5em 0 0.5em 1em; }
.wp-caption { background-color: #eeeeee; margin: 0 .8em 0 0; padding: 0 0 0 6px; }
.wp-caption-text { margin: 0 0 5px 0; padding: 0; font-size: .8em; line-height: 1.2em; }

/* --- 3. ORIGINAL CATEGORY COLORS (Acoustically exact) --- */
.first a, .first a:link, .first a:visited, .first a:active { color: var(--color-first); }
.first a:hover { color: #3a690c; }
.second a, .second a:link, .second a:visited, .second a:active { color: var(--color-second); }
.second a:hover { color: #00557f; }
.third a, .third a:link, .third a:visited, .third a:active { color: var(--color-third); }
.third a:hover { color: #4d0000; }
.fourth a, .fourth a:link, .fourth a:visited, .fourth a:active { color: var(--color-fourth); }
.fourth a:hover { color: #52503c; }
.fifth a, .fifth a:link, .fifth a:visited, .fifth a:active { color: var(--color-fifth); }
.fifth a:hover { color: #000000; }
.sixth a, .sixth a:link, .sixth a:visited, .sixth a:active { color: var(--color-sixth); }
.sixth a:hover { color: #603f2c; }
.seventh a, .seventh a:link, .seventh a:visited, .seventh a:active { color: var(--color-seventh); }
.seventh a:hover { color: #8f4111; }
.eighth a, .eighth a:link, .eighth a:visited, .eighth a:active { color: var(--color-eighth); }
.eighth a:hover { color: #000000; }
.nineth a, .nineth a:link, .nineth a:visited, .nineth a:active { color: var(--color-nineth); }
.nineth a:hover { color: #800000; }

/* Category Side Menu Styling (Preserved) */
.cat127_hidden, .cat128_hidden, .cat129_hidden, .cat130_hidden, .cat131_hidden, .cat132_hidden, .cat133_hidden, .cat134_hidden, .cat135_hidden {
  display: block;
  font-size: 1.2em;
  font-family: var(--font-serif);
  font-style: italic;
  margin: 1em 0.9em 0 0;
  text-decoration: underline;
}
a.cat127_hidden, a.cat128_hidden, a.cat129_hidden, a.cat130_hidden, a.cat131_hidden, a.cat132_hidden, a.cat133_hidden, a.cat134_hidden, a.cat135_hidden {
  color: var(--text-light);
}
a:hover.cat127_hidden { color: #3a690c; text-decoration: none; }
a:hover.cat128_hidden { color: #00557f; text-decoration: none; }
a:hover.cat129_hidden { color: #4d0000; text-decoration: none; }
a:hover.cat130_hidden { color: #52503c; text-decoration: none; }
a:hover.cat131_hidden { color: #000000; text-decoration: none; }
a:hover.cat132_hidden { color: #603f2c; text-decoration: none; }
a:hover.cat133_hidden { color: #8f4111; text-decoration: none; }
a:hover.cat134_hidden { color: #000000; text-decoration: none; }
a:hover.cat135_hidden { color: #800000; text-decoration: none; }

/* --- 4. HEADER LAYOUT (Clean, Airy) --- */
.site-header {
  width: 100%;
  padding-bottom: 2.35em;
  background-color: var(--bg-primary);
}

.site-header.home-border {
  border-bottom: var(--border-dotted);
}

.header-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 4%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.logo-container {
  display: block;
  margin-left: 5.5%;
  margin-top: 2.5em;
}

.logo {
  background-image: url("images/logo/1280.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left bottom;
  width: 234px;
  height: 90px;
}

.breadcrumbs {
  display: none;
  max-width: min(58%, 720px);
  margin: 0 0 .25em 2rem;
  font-family: var(--font-serif);
  font-size: .92em;
  font-style: italic;
  line-height: 1.45;
  color: var(--text-light);
  text-align: right;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .15em .55em;
  list-style: none;
}

.breadcrumbs li {
  display: inline;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: .55em;
  color: var(--text-date);
}

.breadcrumbs a {
  color: var(--text-light);
  text-decoration: underline;
}

.breadcrumbs a:hover {
  color: var(--text-main);
  text-decoration: none;
}

.breadcrumbs [aria-current="page"] {
  color: var(--text-muted);
}

/* --- 5. CATEGORY INTRO SECTION (Elena Danjkina Portrait, Exact Proportions) --- */
.intro {
  width: 100%;
  border-bottom: 2px dotted #999999;
  background-color: var(--bg-secondary);
}

.intro_text {
  max-width: var(--container-width);
  margin: 0 auto;
  min-height: 333px;
  padding: 3rem 4rem 3rem clamp(340px, 33vw, 480px);
  background-image: url("images/elena_danjkina/1280.jpg");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: auto 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.intro_text_header {
  font-size: 2.5em;
  font-style: italic;
  font-family: var(--font-serif);
  color: #333333;
  line-height: 1.2em;
  margin-bottom: 1rem;
}

.intro_text_message {
  font-size: .85em;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-light);
  line-height: 1.65em;
  padding-right: 8em;
}

.intro_text_signature {
  align-self: flex-end;
  color: var(--text-muted);
  font-size: .9em;
  font-family: var(--font-serif);
  font-style: italic;
  margin-top: 1rem;
  padding-right: 9em;
}

/* --- 6. HOMEPAGE GRID (Clean Airy Columns) --- */
.mainpage_content {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 2em 4% 0 8.35%;
}

.mainpage_menu {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4%;
  width: 100%;
}

/* Individual Category Columns (No boxes, no cards, no shadows) */
.mainpage_menu_block {
  display: block;
  margin-bottom: 4rem;
}

.mainpage_menu_title {
  margin-bottom: 0.6rem;
}

.mainpage_menu_title a {
  font-family: var(--font-serif);
  font-size: 1.55em;
  font-style: italic;
  text-decoration: underline;
}

.mainpage_menu_title a:hover {
  text-decoration: none;
}

.mainpage_menu_item {
  font-size: .94em;
  line-height: 1.65em;
  color: var(--text-main);
  padding-left: 1.8em;
}

.mainpage_menu_item a {
  text-decoration: underline;
}

.mainpage_menu_item a:hover {
  text-decoration: none;
}

/* Delicate 3em dots line */
.dots {
  width: 3em;
  height: 0px;
  padding: 0;
  border-top: 1px dotted #666666;
  margin: .7em 0 .5em 1.8em;
  overflow: hidden;
}

.mainpage_menu_summary_link {
  font-family: var(--font-serif);
  font-size: 1.05em;
  font-style: italic;
  padding-left: 1.8em;
  display: block;
}

.mainpage_menu_summary_link a {
  text-decoration: underline;
}

.mainpage_menu_summary_link p {
  display: inline;
}

.summary-arrow {
  white-space: nowrap;
}

.mainpage_menu_summary_link a:hover {
  text-decoration: none;
}

/* --- 7. INTERNAL PAGES GRID SYSTEM (3-Column Editorial Grid) --- */
.site-container {
  max-width: var(--container-width);
  margin: .75rem auto 0 auto;
  padding: 0 4%;
  display: grid;
  grid-template-columns: 28.9% 6.4% 64.7%;
  align-items: start;
}

/* Column 1: Right-Aligned Sidebar Navigation */
.left_menu {
  text-align: right;
  vertical-align: top;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.current_category_title {
  font-family: var(--font-serif);
  font-size: 2.3em;
  font-style: italic;
  margin: .35em 0 .57em 0;
  display: block;
  line-height: 1.2;
}

.left_menu .current_category_title {
  margin: .45em 0 0 0;
  line-height: 1.03;
}

span.current_category_title {
  font-style: italic;
  color: var(--color-accent, var(--text-main));
}

a.current_category_title {
  text-decoration: underline;
}

a.current_category_title:hover {
  text-decoration: none;
}

.leftmenu_subtitles {
  margin: 1rem 0 1.7em 0;
  width: 100%;
}

.current_category_subtitles {
  font-size: .9em;
  margin: 0 0 0.6rem 0;
  line-height: 1.4;
  padding-right: 0.2rem;
}

.current_category_subtitles a {
  text-decoration: underline;
}

.current_category_subtitles.is-current a {
  color: var(--text-main);
  text-decoration: none;
  box-shadow: none;
}

.current_category_subtitles a:hover {
  text-decoration: none;
}

.current_category_subtitles.is-current a:hover {
  color: var(--text-main);
}

.left_menu_others_dots {
  border-top: 1px dotted #888888;
  width: 80%;
  align-self: flex-end;
  margin: 1rem 0;
}

.left_menu_categories_list {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
}

/* Column 2: Centered Separator td */
.middletd {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 2.3em;
  color: var(--color-accent, var(--text-light));
  line-height: 1.4;
  user-select: none;
  -webkit-user-select: none;
  padding-top: .25em;
}

/* Column 3: Content Area */
.content {
  vertical-align: top;
  padding-left: 0;
}

/* --- 8. INTERNAL STYLING ELEMENTS --- */
.single_article {
  margin-bottom: 3rem;
}

.single_article_title {
  font-family: var(--font-serif);
  font-size: 1.7em;
  font-style: italic;
  margin: .65em 0 .57em 0;
  display: block;
  line-height: 1.35em;
}

.main_article_date {
  color: var(--text-date);
  font-size: .7em;
  margin-bottom: 1.5rem;
}

.main_article_date a {
  text-decoration: underline;
}

.main_article_date a:hover {
  text-decoration: none;
}

.single_article_text {
  font-size: .95em;
  padding-right: 10%;
  line-height: 1.6em;
  color: var(--text-main);
}

.single_article_text p {
  margin-bottom: 1.25rem;
}

.single_article_text img {
  margin: .5em 1em .5em 0em;
  border: 1px solid #666666;
  max-width: 100%;
}

/* Category Page Descriptions */
.category_description {
  margin: 1.4em 10% 2.25em 0;
  font-family: var(--font-serif);
  font-size: .97em;
  line-height: 1.65em;
}

/* Archive title dotted badge wrapper */
.archive-badge-container {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 2rem;
}

.dots_category {
  flex-grow: 1;
  border-bottom: 1px dotted #666666;
  height: 1px;
}

.archive-title-badge {
  padding: 0 1.5rem;
  font-family: var(--font-serif);
  font-size: 1.1em;
  font-style: italic;
  white-space: nowrap;
  color: var(--text-muted);
}

/* Category Post Items */
.category_item_title {
  font-family: var(--font-serif);
  font-size: 1.2em;
  margin: 2rem 10% 2rem 0.8em;
  display: block;
}

.category_item_title a {
  text-decoration: underline;
}

.category_item_title a:hover {
  text-decoration: none;
}

.category_item_description {
  font-family: var(--font-sans);
  font-size: .7em;
  line-height: 1.4em;
  margin: 0.5rem 0 0 0;
  color: var(--text-muted);
}

/* Contact Page Template */
.contacts {
  margin-top: 1.5em;
  line-height: 1.6;
}

/* --- 9. FOOTER SYSTEM (Classic dual double line) --- */
.site-footer {
  max-width: var(--container-width);
  margin: 4em auto 0 auto;
  padding: 1.6em 4% 2em 4%;
  border-top: var(--border-double);
  width: 100%;
}

.footer-container {
  display: grid;
  grid-template-columns: 150px 1fr 35% 100px;
  gap: 1.5%;
  align-items: start;
  font-size: .75em;
  color: var(--text-main);
  line-height: 1.4;
}

.footer-copyright {
  text-align: right;
  color: var(--text-muted);
  padding-right: 1.5em;
}

.footer-org {
  text-align: left;
}

.footer-registered {
  text-align: right;
  padding: 0 0 .5em .4em;
}

.footer_links {
  margin-top: .3em;
}

.footer_links a:link, .footer_links a:visited {
  color: var(--text-date);
  text-decoration: underline;
}

.footer_links a:hover {
  color: #000000;
  text-decoration: none;
}

/* --- 10. TYPOGRAPHIC RESPONSIVENESS --- */

@media (max-width: 1024px) {
  .site-container {
    grid-template-columns: 32% 5% 1fr;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding-bottom: .5em;
  }

  /* Site Layout Stack */
  .site-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: .25rem;
  }
  
  .left_menu {
    display: none; /* Hide desktop sidebar */
  }
  
  .middletd {
    display: none; /* Hide middle slash separator on mobile */
  }

  .content {
    padding-left: 1rem;
  }
  
  /* Header Stack */
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: .65rem;
    padding-bottom: 0;
  }

  .breadcrumbs {
    display: block;
    max-width: calc(100% - 1rem);
    margin: 0 0 0 1rem;
    font-size: .88em;
    text-align: left;
  }

  .breadcrumbs ol {
    gap: .1em .25em;
    justify-content: flex-start;
  }

  .breadcrumbs li + li::before {
    margin-right: .3em;
  }
  
  .logo-container {
    margin-left: 1rem;
    margin-top: 1.4em;
  }
  
  /* Elena Danjkina Banner Stack */
  .intro_text {
    padding: 260px 1.5rem 2rem 1.5rem;
    background-position: top center;
    background-size: 100% auto;
    min-height: auto;
  }
  
  .intro_text_header {
    font-size: 1.8em;
  }
  
  .intro_text_message {
    padding-right: 0;
    font-size: 0.85em;
  }
  
  .intro_text_signature {
    padding-right: 0;
    margin-top: 0.8rem;
  }
  
  /* Homepage Columns Stack */
  .mainpage_content {
    padding: .9em 4% 0 4%;
  }
  
  .mainpage_menu {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .mainpage_menu_block {
    margin-bottom: 2rem;
  }
  
  /* Footer Stack */
  .site-footer {
    padding: 1.5em 4% 1.5em 4%;
    margin-top: 2em;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }
  
  .footer-copyright {
    text-align: center;
    padding-right: 0;
  }
  
  .footer-org {
    text-align: center;
  }
  
  .footer-registered {
    text-align: center;
    padding: 0;
  }
  
  .footer_links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
  }
}

@media (max-width: 480px) {
  .logo {
    width: 178px;
    height: 68px;
  }
  
  .intro_text {
    padding: 180px 1rem 1.5rem 1rem;
  }
}
