/*
Theme Name: Мои сайты
Description: Минималистичная витрина сайтов с превью.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: my-sites-apple
*/

:root {
    color-scheme: light;

    --background: #f5f5f7;
    --surface: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --border: #e5e5e7;
    --blue: #0071e3;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

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

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;

    background: var(--background);
    color: var(--text);
}

a {
    color: inherit;
}

::selection {
    background: #cce4ff;
    color: var(--text);
}

/* Содержимое страницы */

.sites-page {
    width: min(100%, 1256px);
    margin: 0 auto;
    padding: 88px 32px 112px;
}

.sites-heading {
    margin-bottom: 46px;
}

.sites-heading h1 {
    margin: 0;

    font-size: clamp(44px, 5.4vw, 68px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.06em;
}

.sites-heading h1 span {
    color: var(--blue);
}

/* Сетка */

.sites-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
}

.site-card {
    display: block;
    min-width: 0;
    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 28px;

    background: var(--surface);
    color: var(--text);
    text-decoration: none;

    box-shadow: 0 3px 18px rgba(0, 0, 0, 0.025);
    -webkit-tap-highlight-color: transparent;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.site-card:hover {
    transform: translateY(-5px);
    border-color: #d2d2d7;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.08);
}

.site-card:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.5);
    outline-offset: 4px;
}

/* Превью сайта */

.site-card__browser {
    overflow: hidden;
    border: 1px solid #e8e8ed;
    border-radius: 18px;
    background: #f0f0f2;
}

.site-card__toolbar {
    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    height: 37px;
    padding: 0 76px;

    border-bottom: 1px solid #e8e8ed;
    background: #fafafa;
}

.site-card__dots {
    display: flex;
    gap: 5px;

    position: absolute;
    left: 15px;
}

.site-card__dots i {
    width: 8px;
    height: 8px;

    border: 1px solid #dedee1;
    border-radius: 50%;
    background: #e8e8ed;
}

.site-card__address {
    display: block;
    overflow: hidden;
    max-width: 100%;

    color: #86868b;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-card__viewport {
    display: grid;
    place-items: center;

    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;

    background: linear-gradient(135deg, #edf2fa, #e7eaf2);
}

.site-card:nth-child(4n + 2) .site-card__viewport {
    background: linear-gradient(135deg, #eeeafa, #e5eaf7);
}

.site-card:nth-child(4n + 3) .site-card__viewport {
    background: linear-gradient(135deg, #e5f2f0, #e6eaf2);
}

.site-card:nth-child(4n + 4) .site-card__viewport {
    background: linear-gradient(135deg, #f7eee8, #f0eaf0);
}

.site-card__letter {
    color: rgba(29, 29, 31, 0.12);
    font-size: clamp(68px, 12vw, 128px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.06em;
    text-transform: uppercase;
    user-select: none;
}

.site-card__image {
    display: block;
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center top;

    opacity: 0;
    transition: opacity 0.25s ease;
}

.site-card__viewport.is-loaded .site-card__image {
    opacity: 1;
}

/* Название и ссылка */

.site-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    min-height: 100px;
    padding: 22px 14px 10px;
}

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

.site-card__details h2 {
    margin: 0;

    font-size: clamp(20px, 2.4vw, 24px);
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.site-card__domain {
    display: block;
    overflow: hidden;
    margin-top: 6px;

    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-card__arrow {
    display: grid;
    place-items: center;
    flex: 0 0 42px;

    width: 42px;
    height: 42px;

    border: 1px solid #e5e5e7;
    border-radius: 50%;

    background: #f5f5f7;
    color: var(--text);

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.site-card__arrow svg {
    width: 19px;
    height: 19px;
}

.site-card:hover .site-card__arrow {
    border-color: var(--blue);
    background: var(--blue);
    color: #ffffff;
}

.add-site-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 0 24px;

    border-radius: 100px;
    background: var(--blue);
    color: #ffffff;

    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.add-site-link:hover {
    background: #0077ed;
}

.add-site-link:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.4);
    outline-offset: 3px;
}

/* Адаптивность */

@media (max-width: 920px) {

    .sites-page {
        padding: 72px 24px 90px;
    }

    .sites-grid {
        gap: 18px;
    }

    .site-card {
        padding: 10px;
        border-radius: 22px;
    }

    .site-card__browser {
        border-radius: 14px;
    }

    .site-card__bottom {
        min-height: 92px;
        padding: 19px 10px 9px;
    }

}

@media (max-width: 680px) {

    .sites-page {
        padding: 52px 16px 70px;
    }

    .sites-heading {
        margin-bottom: 30px;
    }

    .sites-heading h1 {
        font-size: 46px;
    }

    .sites-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .site-card {
        padding: 10px;
        border-radius: 22px;
    }

    .site-card__bottom {
        min-height: 88px;
    }

    .site-card__details h2 {
        font-size: 21px;
    }

}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

}
