/*
  This Day In History Plugin CSS
*/

/* ============================================= */
/*              АДМИНКА                           */
/* ============================================= */
.column-event_date { width: 10%; }
.column-event_name { width: 60%; }
.column-event_modified { width: 15%; }
.column-event_type { width: 15%; }
#dashboard_right_now .tdih_event-count a::before { content: "\f321"; }
#dashboard_right_now .tdih_event_type-count a::before { content: "\f321"; }

/* ============================================= */
/*              ОБЩИЕ СТИЛИ АРХИВА               */
/* ============================================= */
.tdih-archive-wrap {
    max-width: 1000px;
    margin: 20px auto;
    font-family: sans-serif;
}

/* Фильтры */
.tdih-archive-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.tdih-archive-view-toggle a {
    display: inline-block;
    padding: 5px 10px;
    background: #f1f1f1;
    color: #333;
    text-decoration: none;
    border: 1px solid #ccc;
    margin-left: 5px;
}
.tdih-archive-view-toggle a.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Выпадающий список месяца */
.tdih-archive-month-selector {
    margin-right: 15px;
}
.tdih-archive-month-selector select {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}
.tdih-archive-month-selector select:hover {
    border-color: #0073aa;
}

/* ============================================= */
/*              КАЛЕНДАРЬ                        */
/* ============================================= */
.tdih-archive-calendar {
    overflow-x: hidden;
}
.tdih-archive-calendar table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.tdih-archive-calendar caption {
    font-size: 1.2em;
    font-weight: bold;
    padding: 10px 0;
}
.tdih-archive-calendar th,
.tdih-archive-calendar td {
    text-align: center;
    padding: 8px 5px;
    border: 1px solid #ddd;
    width: 14.28%;
}
.tdih-archive-calendar td a {
    display: block;
    text-decoration: none;
    color: #333;
}
.tdih-archive-calendar td a sup {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    font-size: 0.6em;
    padding: 0 4px;
    line-height: 1.4;
    margin-left: 2px;
    vertical-align: super;
}
.tdih-archive-calendar td span.tdih-no-events {
    display: block;
    color: #ccc;
    cursor: default;
}
.tdih-day.tdih-has-events a {
    font-weight: bold;
    color: #0073aa;
}
.tdih-day.tdih-selected {
    background: #0073aa;
}
.tdih-day.tdih-selected a {
    color: #fff !important;
}
.tdih-day.tdih-today {
    background: #f0f8ff;
}
.tdih-empty {
    background: #f9f9f9;
}

/* ============================================= */
/*              РЕЖИМ «СПИСОК»                   */
/* ============================================= */
.tdih-archive-events.tdih-list .tdih-event-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    margin-bottom: 5px;
}
.tdih-archive-events.tdih-list .tdih-event-thumb {
    flex: 0 0 90px;
    width: 90px;
    height: 90px;
    overflow: hidden;
}
.tdih-archive-events.tdih-list .tdih-event-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    float: none;
    margin: 0;
}
.tdih-archive-events.tdih-list .tdih-event-body {
    flex: 1;
    padding-left: 5px;
}

/* ============================================= */
/*              РЕЖИМ «ПЛИТКА»                   */
/* ============================================= */
.tdih-archive-events.tdih-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    clear: both;
}
.tdih-archive-events.tdih-grid h3 {
    width: 100%;
    flex: 0 0 100%;
    margin-bottom: 15px;
}
.tdih-archive-events.tdih-grid .tdih-grid-item {
    flex: 1 1 calc(33.333% - 20px);
    box-sizing: border-box;
    background: #f9f9f9;
    border: 1px solid #ddd;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 10px;
}
.tdih-archive-events.tdih-grid .tdih-event-thumb {
    width: 90px;
    height: 90px;
    margin: 10px auto 0;
    overflow: hidden;
    flex-shrink: 0;
}
.tdih-archive-events.tdih-grid .tdih-event-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    float: none;
    margin: 0;
    border-radius: 50%;
    border: 2px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.tdih-archive-events.tdih-grid .tdih-event-body {
    padding: 10px 10px 15px;
}
.tdih-archive-events.tdih-grid .tdih-event-date {
    font-weight: bold;
    color: #555;
    text-align: center;
}
.tdih-archive-events.tdih-grid .tdih-event-content p {
    margin: 5px 0 0;
    color: #666;
    text-align: left;
}

/* ============================================= */
/*              ОБЩИЕ СТИЛИ ДЛЯ ЭЛЕМЕНТОВ        */
/* ============================================= */
.tdih-event-date {
    font-weight: bold;
    color: #555;
}
.tdih-event-content p {
    margin: 5px 0 0;
    color: #666;
}

/* Ссылка на месяц в заголовке */
.tdih-archive-events h3 a {
    text-decoration: underline;
    color: #0073aa;
}
.tdih-archive-events h3 a:hover {
    text-decoration: none;
}