:root {
  --page-max: 980px;
  
  --bg-main: #FAFAFA;
  --bg-white: #FFFFFF;
  --bg-header: #FFFFFFAB;
  
  --color-text: #111111;
  --color-muted: #6E6E6E;
  --color-border: #DCDCDC;
  --color-primary: #3D8EDA;
  --color-placeholder: #9A9A9A;
  --color-icon-inactive: #C4C4C4;
  
  --shadow-header: 0px 4px 24px 0px rgba(0, 0, 0, 0.12);
  --shadow-header-inset: inset 0px 12px 24px 0px rgba(0, 0, 0, 0.12);
  --shadow-logo: 0px 4px 8px rgba(0, 0, 0, 0.15);
  
  --radius-xl: 30px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 4px;
  
  --font-brand: 'Montserrat', sans-serif;
  --font-main: 'Roboto', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--bg-main);
}

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

button,
input {
  font: inherit;
}

.page {
  position: relative;
  overflow-x: hidden;
  min-height: 100%;
}

.page__decor {
  position: absolute;
  inset: auto;
  pointer-events: none;
  z-index: 1;
  background-repeat: no-repeat;
  background-size: contain;
}

.page__decor--top {
  top: 0;
  left: 0;
  width: 700px;
  height: 480px;
  background-image: url("../images/vector-1.png");
  transition: width 0.3s ease, height 0.3s ease;
}

.page__decor--bottom {
  position: fixed;
  right: 0;
  bottom: -60px;
  width: 240px;
  height: 520px;
  background-image: url("../images/vector-2.png");
  transition: width 0.3s ease, height 0.3s ease;
}

.page__main {
  position: relative;
  z-index: 2;
  padding: 0;
}

.profile {
  width: 100%;
  background: var(--bg-header);
  box-shadow: var(--shadow-header), var(--shadow-header-inset);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 24px 0;
  transition: background 0.3s ease;
}

.profile.is-scrolled {
  background: var(--bg-white) !important;
}

.profile__container {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 16px;
}

