* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f7f9;
    color: #222;
}

a {
    color: #2c5aa0;
    text-decoration: none;
}

.site-header {
    background: #2c3e50;
    color: #fff;
    padding: 40px 20px;
    text-align: center;
}

.site-header.small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    text-align: left;
}

.site-header.small h1 {
    font-size: 20px;
    margin: 0;
}

.logo-link {
    color: #fff;
}

.site-header nav a {
    color: #cfd8e3;
    margin-left: 20px;
    font-weight: bold;
}

.site-header nav a.active,
.site-header nav a:hover {
    color: #fff;
    border-bottom: 2px solid #fff;
}

.subtitle {
    color: #cfd8e3;
    margin-top: 8px;
}

/* Главная страница: крупно и понятно, без лишних деталей */
.home-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 50px;
}

.big-button {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border: 3px solid #2c5aa0;
    border-radius: 12px;
    padding: 25px 30px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.big-button:hover,
.big-button:focus {
    background: #2c5aa0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.big-button:hover .big-button-text,
.big-button:focus .big-button-text,
.big-button:hover .big-button-text small,
.big-button:focus .big-button-text small {
    color: #fff;
}

.big-button-icon {
    font-size: 46px;
    line-height: 1;
}

.big-button-text {
    font-size: 26px;
    font-weight: bold;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.big-button-text small {
    font-size: 16px;
    font-weight: normal;
    color: #777;
}

/* Превью фотографий на главной */
.home-preview h2 {
    font-size: 22px;
    margin-bottom: 15px;
}

/* Сетка миниатюр (используется и на главной, и в каталоге) */
.photo-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.photo-thumb-grid.catalog {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

/* Миниатюра: название и тег появляются снизу при наведении */
.photo-thumb {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    background: #ddd;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.photo-thumb img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}

.photo-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 8px 10px;
    transform: translateY(100%);
    transition: transform 0.25s ease;
}

.photo-thumb:hover .photo-overlay,
.photo-thumb:focus .photo-overlay {
    transform: translateY(0);
}

.photo-overlay-title {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: bold;
    line-height: 1.2;
}

.photo-overlay-tag {
    display: inline-block;
    background: #2c5aa0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.photo-overlay-place {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #ccc;
}

/* Контентные страницы */
main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.search-form select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.search-form button {
    padding: 8px 16px;
    background: #2c5aa0;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-form button:hover {
    background: #234478;
}

.reset-link {
    align-self: center;
    color: #888;
    font-size: 14px;
}

.results-count {
    color: #666;
    font-size: 14px;
}

/* Карточка фото (используется в index.html и photos.html) */
.photo-card {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    background: #ddd;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.photo-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center center;
    display: block;
    background: #ddd;
    transition: transform 0.22s ease;
}

.photo-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 12px;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    z-index: 1;
}

.photo-card:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.photo-card:hover img,
.photo-card:focus-within img {
    transform: scale(1.05);
}

.photo-card:hover .photo-info,
.photo-card:focus-within .photo-info {
    transform: translateY(0);
}

.photo-info h5 {
    margin: 0 0 6px 0;
    font-size: 15px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-info .badge {
    font-size: 11px;
    font-weight: normal;
}


.photo-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.photo-card-link:hover,
.photo-card-link:focus {
    color: inherit;
    text-decoration: none;
}

.photo-detail-image {
    width: 100%;
    height: 420px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.photo-detail-hero {
    position: relative;
    overflow: hidden;
    background: #111;
}

.photo-detail-hero .photo-detail-image {
    width: 100%;
    transition: transform 0.28s ease;
}

.photo-detail-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 18px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.28s ease;
    pointer-events: none;
}

.photo-detail-overlay-title {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

.photo-detail-hero:hover .photo-detail-overlay,
.photo-detail-hero:focus-within .photo-detail-overlay {
    transform: translateY(0);
}

.photo-detail-hero:hover .photo-detail-image,
.photo-detail-hero:focus-within .photo-detail-image {
    transform: scale(1.03);
}

.photo-detail-img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.photo-modal-image {
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
    background: #0f172a;
}

.photo-modal-title {
    margin: 0;
}

/* Список мест */
.place-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.place-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    padding: 18px 22px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.place-card-body,
.place-gallery {
    width: 100%;
}

.place-title {
    margin: 0;
}

.place-description {
    margin: 0;
    color: #555;
}

.place-gallery {
    margin-top: 6px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

.place-photo {
    width: 216px;
    height: 300px;
    display: block;
    object-fit: cover;
    border-radius: 10px;
    background: #ddd;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.place-gallery a {
    display: block;
    flex: 0 0 auto;
}

.place-photo:hover {
    transform: scale(1.03);
}

@media (max-width: 576px) {
    .place-photo {
        width: 100px;
        height: 140px;
    }
}

.empty-state {
    color: #888;
    text-align: center;
    margin-top: 40px;
}

/* Форма админки */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
}

.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: bold;
}

.admin-form input,
.admin-form textarea {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-weight: normal;
}

.admin-form button {
    align-self: flex-start;
    padding: 8px 20px;
    background: #2c5aa0;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.admin-form button:hover {
    background: #234478;
}

.site-footer {
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 13px;
}

.hero{
    background:#fafafa;
}

.hero h1{
    font-weight:600;
}

.hero p{
    max-width:700px;
}

hr{
    border-top:2px solid #dcdcdc;
    opacity:1;
}

.site-footer{
    margin-top:50px;
    border-top:1px solid #ddd;
    padding:25px 0;
    text-align:center;
    color:#777;
}

.photo-card{
    transition:.25s;
}

.photo-card:hover{
    transform:translateY(-5px);
}

.btn-success{
    background:#198754;
    border-color:#198754;
}

.btn-success:hover{
    background:#157347;
}

.site-logo {
    height: 100px;
    width: auto;
    object-fit: contain;
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: 600;
}