/* =====================================================
   Coffee Tasting Log - Flamingo Records
   assets/css/flamingo-records.css
===================================================== */

/* ------------------------------
   Design Tokens
------------------------------ */
:root {
  --ct-bg: #f7f5f0;
  --ct-surface: #ffffff;
  --ct-surface-soft: #fbfaf7;

  --ct-border: #e6e1d8;
  --ct-border-strong: #d6cec1;

  --ct-text: #25211d;
  --ct-text-sub: #6f675d;
  --ct-text-muted: #9a9186;

  --ct-accent: #8a5a2b;
  --ct-accent-dark: #4a2f1d;
  --ct-accent-soft: #f0e6d8;
  --ct-accent-pale: #fff6ea;

  --ct-green-bg: #edf8f3;
  --ct-green-border: #b9dccd;
  --ct-green-text: #276b53;

  --ct-radius: 0;
  --ct-radius-sm: 0;
  --ct-radius-pill: 999px;

  --ct-shadow: none;
}

/* ------------------------------
   Page Base
------------------------------ */
body {
  background: var(--ct-bg);
}

.entry-content {
  color: var(--ct-text);
}

.entry-title {
  margin-bottom: 0px;
  color: var(--ct-text);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 500;
}

/* ------------------------------
   Wrapper
------------------------------ */
#ct-wrap {
  width: 100%;
  margin: 0 auto 48px;
  font-family: inherit;
}

#ct-wrap * {
  box-sizing: border-box;
}

/* CocoonテーブルCSS対策 */
#ct-wrap table,
#ct-wrap tr,
#ct-wrap th,
#ct-wrap td {
  border: none !important;
  background: transparent !important;
}

/* ------------------------------
   Saved Message
------------------------------ */
#ct-saved-msg {
  display: none;
  max-width: 980px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  border: 1px solid var(--ct-green-border);
  background: var(--ct-green-bg);
  color: var(--ct-green-text);
  font-size: 13px;
}

#ct-saved-msg.show {
  display: block;
}

/* ------------------------------
   Filter Area
------------------------------ */
#ct-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 18px;
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  box-shadow: var(--ct-shadow);
}

.ct-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.ct-group label {
  margin: 0;
  color: var(--ct-text-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

#ct-wrap select,
#ct-wrap input[type="date"] {
  width: 100%;
  height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--ct-border);
  border-radius: 0;
  background: var(--ct-surface-soft);
  color: var(--ct-text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-shadow: none;
}

#ct-wrap select:focus,
#ct-wrap input[type="date"]:focus {
  border-color: var(--ct-accent);
  background: #fff;
  box-shadow: none;
}

/* ------------------------------
   Buttons
------------------------------ */
.ct-action-row {
  display: flex;
  gap: 8px;
  align-self: end;
}

#ct-reset,
#ct-search {
  height: 38px;
  padding: 0 16px;
  border-radius: 0;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

#ct-reset {
  border: 1px solid var(--ct-border-strong);
  background: #fff;
  color: var(--ct-text-sub);
}

#ct-reset:hover {
  background: var(--ct-surface-soft);
}

#ct-search {
  border: 1px solid var(--ct-text);
  background: var(--ct-text);
  color: #fff;
}

#ct-search:hover {
  background: var(--ct-accent-dark);
}

/* ------------------------------
   Count
------------------------------ */
#ct-meta {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 14px;
}

#ct-count {
  color: var(--ct-text-muted);
  font-size: 12px;
}

/* ------------------------------
   Card List
------------------------------ */
.coffee-record-list {
  display: grid;
  gap: 16px;
}

.coffee-record {
  position: relative;
  padding: 20px;
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  border-radius: 0;
  box-shadow: none;
}

/* ------------------------------
   Card Header
------------------------------ */
.ct-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ct-border);
}