.profile__inner {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.profile__logo-col {
  flex-shrink: 0;
  padding: 0 40px;
}

.profile__logo {
  width: 110px;
  height: auto;
  aspect-ratio: 1 / 1;
  transition: filter 0.3s ease, width 0.3s ease;
}

.profile.is-scrolled .profile__logo {
  filter: drop-shadow(var(--shadow-logo));
}

.profile__content-col {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.profile__name-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.profile__name {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 500;
  font-size: 24px;
  line-height: 100%;
  letter-spacing: -0.01em;
}

.profile__date-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: 3px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.profile__stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.profile__stat {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.profile__stat-count {
  font-weight: 700;
  font-size: 14px;
}

.profile__stat-label {
  font-size: 14px;
  color: var(--color-text);
}

.profile__filters {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.profile__date-label {
  font-size: 14px;
  color: var(--color-text);
}

.filters__range {
  display: flex;
  gap: 10px;
}

.filters__field {
  width: 175px;
  display: flex;
  align-items: stretch;
}

.filters__input {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 13px;
  background: var(--bg-white) !important;
  color: var(--color-text) !important;
  outline: none;
  transition: border-color 0.2s ease;
}

.filters__input:focus {
  border-color: var(--color-primary);
}

.filters__input::placeholder {
  color: var(--color-placeholder);
}

.filters__actions {
  display: flex;
  height: 28px;
}

.filters__action {
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  background: #F3F3F3;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.filters__action:hover {
  background: #E8E8E8;
  color: var(--color-primary);
}

.filters__action--clear {
  border-left: 0;
  font-size: 16px;
  line-height: 1;
}

.filters__action--calendar {
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #8B8B8B;
}

.posts {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px 16px 56px;
}

.posts__inner {
  padding: 8px 0 0;
}

.posts__controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.view-toggle {
  display: flex;
  gap: 20px;
  align-items: center;
}

.view-toggle__btn {
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-icon-inactive);
  transition: color 0.2s ease;
}

.view-toggle__btn.is-active {
  color: var(--color-primary);
}

.posts__list {
  display: grid;
  gap: 22px;
}

.posts__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
  color: var(--color-muted);
  font-size: 18px;
  font-weight: 500;
}

.posts__list--grid {
  grid-template-columns: repeat(4, 1fr);
}

.post-card {
  background: var(--bg-white);
}

.post-card__img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.post-card__body {
  padding: 12px 12px 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  row-gap: 12px;
  align-items: start;
}

.post-card__title {
  font-size: 13px;
  font-weight: 700;
}

.post-card__date {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.post-card__main {
  grid-column: 1 / 2;
}

.post-card__side {
  grid-column: 2 / 3;
  text-align: right;
}

.post-card__meta {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.post-card__meta--right {
  align-items: flex-end;
}

.post-card__stat {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}

.post-card__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.post-card__footer {
  grid-column: 1 / -1;
  margin-top: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  row-gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.post-card__footer-title {
  color: var(--color-text);
  font-weight: 700;
}

.post-card__footer-date {
  justify-self: end;
}

.posts__list--list {
  grid-template-columns: 1fr;
  gap: 12px;
}

.posts__list--list .post-card {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
}

.posts__list--list .post-card__img {
  height: 90px;
  width: 90px;
}

.posts__list--list .post-card__body {
  padding: 16px 30px;
  grid-template-columns: 260px 220px 1fr;
  column-gap: 32px;
  row-gap: 0;
  align-items: center;
}

.posts__list--list .post-card__main {
  grid-column: 1 / 2;
}

.posts__list--list .post-card__side {
  grid-column: 2 / 3;
  text-align: left;
}

.posts__list--list .post-card__date {
  text-align: left;
}

.posts__list--list .post-card__meta {
  margin-top: 6px;
  flex-direction: row;
  gap: 16px;
  align-items: center;
}

.posts__list--list .post-card__meta--right {
  align-items: center;
}

.posts__list--list .post-card__footer {
  grid-column: 3 / 4;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.posts__more {
  display: flex;
  justify-content: center;
  padding: 28px 0 0;
}

.posts__more-btn {
  height: 34px;
  padding: 0 24px;
  border-radius: 18px;
  border: 1px solid #BCBCBC;
  background: transparent;
  color: #777777;
  font-size: 11px;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.posts__more-btn:active {
  transform: translateY(1px);
}

.flatpickr-calendar {
  border-radius: 10px;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.18);
}

.flatpickr-months .flatpickr-month {
  height: 40px;
}

.flatpickr-current-month {
  padding-top: 8px;
  font-size: 14px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  pointer-events: none;
  font-weight: 600;
}

.flatpickr-current-month input.cur-year {
  font-weight: 600;
}

@media (max-width: 980px) {
  .posts__list--grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .profile__logo-col {
    padding: 0 20px;
  }
  .profile__logo {
    width: 80px;
  }
  .profile__name {
    font-size: 20px;
  }
  .profile__stats {
    gap: 15px;
  }
  .posts__list--list .post-card__body {
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 15px;
    padding: 12px 15px;
  }
  .page__decor--top {
    width: 500px;
    height: 340px;
  }
  .page__decor--bottom {
    width: 180px;
    height: 390px;
  }
}

@media (max-width: 768px) {
  .posts__list--grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .posts__list--list .post-card {
    grid-template-columns: 70px 1fr;
    gap: 12px;
  }
  .posts__list--list .post-card__img {
    width: 70px;
    height: 70px;
  }
  .posts__list--list .post-card__body {
    grid-template-columns: 1fr 1fr;
    row-gap: 10px;
    padding: 10px 12px;
  }
  .posts__list--list .post-card__footer {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (max-width: 600px) {
  .profile__inner {
    gap: 10px;
  }
  .profile__logo-col {
    padding: 0 10px;
  }
  .profile__logo {
    width: 60px;
  }
  .profile__name {
    font-size: 18px;
  }
  .profile__stats {
    gap: 10px;
  }
  .profile__stat-count, .profile__stat-label {
    font-size: 12px;
  }
  .filters__field {
    width: 140px;
  }
  .filters__range {
    gap: 5px;
  }
  .page__decor--top {
    width: 320px;
    height: 240px;
  }
  .page__decor--bottom {
    width: 120px;
    height: 260px;
  }
}

@media (max-width: 480px) {
  .posts__controls {
    display: none;
  }
  
  .profile__container {
    padding: 0 10px;
  }
  .profile__logo-col {
    padding: 0 5px;
  }
  .profile__logo {
    width: 50px;
  }
  .profile__name-row {
    gap: 8px;
  }
  .profile__name {
    font-size: 16px;
    word-break: break-word;
  }
  .profile__date-info {
    padding: 4px 8px;
    font-size: 11px;
  }
  .posts__list--list .post-card {
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  }
  .posts__list--list .post-card__img {
    width: 100%;
    height: 180px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }
  .posts__list--list .post-card__body {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 15px;
  }
  .posts__list--list .post-card__footer {
    margin-top: 8px;
    padding-top: 8px;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .posts__list--grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 450px) {
  .profile__stats {
    gap: 5px;
  }
  .profile__stat {
    gap: 2px;
  }
  .profile__name {
    font-size: 14px;
  }
  .profile__date-info {
    font-size: 10px;
    padding: 3px 6px;
  }
  .filters__field {
    width: 110px;
  }
  .profile__date-label{
    display: none;
  }
}
