/* ==========================================================================
   Base
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f2ee;
    padding: 0;
    margin: 0;
    line-height: 1.6;
}

body.modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   Header & Nav
   ========================================================================== */

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0 10px;
    margin-bottom: 10px;
    background-color: #f5f2ee;
}

.site-title {
    font-family: "Newsreader", serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-size: 28px;
    color: #333;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.site-title:hover {
    color: #000;
}

.nav-links {
    text-align: center;
    margin: 20px 0 40px 0;
    padding: 0;
}

.nav-links a {
    color: #666;
    text-decoration: none;
    font-size: 16px;
    margin: 0 15px;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: #333;
    text-decoration: underline;
}

.nav-links a.active {
    color: #333;
    font-weight: 600;
}

.nav-links span {
    color: #ccc;
    margin: 0 5px;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1 {
    text-align: center;
    font-size: 48px;
    font-weight: 500;
    color: #333;
    margin-bottom: 16px;
    letter-spacing: -1px;
    font-family: "Newsreader", serif;
    font-optical-sizing: auto;
}

.subtitle {
    text-align: center;
    font-size: 18px;
    color: #666;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
    font-family: "Newsreader", serif;
    font-optical-sizing: auto;
    font-weight: 500;
}

/* ==========================================================================
   Gallery Grid
   ========================================================================== */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}

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

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 50%; /* 2:1 aspect ratio matches Midjourney --ar 21 */
    overflow: hidden;
    background: #f0f0f0;
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-image {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.card-title {
    font-size: 22px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    margin: 0;
    flex: 1;
    font-family: "Newsreader", serif;
    font-optical-sizing: auto;
    font-style: italic;
}

/* ==========================================================================
   Like / Star — card badges
   ========================================================================== */

.card-badges {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.card-liked-badge,
.card-stars-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.card-liked-badge.visible,
.card-stars-badge.visible {
    opacity: 1;
}

.card-liked-badge { color: #b85c5c; }
.card-stars-badge { color: #b59149; }

.card-liked-badge svg,
.card-stars-badge svg {
    width: 13px;
    height: 13px;
}

/* ==========================================================================
   Like / Star — filter buttons
   ========================================================================== */

.filter-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: -16px 0 32px;
    min-height: 38px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: #fff;
    color: #555;
    border: 1px solid #d8d2c8;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    font-family: inherit;
}

.filter-btn:hover {
    background: #faf7f2;
    border-color: #c2bbad;
}

.filter-btn svg {
    width: 14px;
    height: 14px;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.filter-btn.hidden { display: none; }

.favs-btn { color: #b85c5c; border-color: #e6cfcf; }
.favs-btn:hover { border-color: #b85c5c; }
.favs-btn.active {
    background: #b85c5c;
    border-color: #b85c5c;
    color: #fff;
}

.stars-btn { color: #b59149; border-color: #e8dec3; }
.stars-btn:hover { border-color: #b59149; }
.stars-btn.active {
    background: #b59149;
    border-color: #b59149;
    color: #fff;
}

/* ==========================================================================
   Like / Star — modal heart + star pill
   ========================================================================== */

.lb-like-btn {
    flex-shrink: 0;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, border-color 0.15s, background 0.15s;
    padding: 0;
}

.lb-like-btn:hover {
    transform: scale(1.08);
    border-color: #b85c5c;
}

.lb-like-btn svg {
    width: 18px;
    height: 18px;
    stroke: #aaa;
    fill: none;
    transition: stroke 0.15s, fill 0.15s;
}

.lb-like-btn:hover svg { stroke: #b85c5c; }

.lb-like-btn.active {
    border-color: #b85c5c;
    background: #fff0ed;
}

.lb-like-btn.active svg {
    fill: #b85c5c;
    stroke: #b85c5c;
}

@keyframes likePopIn {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.lb-like-btn.pop { animation: likePopIn 0.3s ease; }

.lb-stars {
    height: 40px;
    padding: 0 14px;
    border: 2px solid #d8c79a;
    border-radius: 20px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
    color: #b59149;
    white-space: nowrap;
}

.lb-stars svg {
    width: 16px;
    height: 16px;
    fill: #b59149;
    stroke: #b59149;
    flex-shrink: 0;
}

.lb-stars.hidden { display: none; }

/* ==========================================================================
   Modal
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f5f2ee;
    z-index: 1000;
    overflow: auto;
}

.modal.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
}

.modal-image-container {
    width: 90%;
    max-width: 1200px;
    max-height: 75%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    position: relative;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-caption {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.4;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    font-family: "Newsreader", serif;
    font-optical-sizing: auto;
    font-style: italic;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.modal-actions > * {
    display: flex;
    align-items: center;
}

.modal-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
    position: relative;
}

.modal-share-button:hover {
    background-color: #333;
}

.modal-share-button svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.copy-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 6px 12px;
    background-color: #333;
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.copy-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #333;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: none;
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    padding: 0;
}

.modal-close:hover::before,
.modal-close:hover::after {
    background-color: #666;
}

.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: #333;
    transition: background-color 0.2s ease;
}

.modal-close::before {
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

.modal-nav {
    position: fixed;
    top: 40%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: none;
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    padding: 0;
}

.modal-nav:hover svg path {
    fill: #666;
}

.modal-nav svg {
    width: 50px;
    height: 50px;
    display: block;
}

.modal-nav-prev {
    left: 20px;
}

.modal-nav-next {
    right: 20px;
}

@media (max-width: 768px) {
    .modal-nav {
        display: none !important;
    }
    .modal-image-container {
        width: 100%;
        max-width: none;
    }
}

/* ==========================================================================
   Prose (about pages)
   ========================================================================== */

.prose {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 32px;
}

.prose p {
    margin-bottom: 24px;
}

.prose ul {
    margin: 24px 0;
    padding-left: 40px;
}

.prose ul li {
    margin-bottom: 12px;
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}

.prose h2 {
    font-family: "Newsreader", serif;
    font-size: 32px;
    font-weight: 500;
    margin-top: 48px;
    margin-bottom: 24px;
    color: #333;
    letter-spacing: -0.5px;
    font-optical-sizing: auto;
}

.prose h3 {
    font-family: "Newsreader", serif;
    font-size: 24px;
    font-weight: 500;
    margin-top: 32px;
    margin-bottom: 16px;
    color: #333;
    letter-spacing: -0.3px;
    font-optical-sizing: auto;
}

.prose blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 4px solid #333;
    background-color: #fff;
    font-style: italic;
    color: #555;
}

/* ==========================================================================
   Verb Examples (about-verbs)
   ========================================================================== */

.verb-example {
    background-color: #fff;
    border-left: 4px solid #333;
    margin: 24px 0;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    min-height: 100px;
}

.verb-example-text {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.verb-example-text .verb {
    font-family: "Newsreader", serif;
    font-style: italic;
    font-weight: 600;
    font-size: 22px;
    color: #1a1a1a;
}

.verb-example-text .gloss {
    color: #666;
    font-size: 15px;
    margin-top: 8px;
    font-style: normal;
}

.verb-example-image {
    width: 240px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ==========================================================================
   Style Note (about-illustrations)
   ========================================================================== */

.style-note {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    padding: 24px;
    margin: 32px 0;
    border-radius: 8px;
}

.style-note h4 {
    font-family: 'Newsreader', serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.style-note p {
    font-size: 16px;
    margin-bottom: 12px;
}

.style-note p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Artist Profile (about-illustrations)
   ========================================================================== */

.artist-profile {
    text-align: center;
    margin: 40px auto;
    max-width: 360px;
}

.artist-portrait {
    width: 260px;
    height: 260px;
    margin: 0 auto 16px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 60% 35%;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.artist-profile h4 {
    font-family: "Newsreader", serif;
    font-size: 22px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.artist-profile .artist-origin {
    font-size: 13px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.artist-profile p {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
}

/* ==========================================================================
   All Verbs Reference Page
   ========================================================================== */

.verbs-reference {
    column-count: 3;
    column-gap: 32px;
    margin: 32px 0;
    font-family: "Newsreader", serif;
    font-optical-sizing: auto;
}

.verbs-reference .verb-item {
    break-inside: avoid;
    padding: 4px 0;
    font-size: 17px;
    line-height: 1.5;
}

.verbs-reference .verb-item.illustrated {
    color: #1a1a1a;
    font-weight: 500;
}

.verbs-reference .verb-item.illustrated a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #ccc;
}

.verbs-reference .verb-item.illustrated a:hover {
    border-bottom-color: #333;
}

.verbs-reference .verb-item.unillustrated {
    color: #b0a89e;
    font-style: italic;
}

.verbs-reference .verb-count {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    color: #999;
    font-style: normal;
}

.reference-legend {
    margin: 16px 0 32px;
    font-size: 14px;
    color: #666;
}

.reference-legend .swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.reference-legend .illustrated {
    background-color: #1a1a1a;
}

.reference-legend .unillustrated {
    background-color: #b0a89e;
}

@media (max-width: 768px) {
    .verbs-reference {
        column-count: 2;
        column-gap: 20px;
    }
}

@media (max-width: 480px) {
    .verbs-reference {
        column-count: 1;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 48px;
    border-top: 1px solid #e8e3dc;
}

.site-footer a {
    color: #666;
    text-decoration: none;
}

.site-footer a:hover {
    color: #333;
    text-decoration: underline;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.back-to-gallery {
    text-align: center;
    margin-top: 64px;
    margin-bottom: 48px;
}

.back-to-gallery a {
    display: inline-block;
    padding: 12px 24px;
    background-color: #333;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.back-to-gallery a:hover {
    background-color: #555;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #666;
}

.error {
    text-align: center;
    padding: 60px 20px;
    color: #d32f2f;
    font-size: 18px;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.load-more {
    text-align: center;
    margin: 40px 0;
}

.load-more button {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    background-color: #111;
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.load-more button:hover {
    background-color: #333;
}

.load-more button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ==========================================================================
   Share Page
   ========================================================================== */

body.share-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.share-page .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 0;
}

.view-gallery {
    padding: 10px 20px;
    background-color: #111;
    color: white;
    text-decoration: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.view-gallery:hover {
    background-color: #333;
}

.share-page .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.share-page .image-container {
    width: 90%;
    max-width: 900px;
    margin-bottom: 30px;
}

.share-page .verb-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.share-page .caption {
    font-size: 36px;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.4;
    letter-spacing: -0.02em;
    margin-bottom: 30px;
    font-family: "Newsreader", serif;
    font-optical-sizing: auto;
    font-style: italic;
}

.share-page .actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.share-page .share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.share-page .share-button:hover {
    background-color: #333;
}

.share-page .share-button svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    h1 { font-size: 36px; }
    .subtitle { font-size: 17px; }
    .prose { font-size: 16px; }
    .prose h2 { font-size: 28px; }
    .prose h3 { font-size: 20px; }

    .grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .card-content { padding: 20px 24px 24px; }
    .card-title { font-size: 20px; }

    .verb-example { flex-direction: column; }
    .verb-example-image { width: 100%; height: 180px; }

    .share-page .header { flex-direction: column; gap: 20px; }
    .share-page .image-container { width: 95%; }
    .share-page .caption { font-size: 26px; padding: 0 20px; }
    .share-page .actions { flex-direction: column; }
}