.ct-date {
  color: var(--ct-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ct-card-head {
  margin-bottom: 10px;
}

h3.ct-title,
.ct-title {
  margin: 0 0 6px !important;
  padding: 0 !important;
  border: none !important;
  color: var(--ct-text) !important;
  font-size: 21px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: 0.02em;
}

.ct-shop {
  margin: 4px 0 6px;
  color: var(--ct-accent-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.ct-sub {
  margin: 0 0 8px;
  color: var(--ct-text-sub);
  font-size: 13px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* ------------------------------
   Tags
------------------------------ */
.ct-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 12px;
}

.ct-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #eadcca;
  border-radius: var(--ct-radius-pill);
  background: var(--ct-accent-pale);
  color: var(--ct-accent-dark);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

/* ------------------------------
   Sections
------------------------------ */
.ct-section {
  margin-top: 16px;
}

.ct-section-label {
  margin: 0 0 8px;
  color: var(--ct-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ct-detail-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--ct-border);
}

.ct-detail-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--ct-border);
}

.ct-detail-row span {
  color: var(--ct-text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.ct-detail-row strong {
  color: var(--ct-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* ------------------------------
   Taste Pills
------------------------------ */
.ct-taste-section {
  margin-top: 12px;
}

.ct-taste-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ct-taste-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius-pill);
  background: #f3efe8;
  color: #5e5348;
  font-size: 12px;
  line-height: 1.2;
}

/* ------------------------------
   Memo
------------------------------ */
.ct-memo {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--ct-surface-soft);
  border: 1px solid var(--ct-border);
  color: var(--ct-text-sub);
  font-size: 13px;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: anywhere;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 詳細を開いたカードではメモ全文表示 */
.coffee-record:has(.ct-details[open]) .ct-memo {
  display: block;
  overflow: visible;
}

/* ------------------------------
   Details
------------------------------ */
.ct-details {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #ece8df;
}

.ct-summary {
  cursor: pointer;
  list-style: none;
  color: var(--ct-accent-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  user-select: none;
}

.ct-summary::-webkit-details-marker {
  display: none;
}

.ct-summary::after {
  content: "＋";
  margin-left: 8px;
}

.ct-details[open] .ct-summary::after {
  content: "−";
}

.ct-details .ct-section {
  margin-top: 16px;
}

/* ------------------------------
   Footer
------------------------------ */
.ct-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #ece8df;
}

.ct-inputer {
  color: var(--ct-text-muted);
  font-size: 12px;
}

.ct-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--ct-border-strong);
  border-radius: 0;
  background: #fff;
  color: var(--ct-text-sub);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.ct-edit-btn:hover {
  background: var(--ct-surface-soft);
  color: var(--ct-text);
}

/* ------------------------------
   Modal
------------------------------ */
#ct-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(30, 24, 18, 0.45);
}

#ct-modal-overlay.open {
  display: flex;
}

#ct-modal {
  width: min(100%, 680px);
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--ct-border);
  border-radius: 0;
  box-shadow: none;
}

#ct-modal h3 {
  margin: 0 0 18px;
  padding: 0 !important;
  color: var(--ct-text);
  font-size: 18px;
  line-height: 1.5;
}

.ct-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.ct-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.ct-field label {
  color: var(--ct-text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.ct-field input[type="text"],
.ct-field input[type="date"],
.ct-field textarea,
select#ct-edit-origin-type {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--ct-border);
  border-radius: 0;
  background: var(--ct-surface-soft);
  color: var(--ct-text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-shadow: none;
}

.ct-field textarea {
  min-height: 96px;
  resize: vertical;
}

.ct-field input:focus,
.ct-field textarea:focus,
select#ct-edit-origin-type:focus {
  border-color: var(--ct-accent);
  background: #fff;
  box-shadow: none;
}

.ct-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.ct-save-btn,
.ct-cancel-btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 0;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.ct-save-btn {
  border: 1px solid var(--ct-text);
  background: var(--ct-text);
  color: #fff;
}

.ct-save-btn:hover {
  background: var(--ct-accent-dark);
}

.ct-cancel-btn {
  border: 1px solid var(--ct-border-strong);
  background: #fff;
  color: var(--ct-text-sub);
}

.ct-cancel-btn:hover {
  background: var(--ct-surface-soft);
}

/* ------------------------------
   Pagination
------------------------------ */
.ct-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.ct-page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d6c2aa;
  border-radius: 0;
  background: #fff;
  color: var(--ct-accent-dark);
  cursor: pointer;
  font-size: 14px;
}

.ct-page-btn:hover {
  background: var(--ct-accent-pale);
}

.ct-page-btn.is-current {
  background: var(--ct-accent-dark);
  color: #fff;
  border-color: var(--ct-accent-dark);
}

.ct-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ------------------------------
   JS
------------------------------ */
.ct-hidden {
  display: none !important;
}

/* ------------------------------
   Cocoon h3 Reset inside logs
------------------------------ */
#ct-wrap .article h3,
#ct-wrap h3 {
  border-left: 0 !important;
  border-right: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
}

p.ct-shop {
    color: #000000 !important;
    line-height: 2 !important;
    font-size: 16px;
    padding: 0px 0 0px;
    margin-bottom: 0px;
    font-weight: normal;
}

p.ct-sub {
    margin-bottom: 10px;
}

p.ct-section-label {
    margin-bottom: 10px;
}

h3.ct-title {
    padding: 10px 0 0px !important;
}

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

@media (max-width: 900px) {
  #ct-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #ct-wrap {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin-bottom: 40px;
  }

  #ct-bar {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
    margin-bottom: 12px;
  }

  .ct-group label {
    font-size: 10px;
    line-height: 1.3;
  }

  #ct-wrap select,
  #ct-wrap input[type="date"] {
    height: 36px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .ct-group:has(#ct-product-name),
  .ct-group:has(#ct-farm),
  .ct-group:has(#ct-variety),
  .ct-group:has(#ct-process),
  .ct-group:has(#ct-tag) {
    grid-column: 1 / -1;
  }

  .ct-action-row {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-self: auto;
  }

  #ct-reset,
  #ct-search {
    width: 100%;
    height: 40px;
    padding: 0;
    font-size: 13px;
  }

  #ct-meta {
    justify-content: flex-start;
    margin: 8px 0 12px;
  }

  #ct-count {
    font-size: 12px;
  }

  .coffee-record-list {
    gap: 14px;
  }

  .coffee-record {
    padding: 16px;
  }

  .ct-title {
    font-size: 18px !important;
    line-height: 1.45 !important;
  }

  .ct-shop,
  .ct-sub,
  .ct-summary {
    font-size: 12px;
  }

  .ct-tag-list {
    gap: 6px;
    margin: 10px 0 12px;
  }

  .ct-tag {
    min-height: 27px;
    padding: 4px 9px;
    font-size: 11px;
  }

  .ct-section {
    margin-top: 14px;
  }

  .ct-section-label {
    margin-bottom: 6px;
    font-size: 10px;
  }

  .ct-detail-row {
    display: block;
    padding: 8px 0;
  }

  .ct-detail-row span {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
  }

  .ct-detail-row strong {
    display: block;
    font-size: 13px;
  }

  .ct-memo {
    padding: 12px;
    font-size: 13px;
  }

  .ct-footer {
    flex-direction: row;
    gap: 10px;
  }

  .ct-edit-btn {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 11px;
  }

  #ct-modal-overlay {
    padding: 12px;
  }

  #ct-modal {
    width: 100%;
    max-height: 86vh;
    padding: 18px;
  }

  .ct-modal-grid {
    grid-template-columns: 1fr;
  }

  .ct-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .ct-save-btn,
  .ct-cancel-btn {
    width: 100%;
    min-height: 40px;
  }

  .ct-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }
.entry-content p, .ctl-home p {
    line-height: 2 !important;
    font-size: 14px !important;
}
}

@media (max-width: 420px) {
  #ct-bar {
    grid-template-columns: 1fr;
  }

  .ct-group:has(#ct-product-name),
  .ct-group:has(#ct-farm),
  .ct-group:has(#ct-variety),
  .ct-group:has(#ct-process),
  .ct-group:has(#ct-tag) {
    grid-column: auto;
  }

  .ct-action-row {
    grid-column: auto;
  }

  .ct-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .ct-edit-btn {
    width: 100%;
  }
}